/* ============================================
   PACP Explainer Flow - VIDEO MODE
   Auto-playing presentation with transitions
   
   CUSTOMIZATION:
   - Adjust --slide-duration for timing between slides
   - Modify --transition-duration for slide transition speed
   - Change transition types by editing slide classes
   ============================================ */

:root {
  /* Colors */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-muted: #48484a;

  --accent-primary: #2997ff;
  --accent-secondary: #bf5af2;
  --accent-tertiary: #ffd60a;
  --accent-success: #30d158;
  --accent-error: #ff453a;

  /* Slide Timing - EDIT THESE VALUES */
  --slide-duration: 6000ms;
  --transition-duration: 800ms;
  --content-stagger: 150ms;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing */
  --card-padding: 1.25rem;
  --card-radius: 18px;
  --element-gap: 1.5rem;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;

  /* Shadows */
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(41, 151, 255, 0.15);
}

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

html, body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ============================================
   VOROFORCE BACKGROUND
   ============================================ */

#voroforce-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#voroforce-bg canvas {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================================
   PRESENTATION CONTAINER
   ============================================ */

.presentation-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

/* ============================================
   SLIDES
   ============================================ */

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22vh 3rem 3rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-duration) var(--ease-out-expo),
              visibility var(--transition-duration) var(--ease-out-expo),
              transform var(--transition-duration) var(--ease-out-expo);
  background: transparent;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
  transform: translateX(0) translateY(0) scale(1);
}

.slide.exiting {
  opacity: 0;
  z-index: 5;
}

/* Slide transition types - assign these classes to slides in HTML */
.slide.slide-left { transform: translateX(0); }
.slide.slide-left.exiting { transform: translateX(-100%); }
.slide.slide-left:not(.active):not(.exiting) { transform: translateX(100%); }

.slide.slide-right { transform: translateX(0); }
.slide.slide-right.exiting { transform: translateX(100%); }
.slide.slide-right:not(.active):not(.exiting) { transform: translateX(-100%); }

.slide.slide-up { transform: translateY(0); }
.slide.slide-up.exiting { transform: translateY(-100%); }
.slide.slide-up:not(.active):not(.exiting) { transform: translateY(100%); }

.slide.zoom { transform: scale(1); }
.slide.zoom.exiting { transform: scale(0.8); opacity: 0; }
.slide.zoom:not(.active):not(.exiting) { transform: scale(1.2); }

/* Slide content wrapper */
.slide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 1200px;
}

/* Blurred backdrop behind title + subtitle */
.slide-title,
.slide-subtitle {
  position: relative;
  z-index: 1;
}

.slide-title::before {
  content: '';
  position: absolute;
  inset: -1.5rem -3rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 20px;
  z-index: -1;
}

.slide-subtitle::before {
  content: '';
  position: absolute;
  inset: -1rem -2.5rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 16px;
  z-index: -1;
}

/* Title + subtitle act as a header that fills and centers in the space above the stage */
.slide-title {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
  text-align: center;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
  transition: all calc(var(--transition-duration) * 0.8) var(--ease-out-expo);
  margin-top: auto;
}

.slide-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  margin-bottom: 6rem;
  text-align: center;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(14px);
  transition: all calc(var(--transition-duration) * 0.8) var(--ease-out-expo);
  transition-delay: calc(var(--content-stagger) * 1);
}

.visual-stage {
  opacity: 0;
  transform: translateY(24px);
  transition: all calc(var(--transition-duration) * 1.2) var(--ease-out-expo);
  transition-delay: calc(var(--content-stagger) * 2);
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1rem;
  position: relative;
}


.slide.active .slide-title,
.slide.active .slide-subtitle,
.slide.active .visual-stage {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.1s linear;
}

.progress-fill.playing {
  animation: progressGrow var(--slide-duration) linear forwards;
}

@keyframes progressGrow {
  from { width: 0%; }
  to { width: 100%; }
}

/* ============================================
   CONTROLS OVERLAY
   ============================================ */

