/* ========================================================
   PREVIA 3D SPATIAL UNIVERSE: INTERACTIVE 3D INTRO
   Futuristic, Inspiring, Real-Time Interactive Three.js Realm
   - Drag to orbit camera 360 degrees
   - Move cursor to repel/swirl 2,000 glowing cosmic particles
   - 3D Flying Books (Physics, Chemistry, Maths, Biology)
   - 3D Rotating Bohr Atom with electron orbits
   - 3D Glowing DNA Double Helix & Platonic Polyhedra
   - Interactive stream switcher (PCM, PCB, Foundation, AI Twin)
   - Hyperspace Warp speed light-tunnel launch into PREVIA
   ======================================================== */

.previa-3d-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: radial-gradient(circle at 50% 50%, #0d1527 0%, #070a13 60%, #020408 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", sans-serif;
  user-select: none;
}

.previa-3d-intro-overlay.dismissed {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

#previa3dIntroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  cursor: grab;
}

#previa3dIntroCanvas:active {
  cursor: grabbing;
}

/* Subtle Vignette */
.intro-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(4, 6, 12, 0.5) 75%, rgba(2, 4, 8, 0.9) 100%),
              linear-gradient(to bottom, rgba(2, 4, 8, 0.6) 0%, transparent 15%, transparent 80%, rgba(2, 4, 8, 0.85) 100%);
}

/* Top Navigation Bar */
.intro-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 36px;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .intro-top-bar {
    padding: 16px 20px;
  }
}

.intro-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 18px;
  border-radius: 999px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.intro-brand-badge {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intro-btn {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.intro-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: #ffffff;
}

.intro-btn.primary {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.7), rgba(37, 99, 235, 0.7));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-weight: 600;
}

.intro-btn.primary:hover {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

/* Center Spatial Hero Callout */
.intro-spatial-hero {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  pointer-events: none;
}

.intro-interactive-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.2);
  pointer-events: auto;
}

.pulse-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseBeacon 2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

.intro-spatial-title {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 14px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
}

.spatial-gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #a855f7 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-spatial-desc {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: #cbd5e1;
  font-weight: 400;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 22px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

/* Interactive Stream Pills (Clickable 3D Waypoints) */
.intro-stream-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.stream-pill {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.stream-pill:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f1f5f9;
  transform: translateY(-2px);
}

.stream-pill.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.5), rgba(99, 102, 241, 0.5));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
}

/* Bottom HUD */
.intro-bottom-hud {
  position: relative;
  z-index: 10;
  padding: 20px 36px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .intro-bottom-hud {
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
  }
}

.intro-hud-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.intro-hud-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-hud-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intro-hud-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
}

/* Glowing Warp Speed Launch Button */
.intro-center-action {
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-warp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 34px;
  background: linear-gradient(135deg, #0284c7, #2563eb, #7c3aed);
  background-size: 200% 200%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.5), 0 0 30px rgba(124, 58, 237, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: warpBtnGlow 4s infinite linear;
}

@keyframes warpBtnGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.intro-warp-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 50px rgba(37, 99, 235, 0.7), 0 0 45px rgba(56, 189, 248, 0.6);
  border-color: #38bdf8;
}

.warp-btn-icon {
  font-size: 15px;
  color: #fbbf24;
  animation: bounceIcon 1.5s infinite ease-in-out;
}

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

/* Flash Curtain for Hyperspace Warp */
.intro-flash-curtain {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #38bdf8 0%, #ffffff 60%, #000000 100%);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
}

.intro-flash-curtain.flash {
  opacity: 1;
}
