/* WI-7 Atlas — design tokens, layout, and components. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #fbfbfd;
  --bg-2: #f5f5f7;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e5e5ea;
  --line-2: #d2d2d7;
  --accent: #0071e3;
  --accent-2: #5ac8fa;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --state: #86868b;
  --us: #c7c7cc;
  --grow: #0f9d8a;
  --shrink: #d98a1f;
  --rep: #c9453b;
  --dem: #2f66c9;
  --oth: #a1a1a6;
  --pass: #1e8e3e;
  --warn: #b26a00;
  --fail: #c5221f;
  --land: #ececf0;
  --edge: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.06);
  --radius: 22px;
  --nav-h: 52px;
  --max: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #000000; --bg-2: #0b0b0d; --panel: #141416; --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #a1a1a6;
    --faint: #8e8e93; --line: #2c2c2e; --line-2: #3a3a3c; --accent: #2997ff; --accent-2: #64d2ff;
    --accent-soft: rgba(41, 151, 255, 0.14); --state: #98989d; --us: #636366; --grow: #30c8b0; --shrink: #f0a24a;
    --rep: #ef6a5e; --dem: #5b8ef0; --oth: #8e8e93; --pass: #34c759; --warn: #ff9f0a; --fail: #ff453a;
    --land: #1c1c1e; --edge: #000000; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 40px rgba(0, 0, 0, 0.45);
  }
}
:root.dark {
  --bg: #000000; --bg-2: #0b0b0d; --panel: #141416; --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #a1a1a6;
  --faint: #8e8e93; --line: #2c2c2e; --line-2: #3a3a3c; --accent: #2997ff; --accent-2: #64d2ff;
  --accent-soft: rgba(41, 151, 255, 0.14); --state: #98989d; --us: #636366; --grow: #30c8b0; --shrink: #f0a24a;
  --rep: #ef6a5e; --dem: #5b8ef0; --oth: #8e8e93; --pass: #34c759; --warn: #ff9f0a; --fail: #ff453a;
  --land: #1c1c1e; --edge: #000000; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.47;
  letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.08; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }
.center { text-align: center; }
.fine { font-size: 12px; color: var(--faint); line-height: 1.5; margin: 14px 0 0; }
.sub { color: var(--muted); font-size: 15px; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nav-inner { max-width: var(--max); margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 24px; padding: 0 22px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 20px; height: 20px; color: var(--accent); }
.nav nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { color: var(--ink-2); font-size: 13px; white-space: nowrap; opacity: 0.85; transition: opacity 0.2s; }
.nav nav a:hover, .nav nav a.active { opacity: 1; color: var(--ink); text-decoration: none; }
.nav nav a.active { color: var(--accent); }
.theme-toggle { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.theme-toggle:hover { background: var(--bg-2); color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.sample-banner { position: sticky; top: var(--nav-h); z-index: 49; text-align: center; padding: 8px; font-weight: 600; font-size: 14px; background: #ffd60a; color: #1d1d1f; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); display: grid; place-items: center; overflow: hidden; padding: 60px 22px 100px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20%; z-index: -2;
  background: radial-gradient(40% 40% at 70% 40%, var(--accent-soft), transparent 70%),
              radial-gradient(35% 35% at 25% 70%, color-mix(in srgb, var(--grow) 12%, transparent), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.05); } }
.hero-map { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; opacity: 0.8;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 52%, #000 35%, transparent 78%); mask-image: radial-gradient(60% 55% at 50% 52%, #000 35%, transparent 78%); }
.hero-map svg { width: min(92vw, 980px); height: auto; max-height: 92%; }
.hero-copy { position: relative; will-change: transform, opacity; }
.hero-map { will-change: transform, opacity; }
.hero-copy::before { content: ""; position: absolute; inset: -12% -8%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 82%, transparent), transparent); }
.hero-copy { text-align: center; max-width: 980px; }
.eyebrow { color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: 0; margin: 0 0 14px; }
.hero h1 { font-size: clamp(64px, 11vw, 152px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; margin-bottom: 22px; }
.grad { background: linear-gradient(110deg, var(--accent) 10%, var(--accent-2) 55%, var(--grow) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { font-size: clamp(21px, 2.6vw, 30px); color: var(--ink-2); font-weight: 500; line-height: 1.25; letter-spacing: -0.02em; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 980px; font-weight: 500; font-size: 17px; transition: transform 0.2s var(--ease), background 0.2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn[hidden] { display: none; }
.scroll-cue { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--line-2); }
.scroll-cue span { position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--muted); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }

.hero-map .county { fill: var(--accent); fill-opacity: 0; stroke: var(--edge); stroke-width: 0.8; }
.hero-map .county.on { animation: county-in 1.4s var(--ease) forwards; }
@keyframes county-in { to { fill-opacity: var(--o, 0.18); } }
.hero-map .outline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 3.2s cubic-bezier(.45,0,.2,1) .2s forwards; }
.hero-map .state { fill: none; stroke: var(--line-2); stroke-width: 1; opacity: 0.6; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- glance ---------- */
.glance { max-width: var(--max); margin: 0 auto; padding: 40px 22px 80px; }
.glance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stat { background: var(--panel); padding: 30px 26px; }
.stat .num { font-size: clamp(34px, 4vw, 52px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .lab { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.stat .moe { margin-top: 4px; color: var(--faint); font-size: 12px; }

/* ---------- tour ---------- */
.tour { max-width: var(--max); margin: 0 auto; padding: 60px 22px 20px; }
.tour .chapter-head { margin-bottom: 30px; }
.tour-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; aspect-ratio: 16 / 9; }
.tour-frame video { width: 100%; height: 100%; display: block; }

/* ---------- chapters ---------- */
.chapter { max-width: var(--max); margin: 0 auto; padding: 110px 22px 40px; }
.chapter-head { max-width: 820px; margin: 0 auto 54px; text-align: center; }
.chapter-head h2 { font-size: clamp(42px, 6vw, 72px); font-weight: 700; margin-bottom: 18px; }
.lede { font-size: clamp(19px, 2vw, 24px); color: var(--muted); line-height: 1.35; letter-spacing: -0.015em; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 30px 32px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel h3 { font-size: 24px; font-weight: 650; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.two-up .panel { margin-bottom: 22px; }
.chart { width: 100%; min-height: 120px; }
.chart.tall { min-height: 380px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink); font-family: var(--font); }
.chart .axis text, .chart .muted { fill: var(--muted); font-size: 12px; }
.chart .grid line { stroke: var(--line); }
.chart .domain { display: none; }
.legend-inline { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-left: 8px; }
.d-district { background: var(--accent); }
.d-state { background: var(--state); }
.d-us { background: var(--us); }
.src { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--bg-2); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.src:hover { color: var(--accent); text-decoration: none; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ---------- scrollytelling map ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.scrolly-graphic { position: sticky; top: calc(var(--nav-h) + 20px); height: calc(100svh - var(--nav-h) - 40px); display: flex; align-items: center; }
.map-figure { margin: 0; width: 100%; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.map svg { width: 100%; height: auto; max-height: calc(100svh - var(--nav-h) - 190px); display: block; }
.map .ctx { fill: var(--land); stroke: var(--panel); stroke-width: 0.8; }
.map .part { stroke: var(--edge); stroke-width: 1; cursor: pointer; transition: fill 0.8s var(--ease), opacity 0.4s; }
.map .part:hover, .map .part:focus { stroke: var(--ink); stroke-width: 2; outline: none; }
.map .part.dim { opacity: 0.35; }
.map .hatch { pointer-events: none; transition: opacity 0.6s; }
.map .outline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.map .label { font-size: 10.5px; font-weight: 500; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.map-legend { min-height: 44px; margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend-title { width: 100%; color: var(--ink-2); font-weight: 500; }
.legend-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-legend .ramp { display: flex; height: 10px; border-radius: 5px; overflow: hidden; width: 220px; }
.map-legend .ramp span { flex: 1; }
.map-legend .hatch-key { width: 22px; height: 12px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--muted) 0 1.5px, transparent 1.5px 5px); box-shadow: inset 0 0 0 1px var(--line-2); }
.scrolly-steps { padding: 20vh 0 30vh; }
.step { min-height: 78vh; display: flex; align-items: center; }
.step-card { background: var(--panel); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); opacity: 0.35; transform: scale(0.97); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.step.is-active .step-card { opacity: 1; transform: none; }
.step-card h3 { font-size: 26px; margin-bottom: 12px; }
.step-card p { color: var(--ink-2); margin: 0; }
.step-card strong { color: var(--ink); }

/* ---------- people ---------- */
.compare-row { display: grid; grid-template-columns: 260px 1fr 150px; gap: 18px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: 0; }
.compare-row .name { font-size: 15px; }
.compare-row .name small { display: block; color: var(--faint); font-size: 12px; }
.compare-row .track { position: relative; height: 22px; }
.compare-row .track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line); border-radius: 1px; }
.compare-row .pin { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; transition: left 1.1s var(--ease); }
.compare-row .pin.district { background: var(--accent); box-shadow: 0 0 0 3px var(--panel); z-index: 2; width: 18px; height: 18px; top: 2px; margin-left: -9px; }
.compare-row .pin.state { background: var(--state); }
.compare-row .pin.us { background: var(--us); }
.compare-row .vals { text-align: right; font-variant-numeric: tabular-nums; }
.compare-row .vals b { color: var(--accent); font-size: 17px; }
.compare-row .vals small { display: block; color: var(--faint); font-size: 12px; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.trend { border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.trend .t-label { color: var(--muted); font-size: 14px; }
.trend .t-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.trend svg { width: 100%; height: 54px; display: block; }

/* ---------- federal / ranks ---------- */
.rank { display: grid; gap: 12px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 15px; }
.rank-row .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.rank-row .bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease); }
.in .rank-row .bar span { transform: scaleX(1); }
.rank-row .amt { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- seat ---------- */
.seat-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.member .role { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.member .who { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.member .party { margin-top: 8px; display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 980px; background: var(--bg-2); }
.member dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px 0 0; font-size: 15px; }
.member dt { color: var(--muted); }
.member dd { margin: 0; }
.note { border-left: 3px solid var(--warn); padding: 2px 0 2px 16px; margin-bottom: 18px; }
.note.scheduled { border-color: var(--accent); }
.note.verified { border-color: var(--pass); }
.note h4 { margin: 0 0 6px; font-size: 16px; }
.note .tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warn); }
.note.scheduled .tag { color: var(--accent); }
.note.verified .tag { color: var(--pass); }
.note p { font-size: 15px; color: var(--ink-2); margin: 6px 0; }
.note .refs { font-size: 12px; color: var(--faint); }
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ring { text-align: center; }
.ring svg { width: 150px; height: 150px; }
.ring .r-val { font-size: 30px; font-weight: 700; fill: var(--ink); letter-spacing: -0.03em; }
.ring .r-lab { font-weight: 600; margin-top: 6px; }
.ring .r-def { color: var(--muted); font-size: 13px; max-width: 280px; margin: 6px auto 0; }
.ring circle.track { stroke: var(--bg-2); }
.ring circle.fill { stroke: var(--accent); transition: stroke-dashoffset 1.6s var(--ease); }
.recent { margin-top: 26px; }
.recent summary, details summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 8px 0; }
details p { color: var(--ink-2); font-size: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; }
.vote-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 980px; background: var(--bg-2); }
.party-chip { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.segmented button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); font-weight: 600; }
.select { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.select select { border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 6px 10px; font-size: 14px; }

/* ---------- counties ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar input { border: 1px solid var(--line-2); background: var(--panel); border-radius: 12px; padding: 8px 14px; min-width: 220px; }
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.county-card { text-align: left; border: 0; background: var(--panel); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.county-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 18px 40px rgba(0,0,0,.1); }
.county-card h3 { font-size: 20px; margin-bottom: 4px; }
.county-card .kind { font-size: 12px; color: var(--muted); }
.county-card .kind.split { color: var(--warn); font-weight: 600; }
.county-card .row { display: flex; justify-content: space-between; font-size: 14px; margin-top: 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.county-card .row span:first-child { color: var(--muted); }
.county-card svg { width: 100%; height: 34px; margin-top: 10px; display: block; }

/* ---------- trust ---------- */
.pill { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 980px; background: var(--bg-2); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.checks .pass .icon { background: var(--pass); }
.checks .warn .icon { background: var(--warn); }
.checks .fail .icon { background: var(--fail); }
.checks .skip .icon { background: var(--faint); }
.checks .ct { font-weight: 600; font-size: 15px; }
.checks .cd { color: var(--muted); font-size: 14px; margin-top: 3px; }
.downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.downloads a { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--bg-2); border-radius: 12px; color: var(--ink); font-size: 14px; }
.downloads a span { color: var(--muted); }
.sources { padding-left: 22px; font-size: 14px; color: var(--ink-2); display: grid; gap: 10px; }
.sources li, .note .refs, .fine, .checks .cd, td { overflow-wrap: anywhere; }
.sources li:target { background: var(--accent-soft); border-radius: 8px; }
.sources .q { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); word-break: break-all; margin-top: 3px; }

