/* ============================================================
  History 54N · archival editorial visual essay
   ============================================================ */

:root {
  /* Light — manuscript */
  --bg: #f0e9de;
  --bg-elev: #faf6f0;
  --bg-sunken: #e6ddd0;
  --fg: #1c1814;
  --fg-muted: #5c5349;
  --fg-faint: #8a8074;
  --rule: #d4c8b8;
  --rule-strong: #b8a894;
  --accent: #5a3d5c;
  --accent-soft: #ebe0e8;
  --accent-strong: #4a2f4c;
  --danger: #8b3a3a;
  --warn: #8f6508;
  --good: #5a3d5c;
  --shadow-sm: 0 1px 2px rgba(28, 24, 20, 0.06);
  --shadow-md: 0 4px 20px rgba(28, 24, 20, 0.08);

  --chart-lfp: #5a3d5c;
  --chart-nacw: #7a5560;
  --chart-ba: #8b6b4a;

  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --max-width: 1240px;
  --gutter: clamp(18px, 3.8vw, 52px);

  --font-sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
}

:root[data-theme="dark"] {
  --bg: #141210;
  --bg-elev: #1c1916;
  --bg-sunken: #252019;
  --fg: #ebe6df;
  --fg-muted: #b5aca0;
  --fg-faint: #7a7268;
  --rule: #3d362f;
  --rule-strong: #524a42;
  --accent: #d4a574;
  --accent-soft: #2e2618;
  --accent-strong: #e8c49a;
  --danger: #e07f6e;
  --warn: #c99a52;
  --good: #d4a574;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.45);

  --chart-lfp: #d4a574;
  --chart-nacw: #c9957a;
  --chart-ba: #b89068;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: clamp(17px, 1.12vw, 19px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
}

.main-stack {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  border-left: 1px solid color-mix(in oklab, var(--rule) 55%, transparent);
  border-right: 1px solid color-mix(in oklab, var(--rule) 55%, transparent);
}

.ambient-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
:root[data-theme="dark"] .ambient-grain {
  opacity: 0.14;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { border-bottom-color: currentColor; }

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

.mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  border-bottom: 1.5px solid var(--rule-strong);
  transition:
    background 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}
.top-progress {
  flex-shrink: 0;
  height: 2px;
  width: 100%;
  background: color-mix(in oklab, var(--rule) 75%, transparent);
}
.top-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 90ms linear;
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  color: var(--fg);
  font-weight: 600;
  font-size: 13px;
  border: 0;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1.25;
}
.brand:hover {
  border-bottom-color: transparent;
}
.brand-dot {
  display: none;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-author {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}
.topnav {
  flex: 1;
  min-width: 0;
  margin-left: auto;
  margin-right: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent, #fff 12px, #fff calc(100% - 12px), transparent);
  scroll-snap-type: x proximity;
}
.topnav::-webkit-scrollbar {
  display: none;
  height: 0;
}
.topnav a {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  border: 0;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  scroll-snap-align: center;
  transition:
    color 0.22s var(--ease-out),
    background 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out);
}
.topnav a:hover {
  color: var(--fg);
  background: transparent;
  box-shadow: none;
}
.topnav a.active {
  color: var(--accent-strong);
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  padding-bottom: 2px;
}
.section-indicator {
  position: fixed;
  right: clamp(10px, 2vw, 20px);
  bottom: clamp(14px, 3vw, 24px);
  z-index: 42;
  background: color-mix(in oklab, var(--bg-elev) 80%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  pointer-events: none;
}
.section-indicator__kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  font-size: 10px;
  font-weight: 700;
}
.section-indicator__text {
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editorial flat buttons */
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg-elev);
  flex-shrink: 0;
  transition:
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
  box-shadow: none;
}
.ghost-btn::before,
.ghost-btn::after {
  display: none;
}
.ghost-btn__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ghost-btn--icon {
  padding: 0;
  min-width: 42px;
  min-height: 42px;
  border-radius: var(--radius-sm);
}
.ghost-btn:visited {
  color: var(--fg);
}
.ghost-btn:hover,
.ghost-btn:focus {
  border-bottom-color: transparent;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: none;
  box-shadow: none;
}
.ghost-btn:active {
  transform: scale(0.98);
}
.ghost-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hero-cta-primary {
  background: var(--accent);
  color: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: none;
}
.hero-cta-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--bg-elev);
}

.theme-icon { font-size: 16px; line-height: 1; }

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 112px) var(--gutter) clamp(48px, 8vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: center;
}
.hero-inner {
  text-align: left;
  max-width: 40rem;
}
.hero-inner .meta-row {
  justify-content: flex-start;
}
.hero-inner .hero-details {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.hero-inner .hero-details .pills {
  justify-content: flex-start;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 12px;
}
.title {
  font-family: var(--font-serif);
  font-size: clamp(38px, 6.2vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  padding-bottom: 12px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  max-width: 100%;
}
.subtitle {
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.35vw, 30px);
  line-height: 1.45;
  color: var(--fg);
  margin: 0 auto 14px;
  max-width: 52ch;
}
.subtitle strong { color: var(--accent-strong); font-weight: 600; }
.hero-thesis {
  max-width: 54ch;
  margin: 0 auto 26px;
  color: var(--fg-muted);
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1.55;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--fg);
  background: var(--bg-elev);
}
.pill-lfp  { border-color: var(--chart-lfp); color: var(--chart-lfp); }
.pill-nacw { border-color: var(--chart-nacw); color: var(--chart-nacw); }
.pill-ba   { border-color: var(--chart-ba); color: var(--chart-ba); }

.meta-row { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

/* ---------------- Section scaffolding ---------------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--gutter);
  border-top: 1px solid color-mix(in oklab, var(--rule) 65%, transparent);
}
.section-next {
  max-width: var(--max-width);
  margin: -24px auto 0;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: center;
}
.section-next a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px dashed var(--rule-strong);
  background: color-mix(in oklab, var(--bg-elev) 86%, transparent);
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 600;
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.section-next a:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent-soft) 38%, var(--bg-elev));
  transform: translateY(-1px);
}
.section-head { margin-bottom: clamp(40px, 5vw, 56px); }
.section-head { text-align: center; }
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.4vw, 48px);
  margin: 0 auto 12px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--fg);
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in oklab, var(--accent) 55%, var(--rule));
  display: inline-block;
  max-width: min(100%, 28ch);
}
.section-head .section-lede {
  margin-left: auto;
  margin-right: auto;
}
.section-lede {
  color: var(--fg-muted);
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 28px);
  max-width: 70ch;
  margin: 0;
}

.prose {
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.8vw, 25px);
  line-height: 1.7;
  color: var(--fg);
  max-width: 70ch;
}
.prose.narrow { max-width: 62ch; margin-top: 30px; }
.prose,
.prose.narrow {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.prose p { margin: 0 0 18px; }
.prose strong { font-weight: 600; color: var(--fg); }
/* Question: Kokonut-style ink loop behind heading (path drawn on scroll via app.js). */
.question-head-cluster {
  position: relative;
  margin-bottom: clamp(8px, 2vw, 16px);
}
.hand-scroll-ink {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(920px, 100%);
  height: clamp(140px, 22vw, 220px);
  pointer-events: none;
  color: color-mix(in oklab, var(--accent) 55%, var(--fg-muted));
  opacity: 0.92;
  transition: opacity 1.05s var(--ease-out);
}
.hand-scroll-ink--fade-out {
  opacity: 0;
}
.hand-scroll-ink__svg {
  display: block;
  width: 100%;
  height: 100%;
}
.hand-scroll-ink__path {
  vector-effect: non-scaling-stroke;
}
.section-head .section-question__themes {
  margin: 0 auto clamp(14px, 2.2vw, 22px);
  max-width: 65ch;
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.25vw, 17px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1.35;
}
.section-question .section-head {
  position: relative;
  z-index: 1;
  padding-top: clamp(48px, 9vw, 88px);
}

#question .prose .question-jse-figure {
  max-width: min(920px, 100%);
  margin: 28px auto 12px;
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--fg-muted);
  font-size: 18px;
  margin: 24px 0;
}
.callout strong { color: var(--fg); }

