@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Sans+3:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-dark: #0d1117;
  --bg-dark-surface: #161b22;
  --bg-dark-elev: #21262d;
  --text-on-dark: #e6edf3;
  --text-on-dark-muted: #8b949e;
  --border-on-dark: #30363d;

  --bg-light: #fafafa;
  --bg-light-surface: #ffffff;
  --text-on-light: #1a1a1a;
  --text-on-light-muted: #555;
  --border-on-light: #e5e5e5;

  --accent-primary: #e63946;
  --accent-secondary: #457b9d;
  --accent-tertiary: #f4a261;

  --color-ai: #a855f7;
  --color-regime: #dc2626;
  --color-popculture: #f59e0b;
  --color-intervention: #3b82f6;
  --color-economy: #10b981;
  --color-international: #6366f1;
  --color-weather: #06b6d4;

  --font-headline: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-persian: 'Vazirmatn', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --col-narrow: 640px;
  --col-wide: 960px;
  --col-full: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-on-light);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; }

/* ---------- Progress bar (fixed top) ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-on-dark);
  transform: translateY(-100%);
  transition: transform 0.35s ease;
  color: var(--text-on-dark);
}
.progress-bar.visible { transform: translateY(0); }
.progress-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--color-ai), var(--color-regime), var(--color-popculture), var(--color-intervention), var(--color-economy), var(--color-international), var(--color-weather));
  opacity: 0.12;
  transition: width 0.1s linear;
}
.progress-bar-inner {
  position: relative;
  max-width: var(--col-full);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.progress-bar-title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text-on-dark);
}
.progress-bar-title small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}
.chapter-dots {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.chapter-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer;
  background: transparent;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.chapter-dot[data-color="ai"]            { --c: var(--color-ai); }
.chapter-dot[data-color="regime"]        { --c: var(--color-regime); }
.chapter-dot[data-color="popculture"]    { --c: var(--color-popculture); }
.chapter-dot[data-color="intervention"]  { --c: var(--color-intervention); }
.chapter-dot[data-color="economy"]       { --c: var(--color-economy); }
.chapter-dot[data-color="international"] { --c: var(--color-international); }
.chapter-dot[data-color="weather"]       { --c: var(--color-weather); }
.chapter-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.chapter-dot:hover { transform: scale(1.15); border-color: rgba(255,255,255,0.6); }
.chapter-dot.active { border-color: var(--c); transform: scale(1.2); }
.chapter-dot.active::after { opacity: 1; }
.chapter-dot .dot-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  background: rgba(13,17,23,0.95);
  padding: 4px 8px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.chapter-dot:hover .dot-tooltip { opacity: 1; }

/* ---------- Section 0: Opening ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-video {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.85) brightness(0.8);
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(13,17,23,0.35) 0%, rgba(13,17,23,0.85) 100%),
    linear-gradient(180deg, rgba(13,17,23,0.0) 0%, rgba(13,17,23,0.6) 80%, rgba(13,17,23,1) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 60px 24px 120px;
  text-align: center;
}
.kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 28px;
}
.hero h1 {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 28px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.5);
}
.hero h1 em { font-style: italic; color: #ffd3c9; }
.hero-subhead {
  font-family: var(--font-headline);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--text-on-dark-muted);
  max-width: 740px;
  margin: 0 auto 40px;
}
.hero-byline {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: 48px;
}
.hero-byline span { color: var(--text-on-dark); }
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%; transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  z-index: 3;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.65; }
  50%      { transform: translate(-50%, 6px); opacity: 1; }
}
.sound-toggle {
  position: absolute;
  bottom: 20px; right: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px; height: 44px;
  color: white;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.sound-toggle:hover { background: rgba(0,0,0,0.85); transform: scale(1.08); }

/* ---------- Intro section ---------- */
.intro-section {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 80px 24px 120px;
}
.intro-grid {
  max-width: var(--col-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.intro-text h2 {
  font-family: var(--font-headline);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}
.intro-text p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--text-on-dark);
}
.intro-text p.muted { color: var(--text-on-dark-muted); font-size: 15px; }
.intro-card {
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-on-dark);
  border-radius: 8px;
  padding: 20px;
}
.intro-card video {
  width: 100%;
  border-radius: 4px;
  aspect-ratio: 9/16;
  object-fit: cover;
  background: #000;
}
.intro-card .caption {
  font-size: 13px;
  color: var(--text-on-dark-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ---------- Section 1: Dataset overview ---------- */
.dataset {
  background: var(--bg-light);
  padding: 100px 24px;
  border-top: 1px solid var(--border-on-light);
}
.dataset-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
}
.section-kicker {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 16px;
  text-align: center;
}
.section-head {
  font-family: var(--font-headline);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 28px;
  max-width: 820px;
  margin-left: auto; margin-right: auto;
}
.section-lede {
  font-family: var(--font-headline);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-on-light-muted);
  max-width: 680px;
  margin: 0 auto 60px;
  text-align: center;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 60px auto 0;
}
.stat-card {
  background: var(--bg-light-surface);
  border: 1px solid var(--border-on-light);
  border-radius: 6px;
  padding: 28px 20px;
  text-align: center;
}
.stat-card .num {
  font-family: var(--font-headline);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-on-light);
  margin-bottom: 10px;
}
.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-light-muted);
}
.stat-card[data-type="video"]  .num { color: var(--accent-primary); }
.stat-card[data-type="image"]  .num { color: var(--accent-secondary); }
.stat-card[data-type="text"]   .num { color: var(--accent-tertiary); }

