/* ═══════════════════════════════════════════════════════════════════
   GenAI Photobooth — Kiosk Styles
   Config-driven theming via CSS custom properties from brand data
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────────── */

:root {
  /* Brand theming — set dynamically via JS from brand data */
  --brand-primary: #76B900;
  --brand-primary-dark: #5a9000;
  --brand-primary-light: #8ed600;
  --brand-primary-rgb: 118, 185, 0;
  --brand-secondary: #1a1a2e;
  --brand-name: '';

  /* Vū Cyan (constant) */
  --vu-cyan: #5BCFAD;

  /* Surface palette */
  --carbon-black: #000000;
  --carbon-light: #111111;
  --carbon-mid: #1a1a1a;
  --surface: #0d0d0d;
  --surface-2: #252525;
  --text: #ffffff;
  --text-dim: rgba(255,255,255,0.4);
  --text-mid: rgba(255,255,255,0.6);
  --border-subtle: rgba(255,255,255,0.08);
  --border-medium: rgba(255,255,255,0.12);

  /* Layout */
  --header-height: 64px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* Brand theming is applied dynamically via applyBrandCSS() in app.js */

/* ── Reset & Base ────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font-sans);
  background: var(--carbon-black);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* ── Carbon Fiber Background ─────────────────────────────────────── */

.carbon-bg {
  background-color: var(--carbon-black);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 2px,
      rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 2px,
      rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 4px
    );
}

/* ── Speed Streaks ───────────────────────────────────────────────── */

.speed-streaks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.streak {
  position: absolute;
  height: 1px;
  width: 20%;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.3), transparent);
  opacity: 0;
}

.streak-1 { top: 15%; animation: streakFly 6s ease-in-out 0s infinite; width: 25%; }
.streak-2 { top: 35%; animation: streakFly 8s ease-in-out 1.5s infinite; width: 18%; }
.streak-3 { top: 55%; animation: streakFly 5s ease-in-out 3s infinite; width: 22%; }
.streak-4 { top: 72%; animation: streakFly 7s ease-in-out 0.8s infinite; width: 15%; }
.streak-5 { top: 88%; animation: streakFly 9s ease-in-out 4s infinite; width: 20%; }

@keyframes streakFly {
  0%   { left: -30%; opacity: 0; }
  15%  { opacity: 0.5; }
  100% { left: 130%; opacity: 0; }
}

/* ── Dotted Surface 3D Background ── */
.dotted-surface {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.dotted-surface canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Pixel Glitch Canvas ── */
.glitch-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  image-rendering: pixelated;
}

/* Page skew during glitch */
.glitch-skew {
  transform: skewX(0.3deg) !important;
  transition: transform 0.05s;
}

/* ── Transition Streak (fires on brand swap) ── */
.transition-streak {
  position: fixed;
  left: -40%;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.8), white, rgba(var(--brand-primary-rgb), 0.8), transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  filter: blur(0.5px);
  box-shadow: 0 0 20px rgba(var(--brand-primary-rgb), 0.6), 0 0 60px rgba(var(--brand-primary-rgb), 0.3);
}

.transition-streak.fire {
  animation: transitionStreakFly 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes transitionStreakFly {
  0%   { left: -40%; opacity: 0; }
  10%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}

/* ── Nav Glass Header ────────────────────────────────────────────── */

.nav-glass {
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left, .header-right {
  flex: 1;
}

.header-right {
  display: flex;
  justify-content: flex-end;
}

.header-center {
  flex-shrink: 0;
}

/* Brand Cluster */
.brand-cluster {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-cluster-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.vu-text { color: var(--vu-cyan); }

.brand-cluster-x {
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 300;
}

/* Broadcast Bar */
.broadcast-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  padding: 0.35rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.broadcast-bar-red { background: rgba(228,32,34,0.95); }
.broadcast-bar-green { background: rgba(118,185,0,0.95); }
.broadcast-bar-cyan { background: rgba(91,207,173,0.9); color: #000000; }

/* Pulse Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: pulseDot 2s ease-in-out infinite;
}

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

/* Brand Toggle Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-toggle {
  display: flex;
  gap: 6px;
}

.mute-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mute-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-light);
  border-color: rgba(255,255,255,0.15);
}

.mute-btn.muted {
  color: #E42022;
  border-color: rgba(228,32,34,0.3);
}

.brand-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: var(--transition-fast);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.brand-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-mid);
}

.brand-btn.active {
  background: rgba(var(--brand-primary-rgb), 0.15);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* ── Angular Card ────────────────────────────────────────────────── */

.angular-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  clip-path: polygon(
    0 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
  position: relative;
}

/* ── Racing Stripe ───────────────────────────────────────────────── */

.racing-stripe {
  position: relative;
}

.racing-stripe::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #E42022, #76B900, #5BCFAD);
  z-index: 2;
}

/* ── Timing Tower ────────────────────────────────────────────────── */

.timing-tower {
  border-left: 3px solid var(--brand-primary);
  background: linear-gradient(90deg, rgba(var(--brand-primary-rgb), 0.08), transparent);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
}

/* ── Big Number ──────────────────────────────────────────────────── */

.big-number {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ── Screens ─────────────────────────────────────────────────────── */

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--header-height);
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

.screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 32px 24px;
  animation: screenIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Section Labels & Titles ─────────────────────────────────────── */

.section-label {
  display: inline-flex;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-title span {
  color: var(--brand-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 1: CAMERA CAPTURE
   ═══════════════════════════════════════════════════════════════════ */

.camera-screen {
  gap: 24px;
}

.camera-frame {
  width: 640px;
  max-width: 90vw;
  overflow: hidden;
  background: var(--carbon-mid);
  box-shadow:
    0 0 80px rgba(var(--brand-primary-rgb), 0.12),
    0 4px 40px rgba(0,0,0,0.5);
  transition: box-shadow var(--transition);
}

.camera-frame-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.camera-frame video {
  width: 100%;
  display: block;
  transform: scaleX(-1);
}

.camera-frame canvas {
  display: none;
}

/* Corner accents */
.frame-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  z-index: 5;
}

.frame-corner::before,
.frame-corner::after {
  content: '';
  position: absolute;
  background: var(--brand-primary);
}

.frame-corner-tl { top: 8px; left: 8px; }
.frame-corner-tl::before { width: 24px; height: 2px; top: 0; left: 0; }
.frame-corner-tl::after { width: 2px; height: 24px; top: 0; left: 0; }

.frame-corner-tr { top: 8px; right: 8px; }
.frame-corner-tr::before { width: 24px; height: 2px; top: 0; right: 0; }
.frame-corner-tr::after { width: 2px; height: 24px; top: 0; right: 0; }

.frame-corner-bl { bottom: 40px; left: 8px; }
.frame-corner-bl::before { width: 24px; height: 2px; bottom: 0; left: 0; }
.frame-corner-bl::after { width: 2px; height: 24px; bottom: 0; left: 0; }

.frame-corner-br { bottom: 40px; right: 8px; }
.frame-corner-br::before { width: 24px; height: 2px; bottom: 0; right: 0; }
.frame-corner-br::after { width: 2px; height: 24px; bottom: 0; right: 0; }

.camera-overlay {
  padding: 10px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  text-align: center;
}

.camera-status {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Capture Button — Racing Start Button */
.capture-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.capture-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.capture-btn-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--brand-primary);
  animation: captureGlow 2s ease-in-out infinite;
}

@keyframes captureGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(var(--brand-primary-rgb), 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(var(--brand-primary-rgb), 0.6), 0 0 80px rgba(var(--brand-primary-rgb), 0.2);
    transform: scale(1.05);
  }
}

.capture-btn-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-primary);
  transition: var(--transition-fast);
}

.capture-btn:hover .capture-btn-inner {
  background: var(--brand-primary-light);
  transform: scale(1.05);
}

.capture-btn:active .capture-btn-inner {
  transform: scale(0.9);
}

/* 3-2-1 Countdown Overlay */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(8rem, 20vw, 14rem);
  font-weight: 900;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-shadow:
    0 0 40px rgba(var(--brand-primary-rgb), 0.6),
    0 0 80px rgba(var(--brand-primary-rgb), 0.3);
  animation: countdownPulse 1s ease-in-out infinite;
}

