/* Home page: one idea per panel, big type, little copy. Dark only. */
:root {
  --bg: #0b0b0d; --ink: #f4f4f6; --soft: rgba(244,244,246,.72); --mute: rgba(244,244,246,.5);
  --line: rgba(255,255,255,.09); --card: #141417;
  --dem: #4673a1; --rep: #c55650;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* nav */
.nav { display: flex; align-items: center; gap: 40px; height: 88px; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 26px var(--display); letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 0; display: block; }
.nav-links { display: flex; gap: 28px; font-size: 16px; }
.nav-links a { text-decoration: none; color: var(--soft); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: 9px; background: rgba(255,255,255,.08); }
.nav-cta:hover { background: rgba(255,255,255,.14); }

/* hero */
.hero { position: relative; height: min(76vh, 760px); min-height: 520px; border-radius: 22px; overflow: hidden; background: #111114; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 44% at 50% 50%, rgba(11,11,13,.8), rgba(11,11,13,.38) 70%, rgba(11,11,13,.1)); }
.hero .hero-cap { max-width: none; position: absolute; left: 20px; bottom: 14px; z-index: 1; margin: 0; font-size: 12px; color: rgba(255,255,255,.5); }
.btn svg { width: 18px; height: 18px; flex: none; }
.hero-copy { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 24px; }
h1 { font: 700 clamp(44px, 7vw, 84px)/1.02 var(--display); letter-spacing: -0.035em; margin: 0; }
.hero p { font-size: clamp(17px, 2vw, 22px); color: var(--soft); max-width: 640px; margin: 22px 0 34px; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 11px; font-weight: 600; font-size: 16px; text-decoration: none; }
.btn.primary { background: #f4f4f6; color: #0b0b0d; }
.btn.primary:hover { background: #fff; }
.btn.dark { background: rgba(12,12,16,.82); border: 1px solid rgba(255,255,255,.22); }
.btn.dark:hover { background: rgba(28,28,34,.9); }
.btn.ghost { background: rgba(255,255,255,.09); }
.btn.ghost:hover { background: rgba(255,255,255,.15); }
.credit { text-align: center; color: var(--mute); font-size: 14px; margin: 26px 0 0; }

/* panels */
.panel { border-radius: 22px; padding: 72px 56px 0; margin-top: 28px; overflow: hidden; text-align: center; }
.panel h2 { font: 700 clamp(32px, 4.4vw, 52px)/1.05 var(--display); letter-spacing: -0.03em; margin: 0; }
.panel .sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--soft); max-width: 640px; margin: 18px auto 0; }
.panel .shot.wide { border-radius: 14px; margin-bottom: 56px; }
.panel .shot { margin: 48px auto 0; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 60px rgba(0,0,0,.35); max-width: 1080px; width: 100%; }
.green { background: linear-gradient(160deg, #183a33, #10241f 70%); }
.blue { background: linear-gradient(160deg, #1f2556, #161a3c 70%); }
.maroon { background: linear-gradient(160deg, #3d1717, #281012 70%); }
.slate { background: linear-gradient(160deg, #23252c, #17181c 70%); }
.panel.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; text-align: left; padding: 64px 56px; }
.panel.split .sub { margin-left: 0; }

/* stats row inside the Mac panel */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 48px auto 0; max-width: 900px; border-radius: 14px; overflow: hidden; background: var(--line); }
.stats div { background: rgba(0,0,0,.25); padding: 22px 18px; }
.stats b { display: block; font: 700 34px var(--display); letter-spacing: -0.02em; }
.stats span { color: var(--soft); font-size: 14px; }
.more { display: inline-block; margin-top: 22px; color: #9fb4ff; text-decoration: none; font-weight: 600; }
.more:hover { text-decoration: underline; }

/* the 25 voters */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.3); margin-bottom: 22px; flex-wrap: wrap; }
.seg button { font: 600 14px var(--sans); color: var(--soft); background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
#voters { width: 100%; max-width: 380px; display: block; }
#voters .cell { transition: fill .35s ease; }
#voters .cell.r { fill: rgba(197,86,80,.28); }
#voters .cell.d { fill: rgba(70,115,161,.36); }
#voters .v-r { fill: #d0625b; }
#voters .v-d { fill: #5b8dc4; }
#voters .wall { stroke: #fff; stroke-width: 3.5; opacity: 0; transition: opacity .35s ease; }
#voters .wall.on { opacity: .95; }
#voters .frame { fill: none; stroke: #fff; stroke-width: 3.5; }
.toy-seats { font: 700 40px var(--display); letter-spacing: -0.02em; margin: 14px 0 8px; }
.pips { display: flex; gap: 6px; }
.pips i { width: 18px; height: 18px; border-radius: 5px; }
.pips i.d { background: #5b8dc4; } .pips i.r { background: #d0625b; }
.toy-note { color: var(--soft); max-width: 420px; }

/* FAQ */
.faq { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; padding: 112px 0 80px; }
.faq .eyebrow { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.faq h2 { font: 700 clamp(30px, 3.6vw, 44px)/1.08 var(--display); letter-spacing: -0.03em; margin: 0; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 22px 0; font-weight: 600; font-size: 18px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 300; font-size: 26px; line-height: 1; transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 22px; color: var(--soft); max-width: 620px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--mute); font-size: 14px; display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--soft); text-decoration: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .panel { padding: 52px 22px 0; }
  .panel.split { grid-template-columns: 1fr; padding: 48px 22px; }
  .stats { grid-template-columns: 1fr; }
  .faq { grid-template-columns: 1fr; gap: 28px; padding-top: 80px; }
  .hero { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { #voters .cell, #voters .wall { transition: none; } }

/* poster row in the Share panel */
.posters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 44px auto 56px; max-width: 1080px; }
.posters img { width: 100%; border-radius: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.btn.soon { cursor: default; }
@media (max-width: 860px) { .posters { grid-template-columns: repeat(2, 1fr); } }
html { scroll-behavior: smooth; }
footer span:last-child { flex-basis: 100%; }

/* about page */
.about { max-width: 980px; margin: 24px auto 40px; }
.about .eyebrow { font-size: 15px; font-weight: 600; color: var(--soft); margin: 0 0 10px; }
.about h1 { font-size: clamp(36px, 5vw, 56px); text-align: left; }
.about .lede { font-size: 19px; line-height: 1.6; color: var(--soft); margin: 26px 0 0; }
.about .lede a, .about .work a, .credits a { color: var(--ink); }
.about h2 { font: 700 26px/1.2 var(--display); letter-spacing: -0.02em; margin: 64px 0 18px; }
.work { display: grid; gap: 14px; }
.work section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.work h3 { margin: 0 0 8px; font-size: 18px; }
.work p { margin: 0; color: var(--soft); line-height: 1.6; }
.credits { padding-left: 20px; color: var(--soft); line-height: 1.7; }
.nav-links a[aria-current="page"] { color: var(--ink); }

/* home: black, a full-screen hero pinned while the headline wheel turns */
body.home, html:has(body.home) { background: #000; overscroll-behavior: none; }
.top-wrap { position: absolute; left: 0; right: 0; top: 0; z-index: 5; }
.hero .top-wrap { max-width: none; padding: 0 40px; }
.hero-scroll { position: relative; height: 230vh; }
.hero-scroll .hero { position: sticky; top: 0; height: 100vh; min-height: 560px; border-radius: 0; background: #000; }
.hero-scroll .hero::after { background: linear-gradient(to bottom, rgba(0,0,0,.78), rgba(0,0,0,.55) 55%, rgba(0,0,0,.3)); }
.hero h1 { display: flex; flex-direction: column; align-items: center; gap: 0; }
/* Even rhythm: the same gap between the lead-in, the wheel and the line below. One color for both lines. */
.lead-in { display: block; font-size: .62em; line-height: 1.05; letter-spacing: -0.025em; color: var(--ink); }
/* The wheel is a drum seen edge on: the current word faces you, its neighbours curve away above and below and fade
   out at the window's edges, so it reads as a cylinder. The window is taller than a line, so descenders never clip. */
.wheel { position: relative; display: block; height: 1.8em; width: 100%; margin: .02em 0 0; perspective: 9em; perspective-origin: 50% 50%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 70%, transparent 100%); }
.wheel span { position: absolute; left: 0; right: 0; top: 50%; height: 1.15em; line-height: 1.15; margin-top: -.575em; text-align: center; white-space: nowrap;
  color: var(--ink); backface-visibility: hidden; will-change: transform, opacity; }
.hero-copy p { margin-top: .25em; }
.hero-scroll .hero-cap { left: auto; right: 40px; top: 34px; bottom: auto; max-width: 420px; text-align: right; line-height: 1.45; }
/* Horizon: the words at the top on black, Virginia lying flush along the bottom edge, the shape that also closes the page. */
.hero.horizon::after { background: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.82) 38%, rgba(0,0,0,.35) 62%, rgba(0,0,0,0) 80%); }
.hero.horizon .hero-copy { justify-content: center; padding-bottom: 12vh; }
.hero.horizon h1 { font-size: clamp(40px, 5.6vw, 76px); }
.hero-cap a { color: inherit; }
.home .panel:first-of-type { margin-top: 0; }
/* footer: Virginia laid along the bottom of the page, the words in the open sky above its western half */
.map-foot { position: relative; display: block; border-top: 0; margin: 120px 0 0; padding: 0; overflow: hidden; }
#foot-map { display: block; width: 100%; }
.foot-text { position: absolute; left: 4vw; top: 30%; max-width: 30vw; color: var(--mute); font-size: 14px; z-index: 1; }
.foot-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font: 700 30px var(--display); letter-spacing: -0.02em; }
.foot-brand img { width: 36px; height: 36px; border-radius: 0; display: block; }
.foot-by { margin: 6px 0 18px; color: var(--soft); font-size: 16px; }
.foot-text nav { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.foot-text nav a, .foot-credit a { color: var(--soft); text-decoration: none; }
.foot-text nav a:hover { color: var(--ink); }
.foot-credit { margin: 0; font-size: 13px; line-height: 1.55; }
@media (max-width: 860px) { .foot-text { position: static; max-width: none; padding: 0 22px 28px; } }
@media (prefers-reduced-motion: reduce) { .hero-scroll { height: auto; } .hero-scroll .hero { position: relative; } }

.about-hero { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: center; text-align: left; padding: 52px 52px; margin-top: 0; }
.about-hero .portrait { width: 100%; border-radius: 12px; box-shadow: none; }
.about-hero .lede { color: rgba(244,244,246,.82); margin-top: 18px; }
.about > h2, .about > .work, .about > .credits { max-width: none; }
/* What went into Tessera: as wide as the callout, two columns of short sections. */
.work { grid-template-columns: 1fr 1fr; gap: 0 48px; }
.work section { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 22px 0 26px; }
.work section:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 860px) { .work { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .about-hero { grid-template-columns: 1fr; padding: 32px 22px; } .about-hero .portrait { max-width: 260px; } }

/* FAQ: short, the questions on the left and the heading on the right, and the footer close behind it */
.home .faq { grid-template-columns: 1fr 1.6fr; gap: 48px; padding: 72px 0 0; }
.home .faq-head { text-align: left; }
.home .map-foot { margin-top: 24px; }
@media (max-width: 860px) { .home .faq { grid-template-columns: 1fr; } }

.about-hero .lede + .lede { margin-top: 12px; }
.about-hero .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.about-hero .links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.14); color: var(--ink); text-decoration: none; font-size: 15px; }
.about-hero .links a:hover { background: rgba(0,0,0,.42); }
.about-hero .links svg { width: 17px; height: 17px; flex: none; }

/* Black space between the hero (Virginia on its bottom edge) and the first panel. */


/* FAQ page */
.faq-page { max-width: 820px; margin: 56px auto 40px; }
.faq-page .eyebrow { font-size: 15px; font-weight: 600; color: var(--soft); margin: 0 0 8px; }
.faq-page h1 { text-align: left; margin-bottom: 36px; }
.faq-page details p a { color: var(--ink); }
/* The hero's bottom dissolves into the page: a straight fade over its last stretch, so the cut edge of Virginia
   never reads as a hard line when the next section scrolls up. */
.hero.horizon::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), #000); }
.home #draw { margin-top: 40px; }

/* Feature panels: a little tighter so the four scroll by quickly; screenshots open full size on click. */
.home .panel { padding: 56px 48px 0; margin-top: 22px; }
.home .panel .shot { max-width: 920px; margin-top: 36px; cursor: zoom-in; }
.home .panel .shot.wide { margin-bottom: 44px; }
.home .panel h2 { font-size: clamp(30px, 3.8vw, 46px); }
.zoom { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center;
  padding: 3vw; cursor: zoom-out; opacity: 0; transition: opacity .2s ease; }
.zoom.on { opacity: 1; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }

/* About: one flat green, a wider photo, facts as a short list */
.about-hero.panel.charcoal { background: #252527; grid-template-columns: 380px 1fr; align-items: center; }
.about-hero .portrait { aspect-ratio: 1 / 1; object-fit: cover; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.facts li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--soft); line-height: 1.55; }
.facts li b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.facts a { color: var(--ink); }
@media (max-width: 860px) { .about-hero.panel.charcoal { grid-template-columns: 1fr; } }

/* Stacked cards: each feature panel pins near the top as it arrives and the next one slides up over it, like a deck;
   the last one scrolls away into the footer. Each card is about a screen tall so the stack reads as one card at a time. */
.home .stack { position: relative; }
.home .stack .panel { position: sticky; top: 24px; min-height: calc(100vh - 48px); margin-top: 0; margin-bottom: 28px;
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 -18px 50px rgba(0,0,0,.55); transform-origin: 50% 0; }
.home .stack .panel .shot { max-height: calc(100vh - 340px); width: auto; max-width: 100%; object-fit: contain; }
.home .stack .panel .stats { margin-top: 26px; }
.home .stack .panel.slate { justify-content: flex-start; }
@media (max-width: 860px), (prefers-reduced-motion: reduce) { .home .stack .panel { position: relative; top: 0; min-height: 0; } }

/* The live map fades in from black once its first plan has settled (hero.js adds .shown). */
.hero canvas { opacity: 0; transition: opacity .7s ease; }
.hero.shown canvas, .hero.failed canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero canvas { opacity: 1; transition: none; } }

/* The feature cards read at about 90 percent scale (like a browser zoomed out one step): more black around them. */
.home .stack { zoom: 0.9; }

/* About, revised: a wider photo centered in its column, contact links that wrap inside the card, facts as bullets */
.about-hero.panel.charcoal { grid-template-columns: minmax(300px, 1fr) 1.15fr; gap: 48px; padding: 48px; align-items: center; }
.about-hero .portrait { width: 100%; max-width: 480px; margin: 0 auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: 55% 35%; }
.about-hero .links { flex-wrap: wrap; }
.about-hero .links a { font-size: 14px; padding: 8px 12px; }
.facts.bullets { list-style: disc; padding-left: 22px; display: block; }
.facts.bullets li { border-top: 0; padding: 6px 0; }
/* Room after the last card, so it slides all the way over the one before before the stack scrolls away. */
.home .stack::after { content: ""; display: block; height: 45vh; }
/* Every card the same height, so a card arriving on top always hides the one beneath it completely. */
.home .stack .panel { height: calc(100vh - 48px); min-height: 0; overflow: hidden; }
.home .stack .panel.slate .shot { max-height: calc(100vh - 470px); }

/* Compact About panels keep the portrait and technical overview on the page. */
.about-hero.panel.charcoal { grid-template-columns: minmax(250px, .85fr) 1.3fr; gap: 36px; padding: 36px; }
.about-hero .portrait { align-self: start; object-position: 55% 35%; box-shadow: none; }
.about-hero .lede { font-size: 17px; line-height: 1.6; }
.about-brief { background: #202022; border-radius: 24px; padding: 32px 36px; margin-top: 24px; }
.about .about-brief h2 { margin: 0 0 24px; }
.brief-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.brief-grid h3 { font-size: 17px; line-height: 1.3; margin: 0 0 12px; color: var(--ink); }
.brief-grid p { font-size: 15px; line-height: 1.65; color: var(--soft); margin: 0; }
.brief-grid a { color: var(--ink); }
@media (max-width: 860px) {
  .about-hero.panel.charcoal { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
  .about-hero .portrait { max-width: 320px; margin: 0; }
  .brief-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-brief { padding: 28px; }
}

.about-credits { padding: 0 36px; }
.about-credits h2 { font-size: 22px; margin-top: 40px; }
.about-credits p { color: var(--soft); font-size: 14px; line-height: 1.7; }
.about-credits a { color: var(--ink); }
