:root {
  --bg: #090d15;
  --sea: #0d1320;
  --panel: #131a29;
  --line: #243049;
  --text: #e8edf6;
  --muted: #94a0b8;
  --gold: #e6c374;
  --serif: ui-serif, Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { font: 600 15px/1 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 600; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--text); border-bottom-color: var(--gold); }

/* plate heading */
.plate-head { padding: 26px 0 10px; }
.kicker { margin: 0 0 6px; font: 600 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0; font: 600 clamp(26px, 4.4vw, 42px)/1.12 var(--serif); letter-spacing: -.01em; }
h2 { font: 600 24px/1.2 var(--serif); margin: 38px 0 10px; }
h3 { font: 600 17px/1.3 var(--sans); margin: 22px 0 6px; }
.lede { margin: 12px 0 0; max-width: 62ch; color: #c5cee0; font-size: 18px; }
.headline { margin: 12px 0 0; min-height: 3.1em; max-width: 70ch; color: #c5cee0; font-size: 17px; }
.headline strong { color: var(--text); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 14px 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 8px 14px; font: 500 14px var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed='true'] { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 9px; font: 500 13px var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chips button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.chips button[aria-pressed='true'] { color: var(--text); border-color: var(--c); background: var(--panel); }
.chips[hidden] { display: none; }

/* map */
.mapwrap { position: relative; background: var(--sea); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mapwrap svg { display: block; width: 100%; height: auto; }
.mapwrap path, .mapwrap use { stroke: var(--sea); stroke-width: .35; vector-effect: non-scaling-stroke; transition: fill .45s ease; cursor: default; }
.mapwrap path.self, .mapwrap use.self { stroke: var(--selfc, #fff); stroke-width: 1; }
.mapwrap path.hot { stroke: #fff; stroke-width: 1.2; }
.yearbig { position: absolute; left: 16px; bottom: 8px; font: 600 clamp(40px, 8vw, 88px)/1 var(--serif); color: rgba(255, 255, 255, .88); letter-spacing: -.02em; pointer-events: none; text-shadow: 0 2px 18px #000; }
.mapmark { position: absolute; right: 12px; bottom: 8px; font: 600 11px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .35); pointer-events: none; }
.tip { position: absolute; z-index: 4; pointer-events: none; background: #0b111d; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.4; min-width: 190px; max-width: 250px; box-shadow: 0 8px 26px rgba(0, 0, 0, .5); }
.tip[hidden] { display: none; }
.tip b { font-size: 14px; }
.tip .sub { color: var(--muted); }
.tip .warn { color: #e9b26b; }
.tip svg { margin-top: 6px; width: 100%; height: 38px; }

/* legend + time */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 12px 0; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(255, 255, 255, .12); }
.legend .hatch { background: repeating-linear-gradient(45deg, #2a3348 0 2px, #1a2133 2px 5px); }
.legend .lt { color: var(--text); font-weight: 600; margin-right: 2px; }
.timebar { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.timebar button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 16px; cursor: pointer; flex: none; }
.timebar button:hover { border-color: var(--gold); }
.timebar input[type=range] { flex: 1; accent-color: var(--gold); height: 28px; }
.timebar output { font: 600 20px var(--serif); min-width: 3.2em; text-align: right; }
.ticks { display: flex; justify-content: space-between; margin: 0 56px 0 56px; font-size: 12px; color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; max-width: 80ch; margin: 18px 0 0; }

/* story pages */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 22px 0 6px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.fact .big { font: 600 30px/1.1 var(--serif); }
.fact .big small { font: 500 14px var(--sans); color: var(--muted); }
.fact p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin: 14px 0; }
.multiples figure { margin: 0; }
.multiples .mapwrap { border-radius: 8px; }
.multiples figcaption { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 2px 0; font-size: 14px; color: var(--muted); }
.multiples figcaption b { font: 600 22px var(--serif); color: var(--text); }
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; }
.chart svg { width: 100%; height: auto; display: block; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t .dn { color: #e07a7a; }
table.t .up { color: #6fd0a0; }
details { margin: 10px 0; color: var(--muted); }
summary { cursor: pointer; }
.cta { display: inline-block; margin: 14px 0 0; padding: 10px 16px; border: 1px solid var(--gold); border-radius: 8px; text-decoration: none; color: var(--text); }
.cta:hover { background: var(--gold); color: #11151f; }
.note { border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; color: #c5cee0; max-width: 70ch; }
.prose { max-width: 72ch; }
.prose li { margin: 4px 0; }
.prose code { background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: 14px; }

footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }

@media (max-width: 640px) {
  .ticks { margin: 0 16px; }
  .multiples { grid-template-columns: 1fr; }
  .yearbig { left: 10px; }
}
@media (prefers-reduced-motion: reduce) { .mapwrap path, .mapwrap use { transition: none; } }
