:root {
  --surface: #fff;
  --page: #fafafa;
  --ink: #0a0a0a;
  --pink-soft: #f2d4cf;
  --sage-soft: #e5edd6;
  --extended: #f5f5f5;
  --pink: #f472b6;
  --sage: #86a882;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --container: 80rem;
  --side: 1.5rem;
  --section: clamp(4rem, 8vw, 8rem);
  --gap: 1.2rem;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 0 0 5.5rem; background: var(--page); color: var(--ink); overflow-x: hidden; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-style: double; }
img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); background: var(--sage-soft); }
button, input { font: inherit; border-radius: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .5rem;
  left: .5rem;
  min-height: 44px;
  padding: .55rem .8rem;
  border: 3px solid var(--ink);
  background: var(--surface);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 4.6rem;
  border-bottom: 3px solid var(--ink);
  background: var(--surface);
}
.masthead__name {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .75rem var(--side);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.02em;
}
.masthead__name span { padding: .1rem .35rem; background: var(--pink-soft); }
.masthead__stamp {
  display: none;
  align-items: center;
  margin: 0;
  padding: .75rem var(--side);
  border-left: 3px solid var(--ink);
  background: var(--sage-soft);
  font-family: var(--font-mono);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .05em;
}

.chapter, .site-footer {
  width: min(100%, var(--container));
  margin-inline: auto;
  padding-inline: var(--side);
}
.hero {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
  padding-block: clamp(2.5rem, 6vw, 6rem);
  border-bottom: 4px solid var(--ink);
}
.hero__copy { align-self: center; max-width: 54rem; }
.eyebrow {
  margin: 0 0 .8rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .045em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.04; letter-spacing: -.04em; }
h1 { max-width: 15ch; font-size: clamp(2.5rem, 9vw, 4rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; }
p, li, summary, label, input, button, a { font-size: 1rem; }
p { max-width: 72ch; }
.hero__dek { max-width: 58ch; margin: 1.5rem 0 0; font-size: 1.1rem; line-height: 1.55; }
.hero__art { align-self: center; box-shadow: 5px 5px 0 var(--pink); }
.hero__index {
  position: relative;
  min-height: 13rem;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--sage-soft);
  box-shadow: 5px 5px 0 var(--pink);
}
.hero__index span {
  position: absolute;
  left: .8rem;
  bottom: -.35rem;
  font-family: var(--font-mono);
  font-size: clamp(5rem, 22vw, 9rem);
  font-weight: 700;
  line-height: 1;
}
.hero__index i { position: absolute; display: block; width: 45%; height: 45%; border: 3px solid var(--ink); background: var(--surface); }
.hero__index i:nth-of-type(1) { top: -1rem; right: 0; background: var(--pink-soft); }
.hero__index i:nth-of-type(2) { top: 30%; right: 18%; width: 25%; height: 25%; background: var(--pink); }
.hero__index i:nth-of-type(3) { right: 0; bottom: -2rem; background: var(--surface); }

.chapter__section { margin-top: var(--section); }
.chapter__section--grid, .chapter__section--split { display: grid; gap: 1.5rem; }
.chapter__copy h2, .chapter__section > h2 { max-width: 20ch; }
.chapter__copy p, .prose p { margin: 1rem 0 0; }
.signal {
  align-self: stretch;
  padding: 1.25rem;
  border: 3px solid var(--ink);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
}
.signal--pink { background: var(--pink-soft); box-shadow: 5px 5px 0 var(--pink); }
.signal--sage { background: var(--sage-soft); }
.signal__label { margin: 0; font-family: var(--font-mono); font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.signal__big { margin: 1rem 0 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }

.compare, .decision-board, .caption-card, .lane-table, .question-sheet, .red-grid, .step-grid, .matrix, .identity-grid, .decoder, .exit-grid, .timeline {
  margin: var(--section) 0 0;
}
.compare { display: grid; gap: var(--gap); }
.compare__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 1.25rem;
  border: 3px solid var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
}
.compare__item:nth-child(even) { transform: translateY(.55rem); }
.compare__item--pink { background: var(--pink-soft); box-shadow: 5px 5px 0 var(--pink); }
.compare__item--sage { background: var(--sage-soft); }
.compare__item p { margin: .9rem 0; }
.compare__tag, .identity-grid article > span, .decoder__claim {
  margin: 0 0 .6rem;
  font-family: var(--font-mono);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
figcaption {
  grid-column: 1 / -1;
  margin-top: .5rem;
  padding: .8rem 0 0;
  border-top: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.5;
}
.text-link, .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding: .45rem 0;
  font-weight: 600;
}
.button { padding: .55rem .85rem; border: 3px solid var(--ink); background: var(--pink-soft); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; transition: background 170ms ease, box-shadow 170ms ease, transform 170ms ease; }
.button:hover { background: var(--pink); box-shadow: 5px 5px 0 var(--ink); text-decoration: none; }
.button:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

