@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #fbfbf8;
  --sheet: #ffffff;
  --ink: #111111;
  --ink-2: #3a4048;
  --ink-3: #5b6470;
  --rule: #d9d9d3;
  --wash: #efeee8;
  --rule-strong: #a9adb3;
  --rule-idle: #c9cac4;
  --scroll: #b9b9b2;
  --red: #d2261c;
  --red-ink: #b81f16;

  --luna: #1b7843;
  --terra: #0a6c80;
  --sol: #975b00;
  --astra: #a11f88;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Source Serif 4", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --label-col: 8.5rem;
  --head-h: 3.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111214;
    --sheet: #18191c;
    --ink: #ecebe6;
    --ink-2: #bcbfc5;
    --ink-3: #9197a0;
    --rule: #2d2f34;
    --wash: #212328;
    --rule-strong: #4d5158;
    --rule-idle: #3b3e44;
    --scroll: #3b3e44;
    --red: #d2261c;
    --red-ink: #b81f16;

    --luna: #55c792;
    --terra: #45b8ce;
    --sol: #e3a642;
    --astra: #e274d4;

    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111214;
  --sheet: #18191c;
  --ink: #ecebe6;
  --ink-2: #bcbfc5;
  --ink-3: #9197a0;
  --rule: #2d2f34;
  --wash: #212328;
  --rule-strong: #4d5158;
  --rule-idle: #3b3e44;
  --scroll: #3b3e44;
  --red: #d2261c;
  --red-ink: #b81f16;

  --luna: #55c792;
  --terra: #45b8ce;
  --sol: #e3a642;
  --astra: #e274d4;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--scroll) var(--paper);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

code, pre { font-family: var(--f-mono); font-variant-ligatures: none; }
code { font-size: 0.86em; }
p code, li code, dd code, dt code, figcaption code { white-space: nowrap; }
b { font-weight: 700; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  font-family: var(--f-display);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 0.5rem; }

/* ---------- running header / footer ---------- */

.runhead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--ink);
}
.runhead__inner, .runfoot__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--head-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--f-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.runhead__title {
  text-decoration: none;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.runhead__title { gap: 0.6rem; }
.logo-mark { display: block; flex: none; }
.runfoot__brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.runhead__sec { display: none; font-family: var(--f-display); font-style: normal; font-weight: 800; font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--ink); }
.runhead__mid {
  font-family: var(--f-text);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.runhead__end {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
}
.runhead__gh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  padding: 0.35rem 0.1rem;
}
.runhead__gh:hover span { text-decoration: underline; text-underline-offset: 0.2em; }

.runfoot {
  border-top: 1px solid var(--ink);
  margin-top: 0;
}
.runfoot__inner { grid-template-columns: 1fr auto; }
.runfoot__inner > :last-child { justify-self: end; }

/* ---------- thumb-index tabs ---------- */

.tabs { display: none; }

@media (min-width: 900px) {
  .tabs {
    display: block;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
  }
  .tabs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .tabs a {
    display: block;
    writing-mode: vertical-rl;
    padding: 0.9rem 0.55rem 0.9rem 0.6rem;
    background: var(--wash);
    border: 1px solid var(--rule);
    border-right: 0;
    font-family: var(--f-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-2);
    transform: translateX(4px);
    transition: transform 240ms var(--ease-out), background-color 240ms var(--ease-out), color 240ms var(--ease-out);
  }
  .tabs a:hover { transform: translateX(0); color: var(--ink); }
  .tabs a[aria-current="true"] {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    transform: translateX(0);
  }
}

/* ---------- sections ---------- */

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 900px) {
  main { padding-right: calc(var(--gutter) + 2.25rem); }
}

.sec {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(3.5rem, 7vw, 6rem);
  border-bottom: 1px solid var(--rule);
}
.sec--last { border-bottom: 0; padding-bottom: clamp(3rem, 6vw, 5rem); }

.sec__label {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 100%;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  line-height: 1;
  padding-top: 0.55rem;
  align-self: start;
  position: sticky;
  top: calc(var(--head-h) + 1.5rem);
}
.sec__label--inline {
  position: static;
  padding-top: 0;
  font-size: 0.75rem;
}

