/* ============================================
   ANIMATIONS — DETECTIVE NOIR
   ============================================ */

/* --- Keyframes --- */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

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

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

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

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

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

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(200,169,106,0.05); }
  50% { box-shadow: 0 0 60px rgba(200,169,106,0.1); }
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(80px);
    opacity: 0;
  }
}

@keyframes typeCursor {
  0%, 100% { border-right-color: var(--accent-gold); }
  50% { border-right-color: transparent; }
}

/* --- Animation Classes --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Staggered children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 400ms; }
.stagger-children .animate-on-scroll:nth-child(7) { transition-delay: 480ms; }
.stagger-children .animate-on-scroll:nth-child(8) { transition-delay: 560ms; }

/* Hero specific */
.hero-animate-1 { animation: fadeInUp 0.8s ease both; animation-delay: 0.2s; }
.hero-animate-2 { animation: fadeInUp 0.8s ease both; animation-delay: 0.4s; }
.hero-animate-3 { animation: fadeInUp 0.8s ease both; animation-delay: 0.6s; }
.hero-animate-4 { animation: fadeInUp 0.8s ease both; animation-delay: 0.8s; }
.hero-animate-5 { animation: slideInRight 0.8s ease both; animation-delay: 0.5s; }

/* Glow animation for game container */
.game-container {
  animation: glowPulse 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;
  }

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

  .particle {
    display: none;
  }

  html {
    scroll-behavior: auto;
  }
}