:root {
  color-scheme: light dark;
  --text-size-adjust: none;
  --columns: 2;
  --column-width: 25em;
  --column-gap: 1.5em;
}

body {
  background-color: light-dark(#eeeeee, black);
  color: light-dark(black, white);
  font-family: "Comic Relief", "Dejavu Sans", "FreeSans", sans-serif;
  font-size: 16px;
  hyphens: auto;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  margin: 0;
}

header {
  font-family: "Comic Mono", "DejaVu Sans Mono", "FreeMono", monospace;
  padding-top: 2px;
  display: flex;
  gap: 1em;
  align-items: center;
  border-top: 2px solid;
  border-image-slice: 1;
  border-image-source: linear-gradient(
    to right,
    red 0,
    orange calc(100% / 7),
    yellow calc(200% / 7),
    darkturquoise calc(300% / 7),
    green calc(400% / 7),
    blue calc(500% / 7),
    indigo calc(600% / 7)
  );
}

nav {
  display: inline;
  margin: 1em;
  ol {
    list-style: none;
    padding: 0px;
    display: inline;
    margin-inline: 2em;
  }
}

.title {
  font-size: 1.5em;
  font-weight: bold;
  transform-origin: center;
  transform: rotate(320deg);
  a {
    text-decoration: none;
    color: light-dark(black, white);
  }
}

footer {
  margin-top: 2em;
  font-size: 0.8em;
  a {
    text-decoration: none;
  }
  text-align: center;
  border-bottom: 2px solid;
  border-image-slice: 1;
  padding-bottom: 2em;
  border-image-source: linear-gradient(
    to right,
    red 0,
    orange calc(100% / 7),
    yellow calc(200% / 7),
    darkturquoise calc(300% / 7),
    green calc(400% / 7),
    blue calc(500% / 7),
    indigo calc(600% / 7)
  );
}

.a88x31 {
  image-rendering: pixelated;
}

footer.a88x31 p {
  max-width: 352px;
  text-align: center;
  margin-right: auto;
  margin-left: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0px;
}

time.released:before {
  content: "Released ";
}

figcaption {
  font-size: 1em;
}

main {
  counter-reset: figure section subsection subsubsection;
  a:visited {
    color: light-dark(darkorange, orange);
  }
  a:link {
    color: darkcyan;
  }
  a {
    text-decoration: none;
  }
  h1,
  h2,
  h3 {
    break-after: avoid;
  }
  figure {
    margin: 1.5em 0;
    break-inside: avoid;
    text-align: center;
    img {
      background-color: light-dark(lightgrey, darkgrey);
    }
    figcaption {
      text-align: center;
      font-size: 0.8em;
    }
    figcaption::before {
      counter-increment: figure;
      content: "Figure " counter(figure) ": ";
    }
  }
}

pre code.shell::before {
  content: "$ ";
}

main.homepage {
  font-family: "Comic Mono", "DejaVu Sans Mono", "Free Mono", monospace;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: auto;
  margin: auto;
}

main article {
  border: 2px solid;
  background: light-dark(white, #111111);
  border-image-slice: 1;
  border-image-source: linear-gradient(
    to bottom,
    red 0,
    orange calc(100% / 7),
    yellow calc(200% / 7),
    darkturquoise calc(300% / 7),
    green calc(400% / 7),
    blue calc(500% / 7),
    indigo calc(600% / 7)
  );
  padding: 1em;
}

main.homepage article {
  margin: 1em;
  font-size: 20px;
  flex: auto;
  max-width: 25em;
  h2 {
    display: inline-block;
    font-size: 1em;
    font-weight: bold;
    margin: 0;
    padding: 0;
    text-align: left;
  }
  h2::before {
    font-weight: normal;
    content: "let ";
  }
  h2::after {
    content: " =";
    font-weight: normal;
  }
  ul::before {
    content: "vec!["
  }
  ul::after {
    content: "];";
  }
  li::before {
    content: '"';
  }
  li::after {
    content: '",';
  }
  li {
    padding-left: 1em;
  }
  ul {
    list-style: none;
    padding: 0px;
    display: inline;
    padding: 0;
    margin: 0;
  }
  time::after {
    content: " ";
  }
}

main.blogpost article {
  margin-block: 1em;
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.5;
  img {
    max-width: 100%;
    max-height: 20em;
  }
  pre {
    background: light-dark(#eeeeee, #111111);
    line-height: 1;
    white-space: pre;
    overflow-x: auto;
    padding: 1em;
  }
  p {
    orphans: 2;
    widows: 2;
  }
  h1 {
    column-span: all;
    text-align: center;
    font-size: 1.8em;
  }
  h2 {
    text-align: center;
    font-size: 1.5em;
    margin-top: 2em;
  }
  h3 {
    font-size: 1.2em;
  }
  h1::before {
    counter-reset: subsection subsubsection;
  }
  h2::before {
    counter-increment: subsection;
    counter-reset: subsubsection;
    content: "§ " counter(subsection) " ";
  }
  h3::before {
    counter-increment: subsubsection;
    content: "(" counter(subsubsection) ") ";
  }
  h1 + p {
    margin-block: 0;
  }
  p + p {
    text-indent: 1em;
  }
  .wide {
    column-span: all;
  }
  margin-left: auto;
  margin-right: auto;
  max-width: calc(var(--columns) * var(--column-width) + var(--column-gap));
  column-count: var(--columns);
  column-width: var(--column-width);
  column-gap: var(--column-gap);
  column-fill: balance;
}

img.avi {
  image-rendering: pixelated;
  margin-left: auto;
  margin-right: 1em;
}
