/* ==========================================================================
   GIMV GLOBAL — animations.css
   Scroll reveals, micro-interactions, reduced-motion contract
   ========================================================================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes markerPulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes dashFlow {
  to { stroke-dashoffset: -240; }
}
@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes shimmer {
  0%   { opacity: .25; }
  50%  { opacity: .7; }
  100% { opacity: .25; }
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal--fade { transform: none; }
.reveal--right { transform: translateX(-18px); }
.reveal--right.is-in { transform: none; }

/* Staggered children */
.stagger > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.stagger.is-in > * { opacity: 1; transform: none; }
.stagger.is-in > *:nth-child(1) { transition-delay: .00s; }
.stagger.is-in > *:nth-child(2) { transition-delay: .07s; }
.stagger.is-in > *:nth-child(3) { transition-delay: .14s; }
.stagger.is-in > *:nth-child(4) { transition-delay: .21s; }
.stagger.is-in > *:nth-child(5) { transition-delay: .28s; }
.stagger.is-in > *:nth-child(6) { transition-delay: .35s; }
.stagger.is-in > *:nth-child(7) { transition-delay: .42s; }
.stagger.is-in > *:nth-child(8) { transition-delay: .49s; }

/* Line draw */
.rule-draw {
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease-out);
}
.rule-draw.is-in { transform: scaleX(1); }

/* Headline word reveal */
.reveal-lines .line { display: block; overflow: hidden; }
.reveal-lines .line > span {
  display: block;
  transform: translateY(105%);
  transition: transform .9s var(--ease-out);
}
.reveal-lines.is-in .line:nth-child(1) > span { transition-delay: .04s; }
.reveal-lines.is-in .line:nth-child(2) > span { transition-delay: .13s; }
.reveal-lines.is-in .line:nth-child(3) > span { transition-delay: .22s; }
.reveal-lines.is-in .line > span { transform: none; }

/* Animated SVG data flow */
.flow-line {
  stroke-dasharray: 4 8;
  animation: dashFlow 6s linear infinite;
}
.viz-bar { transform-origin: bottom; animation: barGrow .9s var(--ease-out) both; }
.pulse-soft { animation: shimmer 3.6s ease-in-out infinite; }

/* Marker pulse for static/fallback maps */
.marker-pulse { transform-origin: center; animation: markerPulse 2.8s ease-out infinite; }

/* Counter values start hidden until animated */
.count { font-variant-numeric: tabular-nums; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .stagger > *, .reveal-lines .line > span, .rule-draw {
    opacity: 1 !important; transform: none !important;
  }
  .engine__stage .desc { opacity: 1 !important; transform: none !important; }
}
