/* ════════════════════════════════════════════════════════════════════
   GOES Hurricane Story — stylesheet
   Ocean/climate data-journalism theme.
   ════════════════════════════════════════════════════════════════════ */

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

:root {
  /* palette */
  --bg:          #f4f8fa;
  --bg-soft:     #eaf1f5;
  --bg-deep:     #061620;   /* hero / dark sections */
  --bg-deep-2:   #0a2433;
  --card:        #ffffff;
  --ink:         #0c1f2a;   /* primary text */
  --ink-soft:    #33505f;
  --muted:       #6b8090;
  --line:        #dce6ec;
  --line-soft:   #eef4f7;

  /* accents */
  --ocean:       #0ea5e9;
  --ocean-deep:  #0369a1;
  --ocean-darker:#0c4a6e;
  --heat:        #ef4444;
  --heat-warm:   #f97316;

  /* viz 1 series (preserved) */
  --hist:   #2563eb;
  --ssp126: #16a34a;
  --ssp245: #d97706;
  --ssp585: #dc2626;

  --maxw: 1200px;
  --prose: 720px;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
em { font-style: italic; }
strong { font-weight: 600; }

/* ─────────────────────────── STORY INTRO (NEW) ───────────────────── */
#story-intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-deep);
  color: #f4fbff;
  overflow: hidden;
  height: 100vh;
}
body.story-locked {
  overflow: hidden;
}
.story-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.9s ease, filter 0.9s ease;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(14,165,233,0.22), transparent 58%),
    radial-gradient(100% 80% at 12% 100%, rgba(8,47,73,0.62), transparent 62%),
    linear-gradient(160deg, #061620 0%, #0a2a3d 58%, #0d3b54 100%);
}
.story-bg::after {
  content: "";
  position: absolute;
  inset: -24%;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 56px);
  opacity: 0.42;
  animation: drift 34s linear infinite;
}
.story-bg::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(76vw, 720px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.8);
  border-radius: 50%;
  border: 2px solid rgba(251, 146, 60, 0);
  opacity: 0;
  pointer-events: none;
}
.story-stage {
  position: relative;
  width: 100%;
  height: 100%;
}
.story-screen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  padding: clamp(2.5rem, 7vh, 6rem) 6vw clamp(1.25rem, 3.5vh, 2.5rem);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(18px) scale(1.01);
  transition: opacity 0.72s ease, transform 0.72s ease;
  pointer-events: none;
}
.story-screen.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.story-inner {
  width: min(1120px, 100%);
  text-align: center;
  display: grid;
  gap: clamp(0.6rem, 2vh, 1rem);
  align-content: center;
  align-self: center;
  min-height: 0;
}
.story-beat {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.2vw + 1.4vh, 2.9rem);
  line-height: 1.2;
  color: #f4fbff;
  width: 100%;
  max-width: min(26ch, 92vw);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition:
    opacity 0.8s ease,
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.8s ease;
}
.story-beat.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.story-punchline {
  transform: translateY(20px) scale(0.94);
}
.story-punchline.is-visible {
  transform: translateY(0) scale(1);
}
.story-punchline strong {
  font-weight: 700;
  transition: text-shadow 0.9s ease;
}
.story-punchline.is-visible strong {
  text-shadow: 0 0 12px rgba(251, 146, 60, 0.46);
}
.story-heat { color: #fb923c; font-weight: 700; }
.story-ocean { color: #7dd3fc; font-weight: 700; }
.story-air { color: #d8e6ef; }
.story-impact { color: #fcd34d; font-weight: 700; }
.story-thesis { color: #fef3c7; font-weight: 700; }
.story-silent {
  display: inline-block;
  background-image: linear-gradient(100deg, #7dd3fc 0%, #f4fbff 30%, #fb923c 60%, #f97316 100%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  background-position: 0 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#story-intro.is-punchline-ocean .story-silent {
  animation: heatIgnite 1.6s ease forwards, heatPulse 2.4s ease 0.6s 2;
}
.story-thesis {
  display: inline-block;
  background-image: linear-gradient(100deg, #fef3c7 0%, #fde68a 35%, #fff7cf 50%, #facc15 70%, #fef3c7 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#story-intro.is-punchline-thesis .story-thesis {
  animation: thesisSweep 1.6s ease forwards;
}
#story-intro.is-punchline-ocean .story-bg {
  transform: scale(1.015);
  filter: saturate(1.08);
}
#story-intro.is-punchline-ocean .story-bg::before {
  animation: sonarPulse 1.8s ease-out forwards;
}
#story-intro.is-punchline-thesis .story-bg::after {
  animation-duration: 15s;
}
#story-intro.is-punchline-thesis .story-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255, 240, 175, 0.12), rgba(255, 240, 175, 0) 66%);
  opacity: 0;
  animation: thesisFlash 0.7s ease;
  pointer-events: none;
}
.story-footer {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
  padding: 1rem 0 max(1.6rem, env(safe-area-inset-bottom, 0px));
}
.story-progress {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fd4ee;
}
.story-next-btn,
.story-enter-btn {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #062538;
  background: linear-gradient(120deg, #d9f0fb 0%, #9fdff8 100%);
  border: 1px solid rgba(159,223,248,0.9);
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(3,105,161,0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.2s ease;
  pointer-events: none;
}
.story-next-btn.is-visible,
.story-enter-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: buttonPulse 1.2s ease;
}
.story-next-btn:hover,
.story-enter-btn:hover { box-shadow: 0 14px 30px rgba(3,105,161,0.35); }
.story-next-btn:focus-visible,
.story-enter-btn:focus-visible { outline: 2px solid #9fdff8; outline-offset: 2px; }
#story-intro.is-transitioning .story-screen.is-active {
  opacity: 0;
  transform: translateY(-10px);
}
#story-intro.is-exiting {
  opacity: 0;
  transform: translateY(-4vh);
  transition: opacity 0.52s ease, transform 0.52s ease;
  pointer-events: none;
}
.story-transition {
  font-size: 0.98rem;
  color: var(--ocean-darker);
  margin-bottom: 0.75rem;
  font-weight: 600;
  max-width: 56ch;
}

/* ─────────────────────────── HERO / HOOK ─────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 8vw;
  color: #eaf6ff;
  overflow: hidden;
  background: var(--bg-deep);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(14,165,233,0.28), transparent 55%),
    radial-gradient(90% 70% at 10% 100%, rgba(8,47,73,0.65), transparent 60%),
    linear-gradient(160deg, #061620 0%, #0a2a3d 55%, #0d3b54 100%);
}
.hero-bg::after {
  /* faint moving "current" lines */
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 46px);
  opacity: 0.5;
  animation: drift 28s linear infinite;
}
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(46px); } }