/* ---------- drawer, tooltip ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 80; background: var(--panel); box-shadow: none; transform: translateX(102%); visibility: hidden; transition: transform 0.5s var(--ease), visibility 0s linear 0.5s, box-shadow 0.5s; overflow-y: auto; }
.drawer.open { transform: none; visibility: visible; box-shadow: -20px 0 60px rgba(0,0,0,.18); transition: transform 0.5s var(--ease), visibility 0s, box-shadow 0.5s; }
.drawer-inner { padding: 30px 32px 60px; }
.drawer-close { position: sticky; top: 0; float: right; border: 0; background: var(--bg-2); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.drawer h2 { font-size: 38px; margin: 6px 0 4px; }
.drawer .kind { color: var(--muted); }
.drawer section { margin-top: 26px; }
.drawer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 15px; }
.kv .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.drawer svg { width: 100%; display: block; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.25); backdrop-filter: blur(2px); }
.tooltip { position: fixed; z-index: 90; pointer-events: none; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); border-radius: 12px; padding: 10px 14px; font-size: 13px; max-width: 260px; border: 1px solid var(--line); }
.tooltip b { font-size: 15px; display: block; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 80px; background: var(--bg-2); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 34px 22px 50px; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .glance-grid { grid-template-columns: repeat(2, 1fr); }
  .scrolly { grid-template-columns: 1fr; }
  .scrolly-graphic { top: var(--nav-h); height: auto; z-index: 2; }
  .scrolly-steps { padding: 30vh 0 20vh; position: relative; z-index: 3; }
  .step { min-height: 70vh; }
  .step-card { opacity: 0.95; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(10px); }
  .two-up, .seat-top { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr 120px; }
  .compare-row .track { grid-column: 1 / -1; grid-row: 2; }
  .trend-grid, .rings { grid-template-columns: 1fr; }
  .nav nav { display: none; }
  .theme-toggle { margin-left: auto; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .panel { padding: 22px 18px; }
  .chapter { padding-top: 80px; }
  .stat { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-map .outline { stroke-dashoffset: 0; }
  .hero-map .county { fill-opacity: var(--o, 0.18); }
}

/* Film mode: a clean frame for recording the tour video. */
.film .nav, .film .scroll-cue { opacity: 0; pointer-events: none; }
.film ::-webkit-scrollbar { display: none; }

