/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS — derived from Figma
   ═══════════════════════════════════════════════════════ */
:root {
  /* Colors — from Figma file yTRnaD4vopXgrimXvPusEQ */
  --color-bg: #ffffff;
  --color-surface: #fafafa;
  --color-divider-bg: #e2ded8;
  --color-text: #111111;
  --color-text-secondary: rgba(0, 0, 0, 0.5);
  --color-text-body: rgba(0, 0, 0, 0.7);
  --color-accent: #ac44ff;
  --color-accent-light: rgba(172, 68, 255, 0.08);
  --color-border: #e5e7eb;
  --color-chart-axis: #333333;

  /* Chart palette */
  --chart-purple: #ac44ff;
  --chart-magenta: #ac44ff;
  --chart-blue: #3b82f6;
  --chart-green: #10b981;
  --chart-amber: #f59e0b;
  --chart-red: #ef4444;
  --chart-cyan: #06b6d4;
  --chart-orange: #f97316;
  --chart-lime: #84cc16;
  --chart-coal: #374151;

  /* Typography — Figma uses Arial */
  --font: "Arial", system-ui, -apple-system, sans-serif;
  --text-xs: clamp(0.7rem, 0.6rem + 0.3vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.7rem + 0.4vw, 0.95rem);
  --text-base: clamp(0.95rem, 0.85rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.1rem, 0.9rem + 0.7vw, 1.35rem);
  --text-xl: clamp(1.4rem, 1rem + 1.2vw, 2rem);
  --text-2xl: clamp(1.8rem, 1.2rem + 2vw, 3rem);
  --text-3xl: clamp(2.2rem, 1.4rem + 3vw, 4.5rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 4rem;
  --space-2xl: 6.4rem;

  /* Layout */
  --max-width: 1200px;
  --content-padding: clamp(1.5rem, 4vw, 4rem);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ═══════════════════════════════════════════════════════
   SCROLL PROGRESS BAR
   ═══════════════════════════════════════════════════════ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-accent);
  z-index: 1002;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-padding);
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid transparent;
  opacity: 1;
  transform: translateY(0);
  border-bottom-color: var(--color-border);
}

.nav-brand {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
}

.nav-section-wrap {
  position: relative;
}

.nav-section-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-section-btn:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.nav-section-btn[aria-expanded="true"] {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.nav-section {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}

.nav-section-chevron {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.nav-section-btn[aria-expanded="true"] .nav-section-chevron {
  transform: rotate(180deg);
}

/* ── Nav dropdown ── */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 6px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition:
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1001;
}

.nav-dropdown--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-dropdown__item:hover {
  background: var(--color-accent-light);
}

.nav-dropdown__item--active {
  background: var(--color-accent-light);
}

.nav-dropdown__num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 18px;
}

.nav-dropdown__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--color-text-secondary);
  opacity: 0.45;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.nav-social:hover {
  opacity: 1;
  background: var(--color-accent-light);
}

.nav-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ═══════════════════════════════════════════════════════
   SECTIONS — shared
   ═══════════════════════════════════════════════════════ */
.section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) var(--content-padding);
  position: relative;
}

.section__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════
   SLIDE HEADER (badge + title)
   ═══════════════════════════════════════════════════════ */
.slide__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.slide__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--color-text);
}

.slide__header:has(.chamath-player) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) 16px;
}

.slide__header:has(.chamath-player) .slide__badge {
  width: 100%;
  margin-bottom: 0;
}

.slide__header:has(.chamath-player) .slide__title {
  margin-bottom: 0;
}

.slide__lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
  line-height: 1.6;
}

.slide__body p {
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  max-width: 52ch;
}

.slide__body p:first-child {
  margin-top: var(--space-md);
}

.slide__source {
  display: block;
  font-size: var(--text-xs);
  font-style: normal;
  color: var(--color-text-secondary);
  opacity: 0.6;
  margin-top: var(--space-lg);
}

.slide__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.slide__list .highlight-stat {
  margin-top: 0 !important;
}

.highlight-stat {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 8px 8px 0;
  margin-top: var(--space-md) !important;
}

.section--text .highlight-stat {
  font-size: var(--text-lg);
}

.highlight-stat strong {
  color: var(--color-text);
}