/* Timeline chart */
.timeline-wrap {
  margin: 60px auto 40px;
  max-width: 900px;
}
.timeline-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-body);
}
.timeline-svg .bar {
  fill: var(--accent-secondary);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.timeline-svg .bar:hover { opacity: 1; }
.timeline-svg .bar-war { fill: var(--accent-primary); opacity: 0.85; }
.timeline-svg .axis text {
  font-size: 11px;
  fill: var(--text-on-light-muted);
  font-family: var(--font-body);
}
.timeline-svg .axis path,
.timeline-svg .axis line {
  stroke: var(--border-on-light);
  shape-rendering: crispEdges;
}
.timeline-svg .annotation-line {
  stroke: var(--accent-primary);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}
.timeline-svg .annotation-text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--accent-primary);
  letter-spacing: 0.02em;
}
.timeline-svg .gap-rect {
  fill: var(--border-on-light);
  opacity: 0.4;
}
.timeline-svg .gap-text {
  font-size: 10px;
  fill: var(--text-on-light-muted);
  font-style: italic;
}
.timeline-caption {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-on-light-muted);
  text-align: center;
  margin-top: 8px;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
  line-height: 1.5;
}

/* ---------- Chapters: general ---------- */
.chapter {
  padding: 100px 24px;
  border-top: 1px solid var(--border-on-light);
}
.chapter-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
}
.chapter.dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-top-color: var(--border-on-dark);
}
.chapter.dark .section-kicker { color: var(--chapter-color, var(--accent-primary)); }
.chapter.dark .section-lede { color: var(--text-on-dark-muted); }

.chapter-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 56px;
}
.chapter-marker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--accent-primary));
  margin-bottom: 18px;
}
.chapter-marker .bullet {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--chapter-color, var(--accent-primary));
  display: inline-block;
}
.chapter h2 {
  font-family: var(--font-headline);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-align: center;
  margin-bottom: 24px;
  max-width: 820px;
}
.chapter-intro {
  font-family: var(--font-headline);
  font-weight: 400;
  font-style: italic;
  font-size: 21px;
  line-height: 1.55;
  color: var(--text-on-light-muted);
  max-width: 680px;
  margin: 0 auto 0;
  text-align: center;
}
.chapter.dark .chapter-intro { color: var(--text-on-dark-muted); }

