* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --bgc: light-dark(rgb(248, 216, 221), rgb(57, 24, 31));
  --bgc2: light-dark( rgb(171, 195, 247), rgb(40, 62, 116));
  --bgc3: light-dark(#ebb4c8, rgb(72, 33, 49));
  --bg-image-light: url(/img/svg/wavy-bg-light.svg);
  --bg-image-dark: url(/img/svg/wavy-bg-dark.svg);
  --c: light-dark(rgb(31, 103, 146), #69afdc);
  --link: light-dark(#ba0ab7, #ff1dfb);
  --code: light-dark(darkolivegreen, lightblue);
  --mono-fonts: 'Roboto Mono', 'courier new', monospace;
  /* font-size: clamp(0.81rem, calc(0.70rem + 0.45vw), 1.38rem); up to 22px at 2400px wide */
  font-size: clamp(0.81rem, calc(0.68rem + 0.55vw), 1.50rem); /* up to 24px at 2400px wide */
}



::selection {
  background-color: fuchsia;
  color: #fff;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--bgc2) var(--bgc3);
}

body::-webkit-scrollbar {
  width: 2vw;
  /* width of the entire scrollbar */
}

body::-webkit-scrollbar-track {
  background: var(--bgc3);
  /* color of the tracking area */
}

body::-webkit-scrollbar-thumb {
  background-color: var(--bgc2);
  /* color of the scroll thumb */
  border-radius: 30px;
  /* roundness of the scroll thumb */
  border: 1px solid var(--c);
  /* creates padding around scroll thumb */
}

body {
  margin: 0;
  font-family: Epilogue, 'segoe ui', system-ui, sans-serif;
  color: var(--c);
  background: var(--bgc3);
  height: 100%;
}


.container {
  /* max-width: 2200px; */
  margin-right: auto;
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: auto 1fr minmax(7.5em, auto) auto;
  min-height: 100vh;
  position: relative;
  padding: 0;

  & > * {
    padding: 1rem 3rem 2rem 3vw;
  }
}

header,
footer {
  background-color: var(--bgc2);
  padding: 1em;
}

header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2vw;
}

header > nav > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2vw;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

header * {
  vertical-align: baseline;
  line-height: 1;
}

header .site-title {
  font-size: 2em;
  /* text-transform: uppercase; */
  /* margin: .6em 0; */
}

header > .site-title > .subtitle {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1ex;
  justify-content: flex-start;
  font-size: 0.4em;
}

footer {
  grid-column: 1 / 3;
  bottom: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 80%;
}

footer .links {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.hugo-logo {
  font-size: 20px;
}

svg#hugo {
  width: 4rem;
  height: 1rem;
}

main {
  grid-row: 2 / 3;
  display: grid;
  grid-template-columns: 1fr minmax(auto, 1280px);
  position: relative; /* for back to top column */
  background-size: contain;
  /* background-image: var(--bg-image-light); */
  background-image: url(/img/svg/wavy-bg-light.svg);
  background-repeat: no-repeat;
  background-color: var(--bgc);
  border-bottom-right-radius: calc(4vw + 4vh);

  & > article.single-page {
    grid-column: 2 / 3;
  }
}

main > .single-page {
  min-height: 70vh;
  position: relative;
}

main.list-page {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-template-rows: repeat(5, auto);
  gap: 2vw;
}

main.list-page > div:first-child {
  grid-column: 1 / -1;
  /* grid-row: min-content; */
}

/* main.list-page > div > h1 {
  margin: 0;
} */

.list-page article {
  font-size: 0.9em;
  border: solid 1px #7775;
  background-color: #ccc1;
  padding: 1em 25px 0.5em 0.5em;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.25em;
  border-radius: 0 0 35px 0;
}

.list-page article > div {
  line-height: 1.4;
}

/* .list-content is from {{ .Content }} for list pages  */

.list-content > div {
	background-image: 
  linear-gradient(
    light-dark(oklch(from var(--bgc2) l c h / 75%), var(--bgc2)), transparent
    );
	/* background-color: light-dark(#fff6, #00000039); */
	border-radius: 20px;
	padding: 20px;
}
.list-content > div :first-child {
  margin-top: 0;
}

.list-content > div + div {
  margin-top: 3em;
}

.content {
  padding-bottom: 3em;
}
.table-of-contents {
  position: sticky;
  z-index: 20;
  top: 3em;
  width: min(15em, 100%);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
  float: right;
  margin: -1em 0 0.5em 1em;
  padding: 1em 1em 2em 1em;
  background-color: #1114;
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.table-of-contents h2 {
  margin: 0 0 0.5em 0;
  font-size: 1.2em;
  color: var(--c);
}
#TableOfContents {
  list-style: none;
}

#TableOfContents > ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

/* --- Smooth scroll back from https://moderncss.dev/pure-css-smooth-scroll-back-to-top/ -- */
/* How far of a scroll travel within <main> prior to the
   link appearing */
/* $scrollLength: 100vh; */

.back-to-top-wrapper {
  /* uncomment to visualize "track" */
  /* outline: 1px solid red; */
  /* display: none; */
  position: absolute;
  top: 100vh;
  right: 0.25rem;
  /* Optional, extends the final link into the */
  /* footer at the bottom of the page */
  /* Set to `0` to stop at the end of `main` */
  bottom: -5em;
  /* Required for best support in browsers not supporting `sticky` */
  width: 3em;
  /* Disable interaction with this element */
  pointer-events: none;
}

.back-to-top-link {
  position: sticky;
  top: calc(100vh - 10rem);
  pointer-events: all;
  display: inline-block;
  text-decoration: none;
  font-size: 2rem;
  line-height: 2.6rem;
  text-align: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--bgc2);
  /* emoji don't behave like regular fonts
       so this helped position it correctly */
  padding: 0.25rem;
}