.hero-inner { position: relative; max-width: 880px; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: #7fd2f4; font-weight: 600; margin-bottom: 1.4rem;
}
#hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 1.04;
  max-width: 18ch;
  margin-bottom: 1.6rem;
  color: #f4fbff;
}
.hero-lede {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.7;
  max-width: 56ch;
  color: #bfe0f2;
  margin-bottom: 3rem;
  font-family: var(--serif);
}
.scroll-hint {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #9fd4ee; display: flex; align-items: center; gap: 0.55rem;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge { 0%,100% { transform: translateY(0);} 50% { transform: translateY(5px);} }
@keyframes sonarPulse {
  0% {
    opacity: 0.45;
    border-color: rgba(251, 146, 60, 0.4);
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    border-color: rgba(251, 146, 60, 0);
    transform: translate(-50%, -50%) scale(1.18);
  }
}
@keyframes thesisFlash {
  0% { opacity: 0.42; }
  100% { opacity: 0; }
}
@keyframes thesisSweep {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes heatIgnite {
  0% { background-position: 0 50%; }
  100% { background-position: 100% 50%; }
}
@keyframes heatPulse {
  0%, 100% {
    text-shadow: 0 0 0 rgba(249, 115, 22, 0);
    transform: scale(1);
  }
  45% {
    text-shadow: 0 0 18px rgba(249, 115, 22, 0.55);
    transform: scale(1.03);
  }
}
@keyframes buttonPulse {
  0% { transform: translateY(4px) scale(0.97); }
  45% { transform: translateY(0) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

/* ─────────────────────────── PROSE SECTIONS ──────────────────────── */
.prose {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 12vh 6vw;
}
.prose h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  margin-bottom: 1.4rem;
}
.prose p {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 1.3rem;
  font-family: var(--serif);
}
.kicker {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ocean-deep); font-weight: 600; margin-bottom: 0.9rem;
}
.kicker.light { color: var(--ocean); }

/* ─────────────────────────── BEAT SECTIONS (A-B-T) ───────────────── */
.beat {
  padding: 16vh 8vw;
  display: flex;
  justify-content: center;
}
.beat-inner { max-width: 900px; text-align: center; }
.beat-tag {
  display: inline-block;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
  padding: 0.35rem 0.85rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.beat-tag.inline { margin: 0 0.6rem 0 0; vertical-align: middle; }
.beat p {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.3; font-weight: 600;
}
.beat-but { background: linear-gradient(180deg, #0a2433 0%, #07303f 100%); }
.beat-but .beat-tag { background: rgba(249,115,22,0.2); color: #ffb877; }
.beat-but p { color: #eaf6ff; }

/* ─── "not" reveal animation inside .beat-but ─── */
.br-not {
  display: inline-block;
  vertical-align: baseline;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center center;
  will-change: transform, opacity;
  transition: opacity 0.35s ease,
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
/* "the whole story." starts shifted left by the measured width of "not ",
   making it appear adjacent to "are " before the animation fires */
.br-after {
  display: inline-block;
  vertical-align: baseline;
  transform: translateX(calc(-1 * var(--not-w, 0px)));
  will-change: transform;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.br-rest {
  opacity: 0;
  transition: opacity 0.85s ease;
}
#but-reveal.phase-not .br-not  { opacity: 1; transform: scaleX(1); }
#but-reveal.phase-not .br-after { transform: translateX(0); }
#but-reveal.phase-rest .br-rest { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .story-bg::after,
  .story-bg::before,
  .story-screen,
  .story-beat,
  .story-punchline,
  .story-next-btn,
  .story-enter-btn {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }
  .story-silent { background-position: 100% 50%; }
  .story-thesis { background-position: 0 50%; }
  #story-intro.is-exiting { opacity: 0; }
  .br-not  { opacity: 1; transform: none; transition: none; }
  .br-after { transform: none; transition: none; }
  .br-rest { opacity: 1; transition: none; }
}

/* ─────────────────────────── VIZ 1: SCROLLY (preserved IDs) ──────── */
#scrolly { display: flex; position: relative; background: var(--bg); overflow: visible; }

#sticky-graphic {
  position: sticky; top: 0; height: 100vh;
  width: 68%; display: flex; align-items: center; flex-shrink: 0;
  padding: 0 4vw; border-right: 1px solid var(--line);
  overflow: visible;
}
.back-to-story-btn {
  position: absolute; top: 1.25rem; left: 50%; z-index: 4;
  transform: translateX(-50%);
  font-family: var(--sans); font-size: 0.88rem; font-weight: 700;
  letter-spacing: 0.04em;
  color: #062538;
  background: linear-gradient(120deg, #d9f0fb 0%, #9fdff8 100%);
  border: 1px solid rgba(159,223,248,0.9); border-radius: 999px;
  padding: 0.55rem 1.15rem; cursor: pointer;
  box-shadow: 0 8px 20px rgba(3,105,161,0.22);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.back-to-story-btn:hover {
  background: linear-gradient(120deg, #e8f6fc 0%, #b8ecff 100%);
  box-shadow: 0 10px 24px rgba(3,105,161,0.28);
  transform: translateX(-50%) translateY(-1px);
}
.back-to-story-btn:focus-visible {
  outline: 2px solid var(--ocean); outline-offset: 2px;
}
#chart-wrap { width: 100%; }
#chart-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); margin-bottom: 0.25rem; }
#chart-subtitle { font-size: 12.5px; color: var(--muted); margin-bottom: 1.1rem; }
svg#main-chart { display: block; width: 100%; overflow: visible; }

/* ─── RED-IRIS HANDOFF (chart → AND) ─── */
#heat-iris { position: relative; height: 200vh; background: var(--bg); }
.iris-stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: grid; place-items: center; background: var(--bg);
}
.iris-veil {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 50% 50%, #ef4444 0%, #dc2626 45%, #7a1f06 100%);
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path;
}
.iris-content {
  position: relative; z-index: 2; max-width: 900px; padding: 0 8vw;
  text-align: center; color: #fff; opacity: 0; transform: translateY(20px);
  will-change: opacity, transform;
}
.iris-content .beat-tag { background: rgba(255, 255, 255, 0.18); color: #fff; }
.iris-content p {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.3; font-weight: 600; color: #ffe9d6;
}
.iris-content .beat-hot {
  color: #ffd9a0; font-weight: 700;
  text-shadow: 0 0 22px rgba(255, 200, 120, 0.5);
}
/* Static fallback: no JS / reduced motion / mobile — message ALWAYS visible */
@media (prefers-reduced-motion: reduce), (max-width: 880px) {
  #heat-iris { height: auto; }
  .iris-stage {
    position: static; height: auto; min-height: 70vh;
    background: #7a1f06; padding: 16vh 8vw;
  }
  .iris-veil { position: absolute; clip-path: circle(150% at 50% 50%); }
  .iris-content { opacity: 1; transform: none; }
}

#legend {
  display: flex; flex-wrap: wrap; gap: 0.7rem 1.4rem; margin-top: 1rem;
  font-size: 12px; color: var(--ink-soft); opacity: 0; transition: opacity 0.4s;
}
#legend.visible { opacity: 1; }
.legend-item { display: flex; align-items: center; gap: 0.45rem; }
.swatch { width: 20px; height: 3px; border-radius: 2px; }

.chart-source { font-size: 11px; color: var(--muted); margin-top: 1rem; line-height: 1.5; }

#steps { width: 32%; padding: 0 3vw 0 2.4vw; }
.step { padding: 46vh 0; display: flex; align-items: center; }
.step:first-child { padding-top: 22vh; }
.step:last-child  { padding-bottom: 30vh; }
.step-inner {
  max-width: 330px; opacity: 0.32; transform: translateY(12px);
  transition: opacity 0.45s, transform 0.45s;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 1px 2px rgba(12,31,42,0.04);
}
.step.is-active .step-inner { opacity: 1; transform: translateY(0); box-shadow: 0 10px 30px rgba(12,31,42,0.10); }
.step-label { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; font-weight: 600; }
.step-inner h3 { font-size: 1.3rem; margin-bottom: 0.5rem; line-height: 1.2; }
.step-inner p { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.65; font-family: var(--sans); }

/* ─────────────────────────── VIZ SECTIONS (2 & 3) ────────────────── */
.viz-section { max-width: var(--maxw); margin: 0 auto; padding: 10vh 5vw; }
.viz-section.centerpiece {
  max-width: none; padding: 12vh 5vw;
  background: linear-gradient(180deg, #07303f 0%, #06222e 100%);
  color: #eaf6ff;
}
.section-head { max-width: var(--prose); margin: 0 auto 2.6rem; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); margin-bottom: 1.1rem; }
.section-head p { font-size: 1.08rem; color: var(--ink-soft); font-family: var(--serif); }
.centerpiece .section-head p { color: #bfe0f2; }
.centerpiece .kicker { color: #7fd2f4; }

/* chart card */
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.6rem 1.3rem;
  box-shadow: 0 12px 40px rgba(12,31,42,0.08);
  max-width: 1500px; margin: 0 auto;
}
.chart-head { margin-bottom: 2rem; }
.chart-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.chart-sub { font-size: 12.5px; color: var(--muted); margin-top: 0.15rem; }



/* ── Viz 2: side by side season panels ── */

#viz2 {
  max-width: none;
  padding: 10vh 3vw;
}

#viz2 .chart-card {
  max-width: 1500px;
  padding: 1.6rem 1rem 1.3rem;
}

#viz2 #sst-map-wrap {
  margin-top: 1rem;
}



#sst-map-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.sst-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sst-panel-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocean-deep);
  padding: 0.3rem 0.5rem;
  border-left: 3px solid var(--ocean);
  background: rgba(14, 165, 233, 0.06);
  border-radius: 0 5px 5px 0;
}


.sst-panel svg {
  flex: 1;
  height: 100%;
  min-height: 0;
}

#sst-map-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
  overflow: hidden;
}

.sst-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;  /* ← add this */
}

@media (max-width: 680px) {
  #sst-map-wrap {
    grid-template-columns: 1fr;
  }
}

.season-toggles {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 0.85rem;
}
.season-btn {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.05s;
}
.season-btn:hover {
  background: #fff;
  border-color: var(--ocean);
  color: var(--ocean-deep);
}
.season-btn:active { transform: translateY(1px); }
.season-btn.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--ocean);
  color: var(--ocean-darker);
  font-weight: 600;
}
.season-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.season-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 0.55rem;
  line-height: 1.55;
  max-width: 52ch;
  margin-bottom: 1.5rem;
}
.season-note strong { color: var(--ink); font-weight: 600; }