/* ---------------- Cards & grids ---------------- */
.card {
  background: var(--bg-elev);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: clamp(24px, 3vw, 36px);
  transition:
    border-color 0.22s var(--ease-out),
    background 0.22s var(--ease-out);
}
figure.card:hover,
.card:not(.timeline-card):hover {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule-strong));
  box-shadow: var(--shadow-sm);
}
.card-head {
  margin: 0 0 12px;
  text-align: center;
}
.card-head h3,
.card-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--fg);
}
.card-head p,
.card-sub {
  color: var(--fg-muted);
  font-size: 16px;
}
.card-head p {
  margin: 0 auto 6px;
  max-width: 68ch;
}
.card-sub {
  margin: 0 0 6px;
}
.card-title.inline { display: inline; }

/* Keep section card images visually bounded and consistent. */
.grid-2 .card picture,
.grid-3 .card picture {
  display: block;
  margin: 0 0 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
}
.grid-2 .card picture img,
.grid-3 .card picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(360px, 46vh);
  object-fit: contain;
  margin: 0 auto;
}

/* Image beside caption (grid cards, Freedom inline figures, Contemporary). */
figure.card.card--media {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(14px, 2.2vw, 22px);
  padding: clamp(14px, 2vw, 18px);
}
figure.card.card--media picture {
  flex: 0 0 min(40%, 200px);
  max-width: min(40%, 200px);
  margin-bottom: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
}
figure.card.card--media picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(240px, 36vh);
  object-fit: contain;
}
figure.card.card--media figcaption {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 2px;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  color: var(--fg-muted);
}
@media (max-width: 560px) {
  figure.card.card--media {
    flex-direction: column;
    align-items: stretch;
  }
  figure.card.card--media picture {
    flex: none;
    max-width: 100%;
  }
}

/* Part 3 Freedom: essay prose beside images (not a trailing image grid). */
.freedom-essay-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(26px, 4vw, 44px);
  align-items: start;
  margin: clamp(28px, 4vw, 48px) auto;
  max-width: min(100%, 920px);
  padding: clamp(20px, 3vw, 28px);
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--rule-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.freedom-essay-pair--reverse {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}
.freedom-essay-pair--reverse .freedom-essay-pair__text {
  order: 2;
}
.freedom-essay-pair--reverse .freedom-essay-pair__fig {
  order: 1;
}
.freedom-essay-pair__title {
  font-family: var(--font-serif);
  font-size: clamp(1.28rem, 2.2vw, 1.68rem);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.freedom-essay-pair__text {
  min-width: 0;
}
.freedom-essay-pair__text p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.42vw, 20px);
  line-height: 1.62;
  color: var(--fg);
}
.freedom-essay-pair__fig {
  margin: 0;
  min-width: 0;
}
.freedom-essay-pair__fig picture {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
}
.freedom-essay-pair__fig img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(360px, 46vh);
  object-fit: contain;
}
.freedom-essay-pair__credit {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-muted);
}

/* Stack essay + image only on small screens. 840px was too wide — laptop
   browser chrome / half-width windows looked like the old vertical gallery. */
@media (max-width: 640px) {
  .freedom-essay-pair,
  .freedom-essay-pair--reverse {
    grid-template-columns: 1fr;
  }
  .freedom-essay-pair--reverse .freedom-essay-pair__text,
  .freedom-essay-pair--reverse .freedom-essay-pair__fig {
    order: unset;
  }
}

@media (max-width: 1100px) and (min-width: 641px) {
  .freedom-essay-pair,
  .freedom-essay-pair--reverse {
    gap: clamp(18px, 3vw, 30px);
    padding: clamp(16px, 2.5vw, 24px);
  }
}

.freedom-seal-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 168px);
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
  margin-bottom: clamp(18px, 2.5vw, 26px);
  width: 100%;
  box-sizing: border-box;
}
.freedom-seal-copy__text {
  min-width: 0;
}
.freedom-seal-copy__text .freedom-seal-lede {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.42vw, 20px);
  line-height: 1.62;
  color: var(--fg);
}
.freedom-seal-copy__fig {
  margin: 0;
}
.chart-mockup__context-fig--seal.freedom-seal-copy__fig {
  max-width: none;
  margin-bottom: 0;
}
.chart-mockup__context-fig--seal picture,
.chart-mockup__context-fig--seal img {
  display: block;
  margin: 0 auto;
}
.chart-mockup__context-fig--seal img {
  max-height: 140px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 640px) {
  .freedom-seal-copy {
    grid-template-columns: 1fr;
  }
  .freedom-seal-copy__fig {
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
}
.grid-2--single-centered {
  grid-template-columns: minmax(0, min(42rem, 100%));
  justify-content: center;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Chart.js: size the wrapper; never use !important on the canvas (overrides Chart.js inline size and stretches text). */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(300px, 32vw, 440px);
  min-height: 280px;
}
.chart-canvas-wrap--tall {
  height: clamp(320px, 36vw, 480px);
  min-height: 300px;
}
@media (max-width: 640px) {
  .chart-canvas-wrap {
    height: clamp(240px, 58vw, 320px);
    min-height: 220px;
  }
  .chart-canvas-wrap--tall {
    height: clamp(260px, 64vw, 360px);
    min-height: 240px;
  }
  .hero-chart-canvas-wrap {
    height: clamp(150px, 42vw, 200px);
    min-height: 140px;
  }
  .map-wrap {
    height: clamp(280px, 68vw, 380px);
  }
}
figure.card .chart-canvas-wrap {
  margin-top: 4px;
}
.chart-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------- Timeline (horizontal rail + axis) ---------------- */
.timeline-scroll-shell {
  margin-top: 28px;
}
.timeline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.timeline-btn {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12.5px;
}
.timeline-btn--subtle {
  opacity: 0.85;
}
.timeline-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--rule-strong) 40%, transparent),
    0 1px 2px color-mix(in oklab, var(--fg) 4%, transparent);
}

