@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ground: #EEF2F4;
  --paper: #FFFFFF;
  --ink: #0F1B2A;
  --ink-2: #3A4A5C;
  --ink-3: #66788B;
  --line: #C9D4DD;
  --line-strong: #9FB0BF;
  --cobalt: #1F4BFF;
  --cobalt-dark: #1638C4;
  --kind: #0E7C78;
  --mid: #E8ECEF;
  --rude: #E0482F;
  --good: #11845B;
  --display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --measure: 66ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 12px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 4.6vw, 4.1rem); font-weight: 750; letter-spacing: -0.035em; max-width: 14ch; font-variation-settings: "wdth" 85; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 22px 32px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.25rem/1 var(--display); letter-spacing: -0.02em; }
.mark svg { color: var(--cobalt); }
.top nav { display: flex; align-items: center; gap: 28px; }
.top nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.top nav a:not(.btn):hover { color: var(--ink); }

/* buttons */
.btn { display: inline-block; background: var(--cobalt); color: #fff; text-decoration: none; font-weight: 600; padding: 14px 24px; border-radius: 10px; transition: background .15s; }
.btn:hover { background: var(--cobalt-dark); }
.btn.small { padding: 9px 16px; font-size: 0.93rem; border-radius: 8px; }
.btn.light { background: #fff; color: var(--ink); margin-top: 12px; }
.btn.light:hover { background: #DDE6FF; }
.link { color: var(--ink); font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 40px 32px 72px; }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin: 30px 0 34px; }
.live-line { font-size: 1rem; color: var(--ink-2); border-left: 3px solid var(--cobalt); padding: 2px 0 2px 16px; max-width: 48ch; }
.live-line b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(17,132,91,.5); animation: pulse 2.4s infinite; }
.live-dot.off { background: var(--ink-3); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(17,132,91,0); } 100% { box-shadow: 0 0 0 0 rgba(17,132,91,0); } }

.hero-map { margin: 0; position: relative; }
#map { width: 100%; height: auto; display: block; max-height: 78vh; }
#counties path { stroke: var(--ground); stroke-width: 1.4; stroke-linejoin: round; fill: var(--mid); cursor: pointer; }
#counties.live path { transition: fill 1.6s ease; }
#counties path:hover, #counties path.on { stroke: var(--ink); stroke-width: 2.2; }
.hero-map figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: baseline; font-size: 0.9rem; color: var(--ink-2); margin-top: 6px; }
.hero-map figcaption p { margin: 0; max-width: 52ch; }
.legend { display: inline-flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--ink-3); }
.ramp { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--kind), var(--mid), var(--rude)); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 0.85rem; line-height: 1.35; padding: 8px 12px; border-radius: 8px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.tip b { font-weight: 650; }