.h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  max-width: 20ch;
  text-wrap: balance;
}
.h2--small { font-size: clamp(1.75rem, 3vw, 2.5rem); }

.h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.body {
  max-width: 60ch;
  margin: 0 0 2.75rem;
  color: var(--ink-2);
  font-size: 1.125rem;
}
.body code, .plain code, .limits code, .policy code, .after code, .synopsis__note code, .caption code {
  background: var(--wash);
  padding: 0.08em 0.3em;
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  min-height: calc(100svh - var(--head-h));
  align-content: center;
}
.hero > .hero__grid { grid-column: 1 / -1; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: start;
}

.nameline {
  margin: 0 0 1.75rem;
  font-size: 1.0625rem;
  color: var(--ink-2);
}
.nameline b { color: var(--ink); }

.display {
  font-family: var(--f-display);
  font-weight: 850;
  font-stretch: 115%;
  font-size: clamp(3rem, 6.4vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0 0 1.75rem;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  line-height: 1.5;
  max-width: 34ch;
  margin: 0 0 2.25rem;
}

.synopsis {
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
  margin-bottom: 2rem;
  max-width: 30rem;
}
.synopsis__cmds {
  margin: 0.8rem 0 0.6rem;
  font-size: 1rem;
  line-height: 1.7;
}
.synopsis__cmds i { font-style: italic; color: var(--ink-3); }
.synopsis__note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  padding: 0.95rem 1.35rem;
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--primary:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn--primary:active { transform: translateY(1px); }
.btn--quiet {
  padding-inline: 0.2rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.3em;
}
.btn--quiet:hover { text-decoration-color: currentColor; }

/* ---------- session (EXAMPLES) ---------- */

.session {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
}

.session__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem 0.7rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--ink);
}
.seg button {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.seg button + button { border-left: 1px solid var(--ink); }
.seg button:hover { color: var(--ink); background: var(--wash); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.term {
  padding: 1.5rem 1.25rem 1.25rem;
  font-family: var(--f-mono);
  font-size: clamp(0.8125rem, 1vw, 0.9375rem);
  line-height: 1.6;
  min-height: 18.5rem;
}
.term__prompt {
  margin: 0 0 1rem;
  min-height: 1.6em;
  overflow-wrap: anywhere;
}
.term__you { font-weight: 700; }
.term__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: var(--ink);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term__caret { animation: none; } }

.card {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.card .d { color: var(--ink-3); }
.card .b { font-weight: 700; }
.card .kept { color: var(--ink); font-weight: 700; }
.card {
  border-left: 1px solid var(--rule-strong);
  padding-left: 1.2ch;
  position: relative;
}
.card:empty { border-left-color: transparent; }
.card .edge { display: block; }
.card .edge--top { margin: 0 0 0.35rem -1.2ch; padding-left: 1.2ch; position: relative; }
.card .edge--top::before, .card .edge--end::before {
  content: "";
  position: absolute;
  left: -1px;
  width: 0.9ch;
  border-top: 1px solid var(--rule-strong);
}
.card .edge--top::before { top: 0.8em; }
.card .edge--end { position: relative; height: 0.9rem; margin-left: -1.2ch; }
.card .edge--end::before { bottom: 0; width: min(46ch, 100%); }
.card .row {
  display: grid;
  grid-template-columns: 11ch minmax(0, 1fr);
}
.card .row > :last-child { min-width: 0; }
.card[data-state="in"] > * {
  animation: line-in 420ms var(--ease-out) both;
}
.card[data-state="in"] > :nth-child(2) { animation-delay: 30ms; }
.card[data-state="in"] > :nth-child(3) { animation-delay: 60ms; }
.card[data-state="in"] > :nth-child(4) { animation-delay: 90ms; }
.card[data-state="in"] > :nth-child(5) { animation-delay: 120ms; }
.card[data-state="in"] > :nth-child(6) { animation-delay: 150ms; }
.card[data-state="in"] > :nth-child(7) { animation-delay: 180ms; }
.card[data-state="in"] > :nth-child(8) { animation-delay: 210ms; }
@keyframes line-in {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .card[data-state="in"] > * { animation: none; }
}

.t-luna { color: var(--luna); }
.t-terra { color: var(--terra); }
.t-sol { color: var(--sol); }
.t-astra { color: var(--astra); }

.steps {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--rule);
}
.steps__row {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.steps__row li + li { border-left: 1px solid var(--rule); }
.step {
  --tone: var(--ink-3);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.7rem 0.6rem 0.75rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  position: relative;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.step::before {
  content: "";
  display: block;
  width: 100%;
  height: 6px;
  background: var(--rule);
  transition: background-color 260ms var(--ease-out);
}
.step:hover { background: var(--wash); color: var(--ink); }
.step[data-seen="true"]::before { background: color-mix(in srgb, var(--tone) 38%, var(--sheet)); }
.step[aria-current="step"] { color: var(--ink); background: var(--wash); }
.step[aria-current="step"]::before { background: var(--tone); }
.step__tier { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.step[data-seen="true"] .step__tier, .step[aria-current="step"] .step__tier { color: var(--tone); }
.step__kept {
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--sheet);
}

.steps__play {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  padding: 0 1rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--ink);
  cursor: pointer;
}
.steps__play:hover { background: var(--wash); }
.steps__play .i-play { display: none; }
.steps__play[aria-pressed="false"] .i-play { display: block; }
.steps__play[aria-pressed="false"] .i-pause { display: none; }

.caption {
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-3);
  font-style: italic;
}
.caption code { font-style: normal; font-size: 0.82em; }

/* ---------- routing lab ---------- */

.lab {
  display: grid;
  grid-template-columns: minmax(16rem, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.dials {
  display: grid;
  gap: 1.25rem;
  border-top: 1px solid var(--ink);
  padding-top: 1.25rem;
}
.dial { border: 0; margin: 0; padding: 0; min-width: 0; }
.dial legend {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  padding: 0;
}
.dial__opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
}
.dial__opts label {
  position: relative;
  display: grid;
  place-items: center;
  height: 2.75rem;
  font-family: var(--f-mono);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.dial__opts label + label { border-left: 1px solid var(--ink); }
.dial__opts input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.dial__opts label:hover { background: var(--wash); }
.dial__opts label:has(input:checked) { background: var(--ink); color: var(--paper); }
.dial__opts label:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; z-index: 1; }

.readout {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1rem 1.1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  min-height: 9.5rem;
}
.readout .r-tier {
  font-family: var(--f-display);
  font-weight: 850;
  font-stretch: 115%;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 0.6rem;
}
.readout .r-why { color: var(--ink-2); display: block; }
.readout .r-why::before { content: "why  "; color: var(--ink-3); }

.tiertable {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.tiertable th, .tiertable td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 1rem 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}
.tiertable thead th {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-top: 0;
}
.tiertable tbody th { width: 7.5rem; }
.tiertable td:nth-child(2) { color: var(--ink-2); max-width: 22ch; }
.tiertable td:nth-child(n+3) { white-space: nowrap; font-family: var(--f-mono); font-size: 0.8125rem; }
.tiertable td code { font-size: 1em; }
.tiertable tbody tr { transition: background-color 260ms var(--ease-out); }
.tiername {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 110%;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--ink-3);
  transition: color 260ms var(--ease-out);
}
.tiertable tbody th { padding-left: 0.75rem; }
.tiertable thead th:first-child { padding-left: 0.75rem; }
.tiertable tr > :last-child { padding-right: 0.75rem; }
.tiername { display: inline-flex; align-items: center; gap: 0.6rem; }
.tiername::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--rule-idle);
  transition: background-color 260ms var(--ease-out);
}
.tiertable tr[data-active="true"] { background: var(--wash); }
.tiertable tr[data-active="true"] .tiername { color: var(--tone); }
.tiertable tr[data-active="true"] .tiername::before { background: var(--tone); }
.tiertable tr[data-active="true"] td { color: var(--ink); }
.tiertable tr[data-tier="luna"] { --tone: var(--luna); }
.tiertable tr[data-tier="terra"] { --tone: var(--terra); }
.tiertable tr[data-tier="sol"] { --tone: var(--sol); }
.tiertable tr[data-tier="astra"] { --tone: var(--astra); }