.timeline-h-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: min(560px, 78vh);
  padding: 20px 0 28px;
  scrollbar-gutter: stable;
  cursor: grab;
  outline: none;
}
.timeline-h-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.timeline-h-scroll.is-autoplay-paused {
  cursor: auto;
}
.timeline-h-scroll.timeline-h-scroll--stacked {
  cursor: default;
}
.timeline-h-scroll:active {
  cursor: grabbing;
}

.timeline-rail.timeline {
  list-style: none;
  padding: 0 40px;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  min-width: min-content;
  min-height: min(520px, 72vh);
  position: relative;
  z-index: 1;
}

/* Axis: solid line the full width of the rail (gradients looked “broken” when scrolled into the fade zones). */
.timeline-rail.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
  background: color-mix(in oklab, var(--accent) 42%, var(--rule-strong));
  border-radius: 2px;
  opacity: 0.95;
}

.timeline-node {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  flex: 0 0 auto;
  width: clamp(232px, 26vw, 288px);
  align-self: stretch;
  flex-shrink: 0;
  min-height: min(520px, 72vh);
  position: relative;
  z-index: 1;
}

.timeline-fill {
  min-height: 24px;
}
.timeline-node--above .timeline-fill {
  grid-row: 3;
}
.timeline-node--below .timeline-fill {
  grid-row: 1;
}

.timeline-axis-slot {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  z-index: 2;
}
.timeline-node--above .timeline-axis-slot {
  flex-direction: column-reverse;
}
.timeline-node--above .timeline-card {
  grid-row: 1;
  align-self: end;
  margin-bottom: 4px;
}
.timeline-node--below .timeline-card {
  grid-row: 3;
  align-self: start;
  margin-top: 4px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, var(--rule-strong));
  flex-shrink: 0;
}

.timeline-stem {
  width: 2px;
  flex: 0 0 auto;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--accent) 45%, var(--rule-strong)),
    var(--rule-strong)
  );
  border-radius: 1px;
}
.timeline-stem--up {
  height: 40px;
}
.timeline-stem--down {
  height: 40px;
}

.timeline-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--bg-elev);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 16px 14px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease;
  overflow: visible;
}
.timeline-card:hover {
  border-color: var(--accent);
}

.timeline-idx {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.timeline h4 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 2px 0 6px;
  line-height: 1.2;
}
.timeline .year {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.timeline p {
  font-size: 14.5px;
  color: var(--fg-muted);
  margin: 6px auto 0;
  line-height: 1.45;
  max-width: 36ch;
}
.timeline a.kb-link {
  font-size: 12.5px;
  display: inline-block;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .timeline-node {
    width: 260px;
  }
  .timeline-rail.timeline {
    padding: 0 20px;
  }
}
@media (max-width: 860px) {
  .timeline-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .timeline-h-scroll {
    overflow: visible;
    min-height: 0;
    padding: 8px 0 0;
  }
  .timeline-rail.timeline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
    padding: 0;
    min-width: 0;
  }
  .timeline-rail.timeline::before,
  .timeline-axis-slot,
  .timeline-fill,
  .timeline-stem {
    display: none;
  }
  .timeline-node,
  .timeline-node--above,
  .timeline-node--below {
    width: 100%;
    min-height: 0;
    display: block;
  }
  .timeline-node--above .timeline-card,
  .timeline-node--below .timeline-card {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-card:hover {
    transform: none;
  }
}

/* ---------------- Results scrolly (GSAP ScrollTrigger) ---------------- */
.results-scrolly {
  margin-top: 1.25rem;
}
.results-scrolly-inner {
  display: grid;
  grid-template-columns: minmax(0, 148px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}
.results-scrolly-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}
.results-scrolly-rail-item {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  line-height: 1.35;
  border-bottom: 0;
}
.results-scrolly-rail-item.is-active {
  color: var(--fg);
  background: var(--bg-sunken);
  border-left-color: var(--accent);
}
.results-scrolly-panel {
  padding-block: clamp(12px, 2.4vh, 28px);
  scroll-margin-top: 88px;
}
.results-scrolly-panel + .results-scrolly-panel {
  border-top: 1px dashed var(--rule);
}
.results-scrolly-reveal {
  transform-origin: 50% 0%;
}
.results-scrolly--reduced .results-scrolly-reveal {
  opacity: 1 !important;
  transform: none !important;
}
@media (max-width: 899px) {
  .results-scrolly-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .results-scrolly-rail {
    position: static;
    top: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    padding: 6px 2px 14px;
    margin: 0 0 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    mask-image: linear-gradient(to right, transparent, #fff 10px, #fff calc(100% - 10px), transparent);
  }
  .results-scrolly-rail::-webkit-scrollbar {
    height: 6px;
  }
  .results-scrolly-rail-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .results-scrolly-rail-item.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: color-mix(in oklab, var(--bg-sunken) 90%, var(--bg-elev));
  }
  .results-scrolly-panel {
    padding-block: clamp(10px, 2vh, 20px);
  }
}

/* ---------------- Results legend + tier pills ---------------- */
.results-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.results-legend .legend-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.results-legend h4 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.results-legend p { margin: 0; }
.results-legend .legend-pills {
  display: inline-flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.results-legend .legend-note {
  color: var(--fg-faint);
  font-size: 11.5px;
  margin-left: 2px;
}
.results-legend .tier-def {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}
.results-legend .tier-def-label {
  font-size: 10.5px;
  color: var(--fg-faint);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.results-legend.legend-tier h4,
.results-legend .legend-tier h4 {
  align-self: flex-start;
  padding-top: 4px;
}
.p-sig-dot, .p-ns-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 4px;
}
.p-sig-dot { background: var(--good); }
.p-ns-dot  { background: var(--fg-muted); opacity: 0.55; }

.results-legend .legend-glossary {
  flex-basis: 100%;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  gap: 10px;
}
#glossary-select {
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 4px 26px 4px 10px;
  min-width: 160px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
                    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: border-color 120ms ease;
}
#glossary-select:hover,
#glossary-select:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.glossary-def {
  font-size: 12.5px;
  color: var(--fg);
  line-height: 1.5;
  flex: 1 1 220px;
  min-width: 0;
}
.glossary-def:empty::before {
  content: "Select a term to see its definition.";
  color: var(--fg-faint);
  font-style: italic;
}
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.tier-pill.tier-bh {
  color: var(--good);
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--good) 55%, transparent);
}
.tier-pill.tier-bonf {
  color: var(--accent-strong);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
}
.tier-pill.tier-raw {
  color: var(--warn);
  background: color-mix(in oklab, var(--warn) 14%, transparent);
  border-color: color-mix(in oklab, var(--warn) 45%, transparent);
}
.tier-pill.tier-ns {
  color: var(--fg-muted);
  background: var(--bg-sunken);
  border-color: var(--rule);
}
.results-table td .tier-pill {
  margin-right: 8px;
  vertical-align: middle;
}
.outcome-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- Results toolbar & tables ---------------- */
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.metric-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  font-weight: 600;
}
.metric-value {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--fg);
}
.dw-filter {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-sans);
}
.results-table thead th {
  background: var(--bg-sunken);
  color: var(--fg-muted);
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0;
}
.results-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.results-table tbody tr:hover { background: var(--bg-sunken); }
.results-table tbody tr[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--bg-sunken);
}
.results-table tbody tr.row-open { background: var(--accent-soft); }
.results-table td.num { font-family: var(--font-mono); }
.results-table td.p-sig { color: var(--good); font-weight: 600; }
.results-table td.p-notsig { color: var(--fg-muted); }
.results-table td.dw-bad { color: var(--danger); }
.results-table td.dw-ok { color: var(--good); }