/* ---------- compact figures inside a panel ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 24px; margin: 18px 0 22px; }
.mini-stats b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mini-stats span { color: var(--ink-2); font-size: 13px; }

/* ---------- right now: cameras and aircraft ---------- */
.now-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.now-part { fill: var(--panel); stroke: var(--line-2); stroke-width: 0.8; pointer-events: none; }
.now-outline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.plane { fill: var(--ink); stroke: var(--panel); stroke-width: 0.6; cursor: default; }
.cam { fill: var(--accent); stroke: var(--panel); stroke-width: 2.5; cursor: pointer; transition: r .2s var(--ease); }
.cam:hover, .cam:focus, .cam.on { r: 10; outline: none; }
.cam.on { fill: var(--grow); }
.now-key { color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.now-key span { display: inline-block; width: 11px; height: 11px; margin: 0 6px 0 14px; vertical-align: -1px; }
.now-key span:first-child { margin-left: 0; }
.k-plane { background: var(--ink); clip-path: polygon(50% 0, 62% 38%, 100% 62%, 62% 60%, 58% 90%, 42% 90%, 38% 60%, 0 62%, 38% 38%); }
.k-cam { background: var(--accent); border-radius: 50%; }
#now-side h3 { margin-top: 0; }
#now-side h3 + .sub { margin-top: 4px; }
#air-title { margin-top: 26px !important; }
#cam-view { margin: 12px 0; }
#cam-view img { width: 100%; border-radius: 12px; background: var(--bg-2); display: block; min-height: 40px; }
#cam-view figcaption { font-size: 13px; color: var(--ink-2); margin-top: 8px; overflow-wrap: anywhere; }
.cam-list { display: grid; gap: 6px; margin-top: 10px; }
.cam-list button { display: flex; justify-content: space-between; gap: 12px; text-align: left; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg-2); border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.cam-list button span { color: var(--muted); white-space: nowrap; }
.cam-list button.on, .cam-list button:hover { background: var(--accent); color: #fff; }
.cam-list button.on span, .cam-list button:hover span { color: #fff; }
@media (max-width: 900px) { .now-grid { grid-template-columns: 1fr; } }
#now-map svg { overflow: hidden; display: block; }

/* ---------- attendance ---------- */
#attendance { margin-top: 34px; }
#attendance .table-wrap { margin-top: 18px; }
.missed-scroll { max-height: 520px; overflow-y: auto; }

/* ---------- colleges ---------- */
.college-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.college { background: var(--panel); border-radius: var(--radius); padding: 24px 24px 20px; box-shadow: var(--shadow); }
.college h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.college h3 a { color: inherit; text-decoration: none; }
.college h3 a:hover { color: var(--accent); }
.college .where { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.college .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.college .tags span { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 980px; background: var(--bg-2); color: var(--ink-2); }
.college .site { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
#colleges-source { margin-top: 18px; }
#stations .segmented { margin-bottom: 16px; }
