/* ============================================================
   LINUS — animations
   ============================================================ */

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Entrance: fade + rise. Self-revealing via CSS animation so the hero is
   ALWAYS visible even if JS is slow or fails. The .is-in class is a no-op
   kept for backwards compatibility. */
.fade-up {
  animation: fadeUp 0.7s var(--ease) both;
  animation-delay: var(--d, 0s);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Reveal-on-scroll for sections */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Staggered children (feature cards, why cards, legend) */
.stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.stagger.is-in > * { opacity: 1; transform: none; }
.stagger.is-in > *:nth-child(1) { transition-delay: 0.02s; }
.stagger.is-in > *:nth-child(2) { transition-delay: 0.10s; }
.stagger.is-in > *:nth-child(3) { transition-delay: 0.18s; }
.stagger.is-in > *:nth-child(4) { transition-delay: 0.26s; }

/* Number flash when a live metric updates */
.flash-up   { animation: flashUp 0.6s var(--ease); }
.flash-down { animation: flashDown 0.6s var(--ease); }
@keyframes flashUp {
  0% { color: var(--up); }
  100% { color: inherit; }
}
@keyframes flashDown {
  0% { color: var(--down); }
  100% { color: inherit; }
}

/* Donut draw-in */
.donut__seg {
  transition: stroke-dasharray 1s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up, .reveal, .stagger > * { opacity: 1; transform: none; }
}
