/* ══════════════════════════════════════════════════════════════════════
   CFIN Animation Performance Guard — companion to js/perf-guard.js
   Loaded globally from base.html. Reduces GPU/memory load on weak devices
   and honors reduced-motion. Rules here are STRICTLY safe: they only remove
   ornamental cost (filters, blur, particle layers) — they never hide real
   content and never pause finite entrance animations.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Detected low-end devices (html.cfin-low-power set by perf-guard.js) ──
   Drop the most expensive GPU work. Particle/spark/feed dots are purely
   decorative; removing them from the render tree frees compositing entirely.
   (Infinite keyframe loops are frozen from JS, which can target them precisely
   by iteration-count; CSS cannot, so we do NOT blanket-pause animations here.) */
html.cfin-low-power .particle,
html.cfin-low-power .particles,
html.cfin-low-power [class*="particle"],
html.cfin-low-power .stat-spark-dot,
html.cfin-low-power .feed-dot {
  display: none !important;
}

html.cfin-low-power,
html.cfin-low-power *,
html.cfin-low-power *::before,
html.cfin-low-power *::after {
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ── Reduced motion (OS-level "reduce motion") ──
   Collapse decorative motion to a single instantaneous frame. Durations are
   0.01ms (not 0) so `animation-fill-mode: forwards` entrances still resolve to
   their END state — content is never left mid-fade / invisible. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
