:root {
  --bg-void: #050508;
  --bg-surface: rgba(16, 17, 24, 0.72);
  --bg-card: rgba(22, 24, 34, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(41, 151, 255, 0.35);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-blue: #2997ff;
  --accent-indigo: #5e5ce6;
  --accent-emerald: #30d158;
  --accent-amber: #ff9f0a;
  --accent-rose: #ff453a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-void);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Fixed Fullscreen WebGL Layer */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
  opacity: 0.62;
}

/* Subtle Film Grain */
.ambient-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(rgba(255,255,255,0.6) 1px, transparent 0);
  background-size: 24px 24px;
}

#scroll-container {
  position: relative;
  z-index: 2;
  width: 100%;
}

section[data-act-section] {
  position: relative;
  width: 100%;
  scroll-margin-top: 72px;
}

.act3-section-header, .act4-section-header, .act5-header {
  background: radial-gradient(ellipse at center, rgba(5, 6, 12, 0.88) 0%, rgba(5, 6, 12, 0.55) 60%, transparent 100%);
  padding: 20px 28px;
  border-radius: 24px;
}

/* Persistent Awwwards Odyssey HUD */
.odyssey-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 8, 13, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.odyssey-hud.hud-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.hud-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
  animation: hudPulse 2s infinite;
}

@keyframes hudPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

.hud-brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #fff;
}

.hud-brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #d4d4d8;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-chapter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hud-chapter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.hud-chapter-btn.active {
  color: #fff;
  background: rgba(41, 151, 255, 0.14);
  border-color: rgba(41, 151, 255, 0.4);
  box-shadow: 0 0 16px rgba(41, 151, 255, 0.18);
}

.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hud-metric {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.hud-metric-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.hud-metric-accent {
  color: var(--accent-emerald);
}

.hud-panic-btn {
  background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.35);
  color: #ffd60a;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hud-panic-btn:hover {
  background: rgba(255, 159, 10, 0.24);
  transform: translateY(-1px);
}

.hud-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: linear-gradient(135deg, #0071e3, #2997ff);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(41, 151, 255, 0.35);
  transition: all 0.2s ease;
}

.hud-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(41, 151, 255, 0.55);
}

.hud-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.hud-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2997ff, #5e5ce6, #30d158);
  box-shadow: 0 0 10px rgba(41, 151, 255, 0.8);
  transition: width 0.08s linear;
}

@media (max-width: 1100px) {
  .hud-nav, .hud-brand-tag {
    display: none;
  }
}

@media (max-width: 680px) {
  .hud-telemetry {
    display: none;
  }
  .odyssey-hud {
    padding: 0 12px;
  }
}
