:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-alt: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #d03b3b;
  --s1: #2a78d6;  /* blue */
  --s2: #eb6834;  /* orange */
  --s3: #1baf7a;  /* aqua */
  --s4: #eda100;  /* yellow */
  --s5: #e87ba4;  /* magenta */
  --s6: #008300;  /* green */
  --s7: #6250d6;  /* violet */
  --s8: #e34948;  /* red */
  --good: #006300;
  --bad: #d03b3b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-alt: #141413;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #e66767;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --good: #0ca30c;
    --bad: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-alt: #141413;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255, 255, 255, 0.10); --accent: #e66767;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --good: #0ca30c; --bad: #e66767;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); line-height: 1.2; text-wrap: balance; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; margin: 0 0 4px; }
a { color: var(--s1); }

.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 52px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-header nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.site-header nav a { color: var(--ink-2); text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.site-header nav a:hover { color: var(--ink); }

.hero { padding-block: 56px 40px; text-align: center; }
.eyebrow, .kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.clock { font-size: clamp(2.2rem, 8.5vw, 5.4rem); font-weight: 800; line-height: 1.05; margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hero-note { color: var(--ink-2); max-width: 680px; margin: 12px auto 32px; font-size: 0.95rem; }
.clock-words { max-width: 760px; margin: 10px auto 0; font-size: clamp(0.95rem, 2.2vw, 1.15rem); line-height: 1.45; color: var(--ink); font-weight: 500; text-wrap: balance; }
.measure-explain { max-width: 640px; margin: 12px auto 4px; font-size: 0.86rem; color: var(--ink-2); }
.gdp-live { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px auto 0; }
.gdp-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.gdp-ratio { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.1; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { font-size: 0.82rem; color: var(--ink-2); border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.chip b { color: var(--accent); font-weight: 700; }
.gdp-race { font-size: 0.85rem; color: var(--ink-2); max-width: 620px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: left; margin-bottom: 20px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 0.82rem; color: var(--ink-2); }
.tile-value { font-size: 1.75rem; font-weight: 750; line-height: 1.15; }
.tile-sub { font-size: 0.8rem; color: var(--muted); }

.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section.alt { background: var(--surface-alt); }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 760px; margin: 0 0 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-sub { color: var(--ink-2); font-size: 0.92rem; margin: 0 0 14px; max-width: 760px; }
.chart-box { position: relative; height: 340px; }
.chart-box.short { height: 260px; }
.chart-box.bar { height: 150px; }
.eras-legend strong { color: var(--ink); font-weight: 650; }
.chart-box.mid { height: 300px; }
.chart-box.tall { height: 420px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split .card { margin-bottom: 20px; }
.risk-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 4px; }
.risk-split > div { min-width: 0; }
.risk-split h4 { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink-2); font-weight: 600; }
.risk-tiles .tile { background: var(--surface-alt); }
.legend i.line { height: 0; width: 20px; border-radius: 0; border-top: 2px solid; background: none !important; }
.legend i.line.dash { border-top-style: dashed; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button:focus-visible, .hh-input input:focus-visible, .slider input:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.seg button { font: inherit; font-size: 0.85rem; padding: 6px 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

details.data { margin-top: 12px; font-size: 0.88rem; }
details.data summary { cursor: pointer; color: var(--ink-2); }
.tbl-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.86rem; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-2); font-weight: 600; }
td.up { color: var(--bad); font-weight: 600; }

.household .hh-input, .slider { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--ink-2); margin-bottom: 14px; }
.hh-input input { width: 72px; font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--axis); background: var(--page); color: var(--ink); }
.slider input { flex: 1 1 240px; accent-color: var(--s1); }
.hh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.hh-grid > div { background: var(--surface-alt); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.hh-grid .tile-value { font-size: 1.45rem; }
.fine { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }

.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.callouts div { border-left: 3px solid var(--accent); padding: 4px 12px; }
.callouts strong { display: block; font-size: 1.5rem; }
.callouts span { font-size: 0.86rem; color: var(--ink-2); }

.rule { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--grid); }
.rule:last-child { border-bottom: 0; }
.rule .badge { grid-row: span 2; align-self: start; font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; border: 1px solid currentColor; }
.badge.met { color: var(--good); }
.badge.missed { color: var(--bad); }
.rule p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }

.sources { padding-left: 18px; }
.sources li { margin-bottom: 8px; }
.sources small { color: var(--muted); }
.method ul { padding-left: 18px; color: var(--ink-2); font-size: 0.93rem; }
.method li { margin-bottom: 6px; }
.footer { padding-block: 24px 40px; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 860px) {
  .tiles, .tiles.three { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 0; }
  .callouts { grid-template-columns: 1fr; }
  .risk-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header nav { display: none; }
  .tiles, .tiles.three, .hh-grid { grid-template-columns: 1fr; }
  .chart-box { height: 280px; }
  .chart-box.tall { height: 380px; }
  .card { padding: 16px; }
}