.row-expander {
  background: var(--bg-sunken);
}
.row-expander td {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.expander-meta {
  margin-top: 10px;
  color: var(--fg-muted);
}
.coef-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr 1fr;
  gap: 6px 18px;
  max-width: 720px;
}
.coef-grid .h { color: var(--fg-faint); font-size: 11px; text-transform: uppercase; }
.coef-grid .var { color: var(--fg); }
.coef-grid .c { color: var(--fg); }
.coef-grid .s { color: var(--fg-muted); }
.coef-grid .p { color: var(--good); }
.coef-grid .p.notsig { color: var(--fg-muted); }

details summary { cursor: pointer; list-style: revert; }
details summary h3 { display: inline; }

/* ---------------- Map ---------------- */
.map-wrap {
  height: clamp(320px, 56vw, 520px);
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}
.map-legend {
  margin-top: 12px;
  color: var(--fg-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.map-legend .sw {
  display: inline-block;
  width: 14px; height: 14px; border-radius: 3px;
  margin-right: 2px;
}
.sw-1 { background: #c7e7d7; }
.sw-2 { background: #83ccae; }
.sw-3 { background: #3a9a78; }
.sw-4 { background: #134e3a; }

.leaflet-container {
  background: var(--bg-sunken) !important;
  font-family: var(--font-sans);
}
.leaflet-tooltip {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

/* ---------------- Lists, footer ---------------- */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li {
  padding: 12px 6px;
  border-bottom: 1px dashed var(--rule);
  font-size: 16px;
}
.link-list li:last-child { border-bottom: 0; }

/* Sources: match centered section rhythm; equal card rhythm */
#sources .grid-3 .card {
  display: flex;
  flex-direction: column;
  text-align: center;
  margin-bottom: 0;
  padding: 30px 26px 28px;
}
#sources .grid-3 .card .card-title {
  margin: 0 0 4px;
}
#sources .link-list {
  flex: 1;
  text-align: center;
}
#sources .link-list li {
  padding: 0;
  text-align: center;
  text-wrap: balance;
}
#sources .link-list a {
  display: block;
  padding: 14px 10px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule);
  transition: color 0.15s ease, background 0.15s ease;
}
#sources .link-list li:last-child a {
  border-bottom: 0;
}
#sources .link-list a:hover {
  color: var(--accent-strong);
  background: color-mix(in oklab, var(--accent-soft) 35%, transparent);
  border-bottom-color: var(--rule);
}
#sources > .card {
  text-align: center;
  padding: 30px 26px 28px;
}
#sources > .sources-scope-card {
  margin-top: 0.75rem;
}
#sources > .card .card-title {
  margin: 0 0 8px;
}
#sources > .card .link-list {
  text-align: center;
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}
#sources > .card .link-list li {
  text-align: center;
  padding: 0;
  border-bottom: 0;
}
#sources .sources-scope-list {
  margin-top: 8px;
}
#sources .callout-card {
  text-align: center;
  padding: 30px 26px 28px;
}
#sources .callout-card .card-title {
  margin: 0 0 14px;
}
#sources .callout-card ol {
  text-align: left;
  max-width: 72ch;
  margin: 0 auto;
  padding-left: 1.25rem;
}
#sources .callout-card li {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.55;
}

.image-credits-card {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(24px, 4vw, 36px);
  text-align: left;
}
.image-credits-card .card-title {
  text-align: center;
  margin-bottom: 0.5rem;
}
.image-credits-lede {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto 1.25rem;
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.55;
}
.credits-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
}
.credits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.credits-table thead th {
  background: color-mix(in oklab, var(--bg-sunken) 80%, var(--bg-elev));
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.credits-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 65%, transparent);
  vertical-align: top;
}
.credits-table tbody tr:last-child td {
  border-bottom: 0;
}
.credits-table tbody tr:hover {
  background: color-mix(in oklab, var(--accent-soft) 22%, transparent);
}
.credits-table a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
.credits-table a:hover {
  border-bottom-color: currentColor;
}
.credits-table .credits-license {
  font-size: 13.5px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.credits-table .credits-license a {
  font-size: inherit;
}
.image-credits-note {
  margin: 1rem 0 0;
  font-size: 13.5px;
  color: var(--fg-muted);
  text-align: center;
}
@media (max-width: 640px) {
  .credits-table {
    font-size: 14px;
  }
  .credits-table thead th,
  .credits-table tbody td {
    padding: 10px 12px;
  }
}

.callout-card { background: color-mix(in oklab, var(--accent-soft) 55%, var(--bg-elev)); }
.callout-card ol { padding-left: 18px; margin: 4px 0 0; }
.callout-card li { margin-bottom: 8px; font-size: 14.5px; }

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
  border-top: 1px solid var(--rule);
  color: var(--fg-faint);
  font-size: 15px;
}
.footer p { margin: 0 0 6px; }

/* ---------------- KB links - subtle highlight ---------------- */
.kb-link {
  background: var(--accent-soft);
  padding: 0 4px;
  border-radius: 3px;
  text-decoration: none;
  color: var(--accent-strong);
  border-bottom: 1px dotted currentColor;
}
.kb-link:hover { background: color-mix(in oklab, var(--accent-soft) 70%, var(--accent) 20%); }

/* ---------------- Focus ring ---------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- Narrative-forward (ground + hero + readable) ---------------- */
.hero { align-items: start; }
/* One shell: avoid outer card + inner framed photo + bare chart (triple-border look). */
.hero-figure {
  position: relative;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid var(--rule-strong);
  box-shadow: var(--shadow-sm);
  background: var(--bg-elev);
}
.hero-figure .hero-photo-card {
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--accent) 18%, var(--rule));
}
.hero-figure .hero-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(520px, 62vh);
  object-fit: cover;
  object-position: 42% 12%;
  background: var(--bg-sunken);
  border-radius: 0;
  transform-origin: center 18%;
  backface-visibility: hidden;
}
.hero-figure .hero-photo-card figcaption {
  font-size: 14px;
  color: var(--fg-muted);
  padding: 8px 12px;
  line-height: 1.45;
  background: var(--bg-sunken);
  border-top: 1px solid color-mix(in oklab, var(--rule) 65%, transparent);
}
.hero-chart-stack {
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  padding: 10px 12px 12px;
  background: color-mix(in oklab, var(--bg-sunken) 92%, var(--bg-elev));
  border-top: 1px solid color-mix(in oklab, var(--rule) 55%, transparent);
}
.hero-chart-stack .chart-caveat {
  margin: 8px 0 0;
}
.hero-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(180px, 18vw, 240px);
  max-height: min(250px, 34vh);
  min-height: 160px;
}
.hero-chart-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-chart-caption {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-faint);
  margin: 0 0 6px;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-details {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in oklab, var(--fg-muted) 88%, var(--fg));
  max-width: 62ch;
  border: 1px solid color-mix(in oklab, var(--rule) 80%, transparent);
  border-radius: var(--radius-md);
  padding: 10px 14px 14px;
  background: color-mix(in oklab, var(--bg-elev) 70%, transparent);
}
.hero-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-strong);
  font-size: 14.5px;
}
.hero-details-note { margin-top: 10px; }
.hero-details .pills { margin-bottom: 0; margin-top: 10px; }