/* bands */
.band { background: var(--paper); padding: 88px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band.ink { background: var(--ink); color: #E6ECF2; border: 0; }
.band.ink h2, .band.ink h3, .band.ink strong { color: #fff; }
.band.ink a:not(.btn) { color: #9DB4FF; }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: start; }

.facts { margin: 6px 0 0; display: grid; gap: 0; }
.facts div { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 11rem 1fr; gap: 16px; }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { margin: 0; color: var(--ink-2); }

/* results */
#runs, #board { padding-top: 88px; padding-bottom: 8px; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 28px; }
.section-head p { color: var(--ink-2); margin: 0; }
.chart-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 8px; }
#chart { width: 100%; height: auto; display: block; }
#chart text { font: 500 13px var(--body); fill: var(--ink-3); }
.sub { margin: 48px 0 14px; }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 0.85rem; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.data td { padding: 13px 18px; border-bottom: 1px solid #E3E9EE; font-variant-numeric: tabular-nums; }
.data tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; }
.data .empty { color: var(--ink-3); text-align: left; padding: 28px 18px; }
.data .who { font-weight: 600; }
.data .hw { color: var(--ink-2); }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px; }
.badge.ok { background: #DDF3EA; color: #0B6B49; }
.badge.chk { background: #E4EAFF; color: var(--cobalt-dark); }
.badge.on { background: #DDF3EA; color: #0B6B49; }
.score { font-weight: 650; }
.score.neg { color: var(--ink-3); }

/* join */
#join { margin-top: 96px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 28px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 28px 56px; color: #C6D1DC; max-width: 56ch; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #5E7187; color: #fff; font: 700 1rem/33px var(--display); text-align: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 40px; bottom: 6px; width: 1.5px; background: #33465B; }
pre { background: #1C2B3D; border: 1px solid #33465B; border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 12px 0 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9rem; color: #E6ECF2; }
.next { border-left: 1px solid #33465B; padding-left: 48px; }
.next p { color: #C6D1DC; }

.foot { padding: 40px 0 56px; color: var(--ink-3); font-size: 0.88rem; background: var(--ink); border-top: 1px solid #23344A; }
.foot p { margin: 0 0 6px; }
.foot a { color: #9DB4FF; }

@media (max-width: 900px) {
  .hero, .two, .section-head { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding-top: 16px; }
  .top nav a:not(.btn) { display: none; }
  .next { border-left: 0; padding-left: 0; border-top: 1px solid #33465B; padding-top: 32px; }
  .facts div { grid-template-columns: 1fr; gap: 4px; }
  .wrap, .top, .hero { padding-left: 20px; padding-right: 20px; }
  .band { padding: 64px 0; }
  .data .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #counties.live path { transition: none; }
  .live-dot { animation: none; }
}

.stages { list-style: none; padding: 0; margin: 18px 0 24px; counter-reset: st; }
.stages li { counter-increment: st; position: relative; padding: 0 0 20px 44px; color: #C6D1DC; }
.stages li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #5E7187; color: #C6D1DC; font: 700 0.85rem/25px var(--display); text-align: center; }
.stages li.now::before { background: #fff; border-color: #fff; color: var(--ink); }
.stages li span { display: inline-block; font-size: 0.75rem; font-weight: 700; background: #DDF3EA; color: #0B6B49; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }

/* ---------- 3D globe viewport ---------- */
.viewport { margin: 0; position: relative; aspect-ratio: 1 / 1.02; background: radial-gradient(120% 90% at 50% 45%, #13213a 0%, #0a1222 55%, #070c17 100%); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(15, 27, 42, .55); }
.viewport .gl { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.viewport .gl:active { cursor: grabbing; }
.viewport .gl:focus-visible { outline: 3px solid #9DB4FF; outline-offset: -6px; border-radius: 18px; }
.viewport canvas { display: block; width: 100% !important; height: 100% !important; }
.viewport.loading .gl { opacity: .35; transition: opacity .3s; }
.viewport.nogl .gl { display: none; }
.viewport figcaption { position: absolute; left: 20px; right: 20px; bottom: 16px; color: #8FA3BC; font-size: .84rem; line-height: 1.45; pointer-events: none; max-width: 46ch; }
.hud { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; color: #C9D6E6; font-size: .82rem; pointer-events: none; }
.hud-top { display: flex; align-items: center; gap: 8px; background: rgba(8, 14, 26, .62); backdrop-filter: blur(6px); border: 1px solid rgba(157, 180, 255, .16); padding: 7px 12px; border-radius: 999px; max-width: 100%; }
.hud-top b { color: #fff; font-weight: 650; }
.hud .dot { width: 7px; height: 7px; border-radius: 50%; background: #3DDC97; flex: none; }
.hud .fps { color: #7F93AC; font-variant-numeric: tabular-nums; margin-left: 4px; }
.hud .hw { color: #fff; }
.seg { display: inline-flex; background: rgba(8, 14, 26, .62); backdrop-filter: blur(6px); border: 1px solid rgba(157, 180, 255, .16); border-radius: 999px; padding: 3px; pointer-events: auto; }
.seg button { font: 600 .78rem/1 var(--body); color: #9FB2C8; background: none; border: 0; padding: 7px 10px; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { background: var(--cobalt); color: #fff; }
.hud .note { flex-basis: 100%; margin: 0; color: #FFD38A; font-size: .8rem; }
.gtip { position: absolute; pointer-events: none; background: rgba(255, 255, 255, .96); color: var(--ink); font-size: .84rem; line-height: 1.35; padding: 8px 12px; border-radius: 8px; transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; z-index: 2; }

/* ---------- stage one, live ---------- */
.stage { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: center; padding-top: 24px; padding-bottom: 88px; }
.stage-copy p { color: var(--ink-2); }
.stage-map #map { max-height: 70vh; }
@media (max-width: 900px) { .stage { grid-template-columns: 1fr; gap: 20px; } .viewport { aspect-ratio: 1 / 1.1; } .seg button { padding: 7px 8px; } }
.hud .hw { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.stage-map #map { max-height: 62vh; }
.news { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.news-date { font: 700 1.1rem/1.2 var(--display); color: var(--ink); margin-bottom: 10px; }
.news ul { list-style: none; padding: 0; margin: 0 0 14px; }
.news li { font-size: .92rem; color: var(--ink-2); padding: 9px 0; border-bottom: 1px solid #E3E9EE; max-width: 60ch; }
.news li span { display: block; font-size: .78rem; color: var(--ink-3); margin-bottom: 2px; }
.news-laws { font-size: .85rem; color: var(--ink-3); }
.world { padding-top: 24px; padding-bottom: 40px; }
.world .news { border-top: 0; padding-top: 0; margin-top: 0; max-width: 880px; }
.news-stats { color: var(--ink-2); }
.news-note { font-size: .85rem; color: var(--ink-3); margin-top: 14px; }
.ramp.happy { background: linear-gradient(90deg, #E84C3D, #F08C40, #F2C85C, #60C896, #1EAABE); width: 96px; }
.viewport figcaption { display: flex; flex-direction: column; gap: 6px; }
.viewport .legend { color: #8FA3BC; }

/* ---------- help from this device ---------- */
.help { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 56px; align-items: start; padding-top: 72px; padding-bottom: 88px; }
.help-copy p { color: var(--ink-2); }
.help-points { margin: 18px 0 0; padding: 0; list-style: none; max-width: 56ch; }
.help-points li { position: relative; padding: 10px 0 10px 28px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; }
.help-points li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.help-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: 0 24px 48px -32px rgba(15, 27, 42, .35); }
.help-who { font: 650 1.05rem/1.3 var(--display); margin: 0 0 18px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field select { width: 100%; font: 400 1rem var(--body); color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.help-btn { width: 100%; border: 0; cursor: pointer; font: 650 1.05rem var(--body); padding: 16px; margin-top: 4px; }
.help-btn[aria-pressed="true"] { background: var(--ink); }
.help-progress { height: 6px; background: var(--mid); border-radius: 3px; overflow: hidden; margin: 18px 0 12px; }
.help-progress i { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .25s linear; }
.help-status { font-size: .95rem; color: var(--ink-2); margin: 0 0 4px; min-height: 1.5em; }
.help-stats { font-size: .85rem; color: var(--ink-3); margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .help { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; } .help-panel { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { .help-progress i { transition: none; } }

/* Phones and tablets help from the page itself; the desktop download stays out of their way. */
@media (pointer: coarse) and (max-width: 1100px) { .desk-only { display: none !important; } }
