:root {
  --ink: #17242d;
  --muted: #596971;
  --paper: #f7f5ed;
  --card: #fffefa;
  --line: #d9ddd8;
  --warm: #c65329;
  --warm-dark: #8f3218;
  --warm-open: #f1d6c0;
  --blue: #176b86;
  --blue-dark: #164862;
  --blue-open: #c8e1e8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.55; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; padding: .7rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.hero { min-height: 94vh; padding: clamp(2rem, 6vw, 6rem); display: grid; align-content: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; right: -8vw; top: 13%; width: 42vw; height: 42vw; max-width: 620px; max-height: 620px; border: 1px solid #c7d2d1; border-radius: 50%; box-shadow: 0 0 0 3.5vw var(--paper), 0 0 0 calc(3.5vw + 1px) #d6dcda, 0 0 0 10vw var(--paper), 0 0 0 calc(10vw + 1px) #dfe3df; pointer-events: none; }
.eyebrow, .chapter-label { letter-spacing: .13em; text-transform: uppercase; font-size: .75rem; font-weight: 750; color: var(--blue-dark); }
.hero h1 { position: relative; z-index: 1; margin: 1rem 0 1.5rem; max-width: 980px; font: 400 clamp(4rem, 11vw, 10rem)/.8 var(--serif); letter-spacing: -.065em; }
.hero h1 em { color: var(--warm); font-weight: 400; }
.lede { position: relative; z-index: 1; max-width: 760px; margin: 0 0 3rem; font-size: clamp(1.1rem, 1.8vw, 1.5rem); color: #394b54; }
.hero-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(240px, 360px)); gap: 1rem; }
.hero-metrics article { padding: 1.2rem 1.4rem; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); }
.hero-metrics strong { display: block; font: 400 3rem/1 var(--serif); color: var(--warm-dark); }
.hero-metrics strong small { font-size: .45em; color: var(--muted); }
.hero-metrics p { margin: .55rem 0 0; font-size: .9rem; max-width: 27ch; color: #46565e; }
.scroll-cue { position: absolute; left: clamp(2rem, 6vw, 6rem); bottom: 2rem; margin: 0; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

main { overflow: hidden; }
.chapter { padding: clamp(4rem, 9vw, 9rem) clamp(1.25rem, 6vw, 6rem); border-bottom: 1px solid var(--line); }
.chapter > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.chapter-label { margin-bottom: 1.25rem; }
.chapter-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .75fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; margin-bottom: 3rem; }
h2 { margin: 0 0 1rem; font: 400 clamp(2.5rem, 5vw, 5.4rem)/.98 var(--serif); letter-spacing: -.045em; }
.chapter-grid > div > p { max-width: 680px; margin: 0; color: #4c5d66; font-size: 1.05rem; }
.definition { border-left: 2px solid var(--warm); padding: .3rem 0 .3rem 1.2rem; }
.definition b, .definition span { display: block; }
.definition span { margin-top: .45rem; color: var(--muted); font-size: .88rem; }

.chart-card { margin-top: 2rem; padding: clamp(1rem, 2.4vw, 2.1rem); background: var(--card); border: 1px solid var(--line); box-shadow: 0 16px 50px rgba(40, 52, 55, .05); }
.figure-head { display: flex; align-items: start; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.figure-head h3 { margin: 0; font: 600 1.15rem/1.25 var(--sans); }
.figure-head p { margin: .3rem 0 0; color: var(--muted); font-size: .83rem; }
.metric-inline { text-align: right; flex: none; }
.metric-inline b, .metric-inline span { display: block; }
.metric-inline b { color: var(--warm-dark); font: 400 2rem/1 var(--serif); }
.metric-inline.blue b { color: var(--blue-dark); }
.metric-inline span { color: var(--muted); font-size: .76rem; margin-top: .25rem; }
.chart-host { width: 100%; min-height: 380px; }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
figcaption { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid #eceee9; color: var(--muted); font-size: .76rem; }

.chapter-heat { background: #f0eee5; }
.legend-block { align-self: center; display: grid; grid-template-columns: 1fr; gap: .4rem; color: var(--muted); font-size: .75rem; }
.legend-scale { display: grid; grid-template-columns: repeat(5, 1fr); height: 10px; }
.legend-scale i { display: block; }
.legend-block > span:last-child { text-align: right; }
.heat-card { padding-bottom: 1.2rem; }
.heatmap-host { min-height: 640px; overflow-x: auto; }
.heatmap-host svg { min-width: 980px; }

.chapter-waterline { background: #eef4f4; }
.explorer-head { align-items: center; }
.select-wrap { display: grid; gap: .45rem; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
select { width: 100%; padding: .9rem 2.7rem .9rem 1rem; border: 1px solid #b8c4c5; background: var(--card); color: var(--ink); font: 600 1rem var(--sans); border-radius: 0; }
.explorer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.compact-chart { min-height: 300px; }

.conclusion { background: var(--ink); color: #f7f5ed; }
.conclusion-copy { max-width: 900px; margin-left: 0; }
.conclusion .chapter-label { color: #8fc6d3; }
.conclusion p { max-width: 790px; color: #c9d0d3; font-size: 1.08rem; }
.method-grid { margin-top: 4rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #425058; }
.method-grid div { padding: 1.2rem; background: var(--ink); }
.method-grid b, .method-grid span { display: block; }
.method-grid b { color: #f1b690; margin-bottom: .4rem; }
.method-grid span { color: #b9c2c6; font-size: .82rem; }

.sources { padding: clamp(3rem, 7vw, 7rem) clamp(1.25rem, 6vw, 6rem); max-width: 980px; margin: auto; }
.sources h2 { font-size: 2.4rem; }
.sources p, .sources li { color: #50616a; font-size: .86rem; }
.sources a { color: var(--blue-dark); }
.fine-print { padding-top: 1rem; border-top: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1.25rem, 6vw, 6rem); background: #101a20; color: #aab6bb; font-size: .75rem; }

.axis text { fill: #65747b; font: 11px var(--sans); }
.axis line { stroke: #d7ddd9; }
.zero-line { stroke: #50616a; stroke-width: 1.2; stroke-dasharray: 4 4; }
.series-line { fill: none; stroke: var(--warm); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.series-line.blue { stroke: var(--blue); }
.series-line.region { stroke: #7b888e; stroke-width: 1.5; stroke-dasharray: 5 5; }
.focus-line { stroke: var(--warm); stroke-width: 2.5; fill: none; }
.focus-line.blue { stroke: var(--blue); }
.latest-dot { fill: var(--card); stroke: var(--warm-dark); stroke-width: 3; }
.latest-dot.blue { stroke: var(--blue-dark); }
.chart-label { fill: var(--ink); font: 600 11px var(--sans); }
.chart-note { fill: var(--muted); font: 10px var(--sans); }

.tooltip { position: fixed; z-index: 30; opacity: 0; pointer-events: none; padding: .55rem .7rem; background: #102029; color: white; font-size: .75rem; box-shadow: 0 8px 24px rgba(0,0,0,.22); transform: translate(12px, 12px); transition: opacity .1s; }
.tooltip.show { opacity: 1; }

@media (max-width: 760px) {
  .hero { min-height: auto; padding-top: 5rem; padding-bottom: 7rem; }
  .hero::after { width: 70vw; height: 70vw; right: -35vw; top: 7%; opacity: .6; }
  .hero h1 { font-size: clamp(3.15rem, 14vw, 5.5rem); }
  .hero-metrics, .chapter-grid, .explorer-grid { grid-template-columns: 1fr; }
  .chapter-grid { gap: 1.5rem; }
  .chapter-grid, .figure-head { margin-bottom: 1.5rem; }
  .figure-head { flex-direction: column; gap: .8rem; }
  .metric-inline { text-align: left; }
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-host { min-height: 260px; }
  .heatmap-host { min-height: 560px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
