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

:root {
  --bg: #0a0a0a;
  --accent: #FF5722;
  --accent-glow: rgba(255, 87, 34, 0.15);
  --accent-soft: #FF8A65;
  --text: #ffffff;
  --text-muted: #888888;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --green: #4caf50;
  --red: #ef4444;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCENE CONTAINER ===== */
.scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--bg);
  padding: 5%;
  z-index: 1;
}

.scene.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
  animation: sceneIn 0.45s ease-out both;
}

@keyframes sceneIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== ANIMATED BACKGROUND ===== */
.scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, var(--accent-glow) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 20%, rgba(255, 87, 34, 0.05) 0%, transparent 60%);
  animation: bgPulse 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes bgPulse {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0.8; transform: scale(1.1); }
}

.scene > * { position: relative; z-index: 1; }

/* ===== LAYOUT ===== */
.content-center { text-align: center; max-width: 80%; }
.content-left { text-align: left; max-width: 70%; margin-left: 10%; }

/* ===== SCENE INDICATOR ===== */
#scene-indicator {
  position: fixed; bottom: 24px; right: 32px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
  color: var(--text-muted); z-index: 999; opacity: 0.5;
}
#nav-hint {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: var(--text-muted); z-index: 999; transition: opacity 0.5s;
}
#nav-hint span {
  display: inline-block; padding: 2px 8px;
  border: 1px solid var(--card-border); border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}

/* ===== TYPOGRAPHY ===== */
.stat-hero {
  font-size: clamp(48px, 8vw, 120px); font-weight: 900;
  line-height: 1; animation: fadeUp 1s ease-out;
}
.stat-dollar { color: var(--accent); }
.stat-number { color: var(--text); }
.stat-unit {
  display: block; font-size: clamp(24px, 3vw, 48px);
  font-weight: 600; color: var(--text-muted); margin-top: 8px;
}
.stat-subtitle {
  font-size: clamp(16px, 2vw, 28px); color: var(--text-muted);
  margin-top: 32px; line-height: 1.5;
}
.stat-subtitle em { color: var(--text); font-style: italic; }

.tagline {
  font-size: clamp(36px, 6vw, 96px); font-weight: 900;
  letter-spacing: -2px; animation: fadeUp 0.8s ease-out;
}
.tagline-sub {
  font-size: clamp(18px, 2.5vw, 36px); color: var(--text-muted);
  margin-top: 16px; animation: fadeUp 0.8s ease-out 0.3s both;
}

.headline-large {
  font-size: clamp(32px, 5vw, 80px); font-weight: 900;
  letter-spacing: -1px; line-height: 1.1; animation: fadeUp 0.8s ease-out;
}
.headline-medium {
  font-size: clamp(28px, 4vw, 64px); font-weight: 800;
  line-height: 1.2; animation: fadeUp 0.8s ease-out;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(12px, 1.2vw, 18px); font-weight: 700;
  letter-spacing: 4px; color: var(--accent);
  margin-bottom: 24px; animation: fadeUp 0.6s ease-out;
}
.section-divider {
  font-size: clamp(40px, 7vw, 112px); font-weight: 900;
  letter-spacing: -2px; animation: fadeUp 0.8s ease-out;
}
.accent { color: var(--accent) !important; }