/* Post cards */
.posts-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
.posts-grid.two { grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .posts-grid.two { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .posts-grid.three { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}

.post-card {
  background: var(--bg-light-surface);
  border: 1px solid var(--border-on-light);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.chapter.dark .post-card {
  background: var(--bg-dark-surface);
  border-color: var(--border-on-dark);
}
.post-media {
  position: relative;
  background: #000;
  aspect-ratio: 9/16;
  overflow: hidden;
}
.post-media.landscape { aspect-ratio: 16/9; }
.post-media video,
.post-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.post-media .loading-pulse {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  background-size: 200% 100%;
  animation: pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse { 0%, 100% { background-position: 200% 0; } 50% { background-position: -200% 0; } }
.post-media .video-indicator {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  z-index: 2;
}
.post-media .post-sound {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: white;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.post-media .post-sound:hover { background: rgba(0,0,0,0.85); }

.post-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-on-light-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.chapter.dark .post-meta { color: var(--text-on-dark-muted); }
.post-meta .sep { opacity: 0.5; }
.post-meta .chip {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--chapter-color-soft, rgba(0,0,0,0.06));
  color: var(--chapter-color, var(--text-on-light));
  border: 1px solid var(--chapter-color-border, transparent);
}
.chapter.dark .post-meta .chip {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.post-meta .chip.ai-flag {
  background: rgba(168,85,247,0.12);
  color: var(--color-ai);
  border-color: rgba(168,85,247,0.3);
}

.post-text {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-on-light);
  white-space: pre-line;
}
.chapter.dark .post-text { color: var(--text-on-dark); }

.post-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.post-tags .tag {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-on-light-muted);
  background: rgba(0,0,0,0.04);
  padding: 2px 8px;
  border-radius: 3px;
}
.chapter.dark .post-tags .tag {
  background: rgba(255,255,255,0.05);
  color: var(--text-on-dark-muted);
}

.transcript {
  margin-top: 6px;
  border-top: 1px dashed var(--border-on-light);
  padding-top: 10px;
}
.chapter.dark .transcript { border-top-color: var(--border-on-dark); }
.transcript summary {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-light-muted);
  cursor: pointer;
  list-style: none;
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.2s;
}
.transcript[open] summary::before { transform: rotate(90deg); }
.transcript .transcript-body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-on-light-muted);
  margin-top: 8px;
  font-style: italic;
  padding-left: 10px;
  border-left: 2px solid var(--border-on-light);
}
.chapter.dark .transcript .transcript-body {
  color: var(--text-on-dark-muted);
  border-left-color: var(--border-on-dark);
}

/* ---------- Ch2 specific: the turn ---------- */
.before-after-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  text-align: center;
  margin: 60px 0 24px;
  padding-top: 30px;
  border-top: 1px solid var(--border-on-dark);
}
.before-after-label .accent { color: var(--color-regime); }

/* Feb 28 live feed */
.livefeed {
  max-width: 760px;
  margin: 80px auto 40px;
  position: relative;
}
.livefeed-header {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-regime);
  margin-bottom: 8px;
}
.livefeed-header::before {
  content: '● ';
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.livefeed h3 {
  font-family: var(--font-headline);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.livefeed-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-on-dark-muted);
  margin-bottom: 24px;
}
.livefeed-entries {
  border-left: 2px solid var(--color-regime);
  padding-left: 0;
}
.livefeed-entry {
  padding: 14px 0 14px 20px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.livefeed-entry.visible { opacity: 1; transform: translateX(0); }
.livefeed-entry .time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-regime);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.livefeed-entry .body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-on-dark);
  white-space: pre-line;
}

/* ---------- Ch7: weather grid ---------- */
.weather-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .weather-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
.weather-cell {
  background: var(--bg-light-surface);
  border: 1px solid var(--border-on-light);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.weather-cell .post-media { aspect-ratio: 9/16; }
.weather-cell .cell-caption {
  padding: 12px 14px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-on-light);
  background: var(--bg-light-surface);
}

/* ---------- Section 3: Closing / Mosaic ---------- */
.closing {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 120px 24px 140px;
}
.closing-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  text-align: center;
}
.closing h2 {
  font-family: var(--font-headline);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
  max-width: 820px;
  margin-left: auto; margin-right: auto;
}
.closing .closing-lede {
  font-family: var(--font-headline);
  font-style: italic;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-on-dark-muted);
  max-width: 680px;
  margin: 0 auto 48px;
}