.controls-overlay {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.play-pause-btn {
  font-size: 1.5rem;
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.play-pause-btn:hover {
  box-shadow: 0 0 20px var(--accent-primary);
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

/* ============================================
   SLIDE INDICATORS
   ============================================ */

.slide-indicators {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
  pointer-events: auto;
}

.indicator {
  width: 3px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scaleX(1.5);
}

.indicator.active {
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
  height: 36px;
}

.indicator.completed {
  background: rgba(41, 151, 255, 0.4);
}

/* ============================================
   TIMING INDICATOR
   ============================================ */

.timing-indicator {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timer-bar {
  width: 60px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
}

.timer-bar-fill.playing {
  animation: timerProgress var(--slide-duration) linear forwards;
}

@keyframes timerProgress {
  from { width: 0%; }
  to { width: 100%; }
}

/* ============================================
   STAGE ELEMENTS
   ============================================ */

.stage-element {
  opacity: 0;
  transform: translateY(20px);
  transition: all calc(var(--transition-duration) * 0.8) var(--ease-out-expo);
}

.slide.active .stage-element {
  opacity: 1;
  transform: translateY(0);
}

.slide.active .stage-element[data-delay="0"] { transition-delay: calc(var(--content-stagger) * 3); }
.slide.active .stage-element[data-delay="100"] { transition-delay: calc(var(--content-stagger) * 3 + 100ms); }
.slide.active .stage-element[data-delay="200"] { transition-delay: calc(var(--content-stagger) * 3 + 200ms); }
.slide.active .stage-element[data-delay="300"] { transition-delay: calc(var(--content-stagger) * 3 + 300ms); }
.slide.active .stage-element[data-delay="400"] { transition-delay: calc(var(--content-stagger) * 3 + 400ms); }
.slide.active .stage-element[data-delay="500"] { transition-delay: calc(var(--content-stagger) * 3 + 500ms); }
.slide.active .stage-element[data-delay="600"] { transition-delay: calc(var(--content-stagger) * 3 + 600ms); }
.slide.active .stage-element[data-delay="800"] { transition-delay: calc(var(--content-stagger) * 3 + 800ms); }

/* ============================================
   SCENE 1: HOOK
   ============================================ */

#slide-1 .visual-stage {
  perspective: 1000px;
}

.stage-content {
  display: flex;
  align-items: center;
  gap: var(--element-gap);
  flex-wrap: nowrap;
  width: 100%;
  position: relative;
}

.video-placeholder, .report-placeholder {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.5),
    0 20px 60px -10px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.video-placeholder {
  min-width: 280px;
  width: 280px;
  flex-shrink: 0;
}

.report-placeholder {
  flex: 1;
  min-width: 0;
}

.video-frame {
  width: 100%;
  height: 180px;
  background: #0a0a0f;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Frame player image */
.frame-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: #0a0a0f;
}

.frame-player.loaded {
  opacity: 1;
}

/* Loading spinner */
.frame-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(41, 151, 255, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* Frame overlay - top (counters) */
.frame-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 4;
  pointer-events: none;
}

.frame-counter,
.footage-counter {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 0.5px;
}

.footage-counter {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Frame overlay - bottom (progress bar) */
.frame-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
}

.frame-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.frame-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.2s linear;
}

/* Clip navigation row */
.video-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  pointer-events: auto;
}

.clip-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.625rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
  pointer-events: auto;
}

.clip-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.clip-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Clock placeholder (when no clock data) */
.obs-clock-placeholder {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.transform-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.arrow-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  position: relative;
}

.arrow-line::after {
  content: '';
  position: absolute;
  right: -8px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 8px solid var(--accent-primary);
}

.arrow-particles::before,
.arrow-particles::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: flowParticle 1.5s linear infinite;
}

.arrow-particles::after { animation-delay: 0.75s; }

@keyframes flowParticle {
  0% { left: 0; opacity: 0; transform: scale(0); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { left: 100%; opacity: 0; transform: scale(0); }
}

.arrow-label {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.report-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.report-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

/* ============================================
   SCENE 2: MODEL PIPELINE
   ============================================ */

.vlm-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pipeline-stage {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  min-width: 140px;
}

.stage-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.frames-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.frame-thumb {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  border-radius: 4px;
  animation: framePulse 2s ease-in-out infinite;
}

.frame-thumb:nth-child(2) { animation-delay: 0.2s; }
.frame-thumb:nth-child(3) { animation-delay: 0.4s; }

@keyframes framePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.pipeline-arrow {
  font-size: 1.5rem;
  color: var(--accent-primary);
}

.arrow-head {
  animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

.patches-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 60px;
  margin: 0 auto;
}

.patch {
  width: 16px;
  height: 16px;
  background: rgba(0, 212, 255, 0.3);
  border-radius: 2px;
  animation: patchGlow 2s ease-in-out infinite;
}

.patch.highlight {
  background: var(--accent-primary);
  animation: patchGlow 1s ease-in-out infinite;
}

@keyframes patchGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; box-shadow: 0 0 8px var(--accent-primary); }
}