/* --- Substack subscribe form --- */
.substack-form {
  display: flex;
  gap: 10px;
  margin-top: var(--space-lg);
  max-width: 480px;
}

.substack-form__input {
  flex: 1;
  padding: 12px 16px;
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.substack-form__input:focus {
  border-color: var(--color-accent);
}

.substack-form__input::placeholder {
  color: var(--color-text-secondary);
}

.substack-form__btn {
  padding: 12px 24px;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.substack-form__btn:hover {
  background: #9b2ff0;
}

/* --- Typewriter cursor --- */
.tw-cursor {
  color: var(--color-accent);
  font-weight: 300;
  animation: tw-blink 0.6s step-end infinite;
  margin-left: 1px;
}

@keyframes tw-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════
   COVER
   ═══════════════════════════════════════════════════════ */
.section--cover {
  text-align: center;
  background: var(--color-bg);
}

.section--cover .section__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cover__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.cover__accent {
  width: 64px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-top: var(--space-md);
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover__accent.in-view {
  transform: scaleX(1);
}

.cover__subtitle {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-accent);
  margin-top: var(--space-sm);
  letter-spacing: -0.015em;
}

.cover__hook {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
  letter-spacing: -0.01em;
  max-width: 40ch;
}

.cover__scroll {
  position: absolute;
  bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ═══════════════════════════════════════════════════════
   TEXT SECTION (intro/how-to-read)
   ═══════════════════════════════════════════════════════ */
.content--narrow {
  max-width: 680px;
}

.section--text {
  min-height: 80vh;
}

/* ═══════════════════════════════════════════════════════
   TABLE OF CONTENTS
   ═══════════════════════════════════════════════════════ */
.section--toc {
  min-height: 80vh;
}

.toc__list {
  list-style: none;
  margin-top: var(--space-lg);
}

.toc__item {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-lg);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.toc__item:hover {
  background: var(--color-accent-light);
}

.toc__item:last-child {
  border-bottom: none;
}

.toc__num {
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}

.toc__label {
  flex: 1;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.toc__page {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════ */
.section--divider {
  text-align: left;
  background: var(--color-divider-bg);
}

.divider__title {
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.divider__brand {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════
   QUOTE
   ═══════════════════════════════════════════════════════ */
.section--quote {
  text-align: center;
}

.section--quote .section__inner::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  margin: 0 auto var(--space-md);
  border-radius: 2px;
}

.quote__text {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 22ch;
  margin: 0 auto;
}

.quote__text em {
  color: var(--color-accent);
  font-style: normal;
}

/* ═══════════════════════════════════════════════════════
   CONTENT SPLIT (text + visual)
   ═══════════════════════════════════════════════════════ */
.content--split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-xl);
  align-items: center;
  max-width: var(--max-width);
  min-width: 0;
}

.split__visual {
  min-width: 0;
}

.split__text {
  padding-right: var(--space-md);
}

/* ═══════════════════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════════════════ */
.section--charts .section__inner {
  max-width: var(--max-width);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  min-width: 0;
}

.charts-row > * {
  min-width: 0;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--color-border);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-embed--hero {
  max-width: 840px;
  margin: 0 auto;
}

.chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.chart-caption {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 10px;
  min-height: 1.4em;
  transition: color 0.2s ease;
}

.chart-caption--active {
  color: var(--color-text);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.4;
  width: 240px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 20;
  white-space: normal;
}

.chart-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.chart-wrap canvas {
  width: 100% !important;
  max-width: 100%;
  touch-action: none;
}

.chart-wrap--with-toggle {
  display: flex;
  flex-direction: column;
}

.chart-wrap--with-toggle canvas {
  flex: 1;
  min-height: 0;
}

/* ── Country toggle buttons ── */
.chart-toggle {
  display: flex;
  gap: 6px;
  padding-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.toggle-btn {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 100px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.toggle-btn:hover {
  border-color: var(--color-text-secondary);
}

.toggle-btn--active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.toggle-btn--active:hover {
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════
   SCATTER PLOT CONTROLS (T3 — GDP vs Electricity)
   ═══════════════════════════════════════════════════════ */
.scatter-controls {
  margin-top: var(--space-md);
}

.scatter-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-xs);
}

.scatter-toggle {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: 100px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.scatter-toggle:hover {
  border-color: var(--color-text-secondary);
}

.scatter-toggle--active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.scatter-toggle--active:hover {
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════
   SLIDE NUMBER
   ═══════════════════════════════════════════════════════ */
.slide-number {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   T5 — POWER SCALING EXPLORER
   ═══════════════════════════════════════════════════════ */
.power-scale {
  background: var(--color-surface);
  border-radius: 12px;
  padding: var(--space-md);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.power-scale__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.power-scale__items {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.power-scale__item {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 4px;
}

.power-scale__item[data-log="12"] { opacity: 1; }
.power-scale__item[data-log="9"] { opacity: 0.88; margin-left: 4%; }
.power-scale__item[data-log="6"] { opacity: 0.76; margin-left: 8%; }
.power-scale__item[data-log="3"] { opacity: 0.64; margin-left: 12%; }
.power-scale__item[data-log="0"] { opacity: 0.52; margin-left: 16%; }

.power-scale__item.power-scale__item--active {
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(200, 80, 192, 0.4);
  opacity: 1 !important;
}

.power-scale__item.power-scale__item--dimmed {
  opacity: 0.25 !important;
}

.power-scale__unit {
  font-size: var(--text-lg);
  font-weight: 800;
}

.power-scale__desc {
  font-size: var(--text-xs);
  opacity: 0.9;
  line-height: 1.4;
}

.power-scale__exp {
  font-size: var(--text-xs);
  opacity: 0.7;
  text-align: right;
}

.power-scale__slider {
  width: 100%;
  margin-top: var(--space-sm);
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
}

.power-scale__slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.power-scale__readout {
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-accent);
  margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════
   T10 — INTERACTIVE TIMELINE
   ═══════════════════════════════════════════════════════ */
/* ── Marquee timeline ── */
.marquee {
  position: relative;
  overflow: hidden;
  padding: var(--space-md) 0 var(--space-sm);
  mask-image: linear-gradient(
    to right,
    transparent,
    black 8%,
    black 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 8%,
    black 92%,
    transparent
  );
}

.marquee__track {
  display: flex;
  gap: var(--space-md);
  width: max-content;
  animation: marquee-scroll 45s linear infinite;
  will-change: transform;
}

.marquee__track:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee__card {
  flex: 0 0 auto;
  width: 180px;
  padding: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.marquee__card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(172, 68, 255, 0.1);
}

.marquee__card--crisis {
  border-left: 3px solid var(--chart-red);
}

.marquee__card--era {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--color-accent);
  border-color: var(--color-accent);
  text-align: center;
  width: 140px;
}

.marquee__card--era:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(172, 68, 255, 0.25);
}

.marquee__era-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.marquee__era-range {
  display: block;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.marquee__year {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.marquee__title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 4px;
}

.marquee__desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.marquee__controls,
.marquee__scrub-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.marquee__controls {
  margin-top: var(--space-sm);
}

.marquee__scrub-row {
  margin-top: 16px;
}

.marquee__speed-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 62px;
  text-align: right;
  flex-shrink: 0;
}

.marquee__speed,
.marquee__position {
  width: 160px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.marquee__speed::-webkit-slider-thumb,
.marquee__position::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.marquee__speed::-moz-range-thumb,
.marquee__position::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.marquee__spacer {
  width: 28px;
  flex-shrink: 0;
}

.marquee__restart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 0;
  margin-left: 2px;
}

.marquee__restart:hover {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.marquee__restart svg {
  width: 16px;
  height: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }
  .marquee {
    overflow-x: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* ═══════════════════════════════════════════════════════
   STAT CARDS (slide 6 visual)
   ═══════════════════════════════════════════════════════ */
.visual-placeholder {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:first-child {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stat-card__value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.stat-card__label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════
   GRID MAP (Slide 11)
   ═══════════════════════════════════════════════════════ */
.map-container {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.map-container__map {
  width: 100%;
  min-height: 360px;
  aspect-ratio: 4 / 3;
}

/* Override jsvectormap's height:100% to let aspect-ratio work */
#gridMap.jsvmap-container {
  height: auto;
  min-height: 360px;
  aspect-ratio: 4 / 3;
}

.map-search {
  margin-top: var(--space-md);
}

.map-search__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.map-search__input {
  width: 100%;
  max-width: 280px;
  font-family: var(--font);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 44px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.25s ease;
}

.map-search__input:focus {
  border-color: var(--color-accent);
}

.map-search__input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

/* ── Interconnection map labels & tie lines ── */
.ic-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.ic-label {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1.5px solid;
  pointer-events: auto;
  cursor: pointer;
}

.ic-label--western {
  top: 40%;
  left: 12%;
  color: #16a34a;
  border-color: #22c55e;
}

.ic-label--eastern {
  top: 30%;
  right: 8%;
  color: #2563eb;
  border-color: #3b82f6;
}

.ic-label--ercot {
  bottom: 18%;
  left: 42%;
  color: #d97706;
  border-color: #f59e0b;
}

.ic-ties {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* ── State data card ── */
.state-card {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 220px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 10;
}

.state-card--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.state-card__close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 10px 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.state-card__close:hover {
  color: var(--color-text);
}

.state-card__name {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  padding-right: 20px;
}

.state-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--color-border);
}

.state-card__row:last-child {
  border-bottom: none;
}

.state-card__dt {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.state-card__dd {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.state-card__dd[data-rating="aging"] {
  color: var(--chart-red);
}

.state-card__dd[data-rating="mixed"] {
  color: var(--chart-amber);
}

.state-card__dd[data-rating="modernizing"] {
  color: var(--chart-green);
}

/* ── State data bar (horizontal, below map) ── */
.state-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px var(--space-md);
  margin-top: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.state-bar__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.state-bar--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.state-bar__name {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  white-space: nowrap;
}

.state-bar__item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--color-text);
  font-weight: 600;
  white-space: nowrap;
}

.state-bar__dt {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.state-bar [data-rating="aging"] { color: var(--chart-red); }
.state-bar [data-rating="mixed"] { color: var(--chart-amber); }
.state-bar [data-rating="modernizing"] { color: var(--chart-green); }


/* ═══════════════════════════════════════════════════════
   GRID DIAGRAM (Slide 12)
   ═══════════════════════════════════════════════════════ */
.section--diagram .section__inner {
  max-width: var(--max-width);
}

.grid-desc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-lg);
}

.grid-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.grid-desc strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Flow diagram ── */
.grid-flow {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-bottom: var(--space-md);
}

.grid-flow__track {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 36px;
  height: 3px;
  background: var(--color-border);
  z-index: 1;
  overflow: hidden;
  border-radius: 2px;
}

.grid-flow__spark {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--chart-amber);
  box-shadow:
    0 0 6px 2px var(--chart-amber),
    0 0 16px 4px rgba(245, 158, 11, 0.4);
  animation: spark-travel 3.5s ease-in-out infinite;
  animation-play-state: paused;
  z-index: 2;
}

.grid-flow__spark::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--chart-amber));
  border-radius: 2px;
  opacity: 0.5;
}

.grid-flow__spark--b {
  animation-delay: 1.75s;
}

.in-view .grid-flow__spark {
  animation-play-state: running;
}

@keyframes spark-travel {
  0% { left: -2%; opacity: 0; }
  4% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 102%; opacity: 0; }
}

.grid-flow__node {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 3;
}

.grid-flow__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  flex-shrink: 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.grid-flow__node:hover .grid-flow__icon {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(200, 80, 192, 0.15);
}

.grid-flow__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
  line-height: 1.4;
}

.grid-flow__voltage {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--color-accent-light);
  border-radius: 100px;
}

/* ─────────────────────────────────────────────────────────
 * STORYBOARD — Scroll Hint Arrow
 *
 *    0ms   arrow visible, opacity 1
 *  idle    arrow nudges right 6px in a loop (1.2s cycle)
 *  scroll  arrow fades out (0.3s), display none
 * ───────────────────────────────────────────────────────── */

.scroll-hint {
  display: none;
}

@media (max-width: 900px) {
  .scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  .scroll-hint--hidden {
    opacity: 0;
    pointer-events: none;
  }

  .scroll-hint__arrow {
    display: inline-block;
    animation: hint-nudge 1.2s ease-in-out infinite;
  }

  @keyframes hint-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
  }
}

/* ═══════════════════════════════════════════════════════
   INTERACTIVE FLOW DIAGRAMS (Figma 20 & 21)
   ═══════════════════════════════════════════════════════ */

.interactive-diagram {
  position: relative;
  width: 100%;
}

.interactive-diagram canvas {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.diagram-tooltip {
  display: none;
  position: absolute;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #333;
  max-width: 200px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.diagram-tooltip strong {
  color: #111;
  display: block;
  margin-bottom: 2px;
}

.diagram-hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
}

.turbine-img-wrap {
  position: relative;
  margin-bottom: var(--space-sm);
}
.turbine-illustration {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.turbine-hl {
  position: absolute;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  box-shadow: 0 0 0 2px rgba(172, 68, 255, 0.6),
    0 0 18px 4px rgba(172, 68, 255, 0.35);
  background: rgba(172, 68, 255, 0.1);
}
.turbine-hl.active {
  opacity: 1;
}
/* Highlight regions mapped to turbine-diagram.png */
.turbine-hl[data-hl="steam"]   { left: 0%;   top: 15%; width: 17%; height: 75%; }
.turbine-hl[data-hl="turbine"] { left: 17%;  top: 3%;  width: 25%; height: 82%; }
.turbine-hl[data-hl="shaft"]   { left: 40%;  top: 25%; width: 14%; height: 58%; }
.turbine-hl[data-hl="rotor"]   { left: 53%;  top: 10%; width: 15%; height: 78%; }
.turbine-hl[data-hl="coils"]   { left: 50%;  top: 0%;  width: 32%; height: 92%; }
.turbine-hl[data-hl="current"] { left: 78%;  top: 5%;  width: 22%; height: 85%; }

/* ── Regulatory Org Chart ── */
.org-chart {
  position: relative;
  width: 100%;
}

.org-chart canvas {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* ═══════════════════════════════════════════════════════
   DEMAND BUILDER (Slide 60)
   ═══════════════════════════════════════════════════════ */
.demand-builder {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demand-builder__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.demand-builder__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.demand-builder__target {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

.demand-builder__bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demand-builder__bar-bg {
  flex: 1;
  height: 28px;
  background: var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
}

.demand-builder__segment {
  height: 100%;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.demand-builder__pct {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  min-width: 36px;
  text-align: right;
}

.demand-builder__offset-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-align: center;
  font-weight: 500;
}

.demand-builder__toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demand-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.demand-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.demand-toggle__switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.demand-toggle__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.demand-toggle__input:checked + .demand-toggle__switch::after {
  transform: translateX(16px);
}

.demand-toggle__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.demand-toggle__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.demand-toggle__gw {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════
   FREQUENCY SIMULATOR (Slide 13)
   ═══════════════════════════════════════════════════════ */

/* ── Oscilloscope panel ── */
.freq-sim {
  background: #0a0a0f;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.freq-sim__canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 8px;
}

.freq-sim__meter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: var(--space-sm);
}

.freq-sim__hz {
  font-size: var(--text-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #10b981;
  letter-spacing: -0.03em;
  transition: color 0.4s ease;
}

.freq-sim__unit {
  font-size: var(--text-lg);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.freq-sim__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.freq-sim__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  transition: background 0.4s ease;
}

.freq-sim__status-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.freq-sim__callout {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  min-height: 2.4em;
  line-height: 1.4;
  transition: opacity 0.3s ease;
}

/* ── Controls ── */
.freq-controls {
  margin-top: var(--space-lg);
}

.freq-controls__group {
  margin-top: var(--space-md);
}

.freq-controls__group:first-child {
  margin-top: 0;
}

.freq-controls__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.freq-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.freq-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

.freq-toggle__name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.freq-toggle__gw {
  font-size: 0.65rem;
  color: var(--color-text-secondary);
}

/* Active states per source */
.freq-toggle--active[data-source="gas"] {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--chart-amber);
}

.freq-toggle--active[data-source="coal"] {
  background: rgba(55, 65, 81, 0.15);
  border-color: var(--chart-coal);
}

.freq-toggle--active[data-source="nuclear"] {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--chart-red);
}

.freq-toggle--active[data-source="wind"] {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--chart-green);
}

.freq-toggle--active[data-source="solar"] {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--chart-orange);
}

.freq-toggle:not(.freq-toggle--active) {
  opacity: 0.45;
}

.freq-toggle:not(.freq-toggle--active) .freq-toggle__gw {
  text-decoration: line-through;
}

.freq-supply-total {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
  font-variant-numeric: tabular-nums;
}

.freq-supply-total strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Demand slider ── */
.freq-slider {
  width: 100%;
  max-width: 320px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.freq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid var(--color-bg);
  box-shadow: 0 2px 8px rgba(200, 80, 192, 0.4);
}

.freq-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid var(--color-bg);
  box-shadow: 0 2px 8px rgba(200, 80, 192, 0.4);
}

.freq-demand-value {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
  font-variant-numeric: tabular-nums;
}
.freq-demand-value strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   DEMAND GROWTH EXPLORER (Slide 14)
   ═══════════════════════════════════════════════════════ */
.demand-controls {
  margin-top: var(--space-sm);
}

.demand-drivers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space-xs);
}

.demand-driver {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.demand-driver[data-driver="ai"] {
  --driver-color: #3b82f6;
}

.demand-driver[data-driver="ev"] {
  --driver-color: #10b981;
}

.demand-driver[data-driver="ind"] {
  --driver-color: #f59e0b;
}

.demand-driver__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demand-driver__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--driver-color);
}