.rules {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}
.rules li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.35rem;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.55rem;
  height: 1px;
  background: var(--ink);
}

/* ---------- cache track ---------- */

.track {
  display: grid;
  grid-template-columns: 7.5rem repeat(8, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin-bottom: 2.75rem;
  font-family: var(--f-mono);
  font-size: 0.8125rem;
}
.track__head, .track__cell {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.track__head {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.track__cell + .track__cell, .track__head + .track__cell { border-left: 1px solid var(--rule); }
.track__turn { color: var(--ink-3); }
.track__bar {
  display: block;
  height: 6px;
  margin-bottom: 0.4rem;
  background: var(--rule-idle);
  transition: background-color 260ms var(--ease-out);
}
.track__model { color: var(--ink-3); transition: color 260ms var(--ease-out); }
.track__cell[data-on="true"] .track__bar { background: var(--tone); }
.track__cell[data-on="true"] .track__model { color: var(--tone); }
.track__turn[data-on="true"] { color: var(--ink); font-weight: 700; }
.track__cell[data-kept="true"] { background: var(--sheet); box-shadow: inset 0 0 0 1px var(--ink); }
.track__note { display: block; color: var(--ink); font-weight: 700; font-size: 0.6875rem; margin-top: 0.15rem; }
.track > :nth-last-child(-n+9) { border-bottom: 0; }

.policy {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem clamp(1.25rem, 2.5vw, 2.5rem);
  margin: 0;
}
.policy > div { border-top: 1px solid var(--ink); padding-top: 0.85rem; }
.policy dt {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.0625rem;
  margin-bottom: 0.3rem;
}
.policy dt code { font-size: 0.9em; }
.policy dd { margin: 0; color: var(--ink-2); }

/* ---------- install ---------- */

.install {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 4.5vw, 4.5rem);
  margin-top: 2.25rem;
}
.plain {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}
.plain li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}
.plain li:last-child { border-bottom: 1px solid var(--rule); }

.codeblock {
  background: var(--sheet);
  border: 1px solid var(--ink);
}
.codeblock__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.5rem 0.45rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.copy:hover { background: var(--ink); color: var(--paper); }
.copy .i-check { display: none; }
.copy[data-done="true"] { background: var(--ink); color: var(--paper); }
.copy[data-done="true"] .i-check { display: block; }
.copy[data-done="true"] .i-copy { display: none; }
.codeblock pre {
  margin: 0;
  padding: 1.1rem 1.1rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  overflow-x: auto;
}
.codeblock .c { color: var(--ink-3); font-style: italic; }
.after { margin: 1.1rem 0 1.5rem; color: var(--ink-2); }

/* ---------- limits / see also ---------- */

.limits {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lim;
  max-width: 68ch;
}
.limits li {
  counter-increment: lim;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}
.limits li::before {
  content: counter(lim) ".";
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--ink-3);
  padding-top: 0.15rem;
}