/* ===== LOGO ===== */
.logo-container { margin-bottom: 32px; animation: logoReveal 1s ease-out; }
.logo-svg {
  width: clamp(200px, 30vw, 400px); height: auto;
  filter: drop-shadow(0 0 30px var(--accent-glow));
}
@keyframes logoReveal {
  0% { opacity: 0; transform: scale(0.8); filter: blur(10px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ===== GLOW ORB ===== */
.glow-orb {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: orbFloat 6s ease-in-out infinite alternate;
  pointer-events: none; z-index: 0;
}
@keyframes orbFloat {
  0% { transform: translate(-100px, 100px) scale(1); }
  100% { transform: translate(100px, -50px) scale(1.3); }
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: flex; gap: clamp(16px, 3vw, 48px);
  justify-content: center; margin: 40px 0;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: clamp(20px, 3vw, 40px);
  min-width: clamp(140px, 18vw, 260px); text-align: center;
}
.stat-number-sm {
  font-size: clamp(32px, 5vw, 72px); font-weight: 900;
  color: var(--accent); display: block;
}
.stat-label {
  font-size: clamp(12px, 1.4vw, 20px); color: var(--text-muted);
  margin-top: 8px; display: block; line-height: 1.4;
}
.problem-quote {
  font-size: clamp(16px, 1.8vw, 26px); color: var(--text-muted);
  line-height: 1.6; margin-top: 32px; font-style: italic;
}
.problem-quote em { color: var(--text); }

/* ===== SOLUTION FLOW ===== */
.solution-flow {
  display: flex; gap: clamp(12px, 2vw, 32px);
  justify-content: center; align-items: center;
  margin: 40px 0; flex-wrap: wrap;
}
.flow-step {
  font-size: clamp(16px, 2vw, 28px); font-weight: 600;
  padding: 12px 24px; background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: 12px;
}
.flow-arrow { font-size: clamp(20px, 2.5vw, 36px); color: var(--accent); }
.solution-sub {
  font-size: clamp(16px, 1.8vw, 26px); color: var(--text-muted); margin-top: 24px;
}
.solution-sub strong { color: var(--accent); font-weight: 800; }

/* ===== FEATURES ===== */
.feature-icon {
  font-size: clamp(40px, 5vw, 72px); margin-bottom: 16px;
  animation: fadeUp 0.6s ease-out;
}
.feature-title {
  font-size: clamp(28px, 4vw, 64px); font-weight: 800;
  margin-bottom: 24px; animation: fadeUp 0.7s ease-out;
}
.feature-list { list-style: none; padding: 0; }
.feature-list li {
  font-size: clamp(16px, 2vw, 28px); color: var(--text-muted);
  padding: 12px 0; border-bottom: 1px solid var(--card-border);
  position: relative; padding-left: 24px;
}
.feature-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }
.feature-sub {
  font-size: clamp(16px, 1.8vw, 26px); color: var(--text-muted); margin-top: 24px;
}

/* ===== INTEGRATIONS ===== */
.integration-grid { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.integration-badge {
  font-size: clamp(14px, 1.6vw, 22px); font-weight: 600;
  padding: 10px 24px; background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: 8px;
}

/* ===== CTA ===== */
.cta-command { margin: 32px 0; }
.cta-command code {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(18px, 2.5vw, 36px); font-weight: 700;
  padding: 16px 32px; background: rgba(255, 87, 34, 0.1);
  border: 1px solid var(--accent); border-radius: 12px;
  color: var(--accent); display: inline-block;
}
.cta-links { font-size: clamp(16px, 2vw, 28px); color: var(--text-muted); }
.cta-links a { color: var(--text); text-decoration: none; font-weight: 600; }
.cta-sep { margin: 0 12px; }
.cta-founder {
  font-size: clamp(14px, 1.5vw, 22px); color: var(--text-muted); margin-top: 32px;
}
.cta-founder strong { color: var(--text); }

/* ===== PROGRESS BAR ===== */
#progress-bar {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 3px;
  background: rgba(255,255,255,0.05); z-index: 999;
}
#progress-fill {
  height: 100%; width: 0; background: var(--card-border);
  transition: width 0.6s ease, background 0.3s;
}

/* ===== BASE ANIMATIONS ===== */
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.scene.active .fade-in-delay { animation: fadeUp 0.8s ease-out 0.5s both; }
.scene.active .fade-in-delay-2 { animation: fadeUp 0.8s ease-out 1s both; }
.scene.active .fade-in-delay-3 { animation: fadeUp 0.8s ease-out 1.5s both; }

.scene.active .stagger-1 { animation: fadeUp 0.6s ease-out 0.3s both; }
.scene.active .stagger-2 { animation: fadeUp 0.6s ease-out 0.5s both; }
.scene.active .stagger-3 { animation: fadeUp 0.6s ease-out 0.7s both; }
.scene.active .stagger-4 { animation: fadeUp 0.6s ease-out 0.9s both; }


/* ================================================================ */
/*  SCENE 3 — Customer Incident Cards                                */
/* ================================================================ */

.problem-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 40px);
  margin-top: 48px;
  flex-wrap: wrap;
}

.p-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 2.5vw, 36px);
  min-width: clamp(200px, 22vw, 320px);
  text-align: center;
}
.p-card-bad {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}
.p-card-muted {
  opacity: 0.5;
}