.countdown-overlay.countdown-active {
  opacity: 1;
}

.countdown-overlay.countdown-flash {
  background: rgba(255, 255, 255, 0.9);
  transition: background 0.15s ease;
}

@keyframes countdownPulse {
  0% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  100% { transform: scale(1); }
}

.capture-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 2: SCENE SELECTOR
   ═══════════════════════════════════════════════════════════════════ */

/* Scene zones for capture mode transition */
.scenes-top-zone,
.scenes-bottom-zone {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Camera zone — collapsed by default, reveals in capture mode */
.scenes-camera-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9);
  transition: max-height 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.5s ease 0.2s,
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.scenes-camera-zone .camera-frame {
  max-width: 640px;
  width: 100%;
}

.scenes-camera-zone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  min-height: 360px;
}

/* Capture mode active */
#screen-scenes.capture-mode .scenes-camera-zone {
  max-height: 500px;
  opacity: 1;
  transform: scale(1);
  overflow: visible;
}

#screen-scenes.capture-mode .scenes-top-zone {
  transform: translateY(-30px);
}

#screen-scenes.capture-mode .scenes-bottom-zone {
  transform: translateY(20px);
}

/* Unselected cards row — side by side below camera */
.scenes-unselected-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.scenes-unselected-row .scene-card {
  flex: 1;
  max-width: 260px;
}

#screen-scenes.capture-mode .scenes-unselected-row .scene-card {
  opacity: 0.3;
  transform: scale(0.85);
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#screen-scenes.capture-mode .scenes-unselected-row .scene-card:hover {
  opacity: 0.6;
  transform: scale(0.9);
}

#screen-scenes.capture-mode #scenes-btn-group,
#screen-scenes.capture-mode #provider-selector {
  opacity: 0;
  pointer-events: none;
}

/* Capture controls — hidden by default */
.scenes-capture-area {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease 0.4s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

#screen-scenes.capture-mode .scenes-capture-area {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Card animations in capture mode */
#screen-scenes.capture-mode .scene-card:not(.selected) {
  transform: translateY(60px) scale(0.9);
  opacity: 0.15;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

#screen-scenes.capture-mode .scene-card.selected {
  transform: translateY(-20px) scale(0.75);
  opacity: 1;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

/* Header slides up in capture mode */
#screen-scenes.capture-mode .scenes-header {
  transform: translateY(-10px);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hide buttons in capture mode */
#screen-scenes.capture-mode #scenes-btn-group,
#screen-scenes.capture-mode #provider-selector {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.scenes-screen {
  gap: 32px;
  position: relative;
  z-index: 2;
}

.scenes-header {
  display: flex;
  align-items: center;
  gap: 24px;
}

.scenes-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-preview-frame {
  width: 88px;
  height: 88px;
  padding: 4px;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-preview-glow {
  position: absolute;
  inset: -4px;
  border-radius: 4px;
  background: rgba(var(--brand-primary-rgb), 0.15);
  filter: blur(12px);
  z-index: -1;
}

.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scene Grid */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 900px;
}

.scene-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease;
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 16px,
    100% 100%,
    16px 100%,
    0 calc(100% - 16px)
  );
  /* Stagger entrance */
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: sceneCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scene-card:nth-child(1) { animation-delay: 0.1s; }
.scene-card:nth-child(2) { animation-delay: 0.25s; }
.scene-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes sceneCardIn {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Racing stripe on scene cards */
.scene-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-primary), transparent);
  z-index: 2;
  opacity: 0.3;
  transition: all 0.4s ease;
}

/* Scanning light sweep on hover */
.scene-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--brand-primary-rgb), 0.06),
    rgba(var(--brand-primary-rgb), 0.03),
    transparent
  );
  z-index: 3;
  pointer-events: none;
  transition: none;
}

.scene-card:hover::after {
  animation: sceneSweep 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sceneSweep {
  0%   { left: -60%; }
  100% { left: 120%; }
}

.scene-card:hover::before {
  opacity: 1;
  width: 4px;
  box-shadow: 0 0 12px rgba(var(--brand-primary-rgb), 0.6);
}

.scene-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 16px 48px rgba(var(--brand-primary-rgb), 0.15),
    0 0 1px rgba(var(--brand-primary-rgb), 0.4),
    inset 0 1px 0 rgba(255,255,255,0.05);
  border-color: rgba(var(--brand-primary-rgb), 0.35);
  background: rgba(var(--brand-primary-rgb), 0.04);
}

.scene-card:hover img {
  transform: scale(1.08);
  filter: brightness(1.1) contrast(1.05);
}

