/* ===========================================
   I'm OnCall — Animations
   =========================================== */

/* --- Keyframes --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

@keyframes soundWave {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes waveBar {
  0%, 100% { height: 8px; }
  50% { height: 40px; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- Scroll Reveal Classes --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }

/* --- Audio Waveform Animation --- */
.audio-waveform .bar {
  animation: waveBar 1.2s ease-in-out infinite;
}

.audio-waveform .bar:nth-child(1) { animation-delay: 0.0s; }
.audio-waveform .bar:nth-child(2) { animation-delay: 0.1s; }
.audio-waveform .bar:nth-child(3) { animation-delay: 0.2s; }
.audio-waveform .bar:nth-child(4) { animation-delay: 0.3s; }
.audio-waveform .bar:nth-child(5) { animation-delay: 0.4s; }
.audio-waveform .bar:nth-child(6) { animation-delay: 0.5s; }
.audio-waveform .bar:nth-child(7) { animation-delay: 0.6s; }
.audio-waveform .bar:nth-child(8) { animation-delay: 0.7s; }
.audio-waveform .bar:nth-child(9) { animation-delay: 0.8s; }
.audio-waveform .bar:nth-child(10) { animation-delay: 0.9s; }
.audio-waveform .bar:nth-child(11) { animation-delay: 1.0s; }
.audio-waveform .bar:nth-child(12) { animation-delay: 1.1s; }
.audio-waveform .bar:nth-child(13) { animation-delay: 0.0s; }
.audio-waveform .bar:nth-child(14) { animation-delay: 0.1s; }
.audio-waveform .bar:nth-child(15) { animation-delay: 0.2s; }
.audio-waveform .bar:nth-child(16) { animation-delay: 0.3s; }
.audio-waveform .bar:nth-child(17) { animation-delay: 0.4s; }
.audio-waveform .bar:nth-child(18) { animation-delay: 0.5s; }
.audio-waveform .bar:nth-child(19) { animation-delay: 0.6s; }
.audio-waveform .bar:nth-child(20) { animation-delay: 0.7s; }

.audio-waveform.paused .bar {
  animation-play-state: paused;
}

/* --- Phone Float --- */
.phone-mockup {
  animation: float 4s ease-in-out infinite;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }

  .stagger > * {
    opacity: 1;
    transform: none;
  }

  .phone-mockup {
    animation: none;
  }

  .sound-wave {
    display: none;
  }
}
