/* ==========================================================================
   TIMELESS ROOTS — ANIMATIONS
   Scroll-reveal system, keyframes, and micro-interactions. Transition
   *properties* for hover/state changes live alongside their components in
   style.css; this file owns keyframes and the on-scroll reveal mechanism.
   ========================================================================== */

/* ---------- Scroll-reveal (paired with js/animations.js IntersectionObserver) ---------- */
[data-animate] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-animate="fade-up"] { transform: translateY(34px); }
[data-animate="fade-in"] { transform: translateY(0); }

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger the four mission / value cards as they reveal */
.mission-grid [data-animate]:nth-child(1) { transition-delay: 0s; }
.mission-grid [data-animate]:nth-child(2) { transition-delay: 0.12s; }
.mission-grid [data-animate]:nth-child(3) { transition-delay: 0.24s; }
.mission-grid [data-animate]:nth-child(4) { transition-delay: 0.36s; }

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

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fade-in-scale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ---------- Applied micro-animations ---------- */
.footer-lotus {
  animation: float-y 5s ease-in-out infinite;
}

.nav-dropdown-menu.is-open,
.nav-dropdown:hover .nav-dropdown-menu {
  animation: fade-in-scale 0.25s ease;
}

/* Carousel track uses a slow, premium ease (defined via --transition-slow in style.css) */

/* Skeleton/loading shimmer utility (available for future async content) */
.is-loading {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-alt) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto !important; }
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
}
