/* ========================================
   SPEAK INDIA 2026 - Animations
   ========================================
   1. Keyframes
   2. Scroll Animations
   3. Hover Effects
   4. Special Animations
   5. Hero Stage Effects
   ======================================== */


/* ========================================
   1. KEYFRAMES
   ======================================== */

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

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

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(2, 72, 194, 0.3);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 25px rgba(2, 72, 194, 0.45);
  }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes drawLine {
  from { height: 0; }
  to { height: 100%; }
}

/* --- Hero Stage Keyframes --- */

@keyframes spotlightSway {
  0%, 100% { transform: scaleY(1) rotate(var(--spot-start, -3deg)); }
  50% { transform: scaleY(1) rotate(var(--spot-end, 3deg)); }
}

@keyframes spotlightBreath {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scaleY(1) scaleX(1); }
  50% { opacity: 1; transform: translateX(-50%) scaleY(1) scaleX(1.1); }
}

@keyframes spotlightFadeDown {
  0% { opacity: 0; transform: scaleY(0); }
  60% { opacity: var(--spot-opacity, 0.8); transform: scaleY(0.9); }
  100% { opacity: var(--spot-opacity, 0.8); transform: scaleY(1); }
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  8% { opacity: 0.9; }
  50% { transform: translateY(-55vh) translateX(15px) scale(0.8); opacity: 0.7; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-110vh) translateX(-10px) scale(0.5); opacity: 0; }
}

@keyframes eqBounce {
  0%, 100% { height: 5px; }
  50% { height: var(--eq-max, 20px); }
}

@keyframes wavePulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.4; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* --- Timeline Marker Glow Pulse --- */
@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(212, 168, 67, 0.35), 0 0 20px rgba(212, 168, 67, 0.15); }
}


/* ========================================
   2. SCROLL ANIMATIONS
   ======================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grouped elements */
.highlights__grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.highlights__grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.highlights__grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.highlights__grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

.speakers__grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.speakers__grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.speakers__grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.speakers__grid .animate-on-scroll:nth-child(4) { transition-delay: 0.15s; }
.speakers__grid .animate-on-scroll:nth-child(5) { transition-delay: 0.2s; }
.speakers__grid .animate-on-scroll:nth-child(6) { transition-delay: 0.25s; }

.stats .stats__item:nth-child(1) { transition-delay: 0s; }
.stats .stats__item:nth-child(2) { transition-delay: 0.1s; }
.stats .stats__item:nth-child(3) { transition-delay: 0.2s; }
.stats .stats__item:nth-child(4) { transition-delay: 0.3s; }

/* Timeline alternating animations */
@media (min-width: 768px) {
  .timeline__item--left.animate-on-scroll {
    opacity: 0;
    transform: translateX(-30px);
  }

  .timeline__item--right.animate-on-scroll {
    opacity: 0;
    transform: translateX(30px);
  }

  .timeline__item--left.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
  }

  .timeline__item--right.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hero element stagger reveal */
.hero__content .hero-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__content .hero-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* With the mic removed, hero children are now:
   1: hero__label
   2: hero__title
   3: hero__subtitle
   4: hero__divider-line
   5: hero__equalizer
   6: hero__info
   7: countdown
   8: hero__actions */
.hero__content .hero-reveal:nth-child(1) { transition-delay: 0s; }
.hero__content .hero-reveal:nth-child(2) { transition-delay: 0.1s; }
.hero__content .hero-reveal:nth-child(3) { transition-delay: 0.2s; }
.hero__content .hero-reveal:nth-child(4) { transition-delay: 0.28s; }
.hero__content .hero-reveal:nth-child(5) { transition-delay: 0.35s; }
.hero__content .hero-reveal:nth-child(6) { transition-delay: 0.42s; }
.hero__content .hero-reveal:nth-child(7) { transition-delay: 0.5s; }
.hero__content .hero-reveal:nth-child(8) { transition-delay: 0.58s; }


/* ========================================
   3. HOVER EFFECTS
   ======================================== */

/* Card lift */
.highlight-card,
.speaker-card,
.stats__item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Button pulse on hero CTA */
.hero__cta-primary {
  animation: pulse 2.5s ease-in-out infinite;
}

.hero__cta-primary:hover {
  animation: none;
}

/* Nav link underline effect */
@media (min-width: 1024px) {
  .navbar__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease, left 0.3s ease;
  }

  .navbar__link:hover::after,
  .navbar__link.active::after {
    width: 100%;
    left: 0;
  }
}

/* Social links hover glow */
.footer__social-link:hover {
  box-shadow: 0 0 15px rgba(2, 72, 194, 0.4);
}

/* Highlight card mic accent hover */
.highlight-card:hover .highlight-card__mic-accent svg {
  opacity: 0.15;
}


/* ========================================
   4. SPECIAL ANIMATIONS
   ======================================== */

/* Gold shimmer text effect */
.text-gold-shimmer {
  background: linear-gradient(
    90deg,
    #D4A843 0%, #F0D78C 25%, #D4A843 50%, #F0D78C 75%, #D4A843 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* Timeline line draw animation */
.timeline__line.animate-line {
  animation: drawLine 1.5s ease forwards;
}

/* Countdown flip animation */
.countdown__number.flip {
  animation: scaleIn 0.3s ease;
}


/* ========================================
   5. HERO STAGE EFFECTS
   ======================================== */

/* --- Load-gating: hide until JS adds .is-active --- */
.hero__particles .hero__particle {
  opacity: 0;
}

.hero__spotlights .hero__spotlight {
  opacity: 0;
  transform-origin: top center;
  transform: scaleY(0);
}

/* Spotlights fall in from the top when activated - staggered */
.hero__spotlights.is-active .hero__spotlight--left {
  animation: spotlightFadeDown 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             spotlightSway 10s ease-in-out 2s infinite;
}

.hero__spotlights.is-active .hero__spotlight--center {
  animation: spotlightFadeDown 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards,
             spotlightBreath 8s ease-in-out 2.25s infinite;
}

.hero__spotlights.is-active .hero__spotlight--right {
  animation: spotlightFadeDown 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards,
             spotlightSway 10s ease-in-out 2.5s infinite;
}

.hero__particles.is-active .hero__particle {
  /* opacity controlled by particleFloat animation */
}

/* --- Section divider wave animation --- */
.section-divider__path {
  animation: wavePulse 4s ease-in-out infinite;
}

.section-divider__path:nth-child(2) {
  animation-delay: -2s;
}


/* ========================================
   REDUCED MOTION
   ======================================== */

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

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hero__cta-primary {
    animation: none;
  }

  .hero__scroll-indicator {
    animation: none;
  }

  .hero__content .hero-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Hide decorative animated elements */
  .hero__particle {
    display: none !important;
  }

  .hero__spotlight {
    animation: none !important;
    opacity: 0.3 !important;
    transform: scaleY(1) !important;
  }

  .hero__eq-bar {
    animation: none !important;
    height: var(--eq-max, 20px) !important;
  }

  .section-divider__path {
    animation: none !important;
  }
}