.prose-max { max-width: 74ch; }
.section-ground .section-lede { max-width: 72ch; }
.ground-grid { align-items: start; }
.ground-photo {
  margin: 0;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
}
.ground-photo:hover {
  transform: translateY(-1px);
}
.ground-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
  transform-origin: center center;
  backface-visibility: hidden;
}
.ground-photo figcaption {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 10px;
  line-height: 1.45;
  text-align: left;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
figure.ground-photo.ground-photo--media {
  display: block;
  width: 100%;
}
figure.ground-photo.ground-photo--media picture {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
figure.ground-photo.ground-photo--media img {
  width: 100%;
}
figure.ground-photo.ground-photo--media figcaption {
  margin-top: 10px;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}
/* Ground: quiet texture, not duplicated photography behind the foreground sequence. */
.section-visual-panel {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.section-bg-film {
  position: absolute;
  left: 0;
  right: 0;
  top: -80px;
  bottom: -80px;
  height: calc(100% + 160px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.58;
  background:
    radial-gradient(circle at 16% 18%, color-mix(in oklab, var(--accent-soft) 40%, transparent) 0, transparent 30%),
    radial-gradient(circle at 82% 72%, color-mix(in oklab, var(--bg-sunken) 78%, transparent) 0, transparent 36%);
  backface-visibility: hidden;
}
.section-bg-film__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.07);
  filter: saturate(0.7) brightness(0.4);
}
.section-bg-film__slide--a {
  background-image: url("assets/photos/antebellum/women-activist-1.jpg");
  animation: groundFilmA 26s ease-in-out infinite;
}
.section-bg-film__slide--b {
  background-image: url("assets/photos/freedom/Women-riding-on-the-subway.jpeg");
  animation: groundFilmB 26s ease-in-out infinite;
}
.section-bg-film__slide--c {
  background-image: url("assets/photos/freedom/Sunday_in_Little_Rock,_Ark.,_1935._(3109755087).jpg");
  animation: groundFilmC 26s ease-in-out infinite;
}
@keyframes groundFilmA {
  0%, 6% { opacity: 0; transform: scale(1.08); }
  14%, 32% { opacity: 0.48; transform: scale(1); }
  40%, 100% { opacity: 0; transform: scale(1.05); }
}
@keyframes groundFilmB {
  0%, 36% { opacity: 0; transform: scale(1.06); }
  44%, 62% { opacity: 0.48; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.05); }
}
@keyframes groundFilmC {
  0%, 68% { opacity: 0; transform: scale(1.07); }
  76%, 92% { opacity: 0.48; transform: scale(1); }
  98%, 100% { opacity: 0; transform: scale(1.04); }
}
.section-visual-panel-inner {
  position: relative;
  z-index: 2;
}
.section-visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    165deg,
    color-mix(in oklab, var(--bg) 94%, transparent) 0%,
    color-mix(in oklab, var(--bg) 89%, transparent) 44%,
    color-mix(in oklab, var(--bg) 97%, transparent) 100%
  );
}

.ground-sequence {
  display: grid;
  gap: clamp(34px, 6vw, 72px);
}
.ground-step {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
}
.ground-step--reverse {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}
.ground-step .ground-photo {
  width: 100%;
  min-width: 0;
}
.ground-step .ground-photo img {
  width: 100%;
  max-height: min(52vh, 520px);
  object-fit: cover;
  object-position: center;
}
.ground-step--stack {
  grid-template-columns: 1fr;
  gap: clamp(18px, 3vw, 34px);
}
.ground-step__text {
  max-width: 44rem;
}
.ground-step__label,
.annotation-list span {
  display: inline-flex;
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.ground-step__text h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  color: var(--fg);
}
.ground-step__text p {
  margin: 0 0 13px;
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1.62;
}
.ground-step__text p:last-child {
  margin-bottom: 0;
}
.ground-port-hero {
  margin-top: 0;
  margin-bottom: 0;
}
.ground-photo-bleed img {
  max-height: none;
  object-fit: contain;
}
.ground-ports-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3.5vw, 44px);
  margin-top: 0;
}
@media (max-width: 900px) {
  .ground-step,
  .ground-step--reverse {
    grid-template-columns: 1fr;
  }
  .ground-step--reverse .ground-step__text {
    order: -1;
  }
  .ground-ports-pair {
    grid-template-columns: 1fr;
  }
}

/* Section-with-mockup style: explanation left, charts right (vanilla; theme tokens). */
.chart-mockup {
  position: relative;
  isolation: isolate;
  margin-top: clamp(12px, 2vw, 28px);
  margin-bottom: clamp(8px, 2vw, 20px);
  padding-bottom: clamp(20px, 3vw, 36px);
}
.chart-mockup__accent {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 780px);
  height: 1px;
  background: radial-gradient(
    50% 50% at 50% 50%,
    color-mix(in oklab, var(--fg) 16%, transparent) 0%,
    transparent 78%
  );
  pointer-events: none;
  z-index: 0;
}
.chart-mockup__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  align-items: start;
}
@media (min-width: 900px) {
  .chart-mockup__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr);
    gap: clamp(28px, 3.5vw, 52px);
    align-items: stretch;
  }
}
.chart-mockup__copy,
.chart-annotations {
  margin-left: 0;
  margin-right: auto;
  max-width: 44rem;
  text-align: left;
}
.chart-mockup__copy p { margin: 0 0 1.05rem; }
.chart-mockup__title {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.35vw, 1.9rem);
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.chart-claim {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.65vw, 24px);
  line-height: 1.52;
  color: var(--fg);
}
.annotation-list {
  display: grid;
  gap: 10px;
}
.annotation-list p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-elev) 78%, transparent);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
}
.annotation-list span {
  margin: 0 8px 0 0;
  vertical-align: 0.08em;
}
.chart-mockup__context-fig {
  margin: 0 0 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
  box-shadow: var(--shadow-sm);
}
.chart-mockup__context-fig img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}
.chart-mockup__context-fig figcaption {
  font-size: 13px;
  color: var(--fg-muted);
  padding: 8px 12px;
  line-height: 1.45;
  background: color-mix(in oklab, var(--bg-sunken) 94%, var(--bg-elev));
  border-top: 1px solid var(--rule);
}

