/* ==========================================================================
   Soul Sounds Academy (SSA) — motion
   Shared keyframes and state transitions. Scripted motion lives in app.js
   (Fx: Motion + anime.js) and js/ui.js (GSAP); both read motion-tokens.css.
   ========================================================================== */

@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes err-in { from { opacity: 0; translate: 0 -3px; } }

/* Screens: the one leaving dips out quickly, the one arriving rises in */
.screen.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity var(--dur-page-out) var(--ease-in), transform var(--dur-page-out) var(--ease-in); }
.screen.is-entering { opacity: 0; }
html:not(.fx) .screen:not([hidden]):not(.screen--login) { animation: rise-in 420ms var(--ease-rise); }

/* The wash on a row that was just added or edited */
@keyframes row-wash {
  from { background-color: rgb(var(--brass-rgb) / 0.22); box-shadow: inset 3px 0 0 var(--brass); }
}
tr.fx-flash > td,
.fx-flash:not(tr) { animation: row-wash var(--dur-flash) var(--ease-out); }
/* Payments: the cell's drawn check already confirms the change, so its row
   does not wash as well */
#matrix-body tr.fx-flash > td { animation: none; }

/* App bar: the current page name slides in when it changes (ui.js) */
.appbar__here.is-swapping { animation: crumb-in 420ms var(--ease-rise); }
@keyframes crumb-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .ambient__aurora i, .hero__mesh i, .dot--live { animation: none !important; }
  .cursor-glow { display: none; }
}
.reduce-motion .cursor-glow { display: none; }
