/**
 * motion.css — Unified motion language (Superhuman premium-feel step 2/4).
 *
 * Continuation of the premium-feel sequence kicked off by skeletonStyle.css
 * (step 1 — unified skeleton). Where step 1 made loading states feel
 * coherent, step 2 makes every transition feel coherent.
 *
 * Strategy: TOKEN REDIRECT + SAFETY NET.
 *
 *   1. Redefine `--ease` (shell.css L6 — used by ~40 verbatim rules via
 *      `var(--ease)` in hover lifts, modal slides, progress fills, toasts)
 *      to the Superhuman ease-out-expo curve. Token cascade — motion.css
 *      loads AFTER shell.css so our :root value wins, and every existing
 *      `var(--ease)` reference picks up the new curve automatically with
 *      zero per-selector edits.
 *
 *   2. Universal !important override of `transition-timing-function` on
 *      every element. Catches the ~400+ transition rules in _ported/*
 *      that DON'T use `var(--ease)` — they currently default to the
 *      browser `ease` keyword. Longhand !important beats verbatim
 *      shorthand (no verbatim rule uses !important on `transition`).
 *
 *   3. New `--ps-dur-*` / `--ps-ease*` tokens for new code to consume
 *      directly when writing future overlays.
 *
 * Animations (keyframe `@keyframes`) intentionally NOT touched — the
 * skeleton pulse, spinner, drawer slide, and float-up effects have their
 * own intent and curves. Only TRANSITIONS get the universal upgrade.
 *
 * Reduced motion respected globally.
 *
 * Loaded after app-overrides.css in index.html → top of the global cascade.
 */

:root {
  /* Duration tokens for new code. Existing verbatim durations stay as-is —
     the new ease curve makes them feel snappier without retiming. */
  --ps-dur-instant: 90ms;
  --ps-dur-fast:    140ms;
  --ps-dur-base:    220ms;
  --ps-dur-slow:    420ms;

  /* Single Superhuman-style ease curve (ease-out-expo). Fast initial
     acceleration, gentle landing — feels "snappy but settled". */
  --ps-ease:        cubic-bezier(0.16, 1, 0.3, 1);

  /* Spring overshoot for emphasis moments (toasts, success checks). */
  --ps-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* TOKEN REDIRECT — shell.css L6 defined `--ease: cubic-bezier(0.4,0,0.2,1)`
     (Material). Override here with the Superhuman curve so every
     `var(--ease)` reference across _ported/* and shell.css picks up the
     new feel automatically. */
  --ease:           cubic-bezier(0.16, 1, 0.3, 1);
}

/* SAFETY NET — catches transitions that hard-code `ease` (default) or
   omit a timing-function entirely. `!important` on longhand beats
   shorthand (verified: no verbatim rule uses !important on `transition`). */
*, *::before, *::after {
  transition-timing-function: var(--ps-ease) !important;
}

/* Reduced-motion accessibility — collapse all transitions to instant when
   the user has requested reduced motion in their OS. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