.chart-mockup__charts {
  position: relative;
  min-width: 0;
}
/* Decorative slab behind charts, disabled (read as an unwanted green/grey blob). */
.chart-mockup__charts-deco {
  display: none;
}
.chart-mockup__charts-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}
.chart-mockup__charts-stack--split-md {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.5vw, 26px);
}

.chart-mockup__card {
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  background: color-mix(in oklab, var(--bg-elev) 94%, transparent);
  border: 1px solid color-mix(in oklab, var(--rule) 90%, var(--fg));
  box-shadow:
    0 10px 36px color-mix(in oklab, var(--fg) 7%, transparent),
    inset 0 1px 0 color-mix(in oklab, #fff 28%, transparent);
}
:root[data-theme="dark"] .chart-mockup__card {
  background: color-mix(in oklab, var(--bg-elev) 88%, transparent);
  box-shadow:
    0 12px 40px color-mix(in oklab, #000 45%, transparent),
    inset 0 1px 0 color-mix(in oklab, #fff 10%, transparent);
}
.chart-mockup__card.macro-chart-solo {
  margin-bottom: 0;
}
.chart-mockup__card-lede {
  font-size: 15px;
}

@media (min-width: 900px) {
  .chart-mockup__copy--macro,
  .chart-mockup__copy--inequality {
    position: sticky;
    top: 84px;
    align-self: start;
  }
}

.inequality-map-preface {
  margin-bottom: clamp(28px, 4vw, 44px);
}
.inequality-map-figure {
  margin-top: 0;
  margin-bottom: clamp(36px, 5vw, 52px);
}
.inequality-closing {
  margin-top: clamp(36px, 5vw, 48px);
}
.timeline-photo-bleed {
  margin-top: clamp(32px, 4vw, 48px);
  margin-bottom: clamp(28px, 4vw, 40px);
}

.constitutional-court-figure {
  margin-bottom: 24px;
  overflow: hidden;
}
.constitutional-court-figure .constitutional-court-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center 35%;
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
}
.constitutional-court-figure .court-photo-credit {
  margin-top: 14px;
  margin-bottom: 0;
  text-align: center;
  font-size: 14px;
}
.wgi-controls {
  display: flex;
  justify-content: center;
  margin: 2px 0 10px;
}
.wgi-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--fg-muted);
  font-weight: 500;
}
.wgi-toggle input {
  accent-color: var(--accent);
}
.wgi-callouts {
  margin-top: 10px;
  text-align: center;
}
.ground-notes h3, .ground-kicker {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0 0 8px;
}

.chart-more {
  margin-top: 8px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-sunken);
}
.chart-more-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2vw, 28px);
}
.chart-more-lede {
  margin: 0 0 12px;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.5;
}
.chart-more-inner { margin-top: 4px; }

.card.results-plain,
.results-toolbar.card {
  overflow: visible;
}
.results-plain { margin-bottom: 1.5rem; }
.results-plain {
  border-color: color-mix(in oklab, var(--accent) 22%, var(--rule));
  background: color-mix(in oklab, var(--accent-soft) 34%, var(--bg-elev));
}
.results-plain-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 17px;
  line-height: 1.58;
}
.results-plain-list li { margin-bottom: 10px; }
.results-plain-list li:last-child { margin-bottom: 0; }
.results-plain .card-sub {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
}
.conclusion-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 14px);
  max-width: min(920px, 100%);
  margin: 0 auto clamp(8px, 1.5vw, 16px);
}
@media (max-width: 820px) {
  .conclusion-stack {
    grid-template-columns: 1fr;
  }
}
.conclusion-stack__card {
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.5vw, 24px);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  box-shadow: none;
}
.conclusion-stack__card .card-title {
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.conclusion-stack__card .card-title::before {
  display: inline-block;
  margin-right: 6px;
  opacity: 0.7;
}
.conclusion-stack__card:nth-child(1) .card-title::before { content: "◆"; }
.conclusion-stack__card:nth-child(2) .card-title::before { content: "◇"; }
.conclusion-stack__card:nth-child(3) .card-title::before { content: "○"; }
.conclusion-stack__card p {
  margin: 0;
  max-width: none;
  line-height: 1.55;
  font-size: 15px;
}
.conclusion-prose {
  margin-top: 1.5rem;
}

.ground-row-2 { margin-top: 28px; }
.ground-photo-wide img {
  width: 100%;
  max-height: none;
  object-fit: contain;
}
.inequality-map-figure { margin-bottom: 28px; overflow: hidden; }
.inequality-map-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(480px, 60vh);
  object-fit: contain;
  background: var(--bg-sunken);
}

/* ---------------- Quote showcase (circular orbit carousel) ---------------- */
.quote-showcase {
  background: color-mix(in oklab, var(--bg-elev) 90%, var(--bg-sunken));
  margin-top: 1.25rem;
}
.quote-orbit-card {
  overflow: hidden;
}
.quote-orbit {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  margin-top: 14px;
  outline: none;
}
@media (min-width: 900px) {
  .quote-orbit {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(2.5rem, 4vw, 5rem);
  }
}
.quote-orbit__stage {
  position: relative;
  width: min(100%, 340px);
  height: clamp(220px, 48vw, 340px);
  min-height: 220px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 50%;
  aspect-ratio: 1;
}
@media (min-width: 900px) {
  .quote-orbit__stage {
    width: min(100%, 360px);
    height: clamp(260px, 26vw, 360px);
    min-height: 260px;
  }
}
.quote-orbit__ring {
  position: absolute;
  inset: 0;
  perspective: 1000px;
  transform-style: flat;
}
.quote-orbit__face {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: cover;
  border-radius: 50%;
  border: none;
  box-shadow: none;
  transform-origin: center center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.quote-orbit__panel {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  min-height: 0;
}
.quote-orbit__name {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.quote-orbit__designation {
  margin: 0 0 1.25rem;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  color: var(--fg-muted);
  line-height: 1.45;
}
.quote-orbit__quote {
  margin: 0;
  padding: 0;
  border: none;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.65vw, 1.2rem);
  line-height: 1.65;
  color: var(--fg);
  text-wrap: balance;
}
.quote-orbit__credit {
  margin: 0.75rem 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-faint);
}
.quote-orbit__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-top: clamp(0.5rem, 2vw, 1rem);
}
@media (min-width: 900px) {
  .quote-orbit__controls {
    padding-top: 0;
  }
}
.quote-orbit__arrow {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
  box-shadow: none;
}
.quote-orbit__arrow::before,
.quote-orbit__arrow::after {
  display: none;
}
.quote-orbit__arrow span {
  position: relative;
}
.quote-orbit__arrow:hover {
  transform: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}
