/* ==========================================================================
   THE SIMPSONS: PROPHECY OR PROBABILITY?
   Complete CSS Template System for reveal.js 6.0

   Templates: A-H (8 slide layouts)
   Animations: 6 keyframe systems
   Design: Zeitgeist-style dark conspiracy aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. GOOGLE FONTS
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Special+Elite&family=Inter:wght@300;400;600&display=swap');

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #0D0D1A;
  --bg-lighter: #161625;
  --bg-card: #1A1A2E;
  --bg-elevated: #252547;

  /* Text */
  --text-primary: #E0E0E0;
  --text-muted: #8A8A9A;
  --text-dim: #5A5A7A;

  /* Accents */
  --accent-yellow: #FED41D;
  --accent-red: #FF4444;
  --accent-blue: #70D1FE;
  --accent-purple: #9B59B6;
  --accent-green: #2ECC71;
  --accent-orange: #FF8C00;

  /* Category colors (aliases) */
  --politics: #E74C3C;
  --science: #2ECC71;
  --pop-culture: #9B59B6;
  --technology: #3498DB;
  --sports: #F39C12;

  /* Typography */
  --font-title: 'Oswald', 'Arial Narrow', sans-serif;
  --font-quote: 'Special Elite', 'Courier New', cursive;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Layout */
  --slide-max-width: 1200px;
  --slide-padding: 2rem;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Animation */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --duration-fast: 0.3s;
  --duration-med: 0.6s;
}

/* --------------------------------------------------------------------------
   2. REVEAL.JS BASE OVERRIDES
   -------------------------------------------------------------------------- */
.reveal {
  font-family: var(--font-body);
  color: var(--text-primary);
  font-weight: 400;
  font-size: 22px;
}

.reveal .slides {
  text-align: left;
}

.reveal .slides section {
  background-color: var(--bg-primary);
  padding: var(--slide-padding);
  box-sizing: border-box;
  overflow: hidden;
}

.reveal .slides section .slide-content {
  max-width: var(--slide-max-width);
  margin: 0 auto;
  width: 100%;
  max-height: calc(720px - 4rem);
  overflow: hidden;
}

/* Headings */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  font-family: var(--font-title);
  color: var(--accent-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.15;
  margin-bottom: 0.5em;
}

.reveal h1 { font-size: 2.8em; font-weight: 700; }
.reveal h2 { font-size: 2.0em; font-weight: 700; }
.reveal h3 { font-size: 1.4em; font-weight: 700; color: var(--accent-blue); }
.reveal h4 { font-size: 1.1em; font-weight: 600; color: var(--text-primary); }

/* Body text */
.reveal p {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.75em;
}

/* Links */
.reveal a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.reveal a:hover {
  border-bottom-color: var(--accent-blue);
}

/* Lists */
.reveal ul,
.reveal ol {
  font-family: var(--font-body);
  color: var(--text-primary);
  margin-left: 1.5em;
}

.reveal li {
  margin-bottom: 0.4em;
  line-height: 1.5;
}

/* Blockquotes */
.reveal blockquote {
  font-family: var(--font-quote);
  font-size: 1.1em;
  color: var(--accent-yellow);
  border-left: 4px solid var(--accent-yellow);
  padding: 0.5em 1em;
  background: rgba(254, 212, 29, 0.05);
  margin: 0.5em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: normal;
  word-wrap: break-word;
}

/* Constrain blockquotes inside evidence panels */
.evidence-left blockquote,
.evidence-right blockquote {
  font-size: 1em;
}

/* Code */
.reveal code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

/* Strong / emphasis */
.reveal strong {
  color: var(--accent-yellow);
  font-weight: 600;
}

.reveal em {
  color: var(--text-muted);
  font-style: italic;
}

/* Background override for all slides */
.reveal .slide-background {
  background-color: var(--bg-primary);
}

/* Fragment transitions */
.reveal .fragment {
  transition: all var(--duration-fast) var(--ease-smooth);
}

.reveal .fragment.fade-up {
  transform: translateY(20px);
}

