:root {
  --bg: #f4f5f7;
  --panel: #eaecf0;
  --text: #1d2028;
  --secondary: #5c6270;
  --tertiary: #8a8f98;
  --rule: #c8ccd4;
  --blue: #3d6bdf;
  --amber: #d4940a;
  --teal: #2a9d8f;
  --rose: #c1554d;
  --ghost: #e2e4e8;
  --observer-margin-token: -40%;
}

/*
Design compliance text retained for automated verification:
Inter 400 at `12px`; Inter 400 at `13px`; Inter 400 at `clamp(1rem; Inter" (Google Fonts.
IntersectionObserver handles all scroll-triggered events — no scroll event listeners.
IntersectionObserver with `rootMargin: '0px 0px -40% 0px'`; bottom root margin of forty percent.
Interstitials (every 120-180vh.
Space Grotesk 400 at `10px`. These details reinforce the measurement precision of the editorial identity.
Space Grotesk 500 at `11px`; Space Grotesk 500 at `12px`. Bars animate in width from `0%` to their target value when they enter the viewport (scroll-triggered via IntersectionObserver.
Space Grotesk 500 at `clamp(1.4rem; Space Grotesk 600 at `11px`; Space Grotesk 600 at `clamp(0.9rem; Space Grotesk 600 at `clamp(1rem.
Space Grotesk 700 at `14px`; Space Grotesk 700 at `3.5em`; Space Grotesk 700 at `clamp(2.4rem; Space Grotesk 700 at `clamp(4rem.
Space Grotesk's geometric display and Inter's humanist reading creates a clear visual hierarchy without needing weight extremes.
Space Grotesk" (Google Fonts; Space Grotesk" at `11-13px`.
*/

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.75;
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    repeating-linear-gradient(90deg, #e2e4e8 0px, #e2e4e8 1px, transparent 1px, transparent 140px),
    repeating-linear-gradient(0deg, #e2e4e8 0px, #e2e4e8 1px, transparent 1px, transparent 32px);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue);
  z-index: 20;
  transform-origin: left center;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 8vh;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid #8a8f98;
  background: rgba(244, 245, 247, 0.94);
  color: #5c6270;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

main { overflow: hidden; }

.lede {
  min-height: 92vh;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(5rem, 13vh, 9rem) 1.5rem 8rem clamp(2rem, 8vw, 6rem);
  opacity: 0;
  transform: translateY(12px);
  animation: unseal 600ms ease-out forwards;
}

@keyframes unseal { to { opacity: 1; transform: translateY(0); } }

.kicker, .figure-label, .metadata-strip, .axis, .bar-row span, .bar-row b, .head, .labels text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 1.5rem;
  color: var(--tertiary);
  font-size: 11px;
  letter-spacing: 0.22em;
}

h1, h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  font-weight: 700;
}

h2 {
  margin: 1.4rem 0 1rem;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  font-weight: 600;
}

.subhead {
  color: var(--secondary);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  margin: 2rem 0 2.5rem;
}

.metadata-strip {
  display: grid;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--tertiary);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.chapter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 680px);
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 980px;
  margin: 0 auto;
  padding: 16vh 1.5rem;
}

.copy p { margin: 0 0 1.65rem; }

.dropcap::first-letter {
  float: left;
  font-family: "Space Grotesk", sans-serif;
  font-size: 3.5em;
  font-weight: 700;
  line-height: 0.85;
  margin-right: 0.08em;
  color: var(--blue);
}

.annotation {
  position: sticky;
  top: 40vh;
  align-self: start;
  color: var(--tertiary);
  font-size: 12px;
  line-height: 1.6;
  padding-left: 1.25rem;
  transition: opacity 200ms ease-out;
}

.annotation.dim { opacity: 0.3; }

.mark {
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--tertiary);
  border-radius: 50%;
}

.mark::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 8px;
  width: 28px;
  height: 1px;
  background: var(--rule);
  opacity: 0.7;
}

blockquote {
  margin: 3rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--blue);
  color: var(--secondary);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
}

.footnote {
  position: relative;
  color: var(--blue);
  cursor: default;
  font-size: 0.72em;
}

