/* ============================================================
   Academy for Indian Horticulture — animations.css
   Keyframes and scroll-reveal transitions.
   ============================================================ */

/* ---------- Keyframes ---------- */
@keyframes riseIn {
  to { transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}
@keyframes drawArc {
  to { stroke-dashoffset: 0; }
}

/* ---------- Scroll reveals ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.left  { transform: translateX(-16px); }
.reveal.right { transform: translateX(16px); }
.reveal.zoom  { transform: scale(0.97); }
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Stagger helper: children reveal one by one */
.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1) { transition-delay: 0.00s; }
.stagger.in > *:nth-child(2) { transition-delay: 0.10s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.20s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.30s; }
.stagger.in > *:nth-child(5) { transition-delay: 0.40s; }
.stagger.in > *:nth-child(6) { transition-delay: 0.50s; }
.stagger.in > *:nth-child(7) { transition-delay: 0.60s; }
.stagger.in > *:nth-child(8) { transition-delay: 0.70s; }

/* ---------- Draw-in SVG arcs ---------- */
.draw-arc path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}
.draw-arc.in path {
  animation: drawArc 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.draw-arc.in path:nth-child(2) { animation-delay: 0.2s; }
.draw-arc.in path:nth-child(3) { animation-delay: 0.4s; }

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--mango);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 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, .stagger > * { opacity: 1 !important; transform: none !important; }
}