article > h3:first-child {
  margin-top: 0;
}

aside {
  background-color: var(--bgc3);
  grid-row: span 2;
  font-size: 0.8em;
  position: relative;
}
.latest {
  position: sticky;
  top: 1em;
}

/* --- Not sure about this margin-top --- */
aside h2 {
  margin-top: 0;
  margin-bottom: 1ex;
  text-decoration: underline;
  text-decoration-thickness: 5px;
  text-underline-offset: 0.2ex;
  text-decoration-color: var(--bgc);
  text-decoration-skip-ink: none;
  /* text-underline-offset: -2.8ex; */
}

:is(aside, .external-links) ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

aside ul li + li {
  margin-top: 0.5ex;
  padding-top: 0.5ex;
  border-top: solid 1px var(--bgc);
}

aside ul small {
  font-size: 0.7rem;
  white-space: pre;
}

aside a[href='#'] {
  color: var(--c);
  cursor: default;
}

.no-external-links {
  height: 1em;
}

h1 {
  margin: 2rem 0 0.5rem 0;
  font-size: 4rem;
  font-size: clamp(2.5rem, 1.2308rem + 2.4615vw, 4rem);
  white-space: pre-line;
}
h2 {
  font-size: 2.1em;
}
h2,
h3 {
  margin: 2em 0 0.2em 0;
  color: fuchsia;
}

blockquote {
  position: relative;
  margin: 1em 2em 2em 0;
  padding: 1em 2em 0.5em 2em;
  max-width: 60ch;
  font-style: italic;
  background-color: #aaaaaa44;
  border-radius: 30px;
}

blockquote::before {
  position: absolute;
  content: '\201C';
  display: inline;
  font-size: 4em;
  color: var(--bgc2);
  left: 0.4rem;
  top: 0.4rem;
}

blockquote > p {
  margin: 0.5ex 0;
}

blockquote :last-child {
  text-align: right;
}

blockquote > :last-child::before {
  content: '\2014\0020';
}

:is(h3, h2) + p {
  margin-top: 0;
}