/* ---------- storyline ---------- */
.site-header nav a.active { color: var(--ink); font-weight: 650; }
.roadmap-band { padding-block: 8px 48px; }
.roadmap-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; counter-reset: none; }
.roadmap a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; position: relative; }
.roadmap a:hover { border-color: var(--axis); }
.roadmap a:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.roadmap li:not(:last-child) a::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.9rem; background: var(--page); line-height: 1; padding: 2px 0; z-index: 1; }
.rm-num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--ink); color: var(--surface); }
.rm-end .rm-num { background: var(--accent); }
.rm-q { font-size: 0.8rem; color: var(--ink-2); }
.rm-a { font-weight: 650; font-size: 0.95rem; line-height: 1.3; text-wrap: balance; }

.step-head { margin-bottom: 20px; max-width: 820px; }
.step-head .kicker { display: flex; align-items: center; gap: 8px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--surface); font-size: 0.8rem; letter-spacing: 0; }
.question { margin: 0 0 4px; font-size: 1.05rem; color: var(--ink-2); font-style: italic; }
.step-head h2 { text-wrap: balance; }
.step-head .lede { margin-bottom: 0; }

.takeaway { margin-top: 8px; padding: 18px 20px; border-radius: 14px; background: var(--ink); color: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.takeaway p { margin: 0; font-size: 1.02rem; line-height: 1.5; max-width: 780px; }
.takeaway .takeaway-label, .bottom-line .takeaway-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; opacity: 0.75; }
.takeaway .next { align-self: flex-start; margin-top: 4px; color: var(--surface); font-weight: 650; text-decoration: none; border-bottom: 1px solid currentColor; }
.takeaway .next:focus-visible { outline: 2px solid var(--s1); outline-offset: 3px; }

.conclusion { background: var(--surface-alt); }
.chain { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; counter-reset: chain; }
.chain li { counter-increment: chain; display: grid; grid-template-columns: auto 140px 1fr; gap: 6px 16px; align-items: baseline; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.chain li::before { content: counter(chain); width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--surface); font-weight: 700; font-size: 0.85rem; }
.chain a { color: var(--ink); text-decoration: none; }
.chain span { color: var(--ink-2); }
.bottom-line { padding: 22px 24px; border-radius: 14px; border: 2px solid var(--accent); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.bottom-line p { margin: 0; }
.bottom-line p:last-child { font-size: 1.12rem; line-height: 1.55; max-width: 820px; }
.bottom-line .takeaway-label { color: var(--accent); opacity: 1; }

@media (max-width: 860px) {
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .roadmap li:not(:last-child) a::after { display: none; }
  .chain li { grid-template-columns: auto 1fr; }
  .chain li span { grid-column: 2; }
}
@media (max-width: 560px) {
  .roadmap { grid-template-columns: 1fr; }
}


/* ---------- black and white bands: each step flips, whatever the viewer's theme ---------- */
.band-light, :root[data-theme] .band-light {
  color-scheme: light;
  --page: #ffffff; --surface: #ffffff; --surface-alt: #f4f4f2;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #6b6965; --grid: #e6e5df; --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.12); --accent: #d03b3b;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #006300; --bad: #d03b3b;
  background: var(--page); color: var(--ink);
}
.band-dark, :root[data-theme] .band-dark {
  color-scheme: dark;
  --page: #000000; --surface: #121212; --surface-alt: #1a1a19;
  --ink: #f5f5f3; --ink-2: #c3c2b7; --muted: #8f8d87; --grid: #2a2a28; --axis: #3a3a37;
  --border: rgba(255, 255, 255, 0.14); --accent: #ef6b6b;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --good: #0ca30c; --bad: #ef6b6b;
  background: var(--page); color: var(--ink);
}
.section.band-light, .section.band-dark { border-top: 0; }
.site-header.band-dark { background: rgba(0, 0, 0, 0.92); border-bottom-color: rgba(255, 255, 255, 0.12); }
.hero.band-dark { padding-block: 56px 40px; }
.roadmap-band.band-dark .roadmap li:not(:last-child) a::after { background: var(--page); }
.conclusion.band-light { background: var(--page); }
.footer.band-dark { padding-block: 24px 40px; color: var(--muted); }

.about { max-width: 760px; margin-bottom: 36px; }
.about p { color: var(--ink-2); }

/* Reserve space for live text in the hero so the tiles don't jump as it fills in */
.clock-words { min-height: 1.5em; }
.measure-explain { min-height: 4.5em; }
.gdp-race { min-height: 2.9em; }
.hero-note { min-height: 4.6em; }
