/* Palette deliberately avoids red and blue (political associations).
   Neutral charcoal + bronze; source labels use purple, green, bronze, black, gray. */
:root {
  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --ink: #1F2328;
  --ink-2: #3D4248;
  --ink-3: #565C63;
  --line: #E0E1DE;
  --line-soft: #ECEDEA;
  --accent: #2B3440;        /* charcoal: buttons, links */
  --accent-dark: #11161C;
  --bronze: #8A5A00;        /* highlight accent */
  --bronze-soft: #F3EBDD;
  --side-bg: #F1F2EF;       /* both sides of an argument get the same treatment */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--bronze); }
h1, h2, h3 { font-family: 'Space Grotesk', Inter, sans-serif; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 600px) { .wrap { padding-left: 16px; padding-right: 16px; } }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; font-size: 21px; }
.brand .accent { color: var(--bronze); }
.brand:hover { color: var(--ink); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; font-weight: 500; }
.main-nav a { text-decoration: none; padding: 10px 0; color: var(--ink-2); }
.main-nav a:hover { color: var(--bronze); }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--bronze); }

/* Layout */
.main { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.stack-xs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head h2 { font-size: 26px; }
.more { font-weight: 600; font-size: 15px; }
.muted { font-size: 14px; color: var(--ink-3); }
.muted-lg { font-size: 15px; color: var(--ink-2); }
.small { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.h-sm { font-size: 22px; }
.h-md { font-size: 24px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bronze); }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.hero h1 { font-size: 44px; line-height: 1.1; }
@media (max-width: 600px) { .hero h1 { font-size: 32px; } }
.lede { font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.btn { font: inherit; font-size: 16px; border: 0; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid #BFC1BC; }
.btn-secondary:hover { color: var(--ink); border-color: var(--ink-3); }

/* Cards */
.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 300px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card.tradeoff { flex-basis: 480px; gap: 14px; }
.card.tradeoff h3 { font-size: 20px; }

/* Two sides: identical styling on purpose */
.sides { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 auto; }
.side { flex: 1 1 200px; min-width: 0; border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--side-bg); border-top: 3px solid var(--ink-3); }
.side.big { flex-basis: 320px; padding: 20px; }
.side.big p { font-size: 15px; line-height: 1.55; }
.side-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.side-stat { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 24px; font-weight: 700; line-height: 1.15; }
.side-body { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.side-src { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--ink-3); }
.side-src a { color: inherit; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel.grow { flex: 999 1 560px; }
.panel.side-panel { flex: 1 1 320px; }
.panel.col3 { flex: 1 1 340px; }
.panel.debate { padding: 28px; }

/* Bar chart */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.bar-label { flex: 0 0 210px; font-size: 14px; font-weight: 500; }
.bar-track-wrap { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-track { flex: 1 1 auto; height: 24px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; background: #B9A27A; border-radius: 4px; min-width: 2%; }
.bar.dc { background: var(--accent); }
.bar-val { flex: 0 0 64px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tables */
.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; }
.noise thead th { padding: 8px 6px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-weight: 600; }
.noise tbody th, .noise td { padding: 9px 6px; border-bottom: 1px solid var(--line-soft); }
.noise tbody th { font-weight: 500; }
.noise tr.hi th { font-weight: 700; color: var(--ink); }
.noise tr.hi { background: var(--bronze-soft); }
.table-box { border: 1px solid var(--line-soft); border-radius: 8px; }
.tracker { min-width: 920px; }
.tracker thead tr { background: var(--bg); color: var(--ink-3); }
.tracker thead th { padding: 10px 12px; font-weight: 600; }
.tracker tbody th, .tracker td { padding: 11px 12px; border-top: 1px solid var(--line-soft); }
.tracker tbody th { font-weight: 600; }

/* Lists */
.list-item { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.flex-between { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.item-title { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); text-decoration: none; }
a.item-title:hover { color: var(--bronze); }
.tag { flex: 0 0 auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--side-bg); color: var(--ink-2); border: 1px solid var(--line); }
.event { flex-direction: row; align-items: center; gap: 14px; }
.date-chip { flex: 0 0 56px; height: 56px; border-radius: 8px; background: var(--bronze-soft); color: #6B4500; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.date-chip span { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.date-chip b { font-size: 20px; line-height: 1; }

/* Tracker tiles and status pills */
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 150px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile b { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 26px; }
.tile span:last-child { font-size: 13px; color: var(--ink-3); }
.dot { width: 10px; height: 10px; border-radius: 999px; }
.s-operating { background: #2E6B3F; } .s-building { background: #8A5A00; } .s-proposed { background: #5B3A8C; } .s-stopped { background: #1F2328; } .s-closed { background: #9AA0A6; }
.pill { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.p-operating { background: #E1EEE3; color: #245533; }
.p-building { background: #F3EBDD; color: #6B4500; }
.p-proposed { background: #ECE6F4; color: #4A2F75; }
.p-stopped { background: #1F2328; color: #FFFFFF; }
.p-closed { background: #E6E7E8; color: #3D4248; }

/* Opinion */
.op-tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #FFFFFF; }
.op-title { font-size: 18px; font-weight: 600; line-height: 1.35; text-decoration: none; color: var(--ink); }
.op-title:hover { color: var(--bronze); }

/* Footer */
.site-footer { background: var(--ink); color: #DADBD8; }
.footer-row { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; padding-top: 36px; padding-bottom: 36px; }
.footer-text { flex: 1 1 360px; }
.footer-text p { font-size: 14px; line-height: 1.6; }
.footer-title { font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; font-size: 18px; color: #FFFFFF; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 14px; }
.footer-nav a { color: #DADBD8; padding: 10px 0; }
.footer-nav a:hover { color: #FFFFFF; }

/* Facts page */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 600; }
.jump a:hover { border-color: var(--bronze); color: var(--ink); }
.topic { scroll-margin-top: 16px; }
.context { font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 820px; }
.figures { display: flex; flex-wrap: wrap; gap: 12px; }
.figure { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.figure b { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 26px; line-height: 1.15; }
.figure span { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.uncertain { font-size: 14px; line-height: 1.55; color: var(--ink-2); padding: 12px 14px; background: var(--bg); border-radius: 8px; }
.claims { display: flex; flex-wrap: wrap; gap: 16px; }
.claim { flex: 1 1 300px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.claim-text { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 18px; font-weight: 600; line-height: 1.35; }
.claim p:last-child { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.verdict { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.v-depends { background: #E6E7E8; color: #2B3440; }
.v-contested { background: #F3EBDD; color: #6B4500; }
.v-partly { background: #E1EEE3; color: #245533; }

/* Source-type labels (no red or blue) */
.src-tag { display: inline-block; vertical-align: 1px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1; padding: 4px 7px; border-radius: 4px; color: #FFFFFF; white-space: nowrap; }
.t-gov { background: #5B3A8C; }   /* purple */
.t-acad { background: #2E6B3F; }  /* green */
.t-ind { background: #8A5A00; }   /* bronze */
.t-adv { background: #1F2328; }   /* black */
.t-news { background: #6B7178; }  /* gray */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.legend-title { font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* Slogan beside the logo */
.brand-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.slogan { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 16px; font-weight: 600; color: var(--bronze); padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.3; }
@media (max-width: 600px) { .slogan { font-size: 14px; border-left: 0; padding-left: 0; flex-basis: 100%; } }

/* Sources & methodology page */
.standards { margin: 0; padding: 0; list-style: none; counter-reset: std; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.standards li { counter-increment: std; position: relative; padding: 16px 16px 16px 60px; background: var(--side-bg); border-radius: 8px; }
.standards li::before { content: counter(std); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.standards h3 { font-size: 17px; margin-bottom: 4px; }
.standards p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.types { display: flex; flex-direction: column; gap: 12px; }
.type-row { display: flex; gap: 14px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.type-row .src-tag { flex: 0 0 104px; text-align: center; }
.type-row p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
@media (max-width: 600px) { .type-row { flex-direction: column; gap: 6px; } .type-row .src-tag { flex-basis: auto; } }
.steps, .plain-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 900px; }
.biblio-group { margin-top: 8px; }
.biblio { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.biblio li { font-size: 14px; line-height: 1.6; padding-left: 28px; text-indent: -28px; }
.biblio .used { display: block; text-indent: 0; font-size: 13px; color: var(--ink-3); }

/* Standards strip near the top of content pages */
.standards-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--bronze); border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.standards-strip b { color: var(--ink); }

/* About page */
.narrow { max-width: 860px; }
.letter { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 32px; display: flex; flex-direction: column; gap: 16px; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.letter p:nth-child(3) { font-weight: 600; color: var(--ink); }
.signature { display: flex; flex-direction: column; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.sig-name { font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); }
.sig-title { font-size: 14px; color: var(--ink-3); }
@media (max-width: 600px) { .letter { padding: 22px; font-size: 17px; } }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row .field { flex: 1 1 260px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.optional { font-weight: 400; color: var(--ink-3); }
.field input, .field textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid #BFC1BC; border-radius: 6px; padding: 10px 12px; min-height: 44px; width: 100%; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--bronze); outline-offset: 1px; border-color: var(--bronze); }
.word-count { font-size: 13px; color: var(--ink-3); align-self: flex-end; }
.word-count.over { color: var(--ink); font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.form-status { font-size: 14px; color: var(--ink-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Founder note on home page */
.founder-note { display: flex; flex-direction: column; gap: 10px; }
.founder-note blockquote { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.founder-note .sig { font-size: 14px; color: var(--ink-3); }

/* Tracker page */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.filters .field { flex: 1 1 200px; }
.filters .field:first-child { flex-basis: 280px; }
.filters select, .filters input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid #BFC1BC; border-radius: 6px; padding: 10px 12px; min-height: 44px; width: 100%; }
.filters #count { flex: 1 1 100%; }
.tracker-full { min-width: 1240px; }
.tracker td, .tracker tbody th { vertical-align: top; }
.sort { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.sort::after { content: " ↕"; color: var(--ink-3); font-weight: 400; }
.sort[aria-sort="ascending"]::after { content: " ↑"; color: var(--ink); }
.sort[aria-sort="descending"]::after { content: " ↓"; color: var(--ink); }
.row-name { display: block; }
.row-note { display: block; font-weight: 400; margin-top: 4px; max-width: 260px; }
.row-sources { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 220px; }
.nd { color: var(--ink-3); }
.pending { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; border: 1px dashed var(--ink-3); color: var(--ink-2); white-space: nowrap; }

/* Tracker detail levels and paging */
.t-comm { background: #4F5B1E; }  /* olive: community-built data */
.count-line { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 18px; font-weight: 600; color: var(--ink); }
.detail-badge { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.detail-badge .dots { color: var(--bronze); letter-spacing: 1px; font-size: 11px; }
.pager { display: flex; justify-content: center; }
.steps ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }

/* Tracker map */
.dc-map { width: 100%; height: 560px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #EEF0EC; }
@media (max-width: 700px) { .dc-map { height: 70vh; } }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 12px; height: 12px; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); display: inline-block; }
.maplibregl-popup-content { font-family: Inter, system-ui, sans-serif; padding: 14px 16px; border-radius: 8px; max-width: 300px; }
.pop { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pop h3 { font-size: 16px; color: var(--ink); line-height: 1.3; padding-right: 14px; }
.pop dl { display: grid; grid-template-columns: 78px 1fr; gap: 3px 8px; margin: 0; }
.pop dt { color: var(--ink-3); }
.pop dd { margin: 0; color: var(--ink); }
.pop .pop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pop button { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* First-visit welcome note */
.welcome { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--bronze); border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 22, 25, 0.18); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 8px; transform: translateY(16px); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.welcome.in { transform: translateY(0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .welcome { transition: none; } }
@media (max-width: 600px) { .welcome { right: 16px; left: 16px; bottom: 16px; width: auto; } }
.welcome-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bronze); padding-right: 36px; }
.welcome blockquote { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink); }
.welcome-sig { font-size: 13px; color: var(--ink-3); }
.welcome-close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 6px; color: var(--ink-3); cursor: pointer; }
.welcome-close:hover { color: var(--ink); background: var(--side-bg); }
