/* ============================================================
   style.css — MASTER STYLESHEET
   Notebook yellow theme · Playfair Display
   To retheme: change :root variables only
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           #f0f0ee;   /* cool light grey — neutral, no yellow */
  --text:         #1a1a1a;   /* near-black with slight blue — reads crisply on stone */
  --muted:        #6b6b72;   /* cool grey-purple — pairs with near-black text */
  --border:       rgba(90,85,104,0.18);
  --card-bg:      rgba(255,255,255,0.72);
  --operating:    #3d7a5e;   /* cool forest green */
  --construction: #c08b3a;   /* brighter amber — more distinct from green */
  --proposed:     #4a6fa5;   /* slightly lighter navy — more legible */
  --risk:         #a63d2f;   /* standard danger red */
  --win:          #3d7a5e;   /* matches operating green */
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html  { scroll-behavior: smooth; font-size: 18px; }
body  {
  background: var(--bg);
  color: var(--text);
  font-family: 'Bitter', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: 'Bitter', serif; font-weight: 400; line-height: 1.1; }

/* ── SHARED UTILITIES ──────────────────────────────────────── */
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-style: italic;
  color: var(--muted);
  display: block;
}

.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-style: italic;
  margin: 64px 0 36px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Pills */
.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-family: 'Bitter', serif;
  font-style: italic;
}
.pill-op   { background: var(--operating);    color: #f0f0ee; }
.pill-con  { background: var(--construction); color: #f0f0ee; }
.pill-pro  { background: var(--proposed);     color: #f0f0ee; }
.pill-risk { background: rgba(139,32,32,0.1); color: var(--risk); border: 1px solid rgba(139,32,32,0.25); }
.pill-win  { background: rgba(26,92,42,0.1);  color: var(--win);  border: 1px solid rgba(26,92,42,0.25); }
.pill-gray { background: rgba(144,152,160,0.1); color: var(--muted); border: 1px solid var(--border); }

/* ============================================================
   PAGE 1 — TITLE
   ============================================================ */
#title-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px 24px;
}

.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(90,85,104,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90,85,104,0.12) 1px, transparent 1px);
  background-size: 48px 48px;
}

.main-title {
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 1.05;
  text-align: center;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.9s ease 0.4s forwards;
}
.main-title span { display: block; color: var(--operating); }

.subtitle {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-style: italic;
  color: var(--muted);
  max-width: 520px;
  text-align: center;
  line-height: 1.75;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.7s forwards;
}

.scroll-cue {
  position: absolute;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 1s ease 1.1s forwards;
}
.scroll-cue span {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: italic;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out 1.5s infinite;
}

/* ============================================================
   PAGE 2 — SCROLLY MAP
   ============================================================ */
#scroll-container { position: relative; }

.sticky-scene {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}

#map-canvas { width: 86%; height: 86%; display: block; }

.trigger-block { height: 100vh; }

/* Stat counters */
.stat-overlay {
  position: absolute;
  font-family: 'Bitter', serif;
  pointer-events: none;
  transition: opacity 0.6s ease;
  opacity: 0;
}
/* FIX: stats sit just outside the map bottom edge, never over the US outline */
#stat-operating    { bottom: 12px; left: 36px;  text-align: left; }
#stat-construction { bottom: 12px; left: 50%;   transform: translateX(-50%); text-align: center; }
#stat-proposed     { bottom: 12px; right: 36px; text-align: right; }

.stat-number {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  line-height: 1;
}
.stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-style: italic;
  margin-top: 4px;
  display: block;
}
#stat-operating    .stat-number, #stat-operating    .stat-label { color: var(--operating); }
#stat-construction .stat-number, #stat-construction .stat-label { color: var(--construction); }
#stat-proposed     .stat-number, #stat-proposed     .stat-label { color: var(--proposed); }

/* Legend */
#legend {
  position: absolute; top: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; transition: opacity 0.6s ease;
}
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: italic;
  color: var(--muted);
  opacity: 0; transition: opacity 0.5s ease;
}
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Narrative panels */
.narrative {
  position: absolute;
  top: 62%;
  right: 32px;
  left: auto;
  transform: translateY(-50%) translateX(20px);
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  text-align: left;
}
.narrative.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.narrative-tag {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-style: italic;
  margin-bottom: 12px;
  display: block;
}
.narrative h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1.1;
  margin-bottom: 14px;
}
.narrative p {
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  line-height: 1.8;
  color: var(--muted);
}

/* ============================================================
   PAGES 3 & 4 — STORY PAGES
   ============================================================ */