.mosaic-wrap {
  margin: 60px auto;
  max-width: 1100px;
  position: relative;
}
.mosaic-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-on-dark);
  border-radius: 6px;
  cursor: crosshair;
}
.mosaic-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.04em;
}
.mosaic-legend span {
  display: inline-flex; align-items: center; gap: 8px;
}
.mosaic-legend .swatch {
  width: 12px; height: 12px; border-radius: 2px;
  display: inline-block;
}
.mosaic-tooltip {
  position: absolute;
  background: rgba(13,17,23,0.96);
  border: 1px solid var(--border-on-dark);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-on-dark);
  max-width: 320px;
  pointer-events: none;
  z-index: 10;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.mosaic-tooltip .date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-on-dark-muted);
  margin-bottom: 4px;
}
.mosaic-tooltip .theme {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-tertiary);
  margin-top: 4px;
}

.final-line {
  font-family: var(--font-headline);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  margin-top: 60px;
  color: var(--text-on-dark);
}
.final-line strong {
  font-weight: 700;
  font-style: normal;
  color: var(--accent-primary);
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  padding: 40px 24px 60px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid var(--border-on-dark);
}
footer a {
  color: var(--text-on-dark);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.3);
}
footer a:hover { text-decoration-color: white; }

/* ---------- Persian text helpers ---------- */
.persian {
  font-family: var(--font-persian);
  direction: rtl;
  text-align: right;
  font-size: 15px;
  line-height: 1.8;
}

/* ---------- Utility ---------- */
.muted { color: var(--text-on-light-muted); }
.chapter.dark .muted { color: var(--text-on-dark-muted); }
.mono { font-family: var(--font-mono); }

/* ---------- Chapter color variables ---------- */
.chapter[data-color="ai"]            { --chapter-color: var(--color-ai);            --chapter-color-soft: rgba(168,85,247,0.12); --chapter-color-border: rgba(168,85,247,0.3); }
.chapter[data-color="regime"]        { --chapter-color: var(--color-regime);        --chapter-color-soft: rgba(220,38,38,0.12);  --chapter-color-border: rgba(220,38,38,0.3); }
.chapter[data-color="popculture"]    { --chapter-color: var(--color-popculture);    --chapter-color-soft: rgba(245,158,11,0.12); --chapter-color-border: rgba(245,158,11,0.3); }
.chapter[data-color="intervention"]  { --chapter-color: var(--color-intervention);  --chapter-color-soft: rgba(59,130,246,0.12); --chapter-color-border: rgba(59,130,246,0.3); }
.chapter[data-color="economy"]       { --chapter-color: var(--color-economy);       --chapter-color-soft: rgba(16,185,129,0.12); --chapter-color-border: rgba(16,185,129,0.3); }
.chapter[data-color="international"] { --chapter-color: var(--color-international); --chapter-color-soft: rgba(99,102,241,0.12); --chapter-color-border: rgba(99,102,241,0.3); }
.chapter[data-color="weather"]       { --chapter-color: var(--color-weather);       --chapter-color-soft: rgba(6,182,212,0.12);  --chapter-color-border: rgba(6,182,212,0.3); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .progress-bar-inner { padding: 8px 14px; }
  .progress-bar-title { font-size: 13px; }
  .chapter-dot { width: 14px; height: 14px; }
  .stat-cards { grid-template-columns: 1fr; }
  .stat-card .num { font-size: 36px; }
  .chapter { padding: 60px 16px; }
  .section-head { font-size: 28px; }
  .section-lede { font-size: 17px; }
  .chapter h2 { font-size: 28px; }
  .chapter-intro { font-size: 17px; }
  .closing { padding: 80px 16px; }
  .final-line { font-size: 20px; }
}

/* ============================================================
   LEGO HEADLINE
   ============================================================ */