.scene-card.selected {
  border-color: var(--brand-primary);
  background: rgba(var(--brand-primary-rgb), 0.08);
  box-shadow:
    0 0 30px rgba(var(--brand-primary-rgb), 0.2),
    0 0 60px rgba(var(--brand-primary-rgb), 0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: sceneSelectedPulse 2.5s ease-in-out infinite;
}

@keyframes sceneSelectedPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(var(--brand-primary-rgb), 0.2), 0 0 60px rgba(var(--brand-primary-rgb), 0.08); }
  50% { box-shadow: 0 0 40px rgba(var(--brand-primary-rgb), 0.3), 0 0 80px rgba(var(--brand-primary-rgb), 0.12); }
}

.scene-card.selected::before {
  opacity: 1;
  width: 4px;
  background: var(--brand-primary);
  box-shadow: 0 0 16px rgba(var(--brand-primary-rgb), 0.8);
}

.scene-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
}

.scene-card .scene-card-body {
  padding: 16px 20px;
  position: relative;
}

.scene-card .scene-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,0.04);
  position: absolute;
  top: -32px;
  right: 16px;
  line-height: 1;
  z-index: 1;
  transition: color 0.3s ease;
}

.scene-card:hover .scene-number {
  color: rgba(var(--brand-primary-rgb), 0.12);
}

.scene-card.selected .scene-number {
  color: rgba(var(--brand-primary-rgb), 0.2);
}

.scene-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.scene-card:hover h3 { color: var(--brand-primary); }
.scene-card.selected h3 { color: var(--brand-primary); }

.scene-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
  transition: color 0.3s ease;
}

.scene-card:hover p { color: var(--text-mid); }

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 0.5: PIT LANE PREP (INTERSTITIAL)
   ═══════════════════════════════════════════════════════════════════ */

.prep-screen {
  position: relative;
  overflow: hidden;
  background: transparent;
  justify-content: center;
  align-items: center;
}

