/* ============================================================
   Degrees of Consequence — Design System
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #F8F8F6;
  --bg-alt:      #EFEDE3;
  --ink:         #2A3324;
  --ink-soft:    rgba(42,51,36,0.6);
  --ink-faint:   rgba(42,51,36,0.2);
  --card:        #FFFFFF;
  --line:        rgba(42,51,36,0.12);
  --sage:        #82A78A;

  /* tweakable */
  --tw-low:      #82A78A;
  --tw-mid:      #C49B5E;
  --tw-high:     #B4633A;
  --tw-accent:   #3C7B51;
  --tw-serif:    'Bricolage Grotesque', system-ui, sans-serif;
  --tw-measure:  660px;
  --tw-rhythm:   1;

  --serif:       var(--tw-serif);
  --mono:        'JetBrains Mono', ui-monospace, monospace;
  --sans:        'Bricolage Grotesque', system-ui, sans-serif;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { cursor: default; font-family: inherit; }

/* ── Typography ────────────────────────────────────────── */
.display {
  font-family: var(--tw-serif);
  font-size: clamp(68px, 11vw, 128px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.display em.of {
  font-style: italic;
  font-weight: 400;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 0.82em;
}
.display .acc { color: var(--ink); }

.h2 {
  font-family: var(--tw-serif);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.018em;
}
.h3 {
  font-family: var(--tw-serif);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lede {
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.55;
  color: var(--ink);
}
.body { font-size: 18px; line-height: 1.75; }
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tw-accent);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: currentColor;
  flex-shrink: 0;
}

/* Section title used in metric chapters — large orientation anchor */
.metric-section-title {
  font-family: var(--tw-serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-top: 10px;
  margin-bottom: 20px;
  color: var(--ink);
}
.scene--dark .metric-section-title { color: #ECE6CE; }

/* ── Reveal animations ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Layout ────────────────────────────────────────────── */
.col {
  width: 100%;
  max-width: var(--tw-measure);
  margin: 0 auto;
  padding: 0 24px;
}
.col--wide {
  width: 100%;
  max-width: calc(var(--tw-measure) * 1.5);
  margin: 0 auto;
  padding: 0 24px;
}
.stack-28 { display: flex; flex-direction: column; gap: calc(28px * var(--tw-rhythm)); }

/* ── Chrome ────────────────────────────────────────────── */
.readline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--line);
  z-index: 1000;
}
.readline i {
  display: block;
  height: 100%;
  background: var(--tw-accent);
  transition: width 0.1s linear;
}
.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(248,248,246,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 999;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.chrome.on-dark {
  background: rgba(14,26,11,0.88);
  border-bottom-color: rgba(236,230,206,0.1);
  color: #ECE6CE;
}
.chrome-brand {
  font-family: var(--tw-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.chrome-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chrome-chapter {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.chrome-progress {
  width: 80px;
  height: 3px;
  background: rgba(42,51,36,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.on-dark .chrome-progress { background: rgba(236,230,206,0.15); }
.chrome-progress i {
  display: block;
  height: 100%;
  background: var(--tw-accent);
  transition: width 0.1s linear;
}

/* ── Scenes ────────────────────────────────────────────── */
.scene {
  padding: calc(64px * var(--tw-rhythm)) 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.scene--alt  { background: var(--bg-alt); }
.scene--dark {
  background: #0E1A0B;
  color: #ECE6CE;
}
.scene--dark .eyebrow { color: var(--sage); }
.scene--dark .eyebrow::before { background: var(--sage); }
.scene--dark .lede   { color: rgba(236,230,206,0.85); }
.scene--dark .body   { color: rgba(236,230,206,0.8); }
.scene--dark .label  { color: rgba(236,230,206,0.45); }
.scene--tall { min-height: 100vh; }

/* ── Cover ─────────────────────────────────────────────── */
.cover {
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 12vh;
}
.cover-title-row {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}
.cover-thermo {
  width: 134px;
  height: 300px;
  flex-shrink: 0;
  position: relative;
  top: 24px;
}
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-hint .bar {
  width: 1px;
  height: 32px;
  background: var(--ink-soft);
  animation: barPulse 1.6s ease-in-out infinite;
}
@keyframes barPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Persona grid ──────────────────────────────────────── */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
@media (max-width: 780px) {
  .persona-grid { grid-template-columns: 1fr; }
}
.persona {
  appearance: none;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.persona:hover { border-color: var(--tw-accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.persona.sel   { border-color: var(--tw-accent); box-shadow: 0 0 0 3px rgba(60,123,81,0.18), 0 8px 24px rgba(0,0,0,0.1); }
.persona-img { height: 180px; overflow: hidden; background: var(--bg-alt); }
.persona-img img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.persona-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.persona-role { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tw-accent); }
.persona-name { font-family: var(--tw-serif); font-size: 22px; font-weight: 700; line-height: 1.15; }
.persona-tag  { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin-top: 2px; flex: 1; }
.persona-cta  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--tw-accent); display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.sel .persona-cta { font-weight: 600; }

/* ── Console layout ────────────────────────────────────── */
.console-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.4fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) { .console-layout { grid-template-columns: 1fr; } }

.console {
  background: #07120A;
  border-radius: var(--r-xl);
  padding: 24px;
  color: #ECE6CE;
}
.console-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.console-who { display: flex; align-items: center; gap: 14px; }
.nm { font-family: var(--tw-serif); font-size: 18px; font-weight: 700; }
.rl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: rgba(236,230,206,0.45); margin-top: 3px; }
.console-classify { text-align: right; }
.console-classify .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: rgba(236,230,206,0.45); }
.console-classify .v { font-family: var(--tw-serif); font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.fig { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.fig--round img { width: 100%; height: 100%; object-fit: cover; }

.dial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 600px) { .dial-grid { grid-template-columns: repeat(2, 1fr); } }

.dial-cell {
  appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(236,230,206,0.1);
  border-radius: var(--r-md);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ECE6CE;
  transition: background 0.15s, border-color 0.15s;
}
.dial-cell:hover { background: rgba(255,255,255,0.07); }
.dial-cell.active { background: rgba(255,255,255,0.1); border-color: rgba(224,141,92,0.5); }
.dial-cell svg { width: 72px; height: 72px; }
.dl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.55; }
.dv { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.8; }

/* ── Time jump ─────────────────────────────────────────── */
.timejump {
  height: 500vh;
  background: #0E1A0B;
  position: relative;
}
.timejump-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timejump-ring {
  position: absolute;
  width: min(80vw, 600px);
  height: min(80vw, 600px);
  opacity: 0.9;
}
.timejump-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ECE6CE;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.timejump-year {
  font-family: var(--tw-serif);
  font-size: clamp(80px, 16vw, 160px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.timejump-line {
  font-family: var(--tw-serif);
  font-size: clamp(14px, 2vw, 18px);
  max-width: 36ch;
  line-height: 1.5;
  opacity: 0.7;
}
.timejump-track {
  display: flex;
  justify-content: space-between;
  width: 200px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  opacity: 0.4;
}
.timejump-track .now { opacity: 1; color: #E08D5C; }
.timejump-bar {
  width: 200px;
  height: 3px;
  background: rgba(236,230,206,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.timejump-bar i { display: block; height: 100%; background: #E08D5C; }

/* ── Chapter (metric) ──────────────────────────────────── */
.chapter { min-height: unset; justify-content: flex-start; }
.chapter--tall { height: 400vh; }
.chapter--co2 { height: 600vh; }

.chapter-sticky2 {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.metric-comp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "narr viz"
    "chart chart";
  gap: 0 32px;
  width: 100%;
  max-width: calc(var(--tw-measure) * 1.85);
  margin: 0 auto;
  padding: 48px 24px 20px;
  height: 100vh;
}
@media (max-width: 900px) {
  .metric-comp {
    grid-template-columns: 1fr;
    grid-template-areas: "narr" "viz" "chart";
    overflow-y: auto;
    height: 100vh;
  }
}

.mc-narr { grid-area: narr; display: flex; flex-direction: column; justify-content: center; padding-right: 8px; min-height: 0; }
.mc-viz  { grid-area: viz;  display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.mc-chart { grid-area: chart; padding-top: 20px; min-height: 0; }

/* Constrain viz SVGs so the chart row is always visible */
.mc-viz svg {
  max-height: calc(100vh - 280px);
  max-width: 100%;
  width: auto;
}
.sea-combo > svg,
.sea-combo > div > svg {
  max-height: calc(50vh - 150px);
  max-width: 100%;
  width: auto;
}
.sea-combo > div {
  overflow: hidden;
  flex-shrink: 1;
  width: 100%;
}

/* Non-CO2 chapters: narr matches CO2 structure */
.chapter--sea .mc-narr,
.chapter--temp .mc-narr,
.chapter--drought .mc-narr {
  justify-content: flex-start;
  gap: 10px;
  align-self: center;
  height: min(44vh, calc(100vh - 80px));
}

/* ── Non-CO2 metric card viz sizing ──────────────────────── */
.metric-card-viz--sea {
  flex-shrink: 1;
  overflow: hidden;
  padding: 0;
}
.sea-split {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
}
.sea-ice-left {
  flex: 0 0 40%;
  min-width: 0;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
}
.sea-ice-left svg {
  width: 100%;
  height: auto;
  max-height: calc(52vh - 120px);
}
.sea-level-right {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
}
.sea-level-right > div {
  width: 100%;
}
.sea-level-right svg {
  width: 100%;
  height: auto;
  max-height: calc(52vh - 120px);
}
.metric-card-viz--temp {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  overflow: hidden;
}
.metric-card-viz--temp svg {
  max-height: calc(52vh - 100px);
  width: auto;
}
.metric-card-viz--drought {
  flex-shrink: 1;
  overflow: hidden;
  padding: 4px 2px 0;
}
.metric-card-viz--drought svg {
  width: 100%;
  max-height: calc(42vh - 60px);
}

/* ── Dial direction indicator ──────────────────────────── */
.dial-dir {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── Thought-card speech bubble ────────────────────────── */
.thought-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  position: sticky;
  top: 70px;
}
.thought-card::after {
  content: '';
  position: absolute;
  top: 38px;
  right: -10px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 10px solid var(--card);
  filter: drop-shadow(1px 0 0 rgba(42,51,36,0.12));
}

.mc-year {
  font-family: var(--tw-serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.mc-beat h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 12px; }
.mc-beat p  { font-size: 17px; line-height: 1.7; opacity: 0.85; max-width: 40ch; }
.mc-note {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.mc-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.vt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
}
.vv {
  font-family: var(--tw-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.u { font-family: var(--mono); font-size: 14px; opacity: 0.55; margin-left: 4px; }

.viz-box { width: 100%; display: flex; align-items: center; justify-content: center; }
.sea-combo { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 100%; }

/* ── CO₂ chapter layout ─────────────────────────────────── */
.metric-comp--co2 {
  grid-template-columns: minmax(200px, 30%) 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "narr viz";
  align-items: stretch;
  padding: 50px 20px 30px;
  max-width: min(1300px, 90vw);
}
.chapter--co2 .mc-narr {
  justify-content: flex-start;
  gap: 10px;
  align-self: center;
  height: min(44vh, calc(100vh - 80px));
  position: relative;
  padding-bottom: 150px;
}
.chapter--co2 .metric-section-title {
  font-size: clamp(34px, 4.2vw, 56px);
}
.co2-narr-beat { display: flex; flex-direction: column; }
.co2-beat-title {
  font-family: var(--tw-serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--tw-accent);
}
.co2-beat-body {
  font-size: 17px;
  line-height: 1.7;
  opacity: 0.85;
  margin: 0;
  max-width: 38ch;
}
.co2-reached-wrapper {
  position: absolute;
  bottom: -64px;
  left: 0;
  right: 0;
}
.metric-year-wrapper {
  margin-top: auto;
  padding-top: 16px;
}
.co2-reached-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
}
.co2-reached-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
}
.co2-reached-year {
  font-family: var(--tw-serif);
  font-size: clamp(44px, 4.5vw, 58px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.co2-right-card {
  grid-area: viz;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 120px);
  align-self: center;
}
.co2-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.co2-card-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.co2-card-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 7px;
}
.co2-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.co2-card-viz {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.co2-card-viz .viz-box { display: flex; align-items: center; justify-content: center; }
.co2-card-viz svg {
  display: block;
  width: 720px;
  height: auto;
  max-width: 100%;
}
.co2-card-viz svg text {
  font-size: 10px;
}
.co2-value-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.co2-vv { font-size: clamp(32px, 3.5vw, 48px); }
.co2-value-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  text-align: right;
  line-height: 1.6;
}
.precip-stats-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.precip-stat {
  flex: 1;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.precip-stat-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 4px;
  opacity: 0.85;
}
.precip-stat:last-child { border-right: none; }
.precip-stat-value {
  font-family: var(--mono);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.precip-stat-unit {
  font-size: 0.55em;
  opacity: 0.7;
  margin-left: 1px;
}
.precip-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 3px;
}

.co2-card-chart {
  padding: 10px 18px 14px;
  overflow: hidden;
}
.co2-card-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Temperature chapter: dark card matching background ─── */
.chapter--temp .co2-right-card {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(236,230,206,0.12);
}
.chapter--temp .co2-card-header { border-bottom-color: rgba(236,230,206,0.12); }
.chapter--temp .co2-card-title  { color: rgba(236,230,206,0.55); }
.chapter--temp .co2-card-badge  { border-color: rgba(236,230,206,0.2); background: rgba(255,255,255,0.06); color: #ECE6CE; }
.chapter--temp .co2-card-viz    { border-bottom-color: rgba(236,230,206,0.12); }
.chapter--temp .co2-value-row   { border-bottom-color: rgba(236,230,206,0.12); }
.chapter--temp .co2-vv          { color: #ECE6CE; }
.chapter--temp .co2-value-label { color: rgba(236,230,206,0.5); }
.chapter--temp .co2-reached-card {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(236,230,206,0.12);
}
.chapter--temp .co2-reached-label { color: rgba(236,230,206,0.5); }
.chapter--temp .co2-reached-year  { color: #ECE6CE; }

/* ── Line chart title ──────────────────────────────────── */
.lc-title {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.85;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.scene--dark .lc-title { color: #ECE6CE; }

/* ── Line chart tooltip ────────────────────────────────── */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

.tip {
  position: absolute;
  background: rgba(248,248,246,0.96);
  border: 1px solid rgba(42,51,36,0.14);
  border-radius: var(--r-md);
  padding: 10px 14px;
  min-width: 160px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}
.scene--dark .tip {
  background: rgba(14,26,11,0.96);
  border-color: rgba(236,230,206,0.15);
  color: #ECE6CE;
}
.tip-year { display: flex; justify-content: space-between; opacity: 0.55; margin-bottom: 6px; font-size: 10px; letter-spacing: 0.06em; }
.tip-hero { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.tip-hero .n { font-family: var(--tw-serif); font-size: 26px; font-weight: 700; line-height: 1; }
.tip-hero .u { font-size: 11px; opacity: 0.55; }
.tip-rows { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.scene--dark .tip-rows { border-top-color: rgba(236,230,206,0.12); }
.tip-row { display: flex; justify-content: space-between; gap: 12px; }
.tip-row .lab { opacity: 0.5; }
.tip-row .num { font-variant-numeric: tabular-nums; font-weight: 500; }
.tip-row.me { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.scene--dark .tip-row.me { border-top-color: rgba(236,230,206,0.1); }
.tip-foot { margin-top: 8px; opacity: 0.4; font-size: 10px; letter-spacing: 0.04em; }

/* ── Pathway tag ───────────────────────────────────────── */
.pathway-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(236,230,206,0.2);
  border-radius: 100px;
  color: rgba(236,230,206,0.8);
}
.sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Summary tree ──────────────────────────────────────── */
.summary { background: var(--bg); }
.tree-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.tree-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 36px 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: default;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path fill='rgba(42,51,36,0.5)' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.scene.summary { padding-top: calc(120px * var(--tw-rhythm)); }
.summary-tree { margin-top: 24px; width: 100%; }
.summary-tree svg { display: block; }

/* ── Outro ─────────────────────────────────────────────── */
.outro-grid {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px);
  gap: 60px;
  max-width: calc(var(--tw-measure) * 1.6);
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}
@media (max-width: 720px) { .outro-grid { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  margin-top: 8px;
}
.btn--primary {
  background: var(--tw-accent);
  color: #fff;
  border-color: var(--tw-accent);
}
.btn--primary:hover { background: #2d6142; }

.outro-illos {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.outro-illos .fig { width: 72px; height: 72px; border-radius: var(--r-md); overflow: hidden; background: var(--bg-alt); }
.outro-illos .fig img { width: 100%; height: 100%; object-fit: contain; }

.credits {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.9;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  padding-top: 8px;
}
.credits b {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 18px;
  margin-bottom: 2px;
}
.credits b:first-child { margin-top: 0; }

/* ── Persona gate ──────────────────────────────────────── */
.persona-continue-row { display: flex; align-items: center; gap: 20px; }
.persona-gate-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 10px 18px;
  border: 1px dashed var(--line);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
}

/* ── Sea water tip ─────────────────────────────────────── */
.sea-water-tip {
  position: absolute;
  background: rgba(12,30,40,0.95);
  border: 1px solid rgba(218,234,245,0.2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  min-width: 200px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  font-family: var(--mono);
  font-size: 11px;
  color: #ECE6CE;
  transform: translate(14px, -50%);
  z-index: 10;
}

/* ── Grass tip ─────────────────────────────────────────── */
.grass-tip {
  position: absolute;
  top: 16px;
  right: 0;
  width: 240px;
  background: rgba(248,248,246,0.97);
  border: 1px solid rgba(42,51,36,0.14);
  border-radius: var(--r-md);
  padding: 12px 14px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  z-index: 10;
}

/* ── Tree pathway buttons ──────────────────────────────── */
.tree-pathway-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tree-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: all 0.2s;
  cursor: default;
}
.tree-btn:hover { border-color: var(--btn-color); color: var(--ink); }
.tree-btn.active { background: var(--btn-color); border-color: var(--btn-color); color: #fff; }
.tree-btn .tree-btn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--btn-color); flex-shrink: 0; }
.tree-btn.active .tree-btn-dot { background: rgba(255,255,255,0.7); }
.tree-btn-delta { opacity: 0.65; margin-left: 2px; }

/* ── Summary section background distinct from outro ───── */
.summary { background: var(--bg); }

/* ── Tree chart panel ──────────────────────────────────── */
.tree-chart-panel {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px 16px;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tree-chart-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tree-chart-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.tree-chart-close {
  appearance: none;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: default;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.tree-chart-close:hover { background: var(--line); }
.tree-chart-outcomes {
  display: flex;
  gap: 28px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  flex-wrap: wrap;
}
.tree-chart-outcome { display: flex; flex-direction: column; gap: 3px; }
.tco-name {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--c);
  text-transform: uppercase;
}
.tco-val {
  font-family: var(--tw-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--c);
  line-height: 1;
}
.tco-unit {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.55;
}

/* ── Tree chart modal ──────────────────────────────────── */
.tree-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,26,11,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
  padding: 24px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tree-modal {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 36px 44px 32px;
  width: min(1040px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.15);
  animation: scaleIn 0.22s ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tree-modal .tree-chart-panel-head { margin-bottom: 20px; }
.tree-modal .tree-chart-title {
  font-size: 17px;
  letter-spacing: 0.06em;
  opacity: 1;
  color: var(--ink);
}
.tree-modal .tree-chart-close {
  font-size: 18px;
  padding: 4px 10px;
  opacity: 0.5;
}
.tree-modal .tree-chart-outcomes {
  margin-top: 20px;
  padding-top: 20px;
  gap: 40px;
}
.tree-modal .tco-name { font-size: 11px; }
.tree-modal .tco-val { font-size: 36px; }
.tree-modal .tco-unit { font-size: 14px; }

/* ── Smooth section transitions ─────────────────────────── */
.scene { position: relative; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(42,51,36,0.2); border-radius: 3px; }
