/* ============================================
   PaganVillage.com — Animations & Transitions
   ============================================ */

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-glacial), transform var(--transition-glacial);
}

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

/* Staggered reveals for grid children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 120ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 360ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 480ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 600ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 720ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 840ms; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 960ms; }
.reveal-stagger > .reveal:nth-child(10) { transition-delay: 1080ms; }
.reveal-stagger > .reveal:nth-child(n+11) { transition-delay: 1200ms; }


/* === Hero Animations === */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-preheading {
  animation: heroFadeIn 1.2s ease-out 0.2s both;
}

.hero-illustration {
  animation: heroFadeIn 1.4s ease-out 0.4s both;
}

.hero-title {
  animation: heroFadeIn 1.5s ease-out 0.5s both;
}

.hero-subtitle {
  animation: heroFadeIn 1.5s ease-out 0.9s both;
}

.hero-cta {
  animation: heroFadeIn 1.5s ease-out 1.3s both;
}

.scroll-indicator {
  animation: heroFadeIn 1.5s ease-out 1.8s both;
}

/* Page hero animations (faster since user has already seen the home hero) */
.page-hero-label {
  animation: heroFadeIn 1s ease-out 0.1s both;
}

.page-hero-title {
  animation: heroFadeIn 1s ease-out 0.3s both;
}

.page-hero-intro {
  animation: heroFadeIn 1s ease-out 0.5s both;
}


/* === Scroll Bounce (for scroll indicator) === */
@keyframes scrollBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.scroll-indicator svg {
  animation: scrollBounce 2s ease-in-out infinite;
}


/* === Pulse (for altar item hotspots) === */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 164, 64, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 164, 64, 0);
  }
}

.item-dot {
  animation: pulse 2.5s ease-in-out infinite;
}


/* === Subtle Float (for decorative elements) === */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}


/* === Moon Glow === */
@keyframes moonGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(245, 240, 232, 0.15), 0 0 40px rgba(245, 240, 232, 0.05);
  }
  50% {
    box-shadow: 0 0 30px rgba(245, 240, 232, 0.25), 0 0 60px rgba(245, 240, 232, 0.1);
  }
}

.moon-visual,
.moon-sphere {
  animation: moonGlow 4s ease-in-out infinite;
}


/* === Link underline animation === */
@keyframes underlineGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}


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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