.embeddings-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 60px;
}

.embedding-bar {
  width: 8px;
  height: var(--height);
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px 2px 0 0;
  animation: barGrow 0.8s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
  transform-origin: bottom;
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.embedding-labels {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}

.concept-note {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background: rgba(0, 212, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.concept-note p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   SCENE 3: ATTENTION
   ============================================ */

.attention-diagram {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(6, 50px);
  grid-template-rows: repeat(6, 50px);
  gap: 4px;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--card-radius);
}

.attn-patch {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s var(--ease-out-expo);
}

.attn-patch.target {
  background: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-primary);
  animation: targetPulse 2s ease-in-out infinite;
}

.attn-patch.related {
  background: rgba(124, 58, 237, 0.5);
  animation: relatedGlow 2s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--accent-primary); }
  50% { transform: scale(1.1); box-shadow: 0 0 30px var(--accent-primary); }
}

@keyframes relatedGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; box-shadow: 0 0 15px var(--accent-secondary); }
}

.attention-beams {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: calc(6 * 50px + 5 * 4px);
  height: calc(6 * 50px + 5 * 4px);
  pointer-events: none;
}

.beam {
  stroke: url(#beam-gradient);
  stroke-width: 2;
  stroke-dasharray: 5, 5;
  opacity: 0;
  animation: beamDraw 2s ease-in-out infinite;
}

.beam:nth-child(1) { animation-delay: 0s; }
.beam:nth-child(2) { animation-delay: 0.3s; }
.beam:nth-child(3) { animation-delay: 0.6s; }
.beam:nth-child(4) { animation-delay: 0.9s; }

@keyframes beamDraw {
  0% { stroke-dashoffset: 100; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.attention-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-dot.target { background: var(--accent-primary); }
.legend-dot.related { background: rgba(124, 58, 237, 0.5); }

/* ============================================
   SCENE 4: TOKEN EXPLOSION
   ============================================ */

.token-explosion {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.token-stack-container {
  text-align: center;
}

.stack-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.token-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
}

.token-card {
  width: 140px;
  height: 28px;
  background: var(--bg-card);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: stackGrow 0.5s ease-out forwards;
  animation-delay: calc(var(--i) * 0.1s);
  opacity: 0;
  transform: translateY(-20px);
}

.token-card.highlight {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.1));
  border-color: var(--accent-error);
  color: var(--accent-error);
  font-weight: 600;
}

@keyframes stackGrow {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.token-counter {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-error);
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  animation: counterShake 0.5s ease-in-out;
  animation-delay: 1s;
}

.counter-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.counter-label {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes counterShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.complexity-visual {
  text-align: center;
}

.complexity-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.complexity-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 150px;
  margin: 0 auto 1rem;
}

.grid-cell {
  aspect-ratio: 1;
  background: rgba(0, 212, 255, 0.2);
  border-radius: 2px;
  animation: gridPulse 2s ease-in-out infinite;
}

.grid-cell:nth-child(1) { animation-delay: 0s; }
.grid-cell:nth-child(2) { animation-delay: 0.05s; }
.grid-cell:nth-child(3) { animation-delay: 0.1s; }
.grid-cell:nth-child(4) { animation-delay: 0.15s; }
.grid-cell:nth-child(5) { animation-delay: 0.2s; }

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; box-shadow: 0 0 10px var(--accent-primary); }
}

.complexity-math {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.big-number {
  color: var(--accent-error);
  font-weight: 700;
  font-size: 1.1rem;
}

.problem-note {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--accent-error);
}

.problem-note p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   SCENE 5: FRAME COMPRESSION
   ============================================ */

.compression-timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}

.timeline-section {
  text-align: center;
}

.section-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.frame-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--card-radius);
}

.frame-box {
  width: 50px;
  height: 35px;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-out-expo);
}

.frame-box.duplicate {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-error);
  animation: fadeOutDuplicate 1s ease-out forwards;
  animation-delay: 1s;
}

@keyframes fadeOutDuplicate {
  to {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

.frame-box.kept {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--accent-success);
  animation: highlightKept 0.5s ease-out;
  animation-delay: 2s;
}

@keyframes highlightKept {
  0% { box-shadow: 0 0 0 var(--accent-success); }
  50% { box-shadow: 0 0 20px var(--accent-success); }
  100% { box-shadow: 0 0 0 var(--accent-success); }
}

.frame-box.faded {
  opacity: 0.6;
}

.frame-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-family: var(--font-mono);
}