.map-legend { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; font-size: 11.5px; color: var(--ink-soft); flex-wrap: wrap; }
.map-legend .legend-bar { height: 12px; border-radius: 3px; flex: 1; min-width: 160px; max-width: 320px; }
.map-legend .legend-tick { font-variant-numeric: tabular-nums; }

/* fallback block for missing artifacts */
.viz-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.5rem;
  min-height: 280px; padding: 2rem;
  border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); background: var(--bg-soft);
}
.centerpiece .viz-fallback { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.18); color: #bfe0f2; }
.viz-fallback strong { color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }
.centerpiece .viz-fallback strong { color: #eaf6ff; }

/* ─────────────────────────── VIZ 3: EXPLORER ─────────────────────── */
/* .explorer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  max-width: 1100px; margin: 0 auto;
  align-items: start;
} */

/* ── Viz 3: outer wrapper centers the whole explorer ── */
.explorer-wrapper {
  display: flex;
  justify-content: center;
  padding: 0 2vw;
}

/* ── Viz 3: three-column layout ── */
.explorer {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr) 280px;
  gap: 1.5rem;
  max-width: 1560px;
  width: 100%;
  align-items: start;
}

/* ── Left context panel ── */
.explorer-context-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(4px);
  position: sticky;
  top: 2rem;
}




