/* ========================================
   DJ School Animations
   ======================================== */

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.08s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(7) { transition-delay: 0.48s; }
.reveal-stagger.revealed > *:nth-child(8) { transition-delay: 0.56s; }
.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Text Reveal --- */
.text-reveal {
  overflow: hidden;
}
.text-reveal .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.text-reveal.revealed .word {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger words */
.text-reveal.revealed .word:nth-child(1) { transition-delay: 0s; }
.text-reveal.revealed .word:nth-child(2) { transition-delay: 0.05s; }
.text-reveal.revealed .word:nth-child(3) { transition-delay: 0.1s; }
.text-reveal.revealed .word:nth-child(4) { transition-delay: 0.15s; }
.text-reveal.revealed .word:nth-child(5) { transition-delay: 0.2s; }
.text-reveal.revealed .word:nth-child(6) { transition-delay: 0.25s; }
.text-reveal.revealed .word:nth-child(7) { transition-delay: 0.3s; }
.text-reveal.revealed .word:nth-child(8) { transition-delay: 0.35s; }
.text-reveal.revealed .word:nth-child(9) { transition-delay: 0.4s; }
.text-reveal.revealed .word:nth-child(10) { transition-delay: 0.45s; }

/* --- Floating Music Notes --- */
@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) rotate(15deg);
  }
}

.floating-notes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-note {
  position: absolute;
  bottom: -20px;
  font-size: 1.2rem;
  color: var(--gold);
  opacity: 0;
  animation: float-up 6s ease-in-out infinite;
}
.floating-note:nth-child(1) { left: 10%; animation-delay: 0s; font-size: 1rem; opacity: 0.4; }
.floating-note:nth-child(2) { left: 25%; animation-delay: 1.2s; font-size: 1.4rem; opacity: 0.3; }
.floating-note:nth-child(3) { left: 40%; animation-delay: 2.5s; font-size: 0.9rem; opacity: 0.5; }
.floating-note:nth-child(4) { left: 55%; animation-delay: 0.8s; font-size: 1.1rem; opacity: 0.35; }
.floating-note:nth-child(5) { left: 70%; animation-delay: 3.2s; font-size: 1.3rem; opacity: 0.4; }
.floating-note:nth-child(6) { left: 85%; animation-delay: 1.8s; font-size: 1rem; opacity: 0.3; }

/* --- Vinyl Record --- */
@keyframes vinyl-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-hero {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    #111 0%, #111 12%,
    #1a1a1a 12%, #1a1a1a 13%,
    #111 13%, #111 25%,
    #1a1a1a 25%, #1a1a1a 26%,
    #111 26%, #111 38%,
    #1a1a1a 38%, #1a1a1a 39%,
    #111 39%, #111 48%
  );
  border: 2px solid rgba(245,197,24,0.2);
  animation: vinyl-rotate 3s linear infinite;
  animation-play-state: paused;
}
.vinyl-disc.spinning {
  animation-play-state: running;
}

.vinyl-disc::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 15px rgba(245,197,24,0.5);
}

/* Tonearm */
.vinyl-tonearm {
  position: absolute;
  top: -10px;
  right: -30px;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #555, #888);
  border-radius: 2px;
  transform-origin: right center;
  transform: rotate(-30deg);
  transition: transform 0.8s ease;
}
.vinyl-tonearm.on-record {
  transform: rotate(-10deg);
}

/* --- Animated Counter --- */
.counter-value {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
}

/* --- Audio Control Button --- */
.audio-control {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(245,197,24,0.3);
  background: rgba(17,17,17,0.9);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}
.audio-control:hover {
  border-color: rgba(245,197,24,0.6);
  box-shadow: 0 0 20px rgba(245,197,24,0.2);
}
.audio-control.pulsing {
  animation: pulse-invite 2.5s ease infinite;
}
@keyframes pulse-invite {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,197,24,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(245,197,24,0); }
}

.audio-control svg {
  width: 18px;
  height: 18px;
}
.audio-control .vinyl-inner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(245,197,24,0.4);
  animation: vinyl-rotate 3s linear infinite;
  position: relative;
}
.audio-control .vinyl-inner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* --- Waveform Canvas Container --- */
.waveform-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}
.waveform-container canvas {
  width: 100%;
  height: 100%;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
  .text-reveal .word { opacity: 1; transform: none; transition: none; }
  .floating-note { animation: none; opacity: 0; }
  .vinyl-disc { animation: none; }
  .audio-control.pulsing { animation: none; }
  .vinyl-inner { animation: none; }
}