.reveal .fragment.fade-up.visible {
  transform: translateY(0);
}

/* Episode references (shared utility) */
.reveal .episode-ref {
  font-family: 'JetBrains Mono', var(--font-body);
  font-size: 0.7em;
  color: var(--text-dim);
  margin-top: 0.3em;
}

/* Category tags (shared utility) */
.reveal .category-tag {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.6em;
  padding: 2px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-right: 0.5em;
}

.reveal .category-tag.politics { background: var(--politics); color: white; }
.reveal .category-tag.science { background: var(--science); color: white; }
.reveal .category-tag.technology { background: var(--technology); color: white; }
.reveal .category-tag.pop-culture { background: var(--pop-culture); color: white; }
.reveal .category-tag.sports { background: var(--sports); color: white; }


/* ==========================================================================
   3. TEMPLATE A: SLIDE-TITLE
   Title card with radial glow and centered typography.
   Used for: slide 4 (main title card)
   ========================================================================== */
.slide-title {
  text-align: center;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(254, 212, 29, 0.08) 0%, transparent 70%),
    var(--bg-primary) !important;
}

.slide-title h1,
.slide-title .title-main {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 3.5rem;
  color: var(--accent-yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin-bottom: 0.3em;
}

.slide-title h2,
.slide-title .title-tagline {
  font-family: var(--font-quote);
  font-size: 1.5rem;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-top: 1rem;
  max-width: 800px;
}

.slide-title .title-stat {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 2rem;
  letter-spacing: 0.02em;
}

/* Legacy compat: existing .title-slide and .subtitle classes */
.title-slide {
  text-align: center;
}

.title-slide h1 {
  font-size: 3.5em;
  line-height: 1.1;
}

.title-slide .subtitle {
  font-family: var(--font-body);
  font-size: 1.1em;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 1em;
}


/* ==========================================================================
   4. TEMPLATE B: SLIDE-EVIDENCE
   Two-column comparison grid with labels, time delta badge, star ratings.
   Used for: slides 1, 3, 5-6, 10, 15, 17, 33
   ========================================================================== */
.slide-evidence {
  position: relative;
}

.slide-evidence .evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: var(--slide-max-width);
  margin: 0 auto;
}

.slide-evidence .evidence-left,
.slide-evidence .evidence-right {
  background: var(--bg-lighter);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.slide-evidence .evidence-left {
  border-top: 3px solid var(--accent-green);
}

.slide-evidence .evidence-right {
  border-top: 3px solid var(--accent-red);
}

/* Panel labels */
.slide-evidence .label-prediction,
.slide-evidence .label-reality {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 12px;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.slide-evidence .label-prediction {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.slide-evidence .label-reality {
  background: var(--accent-red);
  color: white;
}

/* Time delta badge */
.slide-evidence .time-delta-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-yellow);
  color: var(--bg-primary);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Star rating */
.slide-evidence .star-rating {
  text-align: right;
  color: var(--accent-yellow);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
}

/* Image placeholders */
.slide-evidence .image-placeholder {
  border: 2px dashed var(--text-dim);
  border-radius: var(--radius-sm);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin: 0.75rem 0;
}

.slide-evidence .image-placeholder img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* Constrain evidence slide content to prevent overflow */
.slide-evidence .slide-content {
  max-height: calc(720px - 4rem);
  overflow: hidden;
}

/* Compact evidence grid variant for slides with 2 stacked grids */
.evidence-grid-compact {
  gap: 1rem !important;
}

.evidence-grid-compact .evidence-left,
.evidence-grid-compact .evidence-right {
  padding: 0.75rem !important;
}

.evidence-grid-compact .image-placeholder {
  min-height: 80px !important;
  margin: 0.5rem 0 !important;
}

.evidence-grid-compact blockquote {
  font-size: 0.95em !important;
  padding: 0.3em 0.75em !important;
  margin: 0.3em 0 !important;
}

/* Legacy compat: .side-by-side */
.reveal .side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2em;
  align-items: center;
}

.reveal .side-by-side .label {
  font-family: var(--font-title);
  font-size: 0.8em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5em;
}


/* ==========================================================================
   5. TEMPLATE C: SLIDE-DATA
   Single centered chart with title and annotation.
   Used for: slides 14, 22, 28, 29
   ========================================================================== */
.slide-data {
  text-align: center;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slide-data h2,
.slide-data .data-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--accent-yellow);
  margin-bottom: 1rem;
}