.quote-orbit__arrow:active {
  transform: scale(0.96);
}
.quote-orbit__arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.quote-orbit__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.quote-orbit__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  padding: 0;
  border: 1px solid color-mix(in oklab, var(--rule-strong) 70%, transparent);
  background: color-mix(in oklab, var(--bg-sunken) 90%, var(--fg));
  cursor: pointer;
  transition:
    background 0.22s ease,
    transform 0.22s ease,
    border-color 0.22s ease;
}
.quote-orbit__dot:hover {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule));
  transform: scale(1.15);
}
.quote-orbit__dot.is-active {
  background: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 70%, var(--rule-strong));
  transform: scale(1.25);
}
:root[data-theme="dark"] .quote-orbit__dot.is-active {
  background: var(--accent-strong);
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .hand-scroll-ink {
    opacity: 0 !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    transition: none;
  }
  .hand-scroll-ink__path {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
  .section-question .section-head {
    padding-top: clamp(12px, 3vw, 28px);
  }
  .ambient-path {
    animation: none !important;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.28;
  }
  .section-bg-film__slide {
    animation: none !important;
    opacity: 0;
  }
  .section-bg-film__slide--a {
    opacity: 0.14;
  }
  .card,
  figure.card,
  .ghost-btn,
  .topnav a,
  .ground-photo,
  .quote-orbit__face,
  .quote-orbit__arrow,
  .topbar {
    transition: none !important;
  }
  .card:hover,
  figure.card:hover,
  .ghost-btn:hover,
  .ground-photo:hover,
  .quote-orbit__face:hover {
    transform: none !important;
    box-shadow: var(--shadow-md);
  }
  .quote-orbit__arrow:hover {
    transform: none !important;
  }
  .ghost-btn:hover {
    box-shadow:
      0 0 0 1px color-mix(in oklab, var(--rule-strong) 55%, transparent),
      0 2px 10px color-mix(in oklab, var(--fg) 7%, transparent);
  }
  .section-next a:hover {
    transform: none;
  }
  .section-indicator,
  .top-progress {
    display: none;
  }
}

/* ---------------- Redesign additions ---------------- */
/* Breadcrumb removed in stabilization pass to avoid duplicate top control strips. */

.hero-thesis-pull {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.5;
  font-weight: 400;
  font-style: italic;
  margin: 0 0 1.25em;
  max-width: 40ch;
  padding-left: 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--fg);
}
.hero-thesis-pull em { font-style: normal; color: var(--accent-strong); font-weight: 600; }
.hero-text-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  border: 0;
}
.hero-data-note {
  margin: 12px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
}
@media (max-width: 900px) {
  .hero-inner {
    text-align: center;
    max-width: 100%;
  }
  .hero-inner .meta-row {
    justify-content: center;
  }
  .hero-thesis-pull {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }
}
.argument-summary {
  max-width: min(72ch, calc(var(--max-width) - 2 * var(--gutter)));
  margin: 0 var(--gutter) clamp(32px, 5vw, 48px);
  margin-left: auto;
  margin-right: auto;
  padding: clamp(20px, 3vw, 28px) clamp(22px, 3vw, 32px);
  background: var(--bg-elev);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.argument-summary h2 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 10px;
  line-height: 1.2;
  color: var(--accent-strong);
  border: none;
  padding: 0;
  display: block;
}
.argument-summary p {
  max-width: none;
  margin: 0;
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.55;
}
.section-step {
  display: block;
  margin: 0 0 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-family: var(--font-sans);
  color: var(--accent-strong);
  font-weight: 700;
}
.question-big {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.3;
}
.section-bridge {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4px var(--gutter) 16px;
}
.section-bridge p { margin: 0; }
.section-bridge__from {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--fg-muted);
}
.section-bridge__to {
  margin-top: 5px;
  font-weight: 600;
}
.chart-caveat {
  margin: 10px 0 0;
  color: var(--fg-muted);
  font-size: 13px;
  border-left: 3px solid color-mix(in oklab, var(--warn) 55%, var(--rule));
  padding-left: 10px;
}
.inline-voice {
  margin-top: 14px;
  margin-bottom: 6px;
  border-color: color-mix(in oklab, var(--accent) 25%, var(--rule));
  max-width: min(38rem, 100%);
  margin-left: auto;
  margin-right: auto;
  padding: 18px 22px !important;
  box-shadow: none;
  background: color-mix(in oklab, var(--bg-sunken) 78%, var(--bg-elev));
}
.inline-voice blockquote {
  margin: 8px 0 4px;
  padding: 0;
  border: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.55;
  text-wrap: balance;
}
.inline-voice blockquote p {
  margin: 0;
}
.inline-voice__lead {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.65em !important;
}
.inline-voice__follow {
  font-weight: 400;
  font-size: 0.96em;
  color: color-mix(in oklab, var(--fg) 88%, var(--fg-muted));
  line-height: 1.52;
}
.inline-voice__kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--fg-faint);
}
.inline-voice__source {
  margin: 0;
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.45;
}

