:root {
  --bg-color: #030712;
  --panel-bg: rgba(15, 23, 42, 0.75);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-usa: #38bdf8;
  --accent-india: #34d399;
  --accent-edge: #a855f7;
  --glow-usa: rgba(56, 189, 248, 0.35);
  --glow-india: rgba(52, 211, 153, 0.35);
  --glow-edge: rgba(168, 85, 247, 0.35);
  --active-accent: var(--accent-usa);
  --active-glow: var(--glow-usa);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Background 3D WebGL Canvas (Fixed & Hardware Accelerated) */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none; /* Allows scrolling anywhere on screen */
  outline: none;
  will-change: transform;
}

/* Scroll Container (Generates the scroll track for scrollytelling) */
#scroll-container {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 500vh; /* 5 distinct chapters */
}

/* Fixed HUD Header */
.hud-header {
  position: fixed;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 18px;
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--active-accent);
  box-shadow: 0 0 12px var(--active-accent);
  transition: all 0.4s ease;
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Theme Switcher Bar */
.theme-switcher {
  display: flex;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-btn:hover {
  color: var(--text-main);
}

.theme-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  box-shadow: inset 0 0 12px var(--active-glow), 0 0 12px var(--active-glow);
}

/* Live Performance Metrics Pill */
.perf-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 9999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #a3e635;
}

.perf-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a3e635;
  animation: pulse 2s infinite;
}

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

/* Scrollytelling Sections */
.story-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 8vw;
  position: relative;
  pointer-events: none; /* Let clicks pass to 3D when not on card */
}

.story-section.align-left {
  justify-content: flex-start;
}

.story-section.align-right {
  justify-content: flex-end;
}

.story-section.align-center {
  justify-content: center;
  text-align: center;
}

.story-card {
  pointer-events: auto;
  max-width: 480px;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 32px 36px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease, border-color 0.4s ease;
  will-change: transform, opacity;
}

.story-section.is-active .story-card {
  transform: translateY(0);
  opacity: 1;
  border-color: var(--active-accent);
}

.step-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--active-accent);
  margin-bottom: 8px;
}

.story-card h2 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.story-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.feature-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--active-accent);
  color: #030712;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px var(--active-glow);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--active-glow);
  filter: brightness(1.1);
}

/* Progress Indicator Dots */
.progress-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: var(--active-accent);
  box-shadow: 0 0 10px var(--active-accent);
  transform: scale(1.6);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hud-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .brand-badge {
    justify-content: center;
  }
  .theme-switcher {
    justify-content: center;
  }
  .perf-badge {
    display: none; /* Hide perf badge on mobile screens to save space */
  }
  .progress-nav {
    display: none;
  }
  .story-section {
    padding: 0 16px;
    justify-content: center !important;
  }
  .story-card {
    padding: 24px;
  }
  .story-card h2 {
    font-size: 22px;
  }
  .story-card p {
    font-size: 14px;
  }
}