.story-page {
  background: var(--bg);
  padding: 80px 0 100px;
  border-top: 1px solid var(--border);
}

.page-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.page-header {
  margin-bottom: 56px;
}
.page-header .eyebrow { margin-bottom: 20px; }

.page-title {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  color: var(--text);
  margin-bottom: 20px;
}

.page-intro {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.85;
  color: var(--muted);
  font-style: italic;
}

.page-footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.page-footer p {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ── TABS ──────────────────────────────────────────────────── */
.tab-row { display: flex; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }

.tab-btn {
  padding: 9px 22px;
  font-family: 'Bitter', serif;
  font-size: 0.9rem;
  font-style: italic;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover  { background: rgba(144,152,160,0.12); color: var(--text); }
.tab-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── RANKINGS + STATE MAP ──────────────────────────────────── */
.rankings-layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 540px);
  gap: 40px;
  align-items: start;
  margin-bottom: 20px;
}

.rankings-bars { display: flex; flex-direction: column; gap: 6px; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.rank-row:hover { background: rgba(26,26,26,0.06); }

.rank-state {
  font-family: 'Bitter', serif;
  font-size: 0.95rem;
  color: var(--text);
  width: 32px;
  flex-shrink: 0;
}

.rank-track {
  flex: 1;
  height: 22px;
  background: rgba(144,152,160,0.1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.rank-fill { height: 100%; position: absolute; top: 0; }
.rank-fill.op  { background: var(--operating);    opacity: 0.85; }
.rank-fill.con { background: var(--construction); opacity: 0.85; }
.rank-fill.pro { background: var(--proposed);     opacity: 0.8; }

.rank-num {
  font-size: 0.9rem;
  color: var(--muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* State map panel */
.state-map-panel { position: sticky; top: 24px; }

#map-state-header { margin-bottom: 14px; }

#state-map-container {
  overflow: hidden;
  background: transparent;
}

.map-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
}
.map-legend span { display: flex; align-items: center; gap: 6px; }

.ldot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.map-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
  opacity: 0.8;
}

/* ── COMPANY CARDS ─────────────────────────────────────────── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.company-card {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.company-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.company-name  {
  font-family: 'Bitter', serif;
  font-size: 1.1rem;
  color: var(--text);
}
.company-total { font-size: 0.8rem; color: var(--muted); font-style: italic; }

.company-bars  { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.sbar-row { display: flex; align-items: center; gap: 10px; }
.sbar-label { width: 60px; font-style: italic; font-size: 0.8rem; flex-shrink: 0; }
.sbar-label.op  { color: var(--operating); }
.sbar-label.con { color: var(--construction); }
.sbar-label.pro { color: var(--proposed); }

.sbar-track { flex: 1; height: 7px; background: rgba(144,152,160,0.15); border-radius: 4px; overflow: hidden; }
.sbar-fill  { height: 100%; border-radius: 4px; }
.sbar-fill.op  { background: var(--operating); }
.sbar-fill.con { background: var(--construction); }
.sbar-fill.pro { background: var(--proposed); }

.sbar-num { font-size: 0.8rem; color: var(--muted); width: 24px; text-align: right; }

.company-note {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── SIZE BREAKDOWN ────────────────────────────────────────── */
.size-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.size-row { display: flex; align-items: center; gap: 16px; font-size: 0.95rem; }
.size-label { width: 240px; font-size: 0.9rem; color: var(--text); flex-shrink: 0; }
.size-label span { color: var(--muted); }
.size-track { flex: 1; height: 9px; background: rgba(144,152,160,0.1); border-radius: 5px; overflow: hidden; }
.size-fill  { height: 100%; border-radius: 5px; }
.size-num   { width: 40px; text-align: right; color: var(--text); font-size: 0.85rem; }
.size-note  { font-size: 0.82rem; color: var(--muted); font-style: italic; }

/* ── DATA GAP BARS ─────────────────────────────────────────── */
.gap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }

.gap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}
.gap-row:last-child { border-bottom: none; }
.gap-label { color: var(--text); }
.gap-right { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.gap-bar   { width: 90px; height: 6px; background: rgba(144,152,160,0.12); border-radius: 3px; overflow: hidden; }
.gap-fill  { height: 100%; border-radius: 3px; background: var(--risk); opacity: 0.65; }

/* ── WATER RISK CARDS ──────────────────────────────────────── */
.water-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.water-card { padding: 24px; border-radius: 6px; border: 1px solid; }
.water-card.extreme { background: rgba(139,32,32,0.05); border-color: rgba(139,32,32,0.28); }
.water-card.high    { background: rgba(184,134,11,0.05); border-color: rgba(184,134,11,0.28); }

.water-abbr  {
  font-family: 'Bitter', serif;
  font-size: 2rem;
  color: var(--text);
  line-height: 1;
}
.water-name  { font-size: 0.8rem; color: var(--muted); font-style: italic; margin-bottom: 16px; }
.water-score {
  font-family: 'Bitter', serif;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 4px;
}
.water-card.extreme .water-score { color: var(--risk); }
.water-card.high    .water-score { color: #7a4400; }

.water-cat {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.water-stat { font-size: 0.95rem; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.water-note { font-size: 0.86rem; color: var(--muted); font-style: italic; line-height: 1.6; }

/* ── STORY CARDS ───────────────────────────────────────────── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.story-card {
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  /* Equal height cards so source links all sit at the same baseline */
  height: 100%;
  box-sizing: border-box;
}

/* Hover: pop the hovered card, dim the others */
.story-grid:hover .story-card {
  opacity: 0.5;
}
.story-grid:hover .story-card:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  border-color: rgba(144,152,160,0.45);
}

.story-card.won {
  background: rgba(61,122,94,0.10);
  border: 1.5px solid rgba(61,122,94,0.45);
  border-top: 4px solid var(--operating);
  position: relative;
}
.story-card.won::after {
  content: 'Community Won';
  position: absolute;
  top: -1px;
  right: 16px;
  background: var(--risk);
  color: #fff;
  font-family: 'Bitter', serif;
  font-size: 0.65rem;
  font-style: italic;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 0 0 4px 4px;
}
.story-card.won:hover {
  border-color: rgba(160,61,47,0.55);
  box-shadow: 0 8px 24px rgba(160,61,47,0.12);
}

.story-location {
  font-family: 'Bitter', serif;
  font-size: 1.0rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-project {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: italic;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--muted);
  flex: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .water-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .page-inner { padding: 0 24px; }

  .rankings-layout {
    grid-template-columns: 1fr;
  }
  .state-map-panel { position: static; }

  .company-grid { grid-template-columns: 1fr; }
  .story-grid   { grid-template-columns: 1fr; }
  .water-grid   { grid-template-columns: 1fr; }

  .gap-grid     { grid-template-columns: 1fr; }

  .size-label   { width: 180px; }

  .narrative    { left: 20px; max-width: 260px; }

  #stat-operating    { left: 16px; }
  #stat-proposed     { right: 16px; }
}

@media (max-width: 540px) {
  .page-inner  { padding: 0 16px; }
  .story-page  { padding: 48px 0 64px; }
  .tab-btn     { padding: 8px 14px; font-size: 0.82rem; }
  .size-label  { width: 140px; font-size: 0.82rem; }
  .gap-bar     { width: 60px; }
}

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
@keyframes dotFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 0.9; }
}

