
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --fg-bright: #eee;
  --fg: #cdd3d7;
  --fg-grey: #93989d;
  --bg: #151820;
  --line: color-mix(in srgb, var(--bg), var(--fg) 12%);


  --theme: #00bd8c;

  --sans: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", monospace;
}

::selection {
  background-color: var(--theme);
  color: var(--bg);
}

body, html {
  margin: 0;
  padding: 0;
  background: var(--bg);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--sans);
  color: var(--fg);
  font-size-adjust: cap-height .666;
  min-height: 100svh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem max(1rem, calc(50vw - 30rem));
  height: 4rem;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 1;

  a {
    color: unset;
    text-decoration: none;
    padding: .5rem;
  }

  .links {
    display: flex;
    align-items: center;
    column-gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: .9rem;

    a {
      color: var(--fg-grey);
      transition: color .2s;
      &:hover {
        color: var(--fg);
      }
    }
  }

  .logo {
    display: flex;
    align-items: center;
    gap: .8rem;


    img {
      width: 2rem;
      height: 2rem;
    }

    span {
      font-size: 1.2rem;
      transition: color .2s;
      max-height: 100%;
    }
  }
}

main {
  display: block;
  width: 46em;
  max-width: 100%;
  padding: 1em;
  padding-bottom: 10em;

  p {
    text-align: justify;
    line-height: 1.666;
  }

  h2 + p {
    margin-top: .5em;
  }

  a {
    color: var(--fg-bright);
    text-decoration-color: var(--theme);
    text-underline-offset: .25rem;
    text-decoration-thickness: .075rem;
    transition: color .2s;
    &:hover {
      color: var(--theme);
    }
  }

  pre, code {
    font-family: "Atkinson Hyperlegible Mono";
  }

  pre {
    padding: 1rem;
    border-radius: .5rem;
    overflow: auto;
    border: 1px solid var(--line);
  }

  svg {
    max-width: 100%;
  }

  h1 {
    font-size: 2.5rem;
    font-weight: 200;
    color: var(--fg-bright);

    &[data-title]::before {
      font-size: .8rem;
      padding: .5rem 0;
      display: block;
      content: attr(data-title);
      font-weight: 200;
      text-transform: uppercase;
      font-family: var(--mono);
      letter-spacing: .12em;
      color: var(--fg-grey);
    }
  }

  h2 {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--fg-bright);
    margin-top: 2rem;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    margin-bottom: 1rem;
    position: relative;

    &[data-title]::after {
      font-size: .7rem;
      padding: .5rem 0;
      content: attr(data-title);
      font-weight: 200;
      text-transform: uppercase;
      font-family: var(--mono);
      letter-spacing: .12em;
      color: var(--fg-grey);
      position: absolute;
      top: 0;
      right: 0;
    }
  }

  h3 {
    font-size: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    font-family: var(--mono);
    letter-spacing: .12rem;
    color: var(--fg-bright);
  }

  ul, ol {
    padding-left: 1.2rem;
    li:not(:first-child) {
      margin-top: .5rem;
    }
  }

  > div > svg.typst-doc {
    margin: 1rem 0;
  }
}

@media(max-width: 500px) {
  header {
    .logo span {
      display: none;
    }

    a {
      padding: .25rem;
    }

    .links {
      column-gap: .5rem;
    }
  }

  main {
    h1 {
      font-size: 2rem;
    }
    p {
      text-align: left;
    }
  }
}