h2.unfinished a {
  text-transform: uppercase;
  display: inline-block;
  padding: 1.25em 1em;
  /* border: solid thick var(--link); */
  outline: solid 0.2em var(--c);
  outline-offset: -0.3em;
  border-radius: 15px;
  background-color: var(--link);
  color: var(--c);
  line-height: 0.1;
  transition: 0.3s;
}
h2.unfinished a:hover {
  outline-offset: -0.15em;
  color: #fff;
  text-shadow: 2px 1px #2b2b2bcc;
}
h2.unfinished {
  margin-bottom: 1.5em;
}

p,
li {
  max-width: 70ch;
  line-height: 1.5;
}

img {
  max-width: 100%;
}

hr {
  height: 1px;
  background-color: var(--c);
  border: none;
}

figure {
  margin: 1em 0;
}
.float-right {
  float: right;
  margin: 0 0 1em 1em;
}
.mw30 {
  max-width: 30%;
}

button {
  position: relative;
  isolation: isolate;
  border: none;
  border-radius: 5px;
  background-color: #28c;
  color: #ddd;
  padding: 0.25em 1em;
  font-size: 0.9rem;
}

button:hover {
  cursor: pointer;
}

button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -5;
  background-color: green;
  transition: transform 0.5s;
  transform-origin: right;
  transform: scaleX(0);
}

button:hover::before {
  transform-origin: left;
  transform: scaleX(1);
}

.btn {
  border-radius: 0;
  padding: 0.5em;
  aspect-ratio: 1 / 1;
}

.clipboard-icon {
  fill: #ddd;
}

.clipboard-icon:hover {
  fill: #fff;
}

/* ---------- FOOTNOTES --------- */

div.footnotes {
  margin-top: 5em;
}

section.footnotes::before {
  content: 'Footnotes';
  display: block;
  margin-top: 1em;
  color: var(--link);
  font-weight: bold;
  font-size: 1.5em;
}

section.footnotes {
  margin-top: 4em;
  border-top: 1px solid currentColor;
  font-size: 0.8em;
}
section.footnotes hr {
  display: none;
}
section.footnotes ol {
  padding-left: 2ch;
}

/* ---------- HTML Tables ---------- */

th,
td {
  padding: 0.5em;
  font-size: 0.8em;
}
th {
  border-bottom: 1px solid currentcolor;
}
tr:nth-of-type(even) {
  background-color: #fff1;
}

/* --- For generated thumbnails for photoswipe gallery --- */
.images {
  display: grid;
  width: min(840px, 100%);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  font-size: 70%;
}

.images img:hover {
  cursor: pointer;
}

/* -- This is for iframes in the music section -- */

.music iframe {
  margin-bottom: 1em;
  width: min(100%, 560px);
}

.music iframe + iframe:nth-of-type(even) {
  margin-left: 1em;
}

iframe.yt {
  aspect-ratio: 560 / 315;
  width: min(100%, 560px);
}

details {
  background-color: var(--bgc2);
  margin-bottom: 1em;
  /* padding: .5em; */
  border-radius: 7px;
  border: solid 1px var(--c);
}

details > summary {
  border-radius: 7px;
  font-weight: bold;
  background-color: #eee;
  /* margin-bottom: 0.5em; */
  padding: 0.5em;
}

details > summary:hover {
  cursor: pointer;
}

details div {
  /* column-count: 2; */
  padding: 0.5em;
}

details div :first-child {
  margin-top: 0;
}

.coming-soon,
.scroll-box {
    /* margin: 2em auto; */
    
}
.coming-soon {
    height: 26em;
    overflow-y: scroll;
    float: right;
    width: min(100%, 450px);
    margin: -1em 0 2em 1em;
  border: 1px pink solid;
  border-radius: 15px;
  padding: 1em;
  width: min(100%, 450px);
}
.coming-soon h2 {
  margin: 0;
}

/* the scroll-box is on the home page, _index.md --- */