/* ============================================================
   COMPANY SCROLLY SECTION (page 3)
   ============================================================ */

.company-scroll-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  align-items: start;
  margin-bottom: 48px;
  min-height: 80vh;
}

/* Left sticky panel — big number */
.company-sticky {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.company-sticky-inner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 28px;
  transition: border-color 0.4s ease;
}

.csn-label {
  font-family: 'Bitter', serif;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.csn-number {
  font-family: 'Bitter', serif;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.csn-sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 20px;
}

/* Mini status bars inside sticky panel */
.csn-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.csn-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.csn-bar-label {
  width: 62px;
  font-style: italic;
  flex-shrink: 0;
}
.csn-bar-label.op  { color: var(--operating); }
.csn-bar-label.con { color: var(--construction); }
.csn-bar-label.pro { color: var(--proposed); }

.csn-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(144,152,160,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.csn-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 0.8s ease;
}
.csn-bar-fill.op  { background: var(--operating); }
.csn-bar-fill.con { background: var(--construction); }
.csn-bar-fill.pro { background: var(--proposed); }

.csn-bar-num {
  font-size: 0.78rem;
  color: var(--muted);
  width: 24px;
  text-align: right;
}

.csn-note {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  min-height: 60px;
  transition: opacity 0.3s ease;
}

/* Right scrollable cards */
.company-cards-scroll {
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.company-chapter {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0.35;
  transition: opacity 0.4s ease;
}
.company-chapter:first-child { padding-top: 0; }
.company-chapter:last-child  { border-bottom: none; }
.company-chapter.active      { opacity: 1; }

.cc-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 10px;
}

.cc-name {
  font-family: 'Bitter', serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  color: var(--text);
  margin-bottom: 16px;
}

.cc-body {
  font-size: clamp(1.05rem, 1.3vw, 1.12rem);
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 560px;
}

.cc-stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-stat {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-style: italic;
}
.cc-stat.op  { background: rgba(45,106,31,0.1);  color: var(--operating);    border: 1px solid rgba(45,106,31,0.25); }
.cc-stat.con { background: rgba(154,107,0,0.1);  color: var(--construction); border: 1px solid rgba(154,107,0,0.25); }
.cc-stat.pro { background: rgba(26,74,138,0.1);  color: var(--proposed);     border: 1px solid rgba(26,74,138,0.25); }

/* Responsive */
@media (max-width: 860px) {
  .company-scroll-wrap {
    grid-template-columns: 1fr;
  }
  .company-sticky {
    position: static;
    margin-bottom: 24px;
  }
  .company-cards-scroll {
    padding-left: 0;
  }
}

/* ============================================================
   PAGE 4 — COMMUNITY IMPACT STATS + APPENDIX
   ============================================================ */

.impact-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.impact-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 20px;
  text-align: center;
}