.route-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.route-list a { display: grid; min-height: 64px; padding: .8rem 1rem; border: 2px solid var(--ink); background: var(--surface); text-decoration: none; transition: background 170ms ease, transform 170ms ease; }
.route-list a:hover { background: var(--sage-soft); transform: translateX(3px); }
.route-list span { display: block; }

.decision-board { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--pink); }
.decision-board__row { display: grid; gap: .6rem; padding: 1rem; border-bottom: 2px solid var(--ink); background: var(--surface); }
.decision-board__row:nth-child(even) { background: var(--sage-soft); }
.decision-board__row:last-of-type { border-bottom: 0; }
.decision-board__row span { font-family: var(--font-display); font-weight: 700; }
.decision-board__row a { display: flex; align-items: center; min-height: 44px; font-weight: 600; }
.decision-board figcaption { padding: 1rem; background: var(--extended); }

.qa-stack { display: grid; gap: .9rem; margin-top: var(--section); }
.qa-stack details { border: 3px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); }
.qa-stack details[open] { background: var(--sage-soft); box-shadow: 5px 5px 0 var(--pink); }
.qa-stack summary { display: flex; align-items: center; min-height: 58px; padding: .7rem 2.8rem .7rem 1rem; cursor: pointer; font-family: var(--font-display); font-weight: 700; line-height: 1.3; }
.qa-stack details p, .qa-stack details .text-link { margin: 0 1rem 1rem; }

.check-list { display: grid; gap: .7rem; max-width: 48rem; padding: 0; list-style: none; }
.check-list li { position: relative; min-height: 48px; padding: .65rem .8rem .65rem 2.7rem; border: 2px solid var(--ink); background: var(--surface); }
.check-list li::before { content: ""; position: absolute; left: .7rem; top: .9rem; width: .8rem; height: .8rem; border: 2px solid var(--ink); background: var(--sage); }

.caption-card { padding: 1.2rem; border: 3px solid var(--ink); background: var(--extended); box-shadow: 5px 5px 0 var(--pink); }
.caption-card > p { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.3; }

.red-grid, .step-grid, .question-sheet, .identity-grid, .decoder, .exit-grid { display: grid; gap: var(--gap); }
.red-grid__item, .step-grid article, .question-sheet > div, .identity-grid article, .decoder article, .exit-grid article { min-width: 0; padding: 1.15rem; border: 3px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); }
.red-grid__item--pink { background: var(--pink-soft); box-shadow: 5px 5px 0 var(--pink); }
.red-grid__item--sage { background: var(--sage-soft); }
.red-grid__item > span, .step-grid__mark, .exit-grid article > span { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-bottom: .8rem; border: 2px solid var(--ink); background: var(--ink); color: var(--surface); font-family: var(--font-mono); font-weight: 700; }
.red-grid p, .step-grid p, .question-sheet p, .identity-grid p, .decoder article p, .exit-grid p { margin: .8rem 0 0; }
.question-sheet ul { margin: .8rem 0 0; padding-left: 1.2rem; }
.question-sheet li + li { margin-top: .5rem; }
.decoder__claim { display: inline-block; padding: .2rem .35rem; background: var(--pink-soft); }

.lane-table { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--pink); }
.lane-table__head { display: none; background: var(--ink); color: var(--surface); font-family: var(--font-mono); font-size: .875rem; }
.lane-table__row { display: grid; gap: .65rem; padding: 1rem; border-bottom: 2px solid var(--ink); background: var(--surface); }
.lane-table__row:last-of-type { border-bottom: 0; }
.lane-table__row--pink { background: var(--pink-soft); }
.lane-table__row--sage { background: var(--sage-soft); }
.lane-table__row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: .15rem; font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.lane-table figcaption { margin: 0; padding: 1rem; background: var(--extended); }

.matrix { display: grid; grid-template-columns: minmax(7rem, .75fr) repeat(2, minmax(0, 1fr)); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--pink); }
.matrix > div { min-width: 0; padding: .75rem .55rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); overflow-wrap: anywhere; }
.matrix > div:nth-child(3n) { border-right: 0; }
.matrix > div:nth-last-child(-n+3) { border-bottom: 0; }
.matrix__corner, .matrix__head { background: var(--ink); color: var(--surface); font-family: var(--font-mono); font-size: .875rem; }
.matrix__label { background: var(--sage-soft); font-weight: 700; }

.timeline { padding: 0; list-style: none; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--pink); }
.timeline li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .85rem; padding: 1rem; border-bottom: 2px solid var(--ink); background: var(--surface); }
.timeline li:nth-child(even) { background: var(--sage-soft); }
.timeline li:last-child { border-bottom: 0; }
.timeline li > span { font-family: var(--font-mono); font-weight: 700; }
.timeline p { margin: .6rem 0 0; }