.frame-count.reduced {
  color: var(--accent-success);
  font-weight: 600;
}

.compression-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
}

.arrow-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.compress-icon {
  font-size: 2rem;
  animation: compressPulse 1.5s ease-in-out infinite;
}

@keyframes compressPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.compress-labels {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.compress-labels .label {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.compression-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1rem 2rem;
  border-radius: var(--card-radius);
  text-align: center;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   SCENE 6: SFT PIPELINE
   ============================================ */

.sft-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pipeline-node {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  text-align: center;
  min-width: 100px;
  position: relative;
}

.pipeline-node.model {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
  border: 1px solid var(--accent-primary);
}

.node-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.node-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.processing-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--accent-primary);
  border-radius: calc(var(--card-radius) + 4px);
  animation: processingPulse 2s ease-in-out infinite;
  opacity: 0;
}

@keyframes processingPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.02); }
}

.pipeline-connector {
  display: flex;
  align-items: center;
}

.connector-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  position: relative;
}

.connector-line::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 6px solid var(--accent-primary);
}

.connector-line.reverse {
  background: linear-gradient(to left, var(--accent-tertiary), var(--accent-error));
}

.connector-line.reverse::after {
  left: -6px;
  right: auto;
  border-left: none;
  border-right: 6px solid var(--accent-error);
}

.backprop-label {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--accent-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.comparison-stage {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

.report-compare {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.report-side {
  flex: 1;
}

.side-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.side-label.predicted { color: var(--accent-primary); }
.side-label.ground-truth { color: var(--accent-success); }

.mini-report {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  text-align: left;
}

.report-line {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.field { color: var(--text-muted); }
.value { color: var(--text-secondary); }
.value.diff-wrong {
  background: rgba(239, 68, 68, 0.3);
  padding: 0 0.25rem;
  border-radius: 2px;
  color: var(--accent-error);
}
.value.diff-correct {
  background: rgba(16, 185, 129, 0.3);
  padding: 0 0.25rem;
  border-radius: 2px;
  color: var(--accent-success);
}

.vs-divider {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.loss-indicator {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.loss-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-tertiary);
}

.training-note {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-success);
}

.training-note p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   SCENE 7: GPU CLUSTER
   ============================================ */

.gpu-cluster {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cluster-label {
  font-size: 1.25rem;
  font-weight: 600;
}

.cluster-badge {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  padding: 0.375rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.gpu-rack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.gpu-unit {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.gpu-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin: 0 auto 0.5rem;
  animation: gpuLedPulse 1.5s ease-in-out infinite;
  animation-delay: calc(var(--gpu) * 0.1s);
}

@keyframes gpuLedPulse {
  0%, 100% { background: var(--text-muted); box-shadow: none; }
  50% { background: var(--accent-primary); box-shadow: 0 0 10px var(--accent-primary); }
}

.gpu-id {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

.gpu-load {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.gpu-load::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  animation: loadBar 2s ease-out forwards;
  animation-delay: calc(var(--gpu) * 0.2s);
}

@keyframes loadBar {
  to { width: 85%; }
}

.data-flow {
  position: relative;
  height: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.data-packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 2px;
  transform: translateY(-50%);
  animation: dataFlow 2s linear infinite;
  animation-delay: var(--delay);
  box-shadow: 0 0 8px var(--accent-primary);
}

@keyframes dataFlow {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 20px); opacity: 0; }
}

.infra-specs {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
}

.spec-item {
  text-align: center;
}

.spec-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.spec-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* ============================================
   SCENE 8: PACP SCHEMA
   ============================================ */

.schema-container {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.schema-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  min-width: 350px;
  text-align: left;
}

.schema-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schema-icon {
  font-size: 1.5rem;
}

.schema-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.schema-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent-primary);
}

.field-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.field-type {
  display: inline-block;
  font-size: 0.625rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.field-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.performance-metrics {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.metric-badge {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 2rem;
  text-align: center;
  border: 2px solid var(--accent-success);
}

.metric-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-success);
}

.metric-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.metric-details {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.detail-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   SCENE 9: ATTENTION VISUALIZATION
   ============================================ */

.attention-visualization {
  margin-bottom: 2rem;
}

.frame-with-heatmap {
  position: relative;
  display: inline-block;
  width: 500px;
  height: 350px;
  max-width: 90vw;
}

.inspection-frame {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #0a0a0f 100%);
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
}

.pipe-interior {
  position: absolute;
  inset: 10%;
  background: radial-gradient(ellipse at center, #2a2a3e 0%, #1a1a2e 70%);
  border-radius: 50% / 20%;
}

.pipe-wall {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 30%;
  background: linear-gradient(180deg, #3a3a4e 0%, transparent 100%);
  border-radius: 50% 50% 0 0 / 50% 50% 0 0;
}

.pipe-floor {
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 20%;
  background: linear-gradient(0deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
  border-radius: 0 0 50% 50% / 0 0 50% 50%;
}

.heatmap-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.heat-zone {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
}

.heat-zone.crack {
  width: 80px;
  height: 80px;
  top: 25%;
  left: 35%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.6) 0%, transparent 70%);
}

.heat-zone.roots {
  width: 100px;
  height: 100px;
  bottom: 20%;
  right: 20%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, transparent 70%);
}

.heat-zone.joint {
  width: 60px;
  height: 60px;
  top: 40%;
  right: 30%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.5) 0%, transparent 70%);
}

.heat-pulse {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: heatPulse 2s ease-in-out infinite;
}

@keyframes heatPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.3; }
}