/* Ghost number */
.prep-ghost-num {
  position: absolute;
  font-family: var(--font-display);
  font-size: 40vw;
  font-weight: 700;
  color: rgba(255,255,255,0.015);
  line-height: 0.8;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.prep-screen.running .prep-ghost-num {
  animation: prepGhostIn 1s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes prepGhostIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Layers — all start hidden */
.prep-layer {
  position: absolute;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* ── Layer 1: INITIALIZING ── */
.prep-init {
  top: 18%;
  left: 48px;
}

.prep-label-mono {
  display: block;
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 12px;
}

.prep-mega-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 0.9;
  color: var(--text);
  clip-path: inset(0 100% 0 0);
}

.prep-screen.running .prep-init {
  animation: prepFadeIn 0.1s 0.2s forwards;
}

.prep-screen.running .prep-mega-text {
  animation: prepClipReveal 0.7s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.prep-screen.running .prep-label-mono {
  animation: prepSlideUp 0.5s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(12px);
}

@keyframes prepFadeIn {
  to { opacity: 1; }
}

@keyframes prepClipReveal {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}

@keyframes prepSlideUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Layer 2: Telemetry Strip ── */
.prep-telemetry {
  bottom: 22%;
  left: 48px;
  right: 48px;
  display: flex;
  align-items: center;
  gap: 0;
}

.prep-telem-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  opacity: 0;
  transform: translateY(20px);
}

.prep-telem-label {
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.prep-telem-value {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.prep-telem-value.text-brand { color: var(--brand-primary); }
.prep-telem-value.text-vu { color: var(--vu-cyan); }

.prep-telem-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.08);
  margin: 0 24px;
  opacity: 0;
  transform: scaleY(0);
}

.prep-screen.running .prep-telemetry {
  animation: prepFadeIn 0.1s 0.6s forwards;
}

.prep-screen.running .prep-telem-item:nth-child(1) { animation: prepSlideUp 0.5s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-divider:nth-child(2) { animation: prepLineGrow 0.4s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-item:nth-child(3) { animation: prepSlideUp 0.5s 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-divider:nth-child(4) { animation: prepLineGrow 0.4s 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-item:nth-child(5) { animation: prepSlideUp 0.5s 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-divider:nth-child(6) { animation: prepLineGrow 0.4s 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-telem-item:nth-child(7) { animation: prepSlideUp 0.5s 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes prepLineGrow {
  0% { opacity: 0; transform: scaleY(0); }
  100% { opacity: 1; transform: scaleY(1); }
}

/* ── Layer 3: BIG HEADLINE ── */
.prep-headline {
  top: 38%;
  left: 48px;
  right: 48px;
}

.prep-headline-thin {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  line-height: 1.1;
  opacity: 0;
  transform: translateX(-30px);
}

.prep-headline-bold {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 0.9;
  color: var(--text);
  opacity: 0;
  transform: scale(0.85);
}

.prep-screen.running .prep-headline {
  animation: prepFadeIn 0.1s 1.0s forwards;
}

.prep-screen.running .prep-headline-thin {
  animation: prepSlideRight 0.7s 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.prep-screen.running .prep-headline-bold {
  animation: prepScaleIn 0.8s 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes prepSlideRight {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes prepScaleIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Layer 4: Pipeline Modules ── */
.prep-pipeline {
  top: 55%;
  right: 48px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
}

.prep-module {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  opacity: 0;
  transform: translateX(40px);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.prep-module-num {
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.06);
  line-height: 1;
  min-width: 40px;
}

.prep-module-body { flex: 1; }

.prep-module-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.prep-module-bar {
  height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 1px;
  overflow: hidden;
}

.prep-module-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-primary);
  border-radius: 1px;
}

.prep-screen.running .prep-module:nth-child(1) { animation: prepModuleIn 0.6s 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-module:nth-child(2) { animation: prepModuleIn 0.6s 1.65s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-module:nth-child(3) { animation: prepModuleIn 0.6s 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.prep-screen.running .prep-module:nth-child(1) .prep-module-fill { animation: prepBarFill 0.8s 1.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-module:nth-child(2) .prep-module-fill { animation: prepBarFill 0.8s 1.85s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-module:nth-child(3) .prep-module-fill { animation: prepBarFill 0.8s 2.0s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes prepModuleIn {
  0% { opacity: 0; transform: translateX(40px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes prepBarFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ── Layer 5: Stats ── */
.prep-stats {
  bottom: 10%;
  left: 48px;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.prep-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(16px);
}

.prep-stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.prep-stat-label {
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.prep-screen.running .prep-stats {
  animation: prepFadeIn 0.1s 2.0s forwards;
}

.prep-screen.running .prep-stat:nth-child(1) { animation: prepSlideUp 0.5s 2.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-stat:nth-child(2) { animation: prepSlideUp 0.5s 2.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.prep-screen.running .prep-stat:nth-child(3) { animation: prepSlideUp 0.5s 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ── Racing Stripe Sweep ── */
.prep-stripe {
  position: absolute;
  left: -40%;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.8), white, rgba(var(--brand-primary-rgb), 0.8), transparent);
  opacity: 0;
  z-index: 10;
  filter: blur(0.5px);
  box-shadow: 0 0 20px rgba(var(--brand-primary-rgb), 0.6), 0 0 60px rgba(var(--brand-primary-rgb), 0.3);
}

.prep-screen.running .prep-stripe {
  animation: prepStripeSweep 1s 3.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes prepStripeSweep {
  0% { left: -50%; opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}

/* ── Exit: everything leaves ── */
.prep-screen.exiting .prep-init {
  animation: prepExitLeft 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.prep-screen.exiting .prep-headline {
  animation: prepExitLeft 0.5s 0.05s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.prep-screen.exiting .prep-telemetry {
  animation: prepExitDown 0.5s 0.1s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.prep-screen.exiting .prep-pipeline {
  animation: prepExitRight 0.5s 0.05s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.prep-screen.exiting .prep-stats {
  animation: prepExitDown 0.5s 0.15s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.prep-screen.exiting .prep-ghost-num {
  animation: prepExitFade 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes prepExitLeft {
  to { opacity: 0; transform: translateX(-60px); }
}

@keyframes prepExitRight {
  to { opacity: 0; transform: translateX(60px); }
}

@keyframes prepExitDown {
  to { opacity: 0; transform: translateY(30px); }
}

@keyframes prepExitFade {
  to { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   BEAT 2: PIT LANE SEQUENCE
   ═══════════════════════════════════════════════════════════════════ */

.beat2-screen {
  position: relative;
  overflow: hidden;
  background: var(--carbon-black);
  justify-content: center;
  align-items: center;
}

/* Ghost number */
.beat2-ghost-num {
  position: absolute;
  font-family: var(--font-display);
  font-size: 40vw;
  font-weight: 700;
  color: rgba(255,255,255,0.015);
  line-height: 0.8;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.beat2-screen.running .beat2-ghost-num {
  animation: prepGhostIn 1s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Layers — all start hidden */
.beat2-layer {
  position: absolute;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* ── Header: Section label + title ── */
.beat2-header {
  top: 10%;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 48px;
}

.beat2-section-label {
  display: inline-block;
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(12px);
}

.beat2-title {
  margin-bottom: 12px;
}

.beat2-title-thin {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  line-height: 1.2;
  opacity: 0;
  transform: translateX(-30px);
}

.beat2-title-bold {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 0.9;
  color: var(--text);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
}

.beat2-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.4);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(12px);
}

/* Header entrance animations */
.beat2-screen.running .beat2-header {
  animation: prepFadeIn 0.1s 0.1s forwards;
}

.beat2-screen.running .beat2-section-label {
  animation: prepSlideUp 0.5s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.beat2-screen.running .beat2-title-thin {
  animation: prepSlideRight 0.7s 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.beat2-screen.running .beat2-title-bold {
  animation: beat2TitleReveal 0.9s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.beat2-screen.running .beat2-subtitle {
  animation: prepSlideUp 0.6s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes beat2TitleReveal {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  20% { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0% 0 0); }
}

/* ── Cards grid (reference-page style) ── */
.beat2-cards {
  bottom: 18%;
  left: 48px;
  right: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.beat2-card {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 28px 24px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  opacity: 0;
  transform: translateY(40px);
}

/* Racing stripe accent on left */
.beat2-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--brand-primary);
  opacity: 0.5;
}

.beat2-card-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 0.9;
  color: rgba(255,255,255,0.04);
  letter-spacing: -0.03em;
}

.beat2-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--text);
}

.beat2-card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,0.4);
  flex: 1;
}

.beat2-card-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 12px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  margin-top: auto;
}

.beat2-card-tag.brand-accent {
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
}

.beat2-card-tag.vu {
  background: rgba(var(--vu-cyan-rgb), 0.1);
  color: var(--vu-cyan);
  border: 1px solid rgba(var(--vu-cyan-rgb), 0.2);
}

.beat2-card-tag.collab {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Card entrance animations (staggered from bottom) */
.beat2-screen.running .beat2-cards {
  animation: prepFadeIn 0.1s 1.0s forwards;
}

.beat2-screen.running .beat2-card:nth-child(1) {
  animation: beat2CardIn 0.7s 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-card:nth-child(2) {
  animation: beat2CardIn 0.7s 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-card:nth-child(3) {
  animation: beat2CardIn 0.7s 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-card:nth-child(4) {
  animation: beat2CardIn 0.7s 1.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes beat2CardIn {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Card bar fill (each card's left stripe grows brighter) */
.beat2-screen.running .beat2-card:nth-child(1)::before {
  animation: beat2BarGlow 0.5s 1.4s forwards;
}
.beat2-screen.running .beat2-card:nth-child(2)::before {
  animation: beat2BarGlow 0.5s 1.6s forwards;
}
.beat2-screen.running .beat2-card:nth-child(3)::before {
  animation: beat2BarGlow 0.5s 1.8s forwards;
}
.beat2-screen.running .beat2-card:nth-child(4)::before {
  animation: beat2BarGlow 0.5s 2.0s forwards;
}

@keyframes beat2BarGlow {
  0% { opacity: 0.5; width: 3px; }
  100% { opacity: 1; width: 4px; }
}

/* ── Sector progress bar ── */
.beat2-sectors {
  bottom: 10%;
  left: 48px;
  right: 48px;
  display: flex;
  gap: 0;
  height: 4px;
  clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 3px 100%, 0 calc(100% - 3px));
  overflow: hidden;
}

.beat2-sector {
  flex: 1;
  position: relative;
  transform: scaleX(0);
  transform-origin: left center;
}

.beat2-sector.brand-bg { background: var(--brand-primary); }
.beat2-sector.brand-bg-dim { background: rgba(var(--brand-primary-rgb), 0.3); }
.beat2-sector.vu { background: var(--vu-cyan); }

.beat2-sector::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.15));
}

.beat2-screen.running .beat2-sectors {
  animation: prepFadeIn 0.1s 2.2s forwards;
}

.beat2-screen.running .beat2-sector:nth-child(1) {
  animation: beat2SectorGrow 0.5s 2.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-sector:nth-child(2) {
  animation: beat2SectorGrow 0.5s 2.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-sector:nth-child(3) {
  animation: beat2SectorGrow 0.5s 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat2-screen.running .beat2-sector:nth-child(4) {
  animation: beat2SectorGrow 0.5s 2.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes beat2SectorGrow {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

/* ── Racing stripe sweep ── */
.beat2-stripe {
  position: absolute;
  left: -40%;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.8), white, rgba(var(--brand-primary-rgb), 0.8), transparent);
  opacity: 0;
  z-index: 10;
  filter: blur(0.5px);
  box-shadow: 0 0 20px rgba(var(--brand-primary-rgb), 0.6), 0 0 60px rgba(var(--brand-primary-rgb), 0.3);
}

.beat2-screen.running .beat2-stripe {
  animation: prepStripeSweep 1s 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Exit animations ── */
.beat2-screen.exiting .beat2-header {
  animation: prepExitLeft 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.beat2-screen.exiting .beat2-cards {
  animation: prepExitDown 0.5s 0.05s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.beat2-screen.exiting .beat2-sectors {
  animation: prepExitDown 0.4s 0.1s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.beat2-screen.exiting .beat2-ghost-num {
  animation: prepExitFade 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════════
   BEAT 3: EXPERIENCE FLOW (reference copy — uses Tailwind + inline)
   ═══════════════════════════════════════════════════════════════════ */

/* Reveal animation for sections */
.beat3-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.beat3-screen.running .beat3-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered step entrance */
.beat3-step {
  opacity: 0;
  transform: translateX(-30px);
}

/* Steps are nth-child(2)–(7) because vertical line div is nth-child(1) */
.beat3-screen.running .beat3-step:nth-child(2) { animation: beat3StepIn 1s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.beat3-screen.running .beat3-step:nth-child(3) { animation: beat3StepIn 1s 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.beat3-screen.running .beat3-step:nth-child(4) { animation: beat3StepIn 1s 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.beat3-screen.running .beat3-step:nth-child(5) { animation: beat3StepIn 1s 2.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.beat3-screen.running .beat3-step:nth-child(6) { animation: beat3StepIn 1s 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.beat3-screen.running .beat3-step:nth-child(7) { animation: beat3StepIn 1s 3.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes beat3StepIn {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ── Beat 3: Driver Scan Frame (live webcam) ── */
.beat3-scan-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.3);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  background: #000;
}

/* Corner brackets */
.beat3-scan-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  z-index: 3;
}

.beat3-scan-tl {
  top: 12px; left: 12px;
  border-top: 2px solid var(--brand-primary);
  border-left: 2px solid var(--brand-primary);
}

.beat3-scan-tr {
  top: 12px; right: 12px;
  border-top: 2px solid var(--brand-primary);
  border-right: 2px solid var(--brand-primary);
}

.beat3-scan-bl {
  bottom: 12px; left: 12px;
  border-bottom: 2px solid var(--vu-cyan);
  border-left: 2px solid var(--vu-cyan);
}

.beat3-scan-br {
  bottom: 12px; right: 12px;
  border-bottom: 2px solid var(--brand-primary);
  border-right: 2px solid var(--brand-primary);
}

/* Center crosshair */
.beat3-scan-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  z-index: 3;
  opacity: 0.4;
}

.beat3-scan-crosshair::before,
.beat3-scan-crosshair::after {
  content: '';
  position: absolute;
  background: var(--brand-primary);
}

.beat3-scan-crosshair::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}

.beat3-scan-crosshair::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}

/* Top label */
.beat3-scan-label-top {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.beat3-scan-dot {
  width: 6px;
  height: 6px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease infinite;
}

/* Bottom label */
.beat3-scan-label-bottom {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* Scanning line animation */
.beat3-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--brand-primary-rgb), 0.6), var(--brand-primary), rgba(var(--brand-primary-rgb), 0.6), transparent);
  z-index: 3;
  box-shadow: 0 0 15px rgba(var(--brand-primary-rgb), 0.5), 0 0 40px rgba(var(--brand-primary-rgb), 0.2);
  top: 50%;
}

/* 2x2 mini preview grid */
.beat3-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.beat3-mini {
  aspect-ratio: 16/10;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: #000;
  position: relative;
  opacity: 0;
  transform: scale(0.7);
  clip-path: inset(50% 50% 50% 50%);
  transition: none;
}

/* Staggered entrance — each tile wipes open + scales in */
.beat3-screen.running .beat3-mini:nth-child(1) {
  animation: beat3MiniReveal 0.5s 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat3-screen.running .beat3-mini:nth-child(2) {
  animation: beat3MiniReveal 0.5s 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat3-screen.running .beat3-mini:nth-child(3) {
  animation: beat3MiniReveal 0.5s 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beat3-screen.running .beat3-mini:nth-child(4) {
  animation: beat3MiniReveal 0.5s 2.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes beat3MiniReveal {
  0% {
    opacity: 0;
    transform: scale(0.7);
    clip-path: inset(50% 50% 50% 50%);
  }
  40% {
    opacity: 1;
    transform: scale(1.05);
    clip-path: inset(5% 5% 5% 5%);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    clip-path: inset(0% 0% 0% 0%);
  }
}

.beat3-mini-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Mini preview labels (hidden — no labels per Al's request) */

/* FX 1: Night Vision — green phosphor NVG, scanlines, vignette, grain */
.beat3-fx-nightvision .beat3-mini-vid {
  filter: saturate(0) brightness(1.4) contrast(1.8);
}

.beat3-fx-nightvision::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.2) 1px, rgba(0,0,0,0.2) 2px),
    radial-gradient(ellipse at center, rgba(0,255,0,0.45), rgba(0,40,0,0.7) 80%);
  mix-blend-mode: multiply;
  z-index: 1;
  pointer-events: none;
}

.beat3-fx-nightvision::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  z-index: 2;
  pointer-events: none;
}

/* FX 2: Blueprint / X-Ray — inverted edges, blue wash, technical grid */
.beat3-fx-blueprint .beat3-mini-vid {
  filter: invert(0.85) saturate(0) brightness(1.1) contrast(2);
}

.beat3-fx-blueprint::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(40,140,255,0.07) 10px, rgba(40,140,255,0.07) 11px),
    repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(40,140,255,0.07) 10px, rgba(40,140,255,0.07) 11px),
    linear-gradient(180deg, rgba(10,60,180,0.6), rgba(20,80,220,0.5));
  mix-blend-mode: screen;
  z-index: 1;
  pointer-events: none;
}

.beat3-fx-blueprint::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,20,80,0.5) 100%);
  z-index: 2;
  pointer-events: none;
}

/* FX 3: Broadcast Static — analog TV noise, rolling bars, signal breakup */
.beat3-fx-broadcast .beat3-mini-vid {
  filter: saturate(0) brightness(0.9) contrast(1.6);
}

.beat3-fx-broadcast::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg,
      transparent, transparent 1px,
      rgba(255,255,255,0.03) 1px, rgba(255,255,255,0.03) 2px
    ),
    repeating-linear-gradient(90deg,
      rgba(255,0,0,0.06), rgba(0,255,0,0.06) 33%, rgba(0,0,255,0.06) 66%
    );
  z-index: 1;
  pointer-events: none;
}

.beat3-fx-broadcast::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 35%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.08) 60%, transparent);
  z-index: 2;
  pointer-events: none;
}

/* FX 4: Hologram — cyan/teal projection, horizontal interference, flicker */
.beat3-fx-hologram .beat3-mini-vid {
  filter: saturate(0) brightness(1.2) contrast(1.3);
}

.beat3-fx-hologram::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(91,207,173,0.08) 2px, rgba(91,207,173,0.08) 3px),
    linear-gradient(180deg, rgba(91,207,173,0.35), rgba(0,180,160,0.2) 50%, rgba(91,207,173,0.35));
  mix-blend-mode: screen;
  z-index: 1;
  pointer-events: none;
}

/* hologram ::before removed — was the sweep bar */

/* Slant divider slide animations */
.beat3-slant-from-left {
  opacity: 0;
  transform: translateX(-100%);
}

.beat3-slant-from-right {
  opacity: 0;
  transform: translateX(100%);
}

.beat3-screen.running .beat3-slant-from-left {
  animation: beat3SlideFromLeft 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.beat3-screen.running .beat3-slant-from-right {
  animation: beat3SlideFromRight 0.8s 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes beat3SlideFromLeft {
  0% { opacity: 0; transform: translateX(-100%); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes beat3SlideFromRight {
  0% { opacity: 0; transform: translateX(100%); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Exit */
.beat3-screen.exiting > * {
  animation: prepExitFade 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 3: LOADING
   ═══════════════════════════════════════════════════════════════════ */

.loading-screen {
  gap: 0;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}

/* Pulsing Ring */
.loading-ring {
  width: 160px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loading-ring-track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 3;
}

.loading-ring-progress {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: ringProgress 25s linear forwards, ringPulse 2s ease-in-out infinite;
}

@keyframes ringProgress {
  to { stroke-dashoffset: 34; }
}

@keyframes ringPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.loading-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-timer {
  font-size: 2.8rem;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

.loading-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-badge {
  font-size: 0.6rem;
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-mid);
  line-height: 1.5;
}

.loading-timing {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timing-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.timing-dots::after {
  content: '...';
  animation: dotsAnim 1.5s steps(3) infinite;
}

@keyframes dotsAnim {
  0%   { content: '.'; }
  33%  { content: '..'; }
  66%  { content: '...'; }
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 4: RESULT
   ═══════════════════════════════════════════════════════════════════ */

.result-screen {
  padding: 32px 24px 48px;
}

.result-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 700px;
  width: 100%;
}

.result-showcase {
  width: 100%;
  overflow: hidden;
  box-shadow:
    0 0 80px rgba(var(--brand-primary-rgb), 0.1),
    0 8px 60px rgba(0,0,0,0.4);
  transition: var(--transition);
}

.result-showcase:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 100px rgba(var(--brand-primary-rgb), 0.2),
    0 16px 80px rgba(0,0,0,0.5);
}

.result-showcase img {
  width: 100%;
  display: block;
}

.result-btn-row {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

/* QR Card */
.qr-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-code {
  background: #fff;
  padding: 12px;
  border-radius: 4px;
}

.qr-code img {
  width: 180px;
  height: 180px;
  display: block;
}

.qr-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* Result Info (timing-tower style) */
.result-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-info p {
  border-left: 3px solid var(--brand-primary);
  background: linear-gradient(90deg, rgba(var(--brand-primary-rgb), 0.06), transparent);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-mid);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.result-info strong {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.result-btn-row .btn {
  flex: 1;
  max-width: 220px;
}

/* ═══════════════════════════════════════════════════════════════════
   SCREEN 5: ERROR
   ═══════════════════════════════════════════════════════════════════ */

.error-screen {
  justify-content: center;
}

.error-card {
  max-width: 480px;
  width: 100%;
  border-color: rgba(228,32,34,0.3);
}

.error-card::before {
  background: var(--brand-primary) !important;
}

.error-card-inner {
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.error-badge {
  font-size: 0.6rem;
}

.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
}

.error-message {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.angular-btn {
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--carbon-black);
}

.btn-primary:hover {
  background: var(--brand-primary-light);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-mid);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-color: var(--border-medium);
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand-cluster {
    display: none;
  }

  .header-center {
    flex: 1;
    display: flex;
    justify-content: flex-start;
  }

  .broadcast-bar {
    font-size: 0.55rem;
    padding: 0.3rem 1rem;
  }

  .brand-btn {
    padding: 5px 12px;
    font-size: 0.6rem;
  }

  .screen-inner {
    padding: 24px 16px;
  }

  .camera-frame {
    max-width: 100%;
    width: 100%;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .scenes-header {
    flex-direction: column;
    text-align: center;
  }

  .scenes-header-text {
    align-items: center;
  }

  .scene-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
    margin: 0 auto;
    gap: 12px;
  }

  .scene-card img {
    height: 120px;
  }

  .scene-card .scene-card-body {
    padding: 10px 12px;
  }

  .scene-card h3 {
    font-size: 0.85rem;
  }

  .scene-card p {
    font-size: 0.6rem;
    display: none;
  }

  .scene-card .scene-number {
    font-size: 2.5rem;
  }

  /* Capture mode mobile */
  .scenes-camera-zone .camera-frame {
    max-width: 100%;
  }

  .scenes-camera-zone video {
    min-height: 220px;
  }

  .scenes-unselected-row {
    gap: 8px;
    max-width: 100%;
  }

  .scenes-unselected-row .scene-card {
    max-width: 160px;
  }

  .scenes-unselected-row .scene-card img {
    height: 80px;
  }

  .scenes-unselected-row .scene-card h3 {
    font-size: 0.7rem;
  }

  #screen-scenes.capture-mode .scenes-top-zone {
    transform: translateY(-15px);
  }

  #screen-scenes.capture-mode .scenes-top-zone .scene-card img {
    height: 80px;
  }

  .result-stack {
    max-width: 100%;
  }

  .result-btn-row {
    flex-direction: column;
    align-items: center;
  }

  .loading-ring {
    width: 130px;
    height: 130px;
  }

  .loading-timer {
    font-size: 2.2rem;
  }

  .capture-btn {
    width: 72px;
    height: 72px;
  }

  .capture-btn-inner {
    width: 48px;
    height: 48px;
  }

  /* ── Beat 1: Boot Screen Mobile ── */
  .prep-init {
    top: 10%;
    left: 20px;
  }

  .prep-mega-text {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .prep-headline {
    top: 28%;
    left: 20px;
    right: 20px;
  }

  .prep-pipeline {
    top: auto;
    bottom: 30%;
    right: 20px;
    left: 20px;
    width: auto;
    flex-direction: row;
    gap: 8px;
  }

  .prep-module {
    flex: 1;
    padding: 10px 12px;
    gap: 8px;
  }

  .prep-module-num {
    font-size: 1.2rem;
    min-width: 28px;
  }

  .prep-module-title {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }

  .prep-telemetry {
    bottom: 18%;
    left: 20px;
    right: 20px;
    flex-wrap: wrap;
    gap: 0;
  }

  .prep-telem-item {
    flex: 0 0 calc(50% - 12px);
    margin-bottom: 12px;
  }

  .prep-telem-divider {
    display: none;
  }

  .prep-telem-value {
    font-size: 0.75rem;
  }

  .prep-telem-label {
    font-size: 0.5rem;
  }

  .prep-stats {
    bottom: 5%;
    left: 20px;
    right: 20px;
    gap: 24px;
  }

  .prep-stat-value {
    font-size: 1.4rem;
  }

  .prep-stat-label {
    font-size: 0.45rem;
  }

  .prep-ghost-num {
    font-size: 60vw;
  }

  /* ── Beat 2: Pit Lane Cards Mobile ── */
  .beat2-header {
    top: 6%;
    padding: 0 20px;
  }

  .beat2-subtitle {
    font-size: 0.8rem;
    padding: 0 8px;
  }

  .beat2-cards {
    bottom: 14%;
    left: 16px;
    right: 16px;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .beat2-card {
    padding: 16px 14px;
    min-height: auto;
    gap: 8px;
  }

  .beat2-card-num {
    font-size: 1.8rem;
  }

  .beat2-card-title {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .beat2-card-desc {
    font-size: 0.65rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .beat2-card-tag {
    font-size: 0.45rem;
    padding: 3px 8px;
  }

  .beat2-sectors {
    bottom: 7%;
    left: 16px;
    right: 16px;
  }

  .beat2-ghost-num {
    font-size: 60vw;
  }
}

@media (max-width: 400px) {
  .brand-toggle {
    gap: 4px;
  }

  .brand-btn {
    padding: 4px 10px;
    font-size: 0.55rem;
  }

  .scene-grid {
    max-width: 280px;
    gap: 10px;
  }

  .scene-card img {
    height: 100px;
  }

  .scenes-unselected-row .scene-card {
    max-width: 130px;
  }

  .scenes-camera-zone video {
    min-height: 180px;
  }
}

/* ── Scrollbar ───────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--carbon-black);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

/* ── Selection ───────────────────────────────────────────────────── */

::selection {
  background: rgba(var(--brand-primary-rgb), 0.3);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════
   WELCOME / EXPERIENCE SELECTION SCREEN (multi-mode)
   ═══════════════════════════════════════════════════════════════════ */

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 24px;
}

.welcome-content {
  text-align: center;
  max-width: 1200px;
  width: 100%;
}

.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 16px;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.experience-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.experience-card {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--carbon-mid);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.experience-card:hover {
  transform: scale(1.03);
  border-color: var(--card-accent, var(--brand-primary));
}

.experience-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.experience-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.experience-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.experience-card-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   HERO / ATTRACT SCREEN
   ═══════════════════════════════════════════════════════════════════ */

.hero-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
  padding: 20px 24px 40px;
}

/* ── Radial Glows ── */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}
.hero-glow-1 {
  top: -10%;
  left: 40%;
  width: 600px;
  height: 500px;
  background: rgba(var(--brand-primary-rgb), 0.12);
  animation: glowPulse 6s ease-in-out infinite;
}
.hero-glow-2 {
  bottom: -5%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: rgba(91, 207, 173, 0.06);
  animation: glowPulse 8s ease-in-out infinite 2s;
}
.hero-glow-3 {
  top: 30%;
  right: -5%;
  width: 350px;
  height: 350px;
  background: rgba(228, 32, 34, 0.05);
  animation: glowDrift 10s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}
@keyframes glowDrift {
  0%, 100% { transform: translate(0, 0); opacity: 0.7; }
  33% { transform: translate(-30px, 20px); opacity: 1; }
  66% { transform: translate(20px, -15px); opacity: 0.5; }
}

/* ── Floating Particles ── */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(var(--brand-primary-rgb), 0.4);
  animation: particleFloat linear infinite;
}
.particle-1 { left: 15%; animation-duration: 12s; animation-delay: 0s; }
.particle-2 { left: 35%; animation-duration: 16s; animation-delay: 3s; width: 2px; height: 2px; background: rgba(91, 207, 173, 0.3); }
.particle-3 { left: 55%; animation-duration: 14s; animation-delay: 1s; }
.particle-4 { left: 75%; animation-duration: 18s; animation-delay: 5s; width: 2px; height: 2px; background: rgba(228, 32, 34, 0.3); }
.particle-5 { left: 25%; animation-duration: 20s; animation-delay: 8s; width: 4px; height: 4px; }
.particle-6 { left: 85%; animation-duration: 15s; animation-delay: 2s; background: rgba(91, 207, 173, 0.3); }
@keyframes particleFloat {
  0% { bottom: -10px; opacity: 0; transform: translateX(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { bottom: 110vh; opacity: 0; transform: translateX(40px); }
}

/* ── Hero Content ── */
.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
  width: 100%;
  animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes heroFadeIn {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Eyebrow ── */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
  opacity: 0;
}
.hero-eyebrow-text {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

/* ── Hero Title ── */
.hero-title {
  margin-bottom: 12px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.25s;
  opacity: 0;
}
.hero-title-line {
  display: block;
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-title-brand {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  background: linear-gradient(135deg, rgb(var(--brand-primary-rgb)), rgba(var(--brand-primary-rgb), 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroTitleShimmer 4s ease-in-out infinite;
}
.hero-title-main {
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}
@keyframes heroTitleShimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

/* ── Powered by ── */
.hero-powered {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 28px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.4s;
  opacity: 0;
}
.hero-powered .vu-text { color: var(--vu-cyan); font-weight: 500; }

/* ── Hero Showcase Image ── */
.hero-showcase {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 24px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.55s;
  opacity: 0;
}
.hero-showcase-frame {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  height: 360px;
  transform: perspective(1200px) rotateX(3deg);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  box-shadow: 0 20px 60px -15px rgba(var(--brand-primary-rgb), 0.2);
}
.hero-showcase-frame:hover {
  transform: perspective(1200px) rotateX(0deg) translateY(-4px);
  box-shadow: 0 30px 80px -20px rgba(var(--brand-primary-rgb), 0.3);
}
.hero-showcase-img,
.hero-showcase-video,
.hero-showcase-iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  object-fit: cover;
  object-position: center 30%;
  border: none;
}
.hero-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--carbon-black) 0%, rgba(0, 0, 0, 0.3) 30%, transparent 60%);
  pointer-events: none;
}

/* ── Hero Description ── */
.hero-desc {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 28px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.7s;
  opacity: 0;
}

/* ── Hero Stats Row ── */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 36px;
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.85s;
  opacity: 0;
}
.hero-stat {
  text-align: center;
}
.hero-stat-number {
  font-size: 1.8rem;
  color: var(--brand-primary);
}
.hero-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 4px;
}
.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Hero CTA Button ── */
/* ── CTA Button Wrapper (for shimmer border) ── */
.hero-cta-wrap {
  position: relative;
  display: inline-block;
  padding: 2px;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1s;
  opacity: 0;
}
/* Circulating shimmer border */
.hero-cta-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(
    from var(--shimmer-angle, 0deg),
    transparent 0%,
    rgba(var(--brand-primary-rgb), 0.08) 10%,
    rgba(var(--brand-primary-rgb), 0.6) 20%,
    rgba(255, 255, 255, 0.9) 25%,
    rgba(var(--brand-primary-rgb), 0.6) 30%,
    rgba(var(--brand-primary-rgb), 0.08) 40%,
    transparent 50%
  );
  animation: shimmerRotate 3s linear infinite;
  z-index: 0;
}
@keyframes shimmerRotate {
  0% { --shimmer-angle: 0deg; }
  100% { --shimmer-angle: 360deg; }
}
/* Register custom property for animation */
@property --shimmer-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.hero-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 48px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #000;
  background: transparent;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  overflow: hidden;
  transition: transform var(--transition);
  z-index: 1;
}
.hero-cta:hover {
  transform: scale(1.05);
}
.hero-cta:active {
  transform: scale(0.97);
}
.hero-cta-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(var(--brand-primary-rgb)), rgba(var(--brand-primary-rgb), 0.8));
  z-index: -1;
}
.hero-cta-text {
  position: relative;
}
.hero-cta-arrow {
  position: relative;
  font-size: 1.1rem;
  transition: transform var(--transition);
}
.hero-cta:hover .hero-cta-arrow {
  transform: translateX(4px);
}
/* Soft ambient glow behind the whole wrapper */
.hero-cta-wrap::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 4px;
  background: rgba(var(--brand-primary-rgb), 0.15);
  filter: blur(16px);
  z-index: -1;
  animation: ctaGlowPulse 3s ease-in-out infinite;
}
@keyframes ctaGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ── Tap Hint ── */
.hero-tap-hint {
  margin-top: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.15);
  animation: tapHintPulse 3s ease-in-out infinite;
}
@keyframes tapHintPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ── F1 Swish Brand Swap (transition-based, GPU smooth) ── */

/* After page load: reset animation state, enable transitions */
.hero-loaded .swish-el {
  animation: none !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  will-change: transform, opacity;
}

/* Swish OUT left: slow drag then fast snap far left */
.hero-loaded .swish-el.swish-out-left {
  transform: translateX(-80%) !important;
  opacity: 0 !important;
  transition:
    transform 0.6s cubic-bezier(0.55, 0.06, 0.68, 0.19),
    opacity 0.5s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

/* Swish OUT right: slow drag then fast snap far right */
.hero-loaded .swish-el.swish-out-right {
  transform: translateX(80%) !important;
  opacity: 0 !important;
  transition:
    transform 0.6s cubic-bezier(0.55, 0.06, 0.68, 0.19),
    opacity 0.5s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

/* Parked off-screen right (instant, no transition) */
.hero-loaded .swish-el.swish-ready-right {
  transform: translateX(80%) !important;
  opacity: 0 !important;
  transition: none !important;
}

/* Parked off-screen left (instant, no transition) */
.hero-loaded .swish-el.swish-ready-left {
  transform: translateX(-80%) !important;
  opacity: 0 !important;
  transition: none !important;
}

/* Swish IN: snap into place with elastic */
.hero-loaded .swish-el.swish-in {
  transform: translateX(0) !important;
  opacity: 1 !important;
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Hero Responsive ── */
@media (max-width: 768px) {
  .hero-screen { padding: 16px 16px 32px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .hero-stat-number { font-size: 1.4rem; }
  .hero-cta { padding: 14px 32px; font-size: 0.75rem; }
  .hero-desc { font-size: 0.9rem; }
  .hero-showcase-frame { transform: none; height: 180px; }
}
@media (max-width: 400px) {
  .hero-title-brand { font-size: 2rem; }
  .hero-title-main { font-size: 1.6rem; }
  .hero-stats { gap: 12px; }
}

/* ── Dev: Provider Selector ─────────────────────────── */
.provider-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}
.provider-selector:hover { opacity: 1; }
.provider-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
}
.provider-dropdown {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
}
.provider-dropdown:focus { border-color: var(--accent, #76B900); }
.provider-dropdown option { background: #1a1a1a; color: #fff; }