.scroll-box {
  background-color: var(--bgc2);
  clear: both;
  /* margin: 4em auto; */
  margin-bottom: 4em;
  padding: 1em 1em 1em 2em;
  max-height: 70vh;
  overflow-y: scroll;
  font-size: 80%;
  border-radius: 40px;
}

.scroll-box > :last-child {
  margin-bottom: 4em;
}

/* -- the first h2 in the updates box -- */
#site-updates {
  margin-top: 20px;
}

.time {
  display: flex;
  justify-content: space-between;
  gap: 3vw;
  font-size: 85%;
  margin-bottom: 3em;
  /* text-decoration: underline; */
}

.breadcrumbs {
  margin: 0 0 0.5em 0;
}
.breadcrumbs ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  font-size: 0.85em;
}
.breadcrumbs a[href='#'] {
  cursor: default;
  color: #ccc;
}



pre,
code {
  display: inline-block;
  /* to allow bg colour change */
  font-family: var(--mono-fonts);
  font-weight: 500;
  font-size: 90%;
  white-space: pre-wrap;
  background-color: var(--bgc3);
}

:is(li, p, td, h1, h2, h3, h4) > code {
  background-color: transparent;
  font-size: 90%;
  color: var(--code);
}

.highlight pre code {
  padding: 0.5em 0.5em 0.5em 0;
}

/* -- for the Tags list page -- */

.tags-list {
  grid-column: 1 / -2;
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1ex;
  justify-content: center;
}

.tags-list li a {
  display: block;
  padding: 0 0.7em;
  color: var(--c);
  background-color: var(--bgc2);
  border: solid 1px;
  border-radius: 22px;
}
.tags-list li a:hover {
  color: #fff;
}

.content .tags-list {
  justify-content: start;
  margin: 2em 0;
}

/* This paragraph is at the bottom of all the tags pages */
p.categories {
  grid-column: 1 / 3;
  grid-row: -2 / -1;
  align-self: end;
  text-align: center;
}

#tags {
  margin-top: 2.5em;
  padding-top: 0.5ex;
  position: absolute;
  bottom: -1em;
  width: calc(100% - 2vw);
  border-top: 1px solid;
}

#tags > ul {
  list-style-type: none;
  margin-top: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.pagination {
  grid-column: 1 / -1;
}

.test-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 30px solid #f89bc9;
}

.test-panel h3 {
  margin: 0 0 0.5em 0;
}

.external-links {
  grid-column: 1 / -1;
  background-color: var(--bgc3);
  margin-bottom: 3em;
}

.external-links ul {
  margin-top: 0.5em;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  font-size: 0.8em;
}

.external-links a {
  display: block;
  padding: 0.1em 1em;
  border: solid 1px;
  border-radius: 25px;
  line-height: 40px;
}

.external-links h3 {
  margin-top: 0;
}

/* =========== SEARCH =============== */

.search-box {
  /*   position: relative;  for search results to be position absolute */
  grid-row: span 2;
}

input {
  accent-color: fuchsia;
}

input[type='text'],
#custom-search-field {
  border: none;
  border-radius: 6px;
  /* outline: none; */
  padding: 0.5em;
  font-size: 23px;
  background-color: var(--bgc2);
  color: var(--c);
  transition: 0.9s;
  transform-origin: top left;
}

#custom-search-field:focus {
  /* transform: scaleX(1.5) */
  width: 100%;
  outline: solid 2px fuchsia;
}

/* ============ NAV ============= */

a {
  text-decoration: none;
  transition: 0.5s;
  color: var(--link);
}

a:hover {
  color: white;
}

header a {
  font-family: Epilogue, 'segoe ui', 'courier new';
  font-weight: bold;
}
header ul a {
  font-weight: normal;
  font-size: 1.1em;
}

/* ------- Header CSS for .main-menu and .dropdown is in header.html partial -------- */

.icon {
  fill: currentcolor;
  width: 1em;
  height: 1em;
  margin-right: 0.7ch;
}

