:root {
  --bg: #191d22;
  --surface: #22282f;
  --surface-2: #2a3139;
  --ink: #f1efea;
  --muted: #b5bec7;
  --line: #3b444e;
  --line-strong: #535f6b;
  --accent: #8bc8be;
  --accent-wash: #263c3c;
  --second: #e7b17b;
  --second-wash: #3e3229;
  --reading: Charter, "Bitstream Charter", Georgia, serif;
}

:root[data-theme="light"] {
  --bg: #f6f3ec;
  --surface: #fffcf6;
  --surface-2: #ede8de;
  --ink: #292a27;
  --muted: #5b5e57;
  --line: #dcd5c8;
  --line-strong: #bcb4a6;
}

body {
  background-image: none;
  line-height: 1.65;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  padding: 0 max(24px, 4vw) 72px;
  gap: clamp(36px, 6vw, 68px);
}

.chapters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}

.chapters > span { font-weight: 650; }
.chapters div, .chapter-sections {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.chapters .theme-btn { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 0.23em; }
.chapters a { color: var(--muted); text-decoration: none; }
.chapters a:hover, .chapters a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

header { gap: 16px; min-width: 0; }
.chapter-label { color: var(--accent); font-size: 14px; font-weight: 650; }
h1, h2 {
  font-family: var(--reading);
  font-weight: 400;
  letter-spacing: -0.035em;
}
h1 { font-size: clamp(38px, 7vw, 78px); line-height: 1.02; max-width: 18ch; }
h2 { font-size: clamp(27px, 4vw, 40px); line-height: 1.12; }
h3 { font-size: 17px; }
.lede { font: clamp(18px, 2.4vw, 23px)/1.5 var(--reading); max-width: 57ch; }
.chapter-sections { font-size: 14px; margin-top: 4px; }

.wrap > section {
  border-top: 1px solid var(--line);
  padding-top: clamp(22px, 4vw, 36px);
  scroll-margin-top: 24px;
}
.sec-head { gap: 10px; }
.sec-head p { max-width: 72ch; }
.fix, .finding { box-shadow: none; }
.wrap > header { padding-top: clamp(36px, 6vw, 72px); }
.wrap > header h1 { font-size: clamp(38px, 7vw, 78px); line-height: 1.02; }

:root {
  --walkthrough-paper: #f7f6f0;
  --walkthrough-surface: #fffdf8;
  --walkthrough-ink: #1d2a26;
  --walkthrough-muted: #4f6058;
  --walkthrough-line: #cbd2c8;
  --walkthrough-accent: #225d46;
  --walkthrough-active: #e2eee1;
  --walkthrough-heading: Charter, Georgia, serif;
}

.flow-explorer { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; }
.flow-steps { display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: 1px; background: var(--line); }
.flow-panel { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: center; padding: clamp(20px, 4vw, 40px); min-height: 220px; }
.flow-panel[hidden] { display: none; }
.flow-panel p { color: var(--muted); max-width: 48ch; }
.flow-note { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow-note summary, .archive summary { cursor: pointer; font-weight: 650; }
.archive { border-top: 1px solid var(--line); padding-top: 18px; }
.archive > summary { font-size: 1.1rem; padding: 10px 0; }
.archive > section { margin: 32px 0; }
@media(max-width:650px) { .flow-steps { grid-template-columns: repeat(2,minmax(0,1fr)); } .flow-panel { grid-template-columns: minmax(0,1fr); } }
.audio-handoff { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.audio-handoff span, .audio-handoff a { padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.audio-handoff span[aria-hidden="true"] { padding: 0; border: 0; background: transparent; color: var(--muted); }
@media (max-width:650px) { .audio-handoff { flex-direction: column; align-items: flex-start; } .audio-handoff span[aria-hidden="true"] { transform: rotate(90deg); margin-left: 20px; } }
.wrap > .flow-explorer { padding-top: 0; border: 1px solid var(--line); }
.reference-list { display: grid; gap: 0; }
.reference-list > h2 { margin-bottom: 16px; }
.reference-item { border-top: 1px solid var(--line); padding: 12px 0; min-width: 0; }
.reference-item > summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.reference-item > section { display: grid; gap: 20px; margin: 20px 0; min-width: 0; }
.reference-item > section > .sec-head h2 { font: inherit; font-weight: 650; letter-spacing: 0; }

.site-header {
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--walkthrough-line);
  font: 1rem/1.55 system-ui, sans-serif;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.site-header .wordmark { color: var(--walkthrough-ink); font-weight: 700; text-decoration: none; }
.site-header .wordmark span { color: var(--walkthrough-muted); font-weight: 400; }
.site-header nav a { color: var(--walkthrough-accent); text-decoration: underline; text-underline-offset: .28em; }
.site-header nav a[aria-current="page"] { font-weight: 700; }
.site-header a:focus-visible { outline: 3px solid #3964a5; outline-offset: 3px; }
.site-footer {
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-block: 24px 40px;
  border-top: 1px solid var(--walkthrough-line);
  font: .9rem/1.55 system-ui, sans-serif;
  color: var(--walkthrough-muted);
}
.site-footer p { margin: 0; max-width: none; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.site-footer a { color: var(--walkthrough-accent); text-decoration: underline; text-underline-offset: .28em; }
.site-footer a:focus-visible { outline: 3px solid #3964a5; outline-offset: 3px; }

/* Shared appearance for the four walkthrough chapters. */
:root[data-theme="light"] {
  --bg: var(--walkthrough-paper);
  --surface: var(--walkthrough-surface);
  --surface-2: #efeee6;
  --ink: var(--walkthrough-ink);
  --muted: var(--walkthrough-muted);
  --line: var(--walkthrough-line);
  --line-strong: #aebcaf;
  --accent: var(--walkthrough-accent);
  --accent-wash: var(--walkthrough-active);
  --second: #835217;
  --second-wash: #f3e7d4;
  --good: var(--walkthrough-accent);
}
body { font: 1rem/1.55 system-ui, sans-serif; }
.wrap, main { width: min(100% - 40px, 1080px); max-width: 1080px; margin-inline: auto; padding-inline: 0; }
main h1, main h2 {
  font-family: Charter, "Bitstream Charter", Georgia, serif;
  font-weight: 400;
  letter-spacing: -.035em;
}
main h1, .wrap > header h1, .intro h1 { font-size: clamp(38px, 7vw, 78px); line-height: 1.02; }
main h2 { font-size: clamp(27px, 4vw, 40px); line-height: 1.12; }
main .lede { font: clamp(18px, 2.4vw, 23px)/1.5 Charter, "Bitstream Charter", Georgia, serif; max-width: 57ch; color: var(--muted); }
.flow-steps button, .vision-route button {
  border: 0;
  border-radius: 0;
  padding: 16px;
  text-align: left;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font: 1rem/1.55 system-ui, sans-serif;
}
.flow-steps button span, .vision-route button span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.flow-steps button[aria-pressed="true"], .vision-route button[aria-pressed="true"] {
  background: var(--accent-wash);
  color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
}
.flow-panel h2, .vision-preview h2 { margin: 0 0 12px; }

.flow-art { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; padding: 20px; background: var(--accent-wash); border-radius: 6px; }
.flow-art span { display: grid; place-items: center; min-width: 30px; min-height: 30px; padding: 5px; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; font-size: 12px; }
.flow-art span.full { background: var(--accent); color: var(--surface); }
.flow-art span.media { background: var(--second-wash); border-color: var(--second); color: var(--second); }

.keep-exploring { border-top: 1px solid var(--line); padding: 36px 0 48px; }
.keep-exploring h2 { margin: 0 0 20px; }
.explore-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.explore-links a { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-decoration: none; }
.explore-links a:hover { border-color: var(--accent); }
.explore-links a strong { display: block; color: var(--accent); }
.explore-links a span { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; }
@media (max-width: 650px) { .explore-links { grid-template-columns: 1fr; } }

dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
dl > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}
dt { font-weight: 650; font-size: 14.5px; }
dd { margin: 0; font-size: 13.5px; color: var(--muted); }
dd code { color: var(--ink); }
@media (max-width: 600px) { dl { grid-template-columns: minmax(0, 1fr); } }
pre .c { color: var(--muted); }

:root { --surface: var(--walkthrough-surface); --surface-2: #efeee6; --second: #835217; --second-wash: #f3e7d4; }
.intro { padding-bottom: 32px; }
.chapter pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.intro { padding-top: clamp(36px, 6vw, 72px); }
.intro .lede { margin-top: 16px; }

.model-footprint { padding-block: 36px; border-top: 1px solid var(--line); }
.model-footprint > p { color: var(--muted); margin: 16px 0 24px; }
.model-footprint .card h3 { margin-bottom: 16px; }
.model-footprint .scroll { overflow-x: auto; }
.model-footprint table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
.model-footprint th, .model-footprint td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.model-footprint tr:last-child td { border-bottom: 0; }
.parameter-count { position: relative; text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.parameter-count:hover::after, .parameter-count:focus::after {
  content: attr(data-exact);
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 1;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--ink); font-size: .8rem; font-weight: 400;
}