.seealso {
  margin: 0;
  font-size: 1.125rem;
}
.seealso a { font-family: var(--f-mono); font-size: 0.9em; white-space: nowrap; }
.seealso span { color: var(--ink-3); margin: 0 0.4rem; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: 0; }
  .lede { max-width: 44ch; }
  .lab { grid-template-columns: minmax(0, 1fr); }
  .policy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --label-col: 1fr; }
  .sec {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.25rem;
    padding: 3.5rem 0 3.25rem;
  }
  .sec__label { position: static; padding-top: 0; }
  .hero { padding-top: 2rem; }
  .install { grid-template-columns: minmax(0, 1fr); }
  .runhead__sec { display: inline; }
  .sec > .sec__label { display: none; }
  .runhead__inner { column-gap: 0.75rem; }
  .track { grid-template-columns: 5.25rem repeat(8, minmax(0, 1fr)); font-size: 0.6875rem; }
  .track__cell { padding: 0.55rem 0.2rem; font-size: 0.6875rem; }
  .track__model { font-size: 0.6875rem; overflow-wrap: anywhere; }
  .track__note { font-size: 0.6875rem; }
}

@media (max-width: 560px) {
  .runhead__gh span { display: none; }
  .runhead__end { gap: 0.75rem; }
  body { font-size: 1rem; }
  .display { font-size: clamp(2.75rem, 13vw, 3.5rem); }
  .policy { grid-template-columns: minmax(0, 1fr); }
  .term { padding: 1.1rem 0.9rem 1rem; min-height: 0; font-size: 0.75rem; }
  .card .edge { display: block; white-space: nowrap; overflow: hidden; }
  .card .row { grid-template-columns: 11ch minmax(0, 1fr); }
  .session__bar { padding-left: 0.9rem; }
  .steps { flex-direction: column; }
  .steps__row { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .step { padding: 0.6rem 0.25rem; font-size: 0.6875rem; }
  .step__label { display: none; }
  .steps__play { border-left: 0; border-top: 1px solid var(--rule); padding: 0.7rem 1rem; justify-content: center; }
  .caption { padding-inline: 0.9rem; }
  .tiertable thead { display: none; }
  .tiertable, .tiertable tbody, .tiertable tr, .tiertable th, .tiertable td { display: block; width: auto; }
  .tiertable tr { padding: 0.9rem 0.75rem; border-bottom: 1px solid var(--rule); }
  .tiertable th, .tiertable td, .tiertable tbody th, .tiertable tr > :last-child { border: 0; padding: 0.1rem 0; }
  .tiertable tbody th { width: auto; }

  .tiertable td:nth-child(n+3) { display: inline-block; margin-right: 1rem; }
  .track { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .track__head { grid-column: 1 / -1; padding: 0.6rem 0 0.4rem; border-bottom: 0; }
  .track__head + .track__cell { border-left: 0; }
  .track > :nth-last-child(-n+9) { border-bottom: 1px solid var(--rule); }
  .track > :nth-last-child(-n+8) { border-bottom: 0; }
}

.oneline {
  display: flex;
  align-items: stretch;
  margin-top: 1.25rem;
  max-width: 30rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
}
.oneline pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.oneline .copy { border: 0; border-left: 1px solid var(--ink); }

.theme {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.theme:hover { background: var(--wash); border-color: var(--ink-3); }
.theme .i-sun { display: none; }
.theme[aria-pressed="true"] .i-sun { display: block; }
.theme[aria-pressed="true"] .i-moon { display: none; }

/* ---------- phones: more breathing room ---------- */

@media (max-width: 560px) {
  /* sample session: label on its own line, provider switch full width */
  .session__bar { flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 0.9rem; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .seg button { padding: 0.6rem 0.5rem; font-size: 0.8125rem; }

  /* route card: a little larger and looser */
  .term { font-size: 0.8125rem; line-height: 1.75; padding: 1.25rem 0.9rem 1.1rem; }
  .card .row { grid-template-columns: 10.5ch minmax(0, 1fr); margin-bottom: 0.15rem; }
  .card .edge--top { margin-bottom: 0.6rem; }

  /* turns: two rows of four instead of one row of eight */
  .steps__row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps__row li + li { border-left: 0; }
  .steps__row li:not(:nth-child(4n + 1)) { border-left: 1px solid var(--rule); }
  .steps__row li:nth-child(n + 5) { border-top: 1px solid var(--rule); }
  .step { padding: 0.75rem 0.6rem 0.8rem; font-size: 0.75rem; gap: 0.4rem; }
  .step__label { display: inline; }

  /* tier table: let descriptions use the full width */
  .tiertable td:nth-child(2) { max-width: none; margin: 0.2rem 0 0.35rem; }
  .tiertable tr { padding: 1.1rem 0.75rem; }

  /* cache track: one row per turn, three columns */
  .track {
    grid-template-columns: 3.25rem minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(9, auto);
    grid-auto-flow: column;
    font-size: 0.8125rem;
  }
  .track > .track__head { grid-column: auto; padding: 0.7rem 0.6rem 0.7rem 0; border-left: 0; border-bottom: 1px solid var(--ink); }
  .track > .track__cell { padding: 0.7rem 0.6rem 0.7rem 0; border-left: 0; border-bottom: 1px solid var(--rule); font-size: 0.8125rem; }
  .track > .track__cell[data-kept="true"] { padding-left: 0.6rem; }
  .track > :nth-child(9n) { border-bottom: 0; }
  .track__model { font-size: 0.8125rem; }
  .track__note { font-size: 0.75rem; }
  .track__bar { width: 2.25rem; height: 5px; }

  /* install: wrap long commands instead of running off the edge */
  .codeblock pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.875rem; }
}

/* ---------- header text link (Docs) ---------- */

.runhead__link {
  text-decoration: none;
  padding: 0.35rem 0.1rem;
}
.runhead__link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.runhead__link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

/* ---------- docs page ---------- */

.docs {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.toc {
  position: sticky;
  top: var(--head-h);
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  padding: 2.5rem 0 2rem;
}
.toc__fold summary { display: none; }
.toc__group {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc__group:first-child { margin-top: 0; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--red); font-weight: 600; }

.toc, .doc { min-width: 0; }
.doc {
  margin: 0;
  max-width: 46rem;
  padding: 2.5rem 0 5rem;
}
.doc__head { padding-bottom: 2rem; border-bottom: 1px solid var(--ink); margin-bottom: 0.5rem; }
.doc__title {
  font-family: var(--f-display);
  font-weight: 850;
  font-stretch: 112%;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.doc__lede { margin: 0; font-size: 1.1875rem; color: var(--ink-2); max-width: 40ch; }

.doc__sec { padding: 2.75rem 0 0.5rem; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--head-h) + 1rem); }
.doc__sec:last-child { border-bottom: 0; }
.doc h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(1.625rem, 2.6vw, 2.125rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.doc h2 code { font-size: 0.85em; }
.doc h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 2rem 0 0.75rem;
}
.doc p, .doc ul, .doc ol { margin: 0 0 1.25rem; max-width: 68ch; }
.doc ul, .doc ol.steps-list { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.4rem; }
.doc li::marker { color: var(--ink-3); }
.doc p code, .doc li code, .doc td code, .doc th code {
  background: var(--wash);
  padding: 0.08em 0.3em;
}
.doc .codeblock { margin: 0 0 1.5rem; }
.doc .codeblock pre { font-size: 0.875rem; line-height: 1.7; }
.doc .codeblock__bar { min-height: 2.6rem; }
.note {
  padding: 0.9rem 1.1rem;
  background: var(--wash);
  color: var(--ink-2);
  font-size: 0.9688rem;
}

.dtable-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9688rem;
}
.dtable th, .dtable td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.dtable thead th {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
}
.dtable thead th code { text-transform: none; letter-spacing: 0; }
.dtable tbody th { font-family: var(--f-display); font-weight: 800; white-space: nowrap; }
.dtable td { color: var(--ink-2); }
.dtable--cmds tbody th { font-family: var(--f-text); font-weight: 400; }

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc {
    position: sticky;
    top: var(--head-h);
    z-index: 10;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin: 0 calc(var(--gutter) * -1);
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .toc__fold summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem var(--gutter);
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
  }
  .toc__fold summary::-webkit-details-marker { display: none; }
  .toc__fold summary::after { content: "+"; font-size: 1.1rem; font-weight: 700; }
  .toc__fold[open] summary::after { content: "−"; }
  .toc__groups {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 var(--gutter) 1.25rem;
  }
  .doc { padding-top: 2rem; }
}

@media (max-width: 560px) {
  .doc__lede { font-size: 1.0625rem; }
  .doc .codeblock pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8125rem; }
  .doc .codeblock pre.art { white-space: pre; overflow-x: auto; font-size: 0.75rem; }
  .dtable td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 6.5rem;
    margin-right: 0.5rem;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .dtable { font-size: 0.9375rem; }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable th, .dtable td { display: block; width: auto; }
  .dtable tr { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
  .dtable th, .dtable td { border: 0; padding: 0.1rem 0; }
  .dtable tbody th { white-space: normal; margin-bottom: 0.2rem; }
}

@media (max-width: 560px) {
  .runhead__sec { display: none; }
}

/* ---------- tier rows are clickable presets ---------- */

.tiertable tbody tr { cursor: pointer; }
.tiertable tbody tr:hover { background: var(--wash); }
button.tiername {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
button.tiername:hover { color: var(--ink); }