.demand-driver__name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.demand-driver__mult {
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--driver-color);
  min-width: 3ch;
  text-align: right;
}

.demand-driver__slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  margin-top: 4px;
  cursor: pointer;
  margin-top: 8px;
}

.demand-driver__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--driver-color);
  cursor: pointer;
  border: 2px solid var(--color-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.demand-driver__slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--driver-color);
  cursor: pointer;
  border: 2px solid var(--color-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.demand-driver__twh {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── Power Gap readout ── */
.demand-gap {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.demand-gap__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
  margin-bottom: 2px;
}

.demand-gap__value {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--chart-red);
  transition: color 0.4s ease;
}

.demand-gap__unit {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.demand-gap__unit span {
  font-weight: 700;
  color: var(--chart-red);
  transition: color 0.4s ease;
}

.demand-gap--surplus .demand-gap__value,
.demand-gap--surplus .demand-gap__unit span {
  color: var(--chart-green);
}

.chart-wrap--demand {
  aspect-ratio: 4 / 3;
}

/* ═══════════════════════════════════════════════════════
   T15 — CHALLENGE INTERACTION WEB
   ═══════════════════════════════════════════════════════ */
.challenge-web-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.challenge-web__canvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
  padding: var(--space-lg) var(--content-padding);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__disclaimer {
  margin-top: var(--space-md);
  line-height: 1.6;
  max-width: 720px;
}

/* ═══════════════════════════════════════════════════════
   CHAMATH AUDIO PLAYER
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
 * STORYBOARD — Audio Player
 *
 *  Idle:     pill visible, play icon, bars flat
 *  Click:    play icon → pause, pill glows, bars animate
 *  Playing:  bars dance (staggered sine), progress ring fills
 *  End:      pause → play, bars settle, glow fades
 * ───────────────────────────────────────────────────────── */

.chamath-player {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  border-radius: 24px;
  border: 1.5px solid rgba(172, 68, 255, 0.35);
  background: var(--color-bg);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 3px rgba(172, 68, 255, 0.06),
              0 2px 8px rgba(172, 68, 255, 0.08);
  transition:
    border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 12px;
}

.chamath-player:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(172, 68, 255, 0.1),
              0 4px 16px rgba(172, 68, 255, 0.14);
}

.chamath-player:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.chamath-player--playing {
  border-color: var(--color-accent);
  background: rgba(172, 68, 255, 0.04);
  box-shadow:
    0 0 0 3px rgba(172, 68, 255, 0.08),
    0 4px 16px rgba(172, 68, 255, 0.12);
}

/* --- Play/Pause button ring --- */
.chamath-player__btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chamath-player:hover .chamath-player__btn {
  transform: scale(1.08);
}

.chamath-player__btn svg {
  width: 14px;
  height: 14px;
  fill: #fff;
  transition: opacity 0.15s ease;
}

.chamath-player__btn .icon-play {
  margin-left: 2px;
}

.chamath-player__btn .icon-pause {
  display: none;
}

.chamath-player--playing .chamath-player__btn .icon-play {
  display: none;
}

.chamath-player--playing .chamath-player__btn .icon-pause {
  display: block;
}


/* --- Soundwave bars --- */
.chamath-player__bars {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 18px;
}

.chamath-player__bar {
  width: 3px;
  height: 4px;
  border-radius: 1.5px;
  background: var(--color-accent);
  opacity: 0.35;
  transition: height 0.15s ease, opacity 0.3s ease;
}

.chamath-player--playing .chamath-player__bar {
  opacity: 1;
  animation: bar-dance 0.8s ease-in-out infinite alternate;
}

.chamath-player--playing .chamath-player__bar:nth-child(1) {
  animation-delay: 0s;
}
.chamath-player--playing .chamath-player__bar:nth-child(2) {
  animation-delay: 0.12s;
}
.chamath-player--playing .chamath-player__bar:nth-child(3) {
  animation-delay: 0.24s;
}
.chamath-player--playing .chamath-player__bar:nth-child(4) {
  animation-delay: 0.06s;
}
.chamath-player--playing .chamath-player__bar:nth-child(5) {
  animation-delay: 0.18s;
}

@keyframes bar-dance {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* --- Label --- */
.chamath-player__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.chamath-player__sublabel {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 1px;
}

/* Pulsing dot — signals audio available, hides after first play */
.chamath-player__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  animation: player-pulse 2s ease-in-out infinite;
}

.chamath-player--played .chamath-player__pulse {
  display: none;
}

@keyframes player-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ─────────────────────────────────────────────────────────
 * STORYBOARD — Scrub Track
 *
 *  Idle:        hidden, height 0, opacity 0
 *  Play:  0ms   container expands (height 0 → auto)
 *        80ms   track + time fade in
 *  Pause/End:   reverse — fade out then collapse
 * ───────────────────────────────────────────────────────── */

.chamath-player__scrub {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 4px 0 42px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease 0.08s;
}

.chamath-player--playing .chamath-player__scrub,
.chamath-player--paused .chamath-player__scrub {
  max-height: 24px;
  opacity: 1;
}

.chamath-player__track {
  flex: 1;
  height: 3px;
  background: rgba(172, 68, 255, 0.15);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.chamath-player__track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.chamath-player__track-thumb {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 0 4px rgba(172, 68, 255, 0.3);
}

.chamath-player__track:hover .chamath-player__track-thumb,
.chamath-player__track--dragging .chamath-player__track-thumb {
  opacity: 1;
}

.chamath-player__time {
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

.chamath-player__speed {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-border);
  border: none;
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s;
}

.chamath-player__speed:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ── Substack embed ── */
.substack-wrap {
  height: 120px;
  overflow: hidden;
  margin-left: -55px;
}
.substack-wrap iframe {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════
   MICRO-INTERACTIONS — tactile feedback & polish
   ═══════════════════════════════════════════════════════ */

/* --- Toggle press feedback --- */
.scatter-toggle:active,
.toggle-btn:active,
.freq-toggle:active {
  transform: scale(0.93);
  transition-duration: 0.08s;
}

/* --- Keyboard focus ring --- */
.scatter-toggle:focus-visible,
.toggle-btn:focus-visible,
.freq-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Slider thumb grow on drag --- */
.power-scale__slider::-webkit-slider-thumb {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.power-scale__slider:active::-webkit-slider-thumb {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(172, 68, 255, 0.18),
              0 2px 8px rgba(0, 0, 0, 0.15);
}

.demand-driver__slider::-webkit-slider-thumb {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.demand-driver__slider:active::-webkit-slider-thumb {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(172, 68, 255, 0.18),
              0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Firefox */
.power-scale__slider:active::-moz-range-thumb,
.demand-driver__slider:active::-moz-range-thumb {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(172, 68, 255, 0.18),
              0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Chart container entrance scale --- */
.chart-wrap {
  transform: scale(0.97);
  transform-origin: center center;
}
.in-view .chart-wrap,
.chart-wrap.in-view {
  transform: scale(1);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Freq toggle activation pulse --- */
@keyframes toggle-pulse {
  0% { box-shadow: 0 0 0 0 rgba(172, 68, 255, 0.35); }
  70% { box-shadow: 0 0 0 8px rgba(172, 68, 255, 0); }
  100% { box-shadow: none; }
}
.freq-toggle--active {
  animation: toggle-pulse 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Interactive canvas hint text --- */
.canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.5s ease;
}
.canvas-hint--hidden {
  opacity: 0;
}

/* --- Interactive element hint badge --- */
.interact-hint {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border: 1.5px solid rgba(172, 68, 255, 0.2);
  border-radius: 100px;
  margin-bottom: var(--space-xs);
}

.slide__header .interact-hint {
  display: flex;
}

.interact-hint svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS — Interface Craft storyboard pattern
   ═══════════════════════════════════════════════════════ */

/* Initial hidden state */
.anim {
  opacity: 0;
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim[data-anim="fade-up"] {
  transform: translateY(24px);
}

.anim[data-anim="fade"] {
  transform: none;
}

/* Revealed state */
.anim.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .content--split {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .split__text {
    padding-right: 0;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    aspect-ratio: auto;
    min-height: 280px;
    height: 300px;
  }

  .visual-placeholder {
    grid-template-columns: 1fr;
  }

  .quote__text {
    max-width: none;
  }

  .section--quote .section__inner::before {
    width: 32px;
  }

  .grid-desc-row {
    grid-template-columns: 1fr;
  }

  .grid-flow {
    overflow-x: auto;
    gap: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-sm);
  }

  .grid-flow__node {
    min-width: 90px;
  }

  .grid-flow__icon {
    width: 56px;
    height: 56px;
  }

  .grid-flow__icon svg {
    width: 28px;
    height: 28px;
  }

  .grid-flow__track {
    top: 28px;
  }

  .freq-slider {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .section {
    min-height: auto;
    padding: 5rem var(--content-padding);
  }

  .section--cover,
  .section--divider,
  .section--quote {
    min-height: 100svh;
  }



  .toc__item {
    font-size: var(--text-base);
  }

  .map-search__input {
    max-width: 100%;
  }

  .map-container__map,
  #gridMap.jsvmap-container {
    min-height: 260px;
    aspect-ratio: 4 / 3;
  }

  .state-card {
    width: auto;
    left: var(--space-sm);
    right: var(--space-sm);
    bottom: var(--space-sm);
  }

  .state-bar__row {
    flex-wrap: wrap;
    gap: 4px var(--space-xs);
  }

  .chart-wrap {
    aspect-ratio: auto;
    min-height: 250px;
    height: 280px;
  }

  .grid-flow__node {
    min-width: 80px;
  }

  .grid-flow__icon {
    width: 48px;
    height: 48px;
  }

  .grid-flow__icon svg {
    width: 24px;
    height: 24px;
  }

  .grid-flow__track {
    top: 24px;
  }

  .grid-flow__voltage {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  .nav-brand {
    font-size: 0.7rem;
  }

  .footer__top {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }

  .freq-slider {
    max-width: 100%;
  }

  .freq-sim__canvas {
    aspect-ratio: 4 / 3;
  }

  .cover__scroll {
    bottom: var(--space-md);
  }

  .nav-socials {
    gap: 2px;
  }

  .nav-social {
    width: 24px;
    height: 24px;
  }

  .nav-social svg {
    width: 13px;
    height: 13px;
  }

  .marquee__card {
    width: 150px;
  }

  .marquee__card--era {
    width: 110px;
  }

  .marquee__scrub-row {
    display: none;
  }

  .scatter-toggle--all {
    display: none;
  }

  .slide-nav-mobile {
    position: fixed;
    right: 12px;
    bottom: 24px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .slide-nav-mobile__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .slide-nav-mobile__btn:active {
    background: var(--color-accent-light);
    color: var(--color-accent);
  }

  /* Substack embed: remove negative margin, fit screen */
  .substack-wrap {
    margin-left: 0;
    height: 120px;
  }
  .substack-wrap iframe {
    width: 100%;
  }

  /* Demand builder header: stack on narrow screens */
  .demand-builder__header {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Nav dropdown: constrain to viewport */
  .nav-dropdown {
    min-width: 0;
    width: calc(100vw - 32px);
    max-width: 280px;
  }
}