.prev-next {
  margin-top: 4em;
  display: flex;
  justify-content: center;
  gap: 3em;
  list-style-type: none;
}

.prev-next a {
  display: block;
  padding: 0.1ex 2ex;
  border: solid 1px;
  border-radius: 26px;
  text-transform: uppercase;
  height: 45px;
  line-height: 45px;
  /* line-height: 3.5; */
}

.prev-next li:first-child a:hover {
  transform: translateX(-20px);
}

.prev-next li:last-child a:hover {
  transform: translateX(20px);
}

.rss2 {
  text-align: center;
}

.rss2 div + div {
  margin-top: 6px;
}

.rss2 a {
  color: var(--c);
}

.rss2 a:hover {
  color: #fff;
}

/* --- For the SVG icon --- */

#rss {
  fill: var(--c);
  height: 2em;
  width: 2em;
  transition: 0.5s;
}

a:hover #rss {
  fill: #fff;
}

/* --- Git info doesn't exist elsewhere --- */
.gitinfo {
  margin: 2em 0;
  padding: 1ex;
  font-size: 80%;
  line-height: 1.6;
  border: solid 1px;
  border-radius: 45px;
}

/* ------- MOBILE nav -------- */

nav .icon div {
  display: grid;
  gap: 7px;
}

nav .icon div > div {
  background-color: #ba0ab7;
  height: 10px;
  width: 54px;
  transition: 0.4s;
}

.hamburger {
  display: none;
}

.hamburger div div {
  border-radius: 4px;
}

.change .bar1 {
  transform: rotate(45deg);
  transform-origin: top left 0;
}

.change .bar2 {
  opacity: 0;
}

.change .bar3 {
  transform: rotate(-45deg);
  transform-origin: bottom left 0;
}

.side-nav {
  width: 0;
  height: 100%;
  overflow-x: hidden;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #111111ee;
  transition: 0.5s;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4vh;
  align-items: center;
}

.side-nav a {
  display: block;
  font-size: calc(1rem + 5vh);
}

.side-nav a:first-child {
  position: absolute;
  top: 0;
  right: 2vw;
  font-size: 6em;
  margin-bottom: 3vh;
  text-align-last: right;
}

/* ----------- Charts ----------- */

.chartist-js .ct-chart {
  max-width: min(100%, 750px);
  /* padding-bottom: 1em; */
  margin: 2em 0;
}

.chartist-js .ct-bar {
  stroke: rgb(171, 195, 247);
  stroke-width: min(4vw, 40px);
}

#horizontal .ct-bar {
  stroke: var(--c);
}

#horizontal .ct-label {
  color: var(--c);
}

.graph-wrapper {
  width: min(100%, 700px);
}

/* -------- MUSIC ---------- */

.soundcloud {
  width: min(100%, 700px);
}

.about_roadmap {
  width: 40%;
  margin: 0 0 1em 1em;
  padding: 0.5rem;
  border-radius: 30px;
  background-color: #88888866;
  float: right;
  border: solid 1px var(--bgc2);
  font-size: 80%;
}

.about_roadmap h2 {
  margin-top: 1ex;
  margin-left: 1ex;
}

/* --------- SVG ---------- */

.svg__example {
  width: min(100%, 550px);
  float: right;
}

/* ---------- MEDIA QUERIES ---------- */

@media screen and (max-width: 1500px) {
  aside a small {
    display: none;
  }
  .table-of-contents {
    position: static;
  }
}

@media screen and (max-width: 1000px) {
  .container {
    display: block;
  }

  .container > aside {
    display: none;
  }

  main {
    border-bottom-right-radius: 0;
  }

  header > nav ul > li:not(:last-child) {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .desktop {
    display: none;
  }
}

@media screen and (prefers-color-scheme: dark) {

  main {
    background-image: var(--bg-image-dark);
  }

  code {
    /* filter: invert(1) hue-rotate(180deg); */
    background-color: #ebb4c8;
  }
}