.impact-stat-num {
  font-family: 'Bitter', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.impact-stat-label {
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

/* Story grid — 3 cols, last card (community won) gets accent */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* Appendix note */
.appendix-note {
  background: rgba(139,119,80,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 28px;
}

.appendix-note p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 10px;
}
.appendix-note p:last-child { margin-bottom: 0; }
.appendix-note strong { color: var(--text); font-weight: 400; font-style: italic; }
.appendix-note code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: rgba(144,152,160,0.12);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

/* Responsive */
@media (max-width: 860px) {
  .impact-stats { grid-template-columns: repeat(2, 1fr); }
  .story-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .impact-stats { grid-template-columns: 1fr 1fr; }
  .story-grid   { grid-template-columns: 1fr; }
}

/* ============================================================
   COMMUNITY IMPACT PAGE — STATS + SOURCE LINKS + APPENDIX
   ============================================================ */

.impact-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.impact-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 20px;
  text-align: center;
}

.impact-stat-num {
  font-family: 'Bitter', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.impact-stat-label {
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

/* Source links row at bottom of each story card */
.story-sources {
  display: flex;
  flex-wrap: nowrap;        /* one line only */
  align-items: center;
  gap: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.story-sources a {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  font-style: italic;
  font-family: 'Bitter', serif;
  white-space: nowrap;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.story-sources a::after {
  content: ' ↗';
  font-size: 0.65rem;
  font-style: normal;
  opacity: 0.6;
}

.story-sources a:hover {
  color: var(--text);
}

/* Dot separator between links — all on one line */
.story-sources a + a::before {
  content: ' · ';
  color: var(--muted);
  font-style: normal;
  opacity: 0.5;
}

/* Appendix note */
.appendix-note {
  background: rgba(139,119,80,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 28px;
}

.appendix-note p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 10px;
}
.appendix-note p:last-child { margin-bottom: 0; }
.appendix-note strong { color: var(--text); font-weight: 400; font-style: italic; }
.appendix-note code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  background: rgba(144,152,160,0.12);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

/* Responsive */
@media (max-width: 860px) {
  .impact-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .impact-stats { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   PAGE 5 — COUNTY HEAT MAP
   ============================================================ */

/* Story text block below heat map */
.county-story-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 16px;
}

.county-story-headline {
  font-family: 'Bitter', serif;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 400;
  line-height: 1.3;
}

.county-story-body {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--muted);
}

/* Finding cards — 3 column */
.county-findings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 20px;
  margin-bottom: 16px;
}

.finding-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

.finding-num {
  font-family: 'Bitter', serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.finding-label {
  font-size: 0.82rem;
  color: var(--operating);
  font-style: italic;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.finding-body {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
}

/* Download section */
.download-block { margin-bottom: 16px; }

.download-intro {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 20px;
}

.download-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

.download-option {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-opt-title {
  font-family: 'Bitter', serif;
  font-size: 0.95rem;
  color: var(--text);
}

.download-opt-body {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted);
  flex: 1;
}

.dl-btn {
  display: inline-block;
  padding: 8px 16px;
  font-family: 'Bitter', serif;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--operating);
  border: 1px solid rgba(45,106,31,0.35);
  border-radius: 3px;
  background: rgba(45,106,31,0.06);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s;
  margin-top: auto;
}
.dl-btn:hover { background: rgba(45,106,31,0.14); }

/* Responsive */
@media (max-width: 860px) {
  .county-findings  { grid-template-columns: 1fr; }
  .download-options { grid-template-columns: 1fr; }
}