@font-face {
  font-family: 'Geist';
  src: url('/assets/geist.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/assets/plex-mono.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink-bg: #0b1320;
  --ink-card: #121d30;
  --slate-bg: #f1f5f9;
  --paper: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --emerald: #059669;
  --emerald-bright: #10b981;
  --emerald-soft: #ecfdf5;
  --cobalt: #2563eb;
  --cobalt-soft: #eff6ff;
  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--slate-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  overflow-x: hidden;
}

.wrap {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.atlas-nav {
  background: var(--ink-bg);
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 30;
}
.atlas-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.04rem;
}
.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--emerald);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 5px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
}
.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
}
.nav-links a:hover { color: var(--emerald-bright); }

/* Data-Journalism Hero */
.hero {
  background: var(--ink-bg);
  color: #f8fafc;
  padding: 54px 0 48px;
  border-bottom: 3px solid var(--emerald);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
}
.mono-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-bright);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2.1rem, 3.8vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero-lead {
  color: #cbd5e1;
  font-size: 1.06rem;
  margin: 0 0 22px;
  max-width: 56ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn-emerald {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.94rem;
  background: var(--emerald);
  color: #ffffff;
  border: 1px solid var(--emerald);
  padding: 11px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn-emerald:hover { background: #047857; }
.btn-slate {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.94rem;
  background: var(--ink-card);
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 11px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn-slate:hover { border-color: var(--emerald-bright); }

.atlas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kpi-tile {
  background: var(--ink-card);
  border: 1px solid #24324a;
  border-radius: 10px;
  padding: 18px;
}
.kpi-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.95rem;
  font-weight: 600;
  color: var(--emerald-bright);
}
.kpi-lbl {
  display: block;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-top: 4px;
}

/* Interactive 50-State + DC Electoral Coalition Calculator */
.section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}
.section-head {
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
}

.scoreboard {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.score-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.score-total {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
}
.score-total.is-winning { color: var(--emerald); }
.score-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cobalt-soft);
  color: var(--cobalt);
  border: 1px solid #bfdbfe;
}
.score-status.is-winning {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: #a7f3d0;
}
.meter-progress {
  width: 100%;
  height: 18px;
  accent-color: var(--emerald);
  display: block;
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.preset-btn {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--slate-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
}
.preset-btn:hover,
.preset-btn.is-active {
  background: var(--ink-bg);
  color: #ffffff;
  border-color: var(--ink-bg);
}

.region-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.region-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.region-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
}
.region-ev {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cobalt);
  margin-top: 2px;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.state-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.state-tile:hover { border-color: var(--cobalt); }
.state-tile.is-selected {
  background: var(--emerald-soft);
  border: 2px solid var(--emerald);
}
.st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.86rem;
}
.st-ev { color: var(--cobalt); }
.state-tile.is-selected .st-ev { color: var(--emerald); }
.st-name {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
}
.st-reg {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #64748b;
  margin-top: 2px;
}

/* Accountability & Reference Tables */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.info-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}
.info-card h3 {
  font-size: 1.08rem;
  margin: 0 0 8px;
}
.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--ink-bg);
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: 0; }

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.faq-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.faq-card h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
}
.faq-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer {
  background: var(--ink-bg);
  color: #cbd5e1;
  padding: 36px 0 48px;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: #ffffff;
  text-decoration: none;
}
.footer-links a:hover { color: var(--emerald-bright); }

@media (max-width: 1024px) {
  .state-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid,
  .region-summary,
  .cards-3,
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .state-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .atlas-nav-inner { flex-direction: column; align-items: flex-start; }
  .state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