.defect-callout {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.defect-callout.crack { top: 10%; left: 50%; }
.defect-callout.roots { bottom: 10%; right: 5%; }
.defect-callout.joint { top: 30%; right: 5%; }

.callout-line {
  width: 40px;
  height: 2px;
  background: var(--text-secondary);
  margin-top: 0.75rem;
  position: relative;
}

.callout-line::after {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  border: 4px solid transparent;
  border-right: 6px solid var(--text-secondary);
}

.callout-label {
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.defect-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.attention-score {
  display: block;
  font-size: 0.625rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.attention-insight {
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem;
  background: rgba(0, 212, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--accent-primary);
}

.attention-insight p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   SCENE 10: SPEED COMPARISON
   ============================================ */

.speed-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.speed-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 2rem;
  min-width: 200px;
  text-align: center;
}

.speed-card.human {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-card.model {
  border: 2px solid var(--accent-success);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.speed-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.speed-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.speed-visual {
  margin-bottom: 1rem;
}

.stopwatch {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
}

.stopwatch-face {
  width: 100%;
  height: 100%;
  border: 3px solid var(--text-muted);
  border-radius: 50%;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  background: var(--text-secondary);
  border-radius: 2px;
}

.hand.hour {
  width: 3px;
  height: 20px;
  margin-left: -1.5px;
  animation: hourHand 4s linear infinite;
}

.hand.minute {
  width: 2px;
  height: 30px;
  margin-left: -1px;
  animation: minuteHand 2s linear infinite;
}

@keyframes hourHand {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes minuteHand {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.speedometer {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.gauge {
  width: 100%;
  height: 100%;
  border: 3px solid var(--accent-success);
  border-radius: 50%;
  position: relative;
  background: rgba(16, 185, 129, 0.1);
  overflow: hidden;
}

.gauge::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(16, 185, 129, 0.3) 100%);
}

.needle {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 2px;
  height: 35px;
  margin-left: -1px;
  background: var(--accent-success);
  transform-origin: bottom center;
  animation: needleSweep 1s ease-in-out infinite alternate;
  box-shadow: 0 0 10px var(--accent-success);
}

@keyframes needleSweep {
  from { transform: rotate(-60deg); }
  to { transform: rotate(60deg); }
}

.speed-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.speed-value.highlight {
  color: var(--accent-success);
  font-size: 1.75rem;
}

.speed-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.progress-bar-human,
.progress-bar-model {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  animation: progressFill 2s ease-out forwards;
}

.progress-bar-human .progress-fill {
  background: var(--text-muted);
  width: 95%;
  animation-duration: 4s;
}

.progress-bar-model .progress-fill {
  background: var(--accent-success);
  width: 5%;
  animation-duration: 0.5s;
}

@keyframes progressFill {
  from { width: 0%; }
}

.vs-separator {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-primary);
}

.speed-stats {
  text-align: center;
}

.speedup-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  padding: 1.5rem 3rem;
  border-radius: var(--card-radius);
  border: 2px solid var(--accent-success);
}

.speedup-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-success);
}

.speedup-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   SCENE 11: ACTIVE LEARNING LOOP
   ============================================ */

.learning-loop {
  margin-bottom: 2rem;
}

.loop-diagram {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 0 auto;
}

.loop-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}