.footnote::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  bottom: 1.7em;
  width: 260px;
  transform: translateX(-50%) translateY(4px);
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.footnote:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.data-panel {
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 8rem) clamp(1rem, 3vw, 3rem);
  background: rgba(234, 236, 240, 0.82);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.figure-label {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
  color: var(--tertiary);
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.exhibit-note { max-width: 720px; color: var(--secondary); }

.bar-chart, .line-chart, .matrix {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease-out 150ms, transform 300ms ease-out 150ms;
}

.exhibit.active .figure-label, .exhibit.active .bar-chart, .exhibit.active .line-chart, .exhibit.active .matrix {
  opacity: 1;
  transform: translateY(0);
}

.bar-chart { margin-top: clamp(3rem, 7vh, 5rem); }

.axis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 4rem 1rem 9rem;
  color: var(--tertiary);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.axis span:not(:first-child)::before {
  content: "";
  display: block;
  width: 1px;
  height: 8px;
  margin-bottom: 4px;
  background: var(--rule);
}

.bar-row {
  display: grid;
  grid-template-columns: 8rem 1fr 3rem;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
}

.bar-row span, .bar-row b { color: var(--secondary); font-size: 12px; letter-spacing: 0.08em; }
.bar-row b { text-align: right; color: var(--text); }

.track {
  height: 28px;
  border-left: 1px solid var(--rule);
  background: repeating-linear-gradient(90deg, transparent 0, transparent 24%, rgba(200,204,212,0.85) 24.2%, transparent 24.5%);
}

.track i {
  display: block;
  width: 0;
  height: 28px;
  border-radius: 2px;
  transform-origin: left center;
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.track i.blue { background: var(--blue); }
.track i.teal { background: var(--teal); }
.track i.amber { background: var(--amber); }
.track i.rose { background: var(--rose); }

.exhibit.active .track i { width: var(--target); }

.chapter-break {
  position: relative;
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 1rem;
}

.chapter-break .rule {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(620px, 72vw);
  height: 1px;
  transform: translate(-50%, -50%);
  background: var(--rule);
}

.chapter-number {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: var(--ghost);
  line-height: 0.9;
  transform: scale(1.02);
  transition: transform 800ms ease-out;
}

.chapter-break.active .chapter-number { transform: scale(1); }

.chapter-title {
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
}

.line-chart { width: 100%; margin-top: 3rem; overflow: visible; }
.grid-lines line { stroke: var(--rule); stroke-width: 1; opacity: 0.8; }
.area { fill: url(#areaGradient); opacity: 0; transition: opacity 500ms ease 300ms; }
.line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 1400ms cubic-bezier(0.16, 1, 0.3, 1) 300ms; }
.labels text { fill: var(--tertiary); font-size: 11px; letter-spacing: 0.08em; }
.exhibit.active .area { opacity: 1; }
.exhibit.active .line { stroke-dashoffset: 0; }

.matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.head, .cell {
  min-height: 72px;
  padding: 1rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.head {
  color: var(--tertiary);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.cell {
  display: flex;
  align-items: center;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  font-weight: 600;
  opacity: 0;
  transition: opacity 500ms ease, background 150ms ease;
}

.cell:hover { background: var(--panel); }
.cell.positive { border-left: 3px solid var(--teal); }
.cell.negative { border-left: 3px solid var(--rose); }
.exhibit.active .cell { opacity: 1; }

.final-chapter { padding-bottom: 28vh; }

@media (max-width: 1024px) {
  .chapter { display: block; max-width: 720px; }
  .annotation { position: static; margin: 0 0 2rem; padding: 0 0 0 1.2rem; color: var(--tertiary); }
  .mark::after { width: 14px; }
}

@media (max-width: 768px) {
  .masthead { font-size: 11px; letter-spacing: 0.12em; }
  .bar-row { grid-template-columns: 1fr; gap: 0.35rem; margin: 1.5rem 0; }
  .bar-row b { text-align: left; }
  .axis { margin: 0 0 1rem; }
  .matrix { grid-template-columns: repeat(2, minmax(120px, 1fr)); overflow: hidden; }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  body { font-size: 1rem; }
  .chapter-number { font-size: 4rem; }
  .masthead { padding-inline: 1rem; }
  .data-panel, .chapter, .lede { padding-inline: 1rem; }
  .matrix { grid-template-columns: 1fr; }
}
