/* ============================================
   BACKGROUND SPATIAL HYPERDRIVE
   Signature Visuelle SYCAD
   ============================================ */

/* ========== Conteneur Principal Background ========== */
.hyperdrive-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  perspective: 1000px;
  background: var(--space-navy);
}

/* ========== Couche 1 : Nébuleuse Profonde (Réduite pour réseau neuronal) ========== */
.nebula-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0, 100, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(0, 217, 225, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(204, 255, 0, 0.02) 0%, transparent 50%);
  animation: nebulaFloat 30s ease-in-out infinite;
}

@keyframes nebulaFloat {
  0%, 100% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 0.5;
  }
  33% {
    transform: translateX(-20px) translateY(-15px) scale(1.03);
    opacity: 0.4;
  }
  66% {
    transform: translateX(15px) translateY(20px) scale(0.97);
    opacity: 0.5;
  }
}

/* ========== Couche 2 : Tunnel Spatial - Désactivé pour réseau neuronal ========== */
.space-tunnel {
  display: none;
}

/* ========== Couche 3 : Étoiles Warp Speed ========== */
.warp-stars-container {
  position: absolute;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.warp-star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 1), transparent);
  box-shadow: 0 0 8px currentColor;
  animation: warpSpeed linear infinite;
}

.warp-star.cyan {
  background: radial-gradient(circle, #00D9E1, transparent);
  color: #00D9E1;
}

.warp-star.white {
  background: radial-gradient(circle, #FFFFFF, transparent);
  color: #FFFFFF;
}

.warp-star.lime {
  background: radial-gradient(circle, #CCFF00, transparent);
  color: #CCFF00;
}

@keyframes warpSpeed {
  0% {
    transform: translateZ(-1000px) translateX(var(--x)) translateY(var(--y));
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translateZ(1000px) translateX(calc(var(--x) * 3)) translateY(calc(var(--y) * 3));
    opacity: 0;
  }
}

/* ========== Couche 4 : Lignes Hyperespace ========== */
.hyperspace-lines-container {
  position: absolute;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  overflow: hidden;
}

.hyper-line {
  position: absolute;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--primary-cyan), transparent);
  transform-origin: center bottom;
  animation: hyperspaceMove linear infinite;
  filter: blur(0.5px);
}

@keyframes hyperspaceMove {
  0% {
    transform:
      translateX(var(--start-x))
      translateY(100vh)
      translateZ(-1000px)
      rotateX(85deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform:
      translateX(var(--end-x))
      translateY(-100vh)
      translateZ(1000px)
      rotateX(85deg);
    opacity: 0;
  }
}

/* ========== Couche 5 : Particules Énergétiques ========== */
.energy-particles-container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.energy-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-cyan), transparent);
  animation: energyFlow linear infinite;
  filter: blur(1px);
}

.energy-particle.lime {
  background: radial-gradient(circle, var(--accent-lime), transparent);
}

@keyframes energyFlow {
  0% {
    transform:
      translateX(var(--px))
      translateY(var(--py))
      translateZ(-800px)
      scale(0.1);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    transform:
      translateX(calc(var(--px) * 2.5))
      translateY(calc(var(--py) * 2.5))
      translateZ(800px)
      scale(3);
    opacity: 0;
  }
}

/* ========== Grille Holographique (Pour Section Impact) ========== */
.holographic-grid {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 217, 225, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 217, 225, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  opacity: 0.3;
}

@keyframes gridMove {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(50px) translateX(50px);
  }
}

/* ========== Circuits Flottants (Hero Section) ========== */
.floating-circuit {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid var(--primary-cyan);
  border-radius: 50%;
  box-shadow:
    0 0 20px var(--shadow-glow),
    inset 0 0 20px rgba(0, 217, 225, 0.2);
  animation: floatCircuit 8s ease-in-out infinite;
}

.floating-circuit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  border: 1px solid var(--primary-cyan);
  border-radius: 50%;
  opacity: 0.5;
}

.floating-circuit.circuit-1 {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.floating-circuit.circuit-2 {
  top: 20%;
  right: 8%;
  animation-delay: 2s;
  border-color: var(--accent-lime);
  box-shadow:
    0 0 20px var(--shadow-glow-lime),
    inset 0 0 20px rgba(204, 255, 0, 0.2);
}

.floating-circuit.circuit-3 {
  bottom: 25%;
  left: 10%;
  animation-delay: 4s;
}

.floating-circuit.circuit-4 {
  bottom: 15%;
  right: 12%;
  animation-delay: 6s;
  border-color: var(--accent-lime);
  box-shadow:
    0 0 20px var(--shadow-glow-lime),
    inset 0 0 20px rgba(204, 255, 0, 0.2);
}

@keyframes floatCircuit {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-30px) translateX(20px) rotate(90deg) scale(1.1);
  }
  50% {
    transform: translateY(-50px) translateX(0px) rotate(180deg) scale(0.9);
  }
  75% {
    transform: translateY(-30px) translateX(-20px) rotate(270deg) scale(1.1);
  }
}

/* ========== Effet Parallax sur Scroll ========== */
.parallax-layer {
  transition: transform 0.1s ease-out;
}

/* ========== Optimisations Performance ========== */
.hyperdrive-background * {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