.center-icon {
  font-size: 3rem;
  animation: spin 8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.center-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.loop-step {
  position: absolute;
  text-align: center;
}

.loop-step.step-1 { top: 20px; left: 50%; transform: translateX(-50%); }
.loop-step.step-2 { top: 50%; right: 20px; transform: translateY(-50%); }
.loop-step.step-3 { bottom: 20px; left: 50%; transform: translateX(-50%); }
.loop-step.step-4 { top: 50%; left: 20px; transform: translateY(-50%); }

.step-node {
  position: relative;
  width: 70px;
  height: 70px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-primary);
  margin: 0 auto 0.5rem;
}

.step-icon {
  font-size: 1.75rem;
}

.step-number {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg-primary);
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.loop-arrows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.loop-path {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 2;
  stroke-dasharray: 8, 4;
  opacity: 0.5;
  animation: dashFlow 20s linear infinite;
}

@keyframes dashFlow {
  to { stroke-dashoffset: -100; }
}

.loop-benefits {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: var(--card-radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.benefit-icon {
  font-size: 1.25rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .slide {
    padding: 1.5rem;
  }
  
  .slide-title {
    font-size: 1.75rem;
  }
  
  .controls-overlay {
    padding: 0.5rem 1rem;
    gap: 1rem;
  }
  
  .control-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .slide-indicators {
    right: 1rem;
    gap: 0.5rem;
  }
  
  .indicator {
    height: 20px;
  }
  
  .indicator.active {
    height: 30px;
  }
  
  .timing-indicator {
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
  }
  
  /* Single-slide vertical fit: stop centering the header, compress the
     gaps, and let the content scroll if it still exceeds the viewport. */
  .slide {
    overflow: hidden auto;
    pointer-events: auto;
  }

  .slide-content {
    height: auto;
    min-height: 100%;
    justify-content: flex-start;
  }

  .slide-title {
    margin-top: 0;
  }

  .slide-title::before {
    inset: -1rem -1.5rem;
  }

  .slide-subtitle {
    margin-bottom: 1.5rem;
  }

  .visual-stage {
    padding-top: 0;
  }

  .stage-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .video-placeholder {
    min-width: 280px;
    width: 280px;
  }

  .report-placeholder {
    flex: 1 1 100%;
  }

  .video-frame {
    width: 100%;
    height: 157px;
  }

  .report-body {
    height: 220px;
  }

  .transform-arrow {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
  
  .vlm-pipeline {
    flex-direction: column;
  }
  
  .pipeline-arrow {
    transform: rotate(90deg);
  }
  
  .attention-grid {
    grid-template-columns: repeat(6, 35px);
    grid-template-rows: repeat(6, 35px);
  }
  
  .token-explosion {
    flex-direction: column;
    gap: 2rem;
  }
  
  .sft-pipeline {
    flex-direction: column;
  }
  
  .pipeline-connector {
    transform: rotate(90deg);
  }
  
  .gpu-rack {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .schema-container {
    flex-direction: column;
    align-items: center;
  }
  
  .frame-with-heatmap {
    width: 100%;
    height: 250px;
  }
  
  .defect-callout {
    display: none;
  }
  
  .speed-comparison {
    flex-direction: column;
  }
  
  .loop-diagram {
    width: 280px;
    height: 280px;
  }
  
  .step-node {
    width: 50px;
    height: 50px;
  }
  
  .step-icon {
    font-size: 1.25rem;
  }
  
  .loop-benefits {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .slide-title {
    font-size: 1.5rem;
  }
  
  .slide-subtitle {
    font-size: 0.875rem;
  }
  
  .video-placeholder {
    min-width: 240px;
    width: 240px;
  }

  .video-frame {
    width: 100%;
    height: 135px;
  }

  .report-body {
    height: 190px;
  }

  .frame-box {
    width: 40px;
    height: 28px;
    font-size: 0.5rem;
  }
  
  .attention-grid {
    grid-template-columns: repeat(6, 28px);
    grid-template-rows: repeat(6, 28px);
  }
  
  .gpu-rack {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .gpu-unit {
    padding: 0.75rem;
  }
  
  .infra-specs {
    flex-direction: column;
    gap: 1rem;
  }
  
  .schema-card {
    min-width: 100%;
    max-width: 320px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
