: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;
}

:root {
  color-scheme: light;
  --paper: #f7f6f0;
  --ink: #1d2a26;
  --muted: #4f6058;
  --line: #cbd2c8;
  --accent: #225d46;
  --active: #e2eee1;
  font-family: system-ui, sans-serif;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .28em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #3964a5; outline-offset: 3px; }
.site-header, main { width: min(100% - 40px, 1080px); margin-inline: auto; }
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding-block: 22px; border-bottom: 1px solid var(--line);
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.wordmark { color: var(--ink); font-weight: 700; text-decoration: none; }
.wordmark span { color: var(--muted); font-weight: 400; }
section, #pooling, #audio-window { scroll-margin-top: 24px; }
.intro { padding: clamp(36px, 8vw, 92px) 0 58px; }
.eyebrow { font-size: .84rem; font-weight: 650; color: var(--accent); }
h1, h2 { margin: 0; font-family: Charter, "Bitstream Charter", Georgia, serif; font-weight: 400; letter-spacing: -.035em; }
h1 { font-size: clamp(38px, 7vw, 78px); line-height: 1.02; }
h2 { font-size: clamp(27px, 4vw, 40px); line-height: 1.12; }
h3 { margin: 0; font-size: 1.3rem; }
.lede { max-width: 57ch; color: var(--muted); font: clamp(18px, 2.4vw, 23px)/1.5 Charter, "Bitstream Charter", Georgia, serif; margin: 24px 0 32px; }
.route-explorer {
  border: 1px solid var(--line);
  background: var(--walkthrough-surface, #fffdf8);
  border-radius: 8px;
  overflow: hidden;
}
.route-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.route-picker button {
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  text-align: left;
  background: #efeee6;
  color: var(--ink);
  font-weight: 600;
}
.route-picker button[aria-pressed="true"] {
  background: var(--active);
  color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
}
.route-stage {
  padding: clamp(20px, 3vw, 32px);
}
.route {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; list-style: none;
  padding: 0; margin: 0;
}
.route li { display: flex; align-items: center; gap: 12px; }
.route li + li::before { content: "→"; color: var(--muted); }
.route a, .route span {
  display: block; padding: 9px 14px; border: 1px solid var(--line);
  background: #efeee6; border-radius: 6px; font-size: .95rem;
}
.route a {
  background: var(--active); border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  font-weight: 600; text-decoration: none;
}
.route a:hover { border-color: var(--accent); text-decoration: underline; }
.route li:last-child span {
  background: var(--accent); border-color: var(--accent);
  color: var(--walkthrough-surface, #fffdf8); font-weight: 600;
}
.compact { font-size: .9rem; margin: 0; }
.chapter {
  border-top: 1px solid var(--line); padding: clamp(30px, 6vw, 62px) 0;
  display: grid; gap: 22px;
}
.chapter-heading p, details p, .pipeline-status { color: var(--muted); max-width: 65ch; margin-bottom: 0; }
.chapter-link { justify-self: start; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
.inspection { padding: clamp(16px, 4vw, 32px); background: #fffdf8; border: 1px solid var(--line); border-radius: 8px; }
.inspection-title p { margin: 4px 0 20px; color: var(--muted); }
.pool-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(16px, 5vw, 46px); }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.sample { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 1; background: linear-gradient(#7b9ba0, #e0bc8a 75%); }
.sun { position: absolute; border-radius: 50%; width: 21%; aspect-ratio: 1; left: 64%; top: 15%; background: #fff2cb; }
.ridge { position: absolute; inset: 0; }
.ridge-back { background: #546d68; clip-path: polygon(0 78%, 28% 29%, 47% 56%, 65% 37%, 100% 80%, 100% 100%, 0 100%); }
.ridge-front { background: #294d42; clip-path: polygon(0 83%, 28% 65%, 47% 77%, 76% 53%, 100% 72%, 100% 100%, 0 100%); }
.regions, .token-grid, .patch-stack { display: grid; }
.regions, .token-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.regions { position: absolute; inset: 0; }
.regions button { border: 1px solid #fff8; background: transparent; padding: 0; min-width: 0; }
.regions button[aria-pressed="true"] {
  border: 2px solid #fff;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 3 - 1px), #fff calc(100% / 3 - 1px) calc(100% / 3)),
              repeating-linear-gradient(0deg, #225d4640 0 calc(100% / 3 - 1px), #fff calc(100% / 3 - 1px) calc(100% / 3));
}
.transformation { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 15px; align-items: center; }
.transformation p { grid-column: 1 / -1; margin: 0; }
.transformation p:last-child { color: var(--muted); }
#pool-result { font-weight: 650; }
.patch-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.patch-stack, .token-grid { gap: 3px; }
.patch-stack i, .token-grid i { aspect-ratio: 1; border-radius: 2px; background: var(--active); }
.patch-stack i, .token-grid i.selected { background: var(--accent); }
.operation { font-size: 1.5rem; }
.keys { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; }
.keys li { min-width: 30px; padding: 5px; text-align: center; background: var(--active); border: 1px solid var(--line); border-radius: 4px; }
.keys li.excluded { background: transparent; color: var(--muted); border-style: dashed; }
.keys li.extra { background: #f2d39b; border-color: #8b5b1c; }
.keys li.query { background: var(--accent); color: white; }
.key-result { margin: 0; }
@media (max-width: 600px) {
  .route-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-demo { grid-template-columns: minmax(0, 1fr); }
  .transformation { grid-template-columns: minmax(0, 100px) auto minmax(0, 100px); justify-content: start; }
  .route { flex-direction: column; align-items: start; }
  .route li + li::before { content: "↓"; }
}

.vision-panel {
  margin-top: 22px;
  padding: 14px clamp(14px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}
.vision-content { display: grid; gap: 18px; margin-top: 16px; }
.vision-content .chapter-heading p { margin: 0; }
#pooling > summary { color: var(--accent); }
#pooling[open] > summary { margin-bottom: 16px; }
.vision-panel summary { min-height: 32px; }
.vision-panel { scroll-margin-top: 24px; }

.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; }