.explorer-context-panel .panel-label {
  margin-bottom: 0.4rem;
}

.explorer-context-panel .context-panel-body {
  font-size: 0.85rem;
}

.context-layer-icon {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.context-layer-name {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.context-layer-desc {
  font-size: 0.83rem;
  line-height: 1.55;
}

.context-all-item {
  padding: 0.5rem 0.6rem;
}

.context-all-grid {
  gap: 0.45rem;
}









.context-panel-body {
  font-size: 0.92rem;
  color: #cfe6f4;
  line-height: 1.65;
}

.context-default p {
  color: #8fb9cf;
  font-style: italic;
  font-size: 0.88rem;
}

.context-layer-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.65rem;
  opacity: 0.85;
}

.context-layer-name {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--serif);
  color: #f4fbff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.context-layer-role {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  opacity: 0.7;
}

.context-layer-desc {
  display: block;
  font-size: 0.92rem;
  color: #cfe6f4;
  line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 1050px) {
  .explorer {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .explorer-context-panel {
    display: none;
  }
}
@media (max-width: 880px) {
  .explorer {
    grid-template-columns: 1fr;
  }
}

.context-all-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.context-all-item {
  padding: 0.7rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}



.explorer-stage {
  position: relative;
  background: #02131c;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
  min-width: 0;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.explorer-stage .layer-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: opacity 0.5s ease;
}
.explorer-stage svg.annot-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.explorer-stage .hover-capture { position: absolute; inset: 0; cursor: crosshair; }

/* 2x2 all-layers grid */
.stage-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: #000;
  z-index: 10;
}
.stage-cell {
  position: relative;
  overflow: hidden;
}
.stage-cell-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stage-cell-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.7);
  pointer-events: none;
}