.slide-data .chart-container {
  max-width: 90%;
  margin: 0 auto;
}

.slide-data .chart-container img,
.slide-data img {
  max-width: 90%;
  max-height: 70vh;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(254, 212, 29, 0.03);
}

.slide-data .data-annotation,
.slide-data .annotation {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1rem;
  max-width: 700px;
}


/* ==========================================================================
   6. TEMPLATE D: SLIDE-QUOTE
   Quote with typewriter effect, attribution, and source chips.
   Used for: slides 2, 9, 11, 23
   ========================================================================== */
.slide-quote {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slide-quote .quote-text {
  font-family: var(--font-quote);
  font-size: 1.8rem;
  color: var(--text-primary);
  max-width: 800px;
  line-height: 1.5;
  margin: 0 auto;
}

/* Non-typewriter quotes must wrap normally */
.slide-quote .quote-text:not(.typewriter) {
  white-space: normal;
}

.slide-quote .quote-attribution {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

/* Source chips */
.source-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.5em;
  vertical-align: middle;
}

.source-chip.verified {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.source-chip.debunked {
  background: var(--accent-red);
  color: white;
}

.source-chip.pending {
  background: var(--accent-orange);
  color: var(--bg-primary);
}

.source-chip.fabricated {
  background: var(--accent-purple);
  color: white;
}


/* ==========================================================================
   7. TEMPLATE E: SLIDE-DOSSIER
   Card grid for writer profiles with classified stamp overlay.
   Used for: slides 24, 25, 26, 27
   ========================================================================== */
.slide-dossier {
  position: relative;
}

.slide-dossier .dossier-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: var(--slide-max-width);
  margin: 0 auto;
}

.dossier-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  width: calc(25% - 1.5rem);
  min-width: 150px;
  max-width: 220px;
  position: relative;
  transition: border-color var(--duration-fast) var(--ease-smooth);
  box-sizing: border-box;
}

.dossier-card:hover {
  border-color: var(--accent-yellow);
}

.dossier-card .dossier-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-elevated);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}

.dossier-card .dossier-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dossier-card .dossier-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-yellow);
  margin-bottom: 0.4rem;
  text-align: center;
}

.dossier-card .dossier-credential {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.6rem;
}

.dossier-card .dossier-prediction {
  font-family: var(--font-quote);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.4;
}

/* Classified stamp overlay */
.classified-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  color: rgba(255, 68, 68, 0.6);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  border: 4px solid currentColor;
  padding: 0.5rem 1.5rem;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  opacity: 0;
}

.classified-stamp.visible,
.classified-stamp.active {
  animation: stamp-slam 0.4s var(--ease-bounce) forwards;
}

/* Stamp color variants */
.classified-stamp.stamp-fabricated {
  color: rgba(155, 89, 182, 0.7);
}

.classified-stamp.stamp-verified {
  color: rgba(46, 204, 113, 0.7);
}

/* Legacy compat: .revelation, .dossier */
.reveal .revelation {
  border: 1px solid var(--accent-red);
  background: rgba(255, 51, 51, 0.08);
  padding: 1em 1.5em;
  border-radius: var(--radius-sm);
  position: relative;
}

.reveal .revelation::before {
  content: 'CLASSIFIED';
  position: absolute;
  top: -12px;
  left: 16px;
  background: var(--accent-red);
  color: white;
  font-family: var(--font-title);
  font-size: 0.6em;
  padding: 2px 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.reveal .dossier {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-yellow);
  padding: 1em 1.5em;
  margin: 0.5em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}


/* ==========================================================================
   8. TEMPLATE F: SLIDE-QUIZ
   Interactive-style quiz with real/deepfake buttons and reveal answers.
   Used for: within slide 21
   ========================================================================== */