.lego-headline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: none !important;
  perspective: 800px;
}
.lego-word {
  display: inline-flex;
  gap: 2px;
}
.lego-brick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 5.2vw, 56px);
  line-height: 1;
  width: 0.78em;
  height: 1em;
  padding: 0.18em 0.06em 0.06em;
  margin-top: 0.32em;
  border-radius: 5px 5px 6px 6px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  background: var(--lb, #d62828);
  box-shadow:
    inset 0 -0.18em 0 rgba(0, 0, 0, 0.18),
    inset 0 0.05em 0 rgba(255, 255, 255, 0.18),
    0 0.18em 0 rgba(0, 0, 0, 0.32),
    0 0.32em 0.5em rgba(0, 0, 0, 0.45);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(.2,.9,.2,1.2);
}
.lego-brick::before {
  content: '';
  position: absolute;
  top: -0.32em;
  left: 50%;
  transform: translateX(-50%);
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--lb, #d62828);
  box-shadow:
    inset 0 -0.08em 0 rgba(0, 0, 0, 0.28),
    inset 0 0.05em 0 rgba(255, 255, 255, 0.35),
    0 0.05em 0 rgba(0, 0, 0, 0.25);
}
.lego-brick.is-space {
  width: 0.45em;
  background: transparent;
  box-shadow: none;
  color: transparent;
}
.lego-brick.is-space::before { display: none; }
.lego-headline:hover .lego-brick {
  transform: translateY(-2px) rotate(-1deg);
}

/* ============================================================
   HERO BYLINE LINK
   ============================================================ */
.hero-byline a {
  color: var(--text-on-dark);
  text-decoration: underline;
  text-decoration-color: rgba(230, 57, 70, 0.6);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.hero-byline a:hover { text-decoration-color: var(--accent-primary); }

/* ============================================================
   CAROUSEL
   ============================================================ */
.carousel-section {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 100px 24px;
  border-top: 1px solid var(--border-on-dark);
}
.carousel-section .section-kicker { color: var(--accent-tertiary); }
.carousel-section .section-head { color: var(--text-on-dark); }
.carousel-section .section-lede { color: var(--text-on-dark-muted); }
.carousel-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.carousel {
  position: relative;
  margin-top: 40px;
}
.carousel-viewport {
  overflow: hidden;
  border-radius: 8px;
}
.carousel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 calc((100% - 32px) / 3);
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-on-dark);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
@media (max-width: 1024px) {
  .carousel-slide { flex: 0 0 calc((100% - 16px) / 2); }
}
@media (max-width: 720px) {
  .carousel-slide { flex: 0 0 100%; }
}
.carousel-slide .slide-media {
  position: relative;
  background: #000;
  aspect-ratio: 9/16;
  overflow: hidden;
}
.carousel-slide video,
.carousel-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.carousel-slide .slide-caption {
  padding: 14px 16px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-on-dark-muted);
}
.carousel-slide .slide-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-tertiary);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.carousel-slide .slide-sound {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: white;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(13,17,23,0.85);
  border: 1px solid var(--border-on-dark);
  border-radius: 50%;
  color: var(--text-on-dark);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.carousel-nav:hover { background: var(--accent-primary); border-color: var(--accent-primary); transform: translateY(-50%) scale(1.05); }
.carousel-nav.prev { left: -10px; }
.carousel-nav.next { right: -10px; }
.carousel-nav:disabled { opacity: 0.3; cursor: default; }
.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 0;
  background: var(--text-on-dark-muted);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  padding: 0;
}
.carousel-dots button.active {
  opacity: 1;
  transform: scale(1.3);
  background: var(--accent-primary);
}

/* ============================================================
   CHAPTER TRACKER (top-right pie)
   ============================================================ */