.glossary-tool { display: grid; gap: 1.5rem; margin-top: var(--section); }
.glossary-tool__controls { align-self: start; padding: 1rem; border: 3px solid var(--ink); background: var(--sage-soft); box-shadow: 5px 5px 0 var(--pink); }
.glossary-tool label { display: block; margin-bottom: .4rem; font-weight: 700; }
.glossary-tool input { width: 100%; min-height: 48px; padding: .6rem .75rem; border: 3px solid var(--ink); background: var(--surface); color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.filter-row button { min-height: 44px; padding: .45rem .75rem; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; }
.filter-row button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.filter-row button:active { transform: translateY(1px); }
.glossary-tool__status { margin: .8rem 0 0; font-family: var(--font-mono); font-size: .875rem; }
.glossary-list { display: grid; gap: .8rem; }
.glossary-list article { padding: 1rem; border: 2px solid var(--ink); background: var(--surface); }
.glossary-list article:nth-child(even) { background: var(--pink-soft); }
.glossary-list p { margin: .65rem 0 0; }
.glossary-list [hidden] { display: none; }

.next-band { display: grid; gap: 1rem; margin-top: var(--section); }
.next-band a { display: flex; flex-direction: column; justify-content: center; min-height: 76px; padding: .9rem 1rem; border: 3px solid var(--ink); background: var(--pink-soft); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; }
.next-band a:nth-child(even) { background: var(--sage-soft); }
.next-band span { font-family: var(--font-mono); font-size: .875rem; }

.endnotes { margin-top: var(--section); padding: 1.25rem; border: 3px solid var(--ink); background: var(--surface); box-shadow: 5px 5px 0 var(--sage); }
.endnotes ul { display: grid; gap: .55rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.endnotes li { display: grid; grid-template-columns: 2.25rem 1fr; gap: .6rem; align-items: stretch; }
.endnotes li > span { display: grid; place-items: center; min-height: 44px; border: 2px solid var(--ink); background: var(--ink); color: var(--surface); font-family: var(--font-mono); }
.endnotes a { display: flex; align-items: center; min-height: 44px; padding: .45rem .65rem; border: 2px solid var(--ink); background: var(--extended); }
.endnotes__note { margin: 1rem 0 0; }

.site-footer { display: grid; gap: 1rem; margin-top: var(--section); padding-top: 1.5rem; padding-bottom: 2rem; border-top: 4px solid var(--ink); }
.site-footer p { margin: 0; font-weight: 600; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

.dock {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 4.5rem;
  border-top: 3px solid var(--ink);
  background: var(--surface);
  box-shadow: 0 -4px 0 var(--pink);
}
.dock a { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: .6rem .2rem; border-right: 2px solid var(--ink); font-weight: 600; text-decoration: none; transition: background 160ms ease, color 160ms ease, transform 160ms ease; }
.dock a:last-child { border-right: 0; }
.dock a:hover, .dock a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.dock a:active { transform: translateY(1px); }

.reveal { animation: rise-in 420ms both; }
.reveal:nth-of-type(2) { animation-delay: 80ms; }
.reveal:nth-of-type(3) { animation-delay: 160ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out 160ms both; }
::view-transition-new(root) { animation: fade-in 180ms both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (min-width: 48rem) {
  .masthead__stamp { display: flex; }
  .hero { grid-template-columns: minmax(0, 1.18fr) minmax(18rem, .82fr); }
  .hero__index { min-height: 22rem; }
  .chapter__section--grid { grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); }
  .chapter__section--split { grid-template-columns: minmax(15rem, .7fr) minmax(0, 1.3fr); }
  .compare { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compare--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-board__row { grid-template-columns: minmax(14rem, .75fr) minmax(0, 1.25fr); align-items: center; }
  .red-grid, .step-grid, .question-sheet, .identity-grid, .decoder, .exit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lane-table__head, .lane-table__row { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 1rem; padding: 1rem; }
  .lane-table__head span { font-size: .875rem; }
  .lane-table__row > [data-label]::before { display: none; }
  .glossary-tool { grid-template-columns: minmax(16rem, .6fr) minmax(0, 1.4fr); }
  .glossary-tool__controls { position: sticky; top: 1rem; }
  .next-band, .site-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer nav { justify-content: flex-end; }
  .dock { right: var(--side); bottom: 1rem; left: auto; width: min(38rem, calc(100% - 3rem)); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--pink); }
}

@media (min-width: 70rem) {
  .red-grid, .decoder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .identity-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .compare--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 25rem) {
  :root { --side: 1rem; }
  .masthead__name { gap: .35rem; }
  .matrix { grid-template-columns: minmax(5.5rem, .65fr) repeat(2, minmax(0, 1fr)); }
  .matrix > div { padding: .6rem .35rem; font-size: 1rem; line-height: 1.35; }
  .timeline li { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
