/* Animaciones de fondo — capa GPU aislada (olas + ecualizador) */
#wave-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  contain: layout style;
  isolation: isolate;
}

#wave-background svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 92vh;
  min-height: 520px;
  animation: vibraWaveDrift 12s linear infinite;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

@keyframes vibraWaveDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

#equalizer-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 14px;
  padding: 0 6%;
  pointer-events: none;
  contain: layout style;
}

#equalizer-background .bar {
  --eq-dur: 1.5s;
  width: 14px;
  height: 100px;
  border-radius: 6px;
  transform-origin: center center;
  background: linear-gradient(to top, #c800c8, #ff5cf0, #ff9aeb);
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.35);
  animation: vibraEqPulse var(--eq-dur) ease-in-out infinite both;
}

#equalizer-background .bar:nth-child(1)  { animation-delay: 0s; }
#equalizer-background .bar:nth-child(2)  { animation-delay: calc(var(--eq-dur) * 0.25); }
#equalizer-background .bar:nth-child(3)  { animation-delay: calc(var(--eq-dur) * 0.1); }
#equalizer-background .bar:nth-child(4)  { animation-delay: calc(var(--eq-dur) * 0.35); }
#equalizer-background .bar:nth-child(5)  { animation-delay: calc(var(--eq-dur) * 0.2); }
#equalizer-background .bar:nth-child(6)  { animation-delay: calc(var(--eq-dur) * 0.45); }
#equalizer-background .bar:nth-child(7)  { animation-delay: calc(var(--eq-dur) * 0.3); }
#equalizer-background .bar:nth-child(8)  { animation-delay: calc(var(--eq-dur) * 0.55); }
#equalizer-background .bar:nth-child(9)  { animation-delay: calc(var(--eq-dur) * 0.4); }
#equalizer-background .bar:nth-child(10) { animation-delay: calc(var(--eq-dur) * 0.65); }

@keyframes vibraEqPulse {
  0%, 100% {
    transform: translateZ(0) scaleY(0.14);
    opacity: 0.65;
  }
  50% {
    transform: translateZ(0) scaleY(1);
    opacity: 1;
  }
}

body.animations-paused #wave-background svg,
body.animations-paused #equalizer-background .bar {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  #wave-background svg {
    animation-duration: 20s !important;
  }

  #equalizer-background .bar {
    animation-duration: 3s !important;
  }
}

html.reduce-motion #wave-background svg {
  animation-duration: 20s !important;
}

html.reduce-motion #equalizer-background .bar {
  animation-duration: 3s !important;
}

@media (max-width: 768px) {
  #equalizer-background .bar:nth-child(n+9) {
    display: none;
  }
}