.explorer-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 1.4rem 1.4rem;
  display: flex; flex-direction: column; gap: 1.4rem;
  backdrop-filter: blur(4px);
}
.panel-block { }
.panel-storm { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: #f4fbff; }
.panel-storm-sub { font-size: 12.5px; color: #9fd4ee; margin-top: 0.2rem; }
.panel-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #7fd2f4; font-weight: 600; margin-bottom: 0.7rem; }

.layer-toggles { display: flex; flex-direction: column; gap: 0.5rem; }

/* Individual layer toggle buttons */
.layer-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%; text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  padding: 0.6rem 0.8rem; border-radius: 10px;
  font-family: var(--sans); font-size: 0.92rem; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s, transform 0.05s;
}
.layer-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
}
.layer-btn:active { transform: translateY(1px); }
.layer-btn.active {
  border-color: var(--lb-accent, #7fd2f4);
  background: var(--lb-accent-dim, rgba(127,210,244,0.12));
  box-shadow: 0 0 0 1px var(--lb-accent, #7fd2f4) inset;
  color: #fff;
}

/* Name + sublabel stack */
.layer-btn .lb-text { display: flex; flex-direction: column; gap: 1px; }
.layer-btn .lb-name { font-size: 0.88rem; font-weight: 600; line-height: 1.2; }
.layer-btn .lb-sublabel {
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; opacity: 0.45; transition: opacity 0.15s;
}
.layer-btn.active .lb-sublabel { opacity: 0.7; }

/* On/Off pill */
.layer-btn .lb-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.layer-btn.active .lb-pill {
  background: var(--lb-accent, #7fd2f4);
  color: #000;
  border-color: transparent;
}

/* Divider between individual buttons and All layers */
.lb-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 2px 0;
}

/* All layers button — 2x2 color grid preview, purple accent */
.layer-btn--all {
  --lb-accent: #a78bfa; --lb-accent-dim: rgba(167,139,250,0.15);
  grid-template-columns: 18px 1fr auto;
}

.lb-all-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 18px; height: 18px;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.layer-btn--all.active .lb-all-grid { opacity: 1; }
.lb-all-grid span { display: block; }

#time-slider { width: 100%; accent-color: var(--ocean); cursor: pointer; }
.panel-time-readout { font-size: 12px; color: #9fd4ee; margin-top: 0.4rem; font-variant-numeric: tabular-nums; }

.panel-readout { margin-top: auto; }
.readout-body { font-size: 0.95rem; color: #cfe6f4; line-height: 1.6; }
.readout-body .readout-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: #f4fbff; display: block; margin-bottom: 0.2rem; }
.readout-body .readout-hint { color: #8fb9cf; font-size: 0.85rem; }

.explorer-caption { text-align: center; margin-top: 1.3rem; color: #8fb9cf; }
.centerpiece .chart-source { color: #8fb9cf; }

























/* ─────────────────────────── COMMUNITY IMPACT ────────────────────── */
.impact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin: 2rem 0 2.4rem;
}
.impact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.3rem 1.2rem; box-shadow: 0 4px 18px rgba(12,31,42,0.05);
}
.impact-icon { font-size: 1.6rem; margin-bottom: 0.6rem; }
.impact-card h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 0.4rem; }
.impact-card p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; font-family: var(--sans); margin: 0; }
.therefore-line { font-family: var(--serif); font-size: 1.2rem !important; color: var(--ink) !important; padding-top: 0.6rem; }
.therefore-line .beat-tag { background: rgba(14,165,233,0.14); color: var(--ocean-deep); }

/* ─────────────────────────── TAKEAWAY ────────────────────────────── */
.takeaway {
  max-width: none; padding: 16vh 6vw;
  background: linear-gradient(165deg, #061620 0%, #0a2a3d 60%, #0d3b54 100%);
  color: #eaf6ff; text-align: center;
}
.takeaway > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.takeaway h2 { color: #f4fbff; font-size: clamp(1.8rem, 3.8vw, 3rem); }
.takeaway p { color: #c8e4f2; font-size: 1.2rem; }
.takeaway strong { color: #fff; }

/* ─────────────────────────── HURRICANE INGREDIENTS LAB ───────────── */
.lab-section {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: 12vh 5vw;
}
.lab-section .section-head { max-width: 720px; }
.lab-card { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem 1.3rem; }

.lab-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 1.2fr) minmax(240px, 0.9fr);
  gap: 1.4rem;
  align-items: start;
}

.lab-controls { display: flex; flex-direction: column; gap: 0.85rem; }
.lab-controls .panel-label { margin-bottom: 0.2rem; color: var(--ocean-deep); }

.lab-slider-row { margin-bottom: 0.15rem; }
.lab-slider-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.lab-slider-head label {
  font-size: 0.88rem; font-weight: 600; color: var(--ink);
}
.lab-info {
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ocean-deep); font-size: 0.7rem; font-weight: 700;
  font-family: var(--sans); cursor: pointer; flex-shrink: 0;
  line-height: 1; padding: 0;
}
.lab-info:hover { border-color: var(--ocean); background: #fff; }
.lab-info[aria-expanded="true"] { background: rgba(14,165,233,0.15); border-color: var(--ocean); }

.lab-slider-row input[type="range"] {
  width: 100%; accent-color: var(--ocean); cursor: pointer;
}
.lab-slider-ends {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); margin-top: 0.2rem;
}
.lab-tip {
  font-size: 11.5px; color: var(--ink-soft); margin-top: 0.35rem;
  line-height: 1.45; padding: 0.4rem 0.5rem;
  background: var(--bg-soft); border-radius: 6px; border-left: 3px solid var(--ocean);
}
.lab-tip[hidden] { display: none !important; }

.lab-presets-wrap { margin-top: 0.6rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.lab-presets { display: flex; flex-direction: column; gap: 0.45rem; }
.lab-preset-btn {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  text-align: left; padding: 0.5rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink-soft); cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.lab-preset-btn:hover { background: #fff; border-color: var(--ocean); color: var(--ocean-deep); }
.lab-preset-btn.active {
  background: rgba(14, 165, 233, 0.12); border-color: var(--ocean);
  color: var(--ocean-darker); font-weight: 600;
}

.lab-stage-wrap {
  background: #02131c;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(12,31,42,0.14);
}
#lab-stage { display: block; width: 100%; height: auto; min-height: 280px; }
.lab-annotations {
  list-style: none; margin: 0; padding: 0.65rem 0.85rem 0.75rem;
  background: rgba(6, 22, 32, 0.92); border-top: 1px solid rgba(255,255,255,0.08);
}
.lab-annotations li {
  font-size: 11.5px; color: #bfe0f2; line-height: 1.45;
  padding: 0.2rem 0; padding-left: 0.75rem; position: relative;
}
.lab-annotations li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 4px; height: 4px; border-radius: 50%; background: #7fd2f4;
}
.lab-annotations:empty { display: none; }

.lab-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 4px 18px rgba(12,31,42,0.06);
}
.lab-panel .panel-label { color: var(--ocean-deep); margin-bottom: 0; }
.lab-score-block { }
.lab-score-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 0.35rem; }
.lab-score-row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.lab-score-num { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.risk-badge {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 0.3rem 0.6rem; border-radius: 999px;
}
.risk-badge--low { background: #dcfce7; color: #166534; }
.risk-badge--moderate { background: #fef9c3; color: #854d0e; }
.risk-badge--high { background: #ffedd5; color: #9a3412; }
.risk-badge--extreme { background: #fee2e2; color: #991b1b; }

.lab-main-risk { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.lab-caution {
  margin-top: auto;
  font-size: 11.5px; color: var(--muted); line-height: 1.55;
  padding: 0.75rem 0.8rem; background: var(--bg-soft);
  border-radius: 8px; border: 1px solid var(--line);
}
.lab-caution strong { color: var(--ink); display: block; margin-bottom: 0.25rem; }

@media (max-width: 960px) {
  .lab-layout { grid-template-columns: 1fr; }
  #lab-stage { min-height: 260px; }
}

/* ─────────────────────────── MAKE A HURRICANE (DRAG MAP) ───────────── */
.game-section {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: 12vh 5vw;
}
.game-section .section-head { max-width: 720px; }
.game-dek {
  font-family: var(--serif); font-size: 1.15rem; color: var(--ocean-deep);
  margin: -0.5rem 0 0.75rem; font-style: italic;
}
.game-card { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem 1.3rem; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 300px);
  gap: 1.35rem;
  align-items: start;
}

.game-stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.game-keyboard-hint { font-size: 10.5px; color: var(--muted); margin: 0.35rem 0 0; }

.game-map-toolbar { min-height: 2rem; display: flex; align-items: center; }
.game-map-back {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  padding: 0.4rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--ocean); background: rgba(14, 165, 233, 0.1);
  color: var(--ocean-darker); cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.game-map-back:hover { background: rgba(14, 165, 233, 0.18); }
.game-map-back:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.game-map-back[hidden] { display: none !important; }
.game-map-wrap {
  position: relative;
  background: #5b9fd4;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(12,31,42,0.14);
  touch-action: none;
  aspect-ratio: 900 / 520;
  width: 100%;
  cursor: crosshair;
}
#game-map {
  display: block; width: 100%; height: 100%;
  min-height: 380px; max-height: min(72vh, 640px);
}
.game-map-wrap:focus-within { outline: 2px solid var(--ocean); outline-offset: 2px; }
.game-drag-hint { margin: 0; text-align: left; }
.game-hint-icon { color: #ef4444; font-weight: 700; }

/* Zone detail modal (damage + community impact) */
.game-modal {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.game-modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.game-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 24, 33, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.game-modal-card {
  position: relative; z-index: 1;
  width: min(460px, 100%);
  max-height: calc(100% - 1rem);
  overflow-y: auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(8, 24, 33, 0.35);
  display: flex; flex-direction: column; gap: 1rem;
  transform: translateY(10px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.game-modal.is-open .game-modal-card { transform: translateY(0) scale(1); }
.game-modal-card.is-swapping { animation: gameModalSwap 0.34s ease; }
@keyframes gameModalSwap {
  0% { opacity: 0.3; transform: translateY(5px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.game-modal-close {
  position: absolute; top: 0.6rem; right: 0.7rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.game-modal-close:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--ocean); }
.game-modal-close:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.game-modal-header { padding-right: 2rem; }
.game-modal-kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.game-modal-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--ink); margin: 0.25rem 0 0.25rem; line-height: 1.2; }
.game-modal-response { font-size: 0.9rem; color: var(--ocean-deep); margin: 0; font-weight: 500; }
.game-modal-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.game-storm { pointer-events: none; }
.game-zone-ring { transition: opacity 0.25s ease, stroke 0.25s ease; }
.game-zone-ring--near { stroke: #7fd2f4; stroke-width: 2.5; }
.game-zone:hover .game-zone-ring { stroke: #aee6fb; opacity: 0.85; }
.game-zone:focus-visible { outline: none; }
.game-zone:focus-visible .game-zone-ring { stroke: #fff; stroke-width: 3; opacity: 1; }

.game-stats-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.game-stats-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 4px 18px rgba(12,31,42,0.06);
}
.game-stats-card--bars .game-bars { margin-top: 0.15rem; }
.game-location-type { font-weight: 600; color: var(--ink); margin: 0; font-size: 0.95rem; }
.game-storm-response { font-size: 0.9rem; color: var(--ocean-deep); margin: 0; font-weight: 500; }
.game-score-block { }
.game-score-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 0.3rem; }
.game-score-row { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.game-score-num { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.game-growth-label { font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }

.game-bars { display: flex; flex-direction: column; gap: 0.4rem; }
.game-bar-row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.5rem; align-items: center; font-size: 10.5px; color: var(--muted); }
.game-bar { height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.game-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  transition: width 0.35s ease;
}
.game-bar-fill--warm { background: linear-gradient(90deg, #38bdf8, #ea580c); }
.game-bar-fill--moist { background: #c061c9; }
.game-bar-fill--shear { background: #a78bfa; }
.game-bar-fill--exp { background: #fde047; }
.game-bar-fill--prep { background: #7fd2f4; }

.game-main-reason, .game-explanation { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.game-caution {
  font-size: 0.78rem; color: var(--muted); line-height: 1.5;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.game-error { padding: 2rem; text-align: center; color: var(--muted); }

/* Thumb strip (SST + moisture previews) */
.game-thumb-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.game-thumb {
  display: block; width: 100%; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: #5b9fd4; cursor: pointer; text-align: left;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.game-thumb:hover { border-color: var(--ocean); box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15); }
.game-thumb:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.game-thumb--active {
  border-color: var(--ocean);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}
.game-thumb-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}
.game-thumb-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(2, 19, 28, 0.55);
}
.game-thumb-legend-end {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.85);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.game-thumb-legend-bar {
  flex: 1; height: 10px; min-width: 60px;
  border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.2);
}
.game-thumb-map { position: relative; min-width: 0; }
.game-thumb-title {
  position: absolute; top: 0.4rem; left: 0.5rem; z-index: 2;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.game-thumb-map svg {
  display: block; width: 100%; height: auto;
  min-height: 120px; max-height: 160px;
}
.game-thumb-map .game-land { pointer-events: none; }
.storm-dot { pointer-events: none; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.65)); }

/* Side panel */
.game-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 4px 18px rgba(12,31,42,0.06);
  position: sticky; top: 1.5rem;
}

/* Era toggle */
.game-map-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.game-era-toggle { display: flex; align-items: center; gap: 0.3rem; }
.era-btn {
  font-family: var(--sans); font-size: 0.77rem; font-weight: 600;
  padding: 0.28rem 0.65rem; border-radius: 7px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.era-btn:hover { border-color: var(--ocean); color: var(--ocean-darker); background: rgba(14,165,233,0.07); }
.era-btn--active { background: var(--ocean-darker); border-color: var(--ocean-darker); color: #fff; }
.era-btn--active:hover { background: var(--ocean); border-color: var(--ocean); }
.era-btn[data-era="2080"].era-btn--active { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.era-btn[data-era="2080"].era-btn--active:hover { background: #dc2626; border-color: #dc2626; }
.era-btn:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.era-label-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.12rem 0.45rem;
  border-radius: 4px; background: #f1f5f9; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.era-label-tag--1980 { background: #dbeafe; color: #1d4ed8; }
.era-label-tag--now  { background: #dcfce7; color: #15803d; }
.era-label-tag--2080 { background: #fee2e2; color: #b91c1c; }

@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-panel { position: static; }
  .game-stats-row { grid-template-columns: 1fr; }
  #game-map { min-height: 280px; max-height: none; }
  .game-map-wrap { aspect-ratio: auto; }
  .game-thumb-strip { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .game-modal { padding: 0.75rem; }
  .game-modal-card { padding: 1.2rem 1.1rem 1.25rem; gap: 0.85rem; }
  .game-modal-scores { grid-template-columns: 1fr; gap: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .game-modal, .game-modal-card { transition: none; }
  .game-modal-card.is-swapping { animation: none; }
}

@media (max-width: 900px) {
  .story-screen { padding: clamp(2rem, 6vh, 4.5rem) 5vw clamp(1rem, 3vh, 2rem); }
  .story-inner { min-height: 0; gap: clamp(0.55rem, 1.8vh, 0.9rem); }
  .story-beat {
    font-size: clamp(1.35rem, 5.6vw, 2.25rem);
    max-width: min(24ch, 92vw);
  }
  .story-footer { justify-content: center; }
  .story-next-btn,
  .story-enter-btn { min-width: min(230px, 100%); }
  .story-transition { font-size: 0.92rem; }
}

/* ─────────────────────────── DEMO VIDEO ──────────────────────────── */
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-deep); box-shadow: 0 12px 40px rgba(12,31,42,0.12);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem; color: #9fd4ee; text-align: center;
}
.video-placeholder span { font-family: var(--serif); font-size: 1.3rem; }
.video-placeholder small { color: #6b8090; }

/* ─────────────────────────── SOURCES ─────────────────────────────── */
.sources h3 { font-size: 1.15rem; margin: 1.8rem 0 0.7rem; color: var(--ink); }
.sources ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.sources li { font-family: var(--serif); font-size: 1rem; color: var(--ink-soft); margin-bottom: 0.6rem; line-height: 1.6; }
.footer-note { font-size: 0.85rem !important; color: var(--muted) !important; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* ─────────────────────────── TOOLTIP ─────────────────────────────── */
#tooltip {
  position: fixed; pointer-events: none;
  background: #fff; border: 1px solid var(--line);
  padding: 0.6rem 0.9rem; border-radius: 8px;
  font-size: 12px; color: var(--ink); opacity: 0;
  transition: opacity 0.12s; z-index: 100;
  box-shadow: 0 6px 22px rgba(12,31,42,0.16); min-width: 150px;
}

/* ─────────────────────────── RESPONSIVE ──────────────────────────── */
@media (max-width: 880px) {
  #scrolly { flex-direction: column; }
  #sticky-graphic { width: 100%; height: 78vh; border-right: none; border-bottom: 1px solid var(--line); }
  #steps { width: 100%; padding: 0 6vw; }
  .step { padding: 30vh 0; }
  .step:first-child { padding-top: 8vh; }
  .explorer { grid-template-columns: 1fr; }
  .explorer-stage { aspect-ratio: 4 / 3; min-height: 320px; }
  .prose { padding: 9vh 7vw; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .prose p, .section-head p { font-size: 1rem; }
  #hero { padding: 0 6vw; }
  #hero h1 { font-size: clamp(1.95rem, 8.5vw, 3.2rem); max-width: 100%; }
  .hero-lede { font-size: 1.05rem; max-width: 100%; }
  .eyebrow { letter-spacing: 0.14em; font-size: 10.5px; white-space: normal; }
  .beat { padding: 12vh 7vw; }
  .beat p { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .viz-section { padding: 8vh 5vw; }
  .chart-card { padding: 1.1rem 1rem 1rem; }
  .explorer-panel { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg::after, .scroll-hint { animation: none; }
  * { transition-duration: 0.001ms !important; }
}

/* ════════════════════════════════════════════════════════════════════
   FOLLOW THE FUEL — cinematic emissions leaderboard
   ════════════════════════════════════════════════════════════════════ */
#follow-the-fuel {
  --fuel-heat: 0;
  position: relative;
  background:
    radial-gradient(120% 80% at 70% 0%, rgba(249,115,22,calc(0.10 + 0.18 * var(--fuel-heat))) 0%, transparent 55%),
    linear-gradient(180deg, #061620 0%, #07202c 45%, #0a2433 100%);
  color: #eaf6ff;
}
#follow-the-fuel .kicker { color: #6fd0f0; }
#follow-the-fuel .kicker.light { color: #ffd9a0; }
#follow-the-fuel h2, #follow-the-fuel h3 { color: #fff; }

/* ─── sentence-reveal blocks (But / Therefore) ─── */
.fuel-reveal-block { padding: 16vh 7vw; display: flex; justify-content: center; }
.fuel-reveal-inner { max-width: 820px; text-align: center; }
.fuel-tag-but { background: rgba(14,165,233,0.22); color: #7dd3fc; }
.fuel-tag-therefore { background: rgba(249,115,22,0.22); color: #ffc24d; }
.fuel-beat {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2vw + 1vh, 2.3rem);
  line-height: 1.35; font-weight: 600; color: #dcefff;
  margin: 0.7rem 0;
  opacity: 0; transform: translateY(16px); filter: blur(4px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(0.22,1,0.36,1), filter 1s ease;
}
.fuel-beat.is-visible { opacity: 1; transform: none; filter: none; }
.fuel-em { color: #7dd3fc; font-weight: 700; }
.fuel-em-hot {
  color: #ffb877; font-weight: 800;
  text-shadow: 0 0 26px rgba(249,115,22,0.55);
}

/* ─── Scene 1: scroll-driven warm wipe (storm heat -> global view) ─── */
.fuel-zoomout { --z: 0; --zline: 0; position: relative; height: 150vh; }
.fuel-zoomout-sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: grid; place-items: center;
}
.fuel-zoomout-wash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 55%,
    rgba(255,214,170,0.95) 0%, rgba(249,115,22,0.82) 24%,
    rgba(185,28,28,0.5) 48%, transparent 72%);
  clip-path: circle(calc(var(--z) * 160%) at 50% 55%);
  opacity: calc(1 - 0.35 * var(--z));
  will-change: clip-path, opacity;
}
.fuel-zoomout-line {
  position: relative; margin: 0;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.4rem, 1.4vw + 1.4vh, 2.6rem);
  color: #fff; text-shadow: 0 2px 30px rgba(0,0,0,0.55);
  opacity: var(--zline);
}

/* ─── racing leaderboard ─── */
.fuel-race { position: relative; height: 320vh; }
.fuel-stage {
  position: sticky; top: 0; min-height: 100vh; padding: 4vh 6vw;
  display: flex; flex-direction: column; justify-content: center; gap: 0.6rem;
}
.fuel-stage::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #f97316, #dc2626);
  opacity: calc(0.25 + 0.75 * var(--fuel-heat));
  box-shadow: 0 0 18px rgba(249,115,22,calc(0.3 + 0.5 * var(--fuel-heat)));
}
.fuel-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); margin: 0.1rem 0; }
.fuel-sub { color: #b8d4e4; max-width: 640px; }
.fuel-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.6rem; }
.fuel-metric-toggle { display: inline-flex; background: rgba(255,255,255,0.07); border-radius: 999px; padding: 4px; gap: 2px; }
.fuel-metric-btn {
  background: none; border: none; color: #b8d4e4; cursor: pointer;
  padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  transition: background 0.25s, color 0.25s;
}
.fuel-metric-btn.is-active { background: linear-gradient(180deg, #f97316, #ea580c); color: #fff; }
.fuel-year {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff; text-shadow: 0 0 22px rgba(249,115,22,0.4); font-variant-numeric: tabular-nums;
}
.fuel-annotation { color: #ffd9a0; font-size: 0.96rem; min-height: 1.4em; }
.fuel-annotation.is-flash { animation: fuelFlash 0.7s ease; }
@keyframes fuelFlash { 0% { opacity: 0.2; transform: translateY(-4px); } 100% { opacity: 1; transform: none; } }

.fuel-board-wrap { position: relative; }
#fuel-board { display: block; width: 100%; }
g.fuel-row { cursor: pointer; transition: opacity 0.3s; }
g.fuel-row .fuel-bar {
  fill: #f97316;
  filter: drop-shadow(0 0 5px rgba(249,115,22,0.35));
  transition: fill 0.3s;
}
g.fuel-row:hover .fuel-bar { fill: #fb923c; }
g.fuel-row.is-pinned .fuel-bar { fill: #fde68a; stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 0 10px rgba(253,230,138,0.7)); }
.fuel-rank { fill: #6b8da0; font-size: 13px; font-weight: 700; font-family: var(--sans); }
.fuel-name { fill: #eaf6ff; font-size: 14px; font-weight: 600; font-family: var(--sans); }
g.fuel-row.is-pinned .fuel-name { fill: #fff; }
.fuel-val { fill: #ffce9e; font-size: 12.5px; font-weight: 600; font-family: var(--sans); font-variant-numeric: tabular-nums; }

.fuel-pin-panel {
  position: absolute; top: 0; right: 0; width: 240px;
  background: rgba(8,24,33,0.92); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px;
  padding: 0.8rem 0.9rem; backdrop-filter: blur(4px);
}
.fuel-pin-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.fuel-pin-head button { background: none; border: none; color: #b8d4e4; cursor: pointer; font-size: 1.1rem; }
.fuel-pin-stat { font-size: 0.84rem; color: #cfe6f2; line-height: 1.35; }
.fuel-pin-stat strong {
  display: block; font-family: var(--serif); font-weight: 800;
  font-size: 1.7rem; line-height: 1.1; color: #ffce9e;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(249,115,22,0.4);
}
.fuel-pin-stat sub { font-size: 0.7em; }
.fuel-share-gauge {
  height: 8px; border-radius: 999px; margin: 0.55rem 0;
  background: rgba(255,255,255,0.12); overflow: hidden;
}
.fuel-share-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #f97316, #fde68a); border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22,1,0.36,1);
}
.fuel-pin-cum { font-size: 0.78rem; color: #8fb6c9; margin: 0.2rem 0 0.5rem; }
.fuel-pin-link { font-size: 0.82rem; color: #ffd9a0; margin: 0; line-height: 1.4; }

.fuel-timeline { margin-top: 1rem; }
.fuel-tl-track { position: relative; height: 3px; background: rgba(255,255,255,0.14); border-radius: 3px; margin: 1.4rem 0 0; }
.fuel-tl-fill { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, #f97316, #dc2626); border-radius: 3px; }
.fuel-tl-tick { position: absolute; top: 8px; transform: translateX(-50%); font-size: 11px; color: #8fb6c9; }
.fuel-hint { color: #7e9bab; margin-top: 1.8rem; }

/* ─── final takeaway ─── */
.fuel-takeaway { padding: 14vh 7vw 18vh; display: flex; justify-content: center; }
.fuel-takeaway-inner { max-width: 820px; text-align: center; }
.fuel-takeaway-lead {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.35rem, 1.3vw + 1.2vh, 2.05rem); line-height: 1.5;
  letter-spacing: 0.004em; color: #eaf6ff; margin: 0.6rem auto 1.1rem; max-width: 720px;
}
.fuel-takeaway-lead em { font-style: italic; color: #ffc24d; }
.fuel-takeaway-body {
  color: #b8d4e4; font-size: 1.04rem; line-height: 1.75; max-width: 620px; margin: 0 auto;
}
.fuel-takeaway-punch {
  font-family: var(--serif); font-weight: 800; line-height: 1.18;
  font-size: clamp(1.9rem, 4.2vw, 3.3rem); margin-top: 1.9rem;
  background: linear-gradient(100deg, #ffe1b3 0%, #fb923c 46%, #f43f5e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: 0 0 42px rgba(249,115,22,0.22);
}

/* ─── reduced-motion / mobile: static, readable, no pinned scroll race ─── */
@media (prefers-reduced-motion: reduce), (max-width: 880px) {
  .fuel-zoomout { display: none; }
  .fuel-race { height: auto; }
  .fuel-stage { position: static; min-height: 0; padding: 10vh 6vw; }
  .fuel-beat { opacity: 1; transform: none; filter: none; }
  .fuel-pin-panel { position: static; width: 100%; margin-top: 1rem; }
  .fuel-controls { justify-content: flex-start; }
}

/* ── Viz 1: chart text darker + bigger ── */
#main-chart text {
  fill: var(--ink) !important;
  font-size: 13px !important;
}

#main-chart .tick text {
  fill: var(--ink-soft) !important;
  font-size: 12px !important;
}

#main-chart .axis-label {
  fill: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 600;
}

#chart-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

#chart-subtitle {
  font-size: 13px;
  color: var(--ink-soft);
}

#legend {
  font-size: 13px;
  color: var(--ink-soft);
}

.step-inner h3 {
  font-size: 1.4rem;
}

.step-inner p {
  font-size: 1rem;
  color: var(--ink-soft);
}