.p-card-emoji {
  font-size: clamp(40px, 5vw, 72px);
  margin-bottom: 12px;
  line-height: 1;
}

.p-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.p-card-text {
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.3;
}
.p-card-bad .p-card-text { color: var(--red); }
.p-card-muted .p-card-text { color: var(--text-muted); }

.p-card-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 0.9vw, 13px);
  color: var(--text-muted);
  margin-top: 10px;
  opacity: 0.6;
}

.p-card-vs {
  font-size: clamp(16px, 1.6vw, 24px);
  color: var(--text-muted);
  font-weight: 600;
  font-style: italic;
}

/* Shake animation for angry customer emoji */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px) rotate(-2deg); }
  30% { transform: translateX(4px) rotate(2deg); }
  45% { transform: translateX(-3px) rotate(-1deg); }
  60% { transform: translateX(3px) rotate(1deg); }
  75% { transform: translateX(-2px); }
}
.scene.active .shake-emoji {
  animation: shake 0.6s ease-in-out 1.2s both;
}


/* ================================================================ */
/*  SCENE 4 — Exception Cascade                                      */
/* ================================================================ */

.scene-danger::before {
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(239, 68, 68, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 20%, rgba(239, 68, 68, 0.05) 0%, transparent 60%) !important;
}

.cascade-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 20px);
  margin: 40px 0 32px;
  flex-wrap: wrap;
}

.cascade-box {
  background: var(--card-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  padding: clamp(16px, 2vw, 28px) clamp(14px, 1.8vw, 24px);
  text-align: center;
  min-width: clamp(100px, 14vw, 180px);
}
.cascade-icon {
  display: block;
  font-size: clamp(32px, 4vw, 56px);
  margin-bottom: 8px;
}
.cascade-name {
  font-size: clamp(13px, 1.3vw, 18px);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.3;
}

.cascade-arrow {
  font-size: clamp(24px, 3vw, 40px);
  color: var(--red);
  font-weight: 900;
}

.terminal-mini {
  max-width: 800px;
  margin: 0 auto;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px 24px;
  text-align: left;
}
.terminal-mini code {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1.1vw, 15px);
  display: block;
  line-height: 1.8;
}
.terminal-error { color: #ff6b6b; }
.terminal-fatal { color: #ffd43b; }


/* ================================================================ */
/*  SCENE 5 — P0 War Room                                            */
/* ================================================================ */

.scene-p0::before {
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(239, 68, 68, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 20% 80%, rgba(239, 68, 68, 0.06) 0%, transparent 60%) !important;
}

.p0-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(20px, 3vw, 44px);
  font-weight: 900;
  color: #ff4444;
  letter-spacing: 3px;
  padding: 12px 36px;
  border: 2px solid #ff4444;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
  50% { box-shadow: 0 0 40px 12px rgba(255, 68, 68, 0.15); }
}
.scene.active .pulse-badge {
  animation: fadeUp 0.6s ease-out 0.3s both, pulseBadge 2s ease-in-out 1s infinite;
}

.p0-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(16px, 2vw, 28px);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.p0-warroom {
  max-width: 680px;
  margin: 0 auto;
  background: #111118;
  border: 1px solid rgba(255, 68, 68, 0.15);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p0-msg {
  display: flex;
  gap: 10px;
  font-size: clamp(13px, 1.3vw, 18px);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  text-align: left;
  opacity: 0;
}

.p0-who {
  font-weight: 700;
  color: var(--accent-soft);
  white-space: nowrap;
  min-width: 80px;
}
.p0-what {
  color: var(--text-muted);
}

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

.scene.active .p0-slide-1 { animation: msgSlide 0.4s ease-out 0.8s both; }
.scene.active .p0-slide-2 { animation: msgSlide 0.4s ease-out 1.4s both; }
.scene.active .p0-slide-3 { animation: msgSlide 0.4s ease-out 2.0s both; }
.scene.active .p0-slide-4 { animation: msgSlide 0.4s ease-out 2.6s both; }
.scene.active .p0-slide-5 { animation: msgSlide 0.4s ease-out 3.2s both; }

.p0-bottom {
  font-size: clamp(16px, 1.8vw, 26px);
  color: var(--text-muted);
  margin-top: 24px;
}
.p0-bottom em { color: var(--text); }