.result-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.result-chip {
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  padding: 14px;
  color: var(--fg);
  cursor: pointer;
}
.result-chip__tier {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.result-chip__claim {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.result-chip--bh { border-color: color-mix(in oklab, var(--good) 35%, var(--rule)); }
.result-chip--raw { border-color: color-mix(in oklab, var(--warn) 35%, var(--rule)); }
.result-chip--ns { border-color: color-mix(in oklab, var(--danger) 30%, var(--rule)); }
.results-table tr.flash-target {
  animation: rowFlash 1.2s ease-out;
}
@keyframes rowFlash {
  0% { background: color-mix(in oklab, var(--accent-soft) 80%, var(--bg-elev)); }
  100% { background: transparent; }
}

.result-row-card {
  display: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin: 8px 0;
}

@media (max-width: 900px) {
  .section-indicator { display: none; }
  .result-chips { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .results-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
/* ---------------- Ask me anything (inline Essay Guide agent) ---------------- */
.section-about {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.about-stack {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
  max-width: min(68rem, 100%);
  margin: 0 auto;
}
.about-block {
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--rule-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.about-block__head {
  margin-bottom: clamp(16px, 2vw, 22px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.about-block__title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  line-height: 1.2;
  color: var(--fg);
}
.about-block__guide {
  margin: 0;
  max-width: 52ch;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-muted);
}
.about-block__body {
  max-width: 68ch;
}
.about-block__body p:empty {
  min-height: 1.5em;
  border-left: 2px dashed color-mix(in oklab, var(--accent) 35%, var(--rule));
  padding-left: 12px;
  color: var(--fg-muted);
}
.about-block__body p:empty::before {
  content: "Empty paragraph — click here to write.";
  font-style: italic;
  font-size: 15px;
  color: var(--fg-muted);
}
.section-ask-anything {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.ask-anything__shell {
  max-width: min(72rem, 100%);
  margin: 0 auto;
}
.ask-anything__intro {
  margin-bottom: 18px;
}
.section-ask-anything h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.15;
  margin: 0 0 10px;
}
.ask-anything__lede {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  color: var(--fg-muted);
}
.ask-anything__lede--second {
  margin-top: 6px;
}
.ask-anything__panel {
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--rule-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .ask-anything__panel {
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.ask-anything__log {
  min-height: 0;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg);
}
.ask-anything__log:not(:empty) {
  min-height: 80px;
}
.ask-anything__suggestions {
  margin-bottom: 12px;
}
.ask-anything__form {
  align-items: stretch;
}
.ask-anything__input {
  flex: 1;
  min-height: 7.5rem;
  font-size: 16px;
  padding: 14px 16px;
  line-height: 1.5;
  resize: vertical;
  field-sizing: content;
}
.ask-anything__send {
  align-self: flex-end;
  padding: 12px 22px;
  font-size: 15px;
  min-height: 44px;
}
.ask-anything__disclaimer {
  margin-top: 12px;
}
.ask-anything__guide-link {
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--accent-strong);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ask-anything__guide-link:hover,
.ask-anything__guide-link:focus-visible {
  color: var(--accent);
  outline: none;
}

/* ---------------- Essay Guide (walkthrough + Q&A) ---------------- */
.essay-guide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  width: min(380px, 92vw);
  pointer-events: none;
  padding: 58px 0 max(12px, env(safe-area-inset-bottom)) 0;
}
.essay-guide.is-open {
  pointer-events: auto;
}
/* Nudge main essay left so the dock does not cover charts on wide screens */
@media (min-width: 900px) {
  body.essay-guide-panel-open .main-stack {
    margin-right: min(380px, 34vw);
    transition: margin-right 0.35s var(--ease-out);
  }
  body.essay-guide-panel-open .section-indicator {
    right: min(400px, calc(34vw + 16px));
    transition: right 0.35s var(--ease-out);
  }
}
.essay-guide__launcher {
  flex-shrink: 0;
}
.essay-guide__launcher--float {
  position: fixed;
  right: max(16px, var(--gutter));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 850;
  box-shadow: var(--shadow-md);
}
.essay-guide__bar {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg-elev);
  border-left: 1px solid var(--rule-strong);
  border-radius: 0;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(105%);
  opacity: 0;
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
:root[data-theme="dark"] .essay-guide__bar {
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
}
.essay-guide.is-open .essay-guide__bar {
  transform: translateX(0);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .essay-guide__bar,
  body.essay-guide-panel-open .main-stack,
  body.essay-guide-panel-open .section-indicator {
    transition: none;
  }
}
.essay-guide__bar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.essay-guide__kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 2px;
  font-family: var(--font-mono);
}
.essay-guide__heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}
.essay-guide__bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.essay-guide__tabs {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.essay-guide__tab {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.essay-guide__tab.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.essay-guide__close {
  min-width: 36px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}
.essay-guide__panel {
  padding: 12px 16px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#essay-guide-panel-tour {
  overflow-y: auto;
}
.essay-guide__panel.is-hidden {
  display: none;
}
.essay-guide__log {
  flex: 1;
  overflow-y: auto;
  min-height: 80px;
  margin-bottom: 10px;
  padding-right: 4px;
  font-size: 14px;
  line-height: 1.5;
}
.essay-guide__msg {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.essay-guide__msg--user {
  background: var(--bg-sunken);
  margin-left: 24px;
}
.essay-guide__msg--assistant {
  background: color-mix(in oklab, var(--accent-soft) 60%, var(--bg-sunken));
  border-left: 3px solid var(--accent);
}
.essay-guide__msg--assistant a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.essay-guide__thinking {
  color: var(--fg-muted);
  font-style: italic;
}
.essay-guide__stats {
  font-size: 12px;
  margin-top: 6px;
}
.essay-guide__cite,
.essay-guide__note {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 8px;
}
.essay-guide__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.essay-guide__chip {
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--rule-strong);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.essay-guide__chip:hover,
.essay-guide__chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: none;
}
.essay-guide__form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.essay-guide__input {
  flex: 1;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
}
.essay-guide__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.essay-guide__send {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
}
:root[data-theme="dark"] .essay-guide__send {
  color: var(--bg);
}
.essay-guide__disclaimer {
  font-size: 11px;
  color: var(--fg-faint);
  margin: 8px 0 0;
  line-height: 1.35;
}
.essay-guide__tour-progress {
  font-size: 12px;
  color: var(--accent-strong);
  margin: 0 0 6px;
}
.essay-guide__tour-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.essay-guide__tour-narration {
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--fg);
}
.essay-guide__tour-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  flex-shrink: 0;
}
.essay-guide__tour-btn {
  flex-shrink: 0;
  min-width: 0;
  padding: 8px 14px;
  min-height: 38px;
  font-size: 13px;
}
.essay-guide__tour-btn .ghost-btn__text,
.essay-guide__next-btn .ghost-btn__text {
  color: var(--fg);
}
.essay-guide__next-btn {
  margin-left: auto;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  padding: 8px 18px;
  min-height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg-elev);
  cursor: pointer;
  flex-shrink: 0;
}
.essay-guide__next-btn .ghost-btn__text {
  position: relative;
  z-index: 2;
  color: var(--bg-elev);
}
.essay-guide .ghost-btn__text {
  position: relative;
  z-index: 2;
}
.essay-guide__close .ghost-btn__text {
  font-size: 1.25rem;
  line-height: 1;
}
.essay-guide-tour-active main section:not(.essay-guide-tour-focus),
.essay-guide-tour-active .hero:not(.essay-guide-tour-focus) {
  opacity: 0.38;
  filter: saturate(0.88);
  transition:
    opacity 0.35s var(--ease-out),
    filter 0.35s var(--ease-out);
}
.essay-guide-tour-focus {
  opacity: 1 !important;
  filter: none !important;
  position: relative;
  z-index: 10;
  isolation: isolate;
  box-shadow:
    0 0 0 2px color-mix(in oklab, var(--accent) 55%, transparent),
    0 16px 48px color-mix(in oklab, var(--bg) 55%, transparent);
}

/* Subtle hint on the sidebar Next while tour is active */
body.essay-guide-tour-active .essay-guide__next-btn {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent);
}

/* First-visit invite (bottom-right, does not cover the essay) */
.essay-guide-invite {
  position: fixed;
  right: max(16px, var(--gutter));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px));
  z-index: 1200;
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.4s var(--ease-spring),
    opacity 0.3s var(--ease-out);
}
.essay-guide-invite.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.essay-guide-invite.is-hidden {
  display: none;
}
.essay-guide-invite__kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 6px;
}
.essay-guide-invite__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
}
.essay-guide-invite__lede {
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-muted);
  margin: 0 0 14px;
}
.essay-guide-invite__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.essay-guide-invite__primary {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  text-align: center;
}
.essay-guide-invite__secondary {
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.essay-guide-invite__dismiss {
  font: inherit;
  font-size: 12px;
  padding: 4px 0 0;
  border: none;
  background: none;
  color: var(--fg-faint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-start;
}
.essay-guide-invite__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.essay-guide-invite__close:hover,
.essay-guide-invite__close:focus-visible {
  background: var(--bg-sunken);
  outline: none;
}
@media (max-width: 720px) {
  .essay-guide {
    width: min(340px, 100vw);
  }
  body.essay-guide-panel-open .main-stack {
    margin-right: 0;
  }
  .essay-guide__bar-head {
    flex-wrap: wrap;
  }
  .essay-guide-invite {
    bottom: max(64px, calc(env(safe-area-inset-bottom) + 48px));
    width: min(300px, calc(100vw - 24px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .essay-guide-invite { transition: opacity 0.2s ease; }
}