.slide-quiz {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.quiz-round {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 2rem;
  background: var(--bg-lighter);
  position: relative;
}

.quiz-round .quiz-claim {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.quiz-round .quiz-buttons {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: center;
}

.btn-real,
.btn-deepfake {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
}

.btn-real {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.btn-deepfake {
  background: var(--accent-purple);
  color: white;
}

.btn-real:hover,
.btn-deepfake:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Quiz answer reveal */
.quiz-answer {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quiz-answer.answer-real {
  border-left: 4px solid var(--accent-green);
  color: var(--text-primary);
}

.quiz-answer.answer-deepfake {
  border-left: 4px solid var(--accent-purple);
  color: var(--text-primary);
}


/* ==========================================================================
   9. TEMPLATE G: SLIDE-WEB
   Full-screen conspiracy web image with cork-board texture and connectors.
   Used for: slides 18, 19, 20, 25
   ========================================================================== */
.slide-web {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  /* Cork board texture via repeating gradient */
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(139, 90, 43, 0.02) 10px,
      rgba(139, 90, 43, 0.02) 11px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(139, 90, 43, 0.02) 10px,
      rgba(139, 90, 43, 0.02) 11px
    ),
    var(--bg-primary) !important;
}

.slide-web .web-image {
  max-width: 95%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
}

/* Red string SVG overlay */
.slide-web .red-string {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.slide-web .red-string line,
.slide-web .red-string path {
  stroke: var(--accent-red);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: draw-string 2s ease-out forwards;
}

@keyframes draw-string {
  to {
    stroke-dashoffset: 0;
  }
}

/* Chain nodes and connectors */
.chain-node {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  position: relative;
}

.chain-connector {
  display: inline-block;
  width: 3rem;
  border-bottom: 2px dashed var(--accent-red);
  vertical-align: middle;
  margin: 0 0.25rem;
}

.chain-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 1rem 0;
  overflow-x: auto;
}


/* ==========================================================================
   10. TEMPLATE H: SLIDE-STATBOMB
   Single stat/number fills the screen with glow.
   Used for: within slides 4, 7, 11, 14, 17, 27
   ========================================================================== */
.slide-statbomb {
  text-align: center;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slide-statbomb .stat-number,
.stat-number {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 7rem;
  color: var(--accent-yellow);
  line-height: 1;
  text-shadow: 0 0 40px rgba(254, 212, 29, 0.3);
}

.slide-statbomb .stat-label,
.stat-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 600px;
}

/* Counter animation target */
.stat-number.counter {
  /* JS will handle count-up; CSS provides the display style */
  font-variant-numeric: tabular-nums;
}

/* Smaller stat variants for inline use */
.stat-inline {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 4rem;
  color: var(--accent-yellow);
  line-height: 1;
}

/* Stat number sized for use within data slides alongside other content */
.stat-number.stat-inline-large {
  font-size: 4rem;
  text-shadow: 0 0 20px rgba(254, 212, 29, 0.2);
}

/* Legacy compat: .stat-big */
.reveal .stat-big {
  font-family: var(--font-title);
  font-size: 4em;
  font-weight: 700;
  color: var(--accent-yellow);
  line-height: 1;
}


/* ==========================================================================
   11. ANIMATIONS
   ========================================================================== */

/* ---------- TYPEWRITER ---------- */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-yellow);
  width: 0;
  max-width: 100%;
  display: inline-block;
  animation:
    typewriter-reveal 3s steps(60) forwards,
    blink-cursor 0.75s step-end infinite;
}

@keyframes typewriter-reveal {
  to {
    width: 100%;
  }
}

@keyframes blink-cursor {
  50% {
    border-color: transparent;
  }
}

/* Typewriter speed variants */
.typewriter.typewriter-slow {
  animation:
    typewriter-reveal 5s steps(80) forwards,
    blink-cursor 0.75s step-end infinite;
}

.typewriter.typewriter-fast {
  animation:
    typewriter-reveal 1.5s steps(40) forwards,
    blink-cursor 0.75s step-end infinite;
}

/* Cursor-only (for after typewriter finishes) */
.typewriter-done {
  border-right: 3px solid var(--accent-yellow);
  animation: blink-cursor 0.75s step-end infinite;
}


/* ---------- STAGGER-IN ---------- */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-in.visible > *:nth-child(1)  { animation: fade-up 0.4s 0.0s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(2)  { animation: fade-up 0.4s 0.1s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(3)  { animation: fade-up 0.4s 0.2s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(4)  { animation: fade-up 0.4s 0.3s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(5)  { animation: fade-up 0.4s 0.4s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(6)  { animation: fade-up 0.4s 0.5s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(7)  { animation: fade-up 0.4s 0.6s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(8)  { animation: fade-up 0.4s 0.7s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(9)  { animation: fade-up 0.4s 0.8s var(--ease-smooth) forwards; }
.stagger-in.visible > *:nth-child(10) { animation: fade-up 0.4s 0.9s var(--ease-smooth) forwards; }


/* ---------- GLOW-BUILD ---------- */
.glow-build {
  opacity: 0;
}

.glow-build.visible {
  animation: glow-build 3s ease-out forwards;
}

@keyframes glow-build {
  0% {
    text-shadow: none;
    opacity: 0;
  }
  30% {
    text-shadow: 0 0 10px rgba(254, 212, 29, 0.3);
    opacity: 1;
  }
  100% {
    text-shadow:
      0 0 40px rgba(254, 212, 29, 0.5),
      0 0 80px rgba(254, 212, 29, 0.2);
    opacity: 1;
  }
}


/* ---------- STAMP-SLAM ---------- */
@keyframes stamp-slam {
  0% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(3);
    opacity: 0;
  }
  60% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(0.9);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(1.05);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    opacity: 1;
  }
}


/* ---------- FADE-UP ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ---------- FADE-IN (general) ---------- */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ---------- BLACKOUT (mic-drop slide 32) ---------- */
.slide-blackout {
  background: #000 !important;
  text-align: center;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slide-blackout .reveal-text {
  opacity: 0;
  animation: fade-in 1s 2s forwards;
}

.slide-blackout .reveal-text-delayed {
  opacity: 0;
  animation: fade-in 1s 4s forwards;
}

.slide-blackout .punchline {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 3.5rem;
  color: var(--accent-yellow);
  text-shadow: 0 0 60px rgba(254, 212, 29, 0.4);
  opacity: 0;
  animation: glow-build 3s 3s ease-out forwards;
}


/* ---------- PULSE (utility) ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}


/* ---------- SHAKE (for wrong answers, errors) ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}


/* ---------- SCALE-IN (for emphasis moments) ---------- */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in.visible {
  animation: scale-in 0.5s var(--ease-bounce) forwards;
}


/* ==========================================================================
   12. UTILITY CLASSES
   ========================================================================== */

/* Text colors */
.text-yellow   { color: var(--accent-yellow) !important; }
.text-red      { color: var(--accent-red) !important; }
.text-blue     { color: var(--accent-blue) !important; }
.text-purple   { color: var(--accent-purple) !important; }
.text-green    { color: var(--accent-green) !important; }
.text-orange   { color: var(--accent-orange) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-dim      { color: var(--text-dim) !important; }

/* Text sizing */
.text-sm { font-size: 0.9rem; }
.text-lg { font-size: 1.3rem; }
.text-xl { font-size: 1.7rem; }
.text-2xl { font-size: 2.2rem; }
.text-3xl { font-size: 2.8rem; }

/* Font families */
.font-title { font-family: var(--font-title) !important; }
.font-quote { font-family: var(--font-quote) !important; }
.font-body  { font-family: var(--font-body) !important; }

/* Text alignment */
.text-center { text-align: center !important; }
.text-left   { text-align: left !important; }
.text-right  { text-align: right !important; }

/* Spacing */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }

/* Layout helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Backgrounds */
.bg-dark    { background: var(--bg-primary) !important; }
.bg-lighter { background: var(--bg-lighter) !important; }
.bg-card    { background: var(--bg-card) !important; }
.bg-black   { background: #000 !important; }

/* Borders */
.border-subtle {
  border: 1px solid var(--border-subtle);
}

.border-yellow {
  border: 1px solid var(--accent-yellow);
}

.border-red {
  border: 1px solid var(--accent-red);
}

/* Highlight box */
.highlight-box {
  background: rgba(254, 212, 29, 0.06);
  border: 1px solid rgba(254, 212, 29, 0.2);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

/* Dimmed overlay for de-emphasis */
.dimmed {
  opacity: 0.4;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.dimmed:hover {
  opacity: 1;
}

/* Separator line */
.separator {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

/* Full-width image (no constraints) */
.full-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Timeline container fixes (slide 8 — inline-styled timeline) */
[style*="position: relative"][style*="padding-left"] {
  box-sizing: border-box;
  overflow: visible;
}


/* ==========================================================================
   13. LEGACY COMPATIBILITY
   Styles from original CSS that existing slides may use.
   ========================================================================== */

/* .bare-slide (Swartzwelder / deliberate minimalism) */
.bare-slide {
  text-align: center;
}

.bare-slide p {
  font-size: 1.4em;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* .final-slide (existing closing slide) */
.final-slide {
  text-align: center;
  background: #000 !important;
}

.final-slide p {
  color: var(--text-dim);
  font-size: 1.2em;
}

.final-slide .punchline {
  font-family: var(--font-title);
  font-size: 3.5em;
  font-weight: 700;
  color: var(--accent-yellow);
  text-shadow: 0 0 60px rgba(254, 212, 29, 0.4);
  margin-top: 0.5em;
}

/* .mic-drop (legacy) */
.reveal .mic-drop {
  text-align: center;
  padding: 2em;
}

.reveal .mic-drop h2 {
  font-size: 3em;
  color: var(--accent-yellow);
  text-shadow: 0 0 40px rgba(254, 212, 29, 0.3);
}


/* ==========================================================================
   14. RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 1024px) {
  .slide-evidence .evidence-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .slide-title h1,
  .slide-title .title-main {
    font-size: 2.5rem;
  }

  .stat-number,
  .slide-statbomb .stat-number {
    font-size: 5rem;
  }

  .dossier-card {
    width: calc(33% - 1.5rem);
    min-width: 140px;
  }
}

@media (max-width: 640px) {
  :root {
    --slide-padding: 1rem;
  }

  .slide-title h1,
  .slide-title .title-main {
    font-size: 2rem;
  }

  .slide-quote .quote-text {
    font-size: 1.3rem;
  }

  .stat-number,
  .slide-statbomb .stat-number {
    font-size: 3.5rem;
  }

  .quiz-round .quiz-buttons {
    flex-direction: column;
  }

  .dossier-card {
    width: 100%;
    max-width: 260px;
    min-width: unset;
  }
}


/* ==========================================================================
   14b. CONSPIRACY WEB ZOOM LENS
   Magnifying glass overlay for the conspiracy board (slide 19)
   ========================================================================== */
.zoom-container {
  position: relative;
  display: inline-block;
  cursor: crosshair;
}

.zoom-lens {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 3px solid rgba(254, 212, 29, 0.7);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 0 30px rgba(254, 212, 29, 0.15), 0 0 80px rgba(0,0,0,0.4);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.slide-web .zoom-container {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.slide-web .zoom-container .web-image {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.zoom-hint {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
}


/* ==========================================================================
   15. PRINT OVERRIDES
   For PDF export via reveal.js ?print-pdf
   ========================================================================== */
@media print {
  .reveal .slides section {
    background-color: white !important;
    color: #111 !important;
  }

  .reveal h1, .reveal h2, .reveal h3 {
    color: #111 !important;
  }

  .classified-stamp {
    color: rgba(255, 68, 68, 0.3) !important;
  }

  .typewriter {
    width: 100% !important;
    animation: none !important;
    border-right: none !important;
  }
}