.chapter { position: relative; }
.chapter-tracker {
  position: absolute;
  top: 40px;
  right: 24px;
  z-index: 4;
  width: 180px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-on-light);
  border-radius: 8px;
  padding: 14px 14px 14px;
  font-family: var(--font-body);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.chapter.dark .chapter-tracker {
  background: rgba(22, 27, 34, 0.92);
  border-color: var(--border-on-dark);
  color: var(--text-on-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.tracker-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tracker-pie {
  flex: 0 0 50px;
  width: 50px; height: 50px;
}
.tracker-num {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.tracker-num .pct {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  color: var(--chapter-color, var(--accent-primary));
}
.tracker-num .of {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-light-muted);
}
.chapter.dark .tracker-num .of { color: var(--text-on-dark-muted); }
.tracker-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-on-light);
}
.chapter.dark .tracker-label { color: var(--text-on-dark); }
.tracker-sub {
  margin-top: 8px;
  border-top: 1px dashed var(--border-on-light);
  padding-top: 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chapter.dark .tracker-sub { border-top-color: var(--border-on-dark); }
.tracker-sub .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-on-light-muted);
}
.chapter.dark .tracker-sub .row { color: var(--text-on-dark-muted); }
.tracker-sub .row strong {
  color: var(--chapter-color, var(--accent-primary));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Push chapter-header text away from the tracker on big screens */
@media (min-width: 1080px) {
  .chapter-header { padding-top: 0; }
}
@media (max-width: 900px) {
  .chapter-tracker {
    position: static;
    width: auto;
    margin: 0 auto 24px;
    max-width: 320px;
  }
}

/* ============================================================
   REGIME SCATTER SECTION
   ============================================================ */
.regime-scatter-section {
  background: linear-gradient(180deg, #1a0d10 0%, #0d1117 100%);
  color: var(--text-on-dark);
  border-top: 1px solid var(--border-on-dark);
}
.regime-scatter-section .chapter-marker { color: var(--color-regime); }
.regime-scatter-section h2 { color: var(--text-on-dark); }
.regime-scatter-section .chapter-intro { color: var(--text-on-dark-muted); }
.regime-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto 40px;
}
.regime-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-on-dark);
  border-radius: 8px;
  padding: 20px 22px;
}
.regime-stat .head {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.regime-stat.anti .head { color: var(--accent-tertiary); }
.regime-stat.pro .head { color: var(--color-regime); }
.regime-stat .big {
  font-family: var(--font-headline);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
}
.regime-stat.anti .big { color: var(--accent-tertiary); }
.regime-stat.pro .big { color: var(--color-regime); }
.regime-stat .breakdown {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-on-dark-muted);
}
.regime-stat .breakdown b {
  color: var(--text-on-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
@media (max-width: 720px) {
  .regime-stats { grid-template-columns: 1fr; }
}

.scatter-wrap {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-on-dark);
  border-radius: 8px;
  padding: 24px 18px 18px;
}
.scatter-chart {
  position: relative;
  width: 100%;
  min-height: 480px;
}
.scatter-chart svg { width: 100%; height: auto; display: block; }
.scatter-chart .axis text {
  fill: var(--text-on-dark-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.scatter-chart .axis path,
.scatter-chart .axis line {
  stroke: var(--border-on-dark);
}
.scatter-chart .divider {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-dasharray: 4 4;
}
.scatter-chart .war-line {
  stroke: var(--color-regime);
  stroke-dasharray: 5 4;
  stroke-width: 1.5;
}
.scatter-chart .war-label {
  fill: var(--color-regime);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scatter-chart .side-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.scatter-chart .side-label.anti { fill: var(--accent-tertiary); }
.scatter-chart .side-label.pro { fill: var(--color-regime); }
.scatter-tile {
  cursor: pointer;
  transition: opacity 0.4s ease, filter 0.15s ease;
  opacity: 0;
}
.scatter-tile.visible { opacity: 1; }
.scatter-tile:hover { filter: brightness(1.35) drop-shadow(0 0 5px rgba(255, 255, 255, 0.6)); }
.scatter-tooltip {
  position: absolute;
  background: rgba(13, 17, 23, 0.96);
  border: 1px solid var(--border-on-dark);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-on-dark);
  max-width: 320px;
  pointer-events: none;
  z-index: 12;
  display: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}
.scatter-tooltip .date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-on-dark-muted);
  margin-bottom: 4px;
}
.scatter-tooltip .label {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.scatter-tooltip .label.anti { background: rgba(244, 162, 97, 0.18); color: var(--accent-tertiary); }
.scatter-tooltip .label.pro  { background: rgba(220, 38, 38, 0.2);  color: var(--color-regime); }
.scatter-caption {
  text-align: center;
  font-size: 12px;
  color: var(--text-on-dark-muted);
  margin-top: 18px;
}
