/* motion.css — global motion guard, shared keyframes, motion utilities.
 * Loaded after pages.css. Pair with js/lib/motion.js (the JS facade) which
 * enforces the same reduced-motion contract for script-driven animations. */

/* Reduced-motion guard: one place that neutralizes ALL motion. Keeps a 0.01ms
 * duration (not 0) so animationend/transitionend listeners still fire. */
@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;
  }
}

/* Shared keyframes */
@keyframes mo-fade-in {
  from { opacity: 0; transform: translateY(var(--move-md)); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mo-flash-ok {
  0%   { background-color: var(--ok-soft-bg); }
  100% { background-color: transparent; }
}

/* Utilities */
.u-fade-in {
  animation: mo-fade-in var(--dur-base) var(--ease-out) both;
}

/* Success flash — apply briefly to a saved row/card, then remove. */
.mo-flash-ok {
  animation: mo-flash-ok var(--dur-xslow) var(--ease-out) both;
}

@keyframes mo-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.mo-shake { animation: mo-shake var(--dur-base) var(--ease-standard); }
