/* =============================================
   ANIMATIONS — Keyframes + Scroll Trigger System
   ============================================= */

/* === KEYFRAMES === */

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

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

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

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

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

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(229, 37, 53, 0.3), 0 0 40px rgba(229, 37, 53, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(229, 37, 53, 0.5), 0 0 60px rgba(229, 37, 53, 0.2);
  }
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(229, 37, 53, 0.4), 0 0 30px rgba(229, 37, 53, 0.2);
  }
  50% {
    text-shadow: 0 0 20px rgba(229, 37, 53, 0.6), 0 0 50px rgba(229, 37, 53, 0.3);
  }
}

@keyframes slideReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--c-glass-border); }
  50% { border-color: var(--c-glass-border-hover); }
}

/* === SCROLL-TRIGGERED ANIMATION SYSTEM === */

/* Base state: hidden */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

/* Visible state */
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animation variants */
[data-animate="fadeDown"] {
  transform: translateY(-30px);
}
[data-animate="fadeDown"].is-visible {
  transform: translateY(0);
}

[data-animate="fadeLeft"] {
  transform: translateX(-40px);
}
[data-animate="fadeLeft"].is-visible {
  transform: translateX(0);
}

[data-animate="fadeRight"] {
  transform: translateX(40px);
}
[data-animate="fadeRight"].is-visible {
  transform: translateX(0);
}

[data-animate="scale"] {
  transform: scale(0.85);
}
[data-animate="scale"].is-visible {
  transform: scale(1);
}

[data-animate="reveal"] {
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition:
    opacity 0.8s var(--ease-out-expo),
    clip-path 0.8s var(--ease-out-expo);
}
[data-animate="reveal"].is-visible {
  clip-path: inset(0 0 0 0);
}

/* Stagger delays via data-delay attribute */
[data-delay="1"] { transition-delay: 0.05s; }
[data-delay="2"] { transition-delay: 0.1s; }
[data-delay="3"] { transition-delay: 0.15s; }
[data-delay="4"] { transition-delay: 0.2s; }
[data-delay="5"] { transition-delay: 0.25s; }
[data-delay="6"] { transition-delay: 0.3s; }
[data-delay="7"] { transition-delay: 0.35s; }
[data-delay="8"] { transition-delay: 0.4s; }
[data-delay="9"] { transition-delay: 0.45s; }
[data-delay="10"] { transition-delay: 0.5s; }

/* Hero-specific entrance animations */
.hero [data-animate] {
  transition-duration: 1s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }

  .prize-card__icon {
    animation: none;
  }

  .hero__scroll {
    animation: none;
  }

  .loader__logo,
  .loader__bar {
    animation: none;
  }
}
