@font-face {
  font-family: "Atkinson";
  src: url("fonts/AtkinsonHyperlegibleNext.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Mono";
  src: url("fonts/AtkinsonHyperlegibleMono.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #1d1a29;
  --raised: #262236;
  --rim: #4a4170;
  --text: #ece9f5;
  --muted: #9a95ae;
  --link: #82aaff;
  --cursor: #e0559b;
  --code-bg: #242033;
  --step: 1.25;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --ink: #f6f4ef;
    --raised: #ffffff;
    --rim: #d6d0e4;
    --text: #1e2028;
    --muted: #5d6070;
    --link: #3460d2;
    --cursor: #c23b80;
    --code-bg: #eeebf4;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 "Atkinson", system-ui, sans-serif;
}
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cursor); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }

code, pre, kbd { font-family: "Atkinson Mono", ui-monospace, monospace; font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
kbd { border: 1px solid var(--rim); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.35em; }
pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rim);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.bar nav { display: flex; gap: 1.4rem; }
.bar nav a { color: var(--text); text-decoration: none; }
.bar nav a:hover { color: var(--link); }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rim);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot a { color: var(--muted); }

/* the front page */
.front { max-width: 46rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 4rem; }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 3.5rem 0 1rem;
}
.hero h1::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.12em;
  margin-left: 0.12em;
  background: linear-gradient(90deg, var(--cursor) 25%, color-mix(in srgb, var(--cursor) 70%, transparent) 25% 50%, color-mix(in srgb, var(--cursor) 45%, transparent) 50% 75%, color-mix(in srgb, var(--cursor) 25%, transparent) 75%);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero h1::after { animation: none; } }
.hero > p { font-size: 1.15rem; max-width: 38rem; color: var(--text); }
.pane { margin: 2rem 0 0; border: 1px solid var(--rim); border-radius: 8px; overflow: hidden; background: #000; }
.pane img { display: block; width: 100%; }

.front h2 { font-size: 1.5rem; margin: 3.5rem 0 1rem; }
.install { display: grid; grid-template-columns: max-content 1fr; gap: 0.7rem 1.4rem; margin: 0; }
.install dt { color: var(--muted); padding-top: 0.15em; }
.install dd { margin: 0; min-width: 0; overflow-x: auto; }

.guide-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.guide-list li { padding: 0.9rem 0; border-top: 1px solid var(--rim); }
.guide-list a { font-weight: 700; font-size: 1.1rem; }
.guide-list p { margin: 0.25rem 0 0; color: var(--muted); }

/* search, on the front page and beside every guide */
.search { position: relative; }
.search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}
.results {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.3rem;
  background: var(--raised);
  border: 1px solid var(--rim);
  border-radius: 6px;
  position: absolute;
  inset: 100% 0 auto;
  z-index: 2;
  max-height: 24rem;
  overflow-y: auto;
}
.results a { display: block; padding: 0.45rem 0.6rem; border-radius: 4px; text-decoration: none; color: var(--text); }
.results a:hover, .results a:focus-visible { background: var(--code-bg); }
.results small { display: block; color: var(--muted); }
.results .empty { padding: 0.45rem 0.6rem; color: var(--muted); }

/* a guide: the list and search, the page, and its outline */
.reader {
  display: grid;
  grid-template-columns: 15rem minmax(0, 46rem) 13rem;
  gap: 3rem;
  justify-content: center;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}
.side, .outline { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; }
.guides { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.guides li { position: relative; }
.guides a { display: block; padding: 0.3rem 0 0.3rem 1rem; color: var(--muted); text-decoration: none; }
.guides a:hover { color: var(--text); }
.guides [aria-current] a { color: var(--text); font-weight: 700; }
.guides [aria-current]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.3rem;
  height: 1.05rem;
  background: var(--cursor);
}
.outline p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.outline ol { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.outline a { display: block; padding: 0.2rem 0; color: var(--muted); text-decoration: none; }
.outline a:hover { color: var(--text); }

.prose h1 { font-size: 2.3rem; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 1.2rem; }
.prose h2 { font-size: 1.5rem; margin: 2.6rem 0 0.8rem; scroll-margin-top: 1.5rem; }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; scroll-margin-top: 1.5rem; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--rim); vertical-align: top; }
.prose blockquote { margin: 1.2rem 0; padding: 0.2rem 1rem; border-left: 3px solid var(--rim); color: var(--muted); }
.turn { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.2rem; border-top: 1px solid var(--rim); }
.turn [rel="next"] { margin-left: auto; text-align: right; }

/* code colors, from the logo's blue and pink */
.code .k, .code .kd, .code .kn, .code .kr, .code .kt, .code .kc { color: var(--link); }
.code .s, .code .s1, .code .s2, .code .sb, .code .se, .code .sc { color: #a8d8a0; }
.code .c, .code .c1, .code .cm, .code .cd, .code .ch { color: var(--muted); font-style: italic; }
.code .mi, .code .mf, .code .m, .code .mh { color: var(--cursor); }
.code .nf, .code .fm { color: #e6c47a; }
.code .nc, .code .nn, .code .nt { color: #c9a5ff; }
@media (prefers-color-scheme: light) {
  .code .s, .code .s1, .code .s2, .code .sb, .code .se, .code .sc { color: #2c7a3a; }
  .code .nf, .code .fm { color: #8a5a00; }
  .code .nc, .code .nn, .code .nt { color: #6b3fbf; }
}

@media (max-width: 70rem) {
  .reader { grid-template-columns: 14rem minmax(0, 46rem); }
  .outline { display: none; }
}
@media (max-width: 48rem) {
  .reader { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .side { position: static; max-height: none; }
  .guides { display: flex; flex-wrap: wrap; gap: 0 1rem; }
  .bar nav { gap: 1rem; }
}
