/* ===========================================================================
   MOTION (U-56) — GENERATED, DO NOT EDIT BY HAND
   Run `node scripts/make-springs.mjs` after changing a spring.

   Every animation in this application used a fixed duration and a hand-picked
   cubic-bezier. Apple's are springs, and the difference is not decoration: a
   spring carries velocity, so an interrupted movement continues from where it
   is instead of restarting from zero. That is most of why iOS feels expensive
   while being grey.

   EACH SPRING IS A PAIR AND THE PAIR MUST TRAVEL TOGETHER. A `linear()` curve
   encodes the whole motion INCLUDING its timing, so using --snap with the glide
   duration gives neither: it is the snap curve stretched, which reads as sludge.
   Always write `var(--<name>-t) var(--<name>)`.

 * --snap   146ms  (duration 0.13s, bounce 0)
 *          A tap answering. Nothing overshoots, because a button that wobbles under a finger feels loose.
 * --glide  292ms  (duration 0.28s, bounce 0.18)
 *          Something arriving or leaving: a sheet, a screen, an overlay. The barest overshoot, so it lands rather than stops.
 * --pop    358ms  (duration 0.34s, bounce 0.35)
 *          Something appearing that deserves to be noticed: a tapback, the reveal, a new picture. This is the only one allowed to be playful.
 * --drop   267ms  (duration 0.24s, bounce 0)
 *          Getting out of the way. Faster than it arrived, because nobody wants to wait for a dismissal.
   ======================================================================== */

:root{
  /* A tap answering. Nothing overshoots, because a button that wobbles under a finger feels loose. */
  --snap: linear(0, 0.0115, 0.0416, 0.0844, 0.1355, 0.1916, 0.25, 0.3088, 0.3666, 0.4225, 0.4757, 0.5258, 0.5726, 0.6159, 0.6557, 0.6922, 0.7254, 0.7555, 0.7828, 0.8073, 0.8293, 0.849, 0.8666, 0.8824, 0.8964, 0.9088, 0.9198, 0.9295, 0.9382, 0.9458, 0.9525, 0.9584, 0.9636, 0.9682, 0.9722, 0.9757, 0.9788, 0.9815, 0.9839, 0.986, 0.9878, 0.9894, 0.9908, 0.992, 1);
  --snap-t: 146ms;
  /* Something arriving or leaving: a sheet, a screen, an overlay. The barest overshoot, so it lands rather than stops. */
  --glide: linear(0, 0.0102, 0.0376, 0.0779, 0.1276, 0.1836, 0.2435, 0.3052, 0.3672, 0.4282, 0.4872, 0.5434, 0.5965, 0.6459, 0.6916, 0.7335, 0.7715, 0.8058, 0.8364, 0.8636, 0.8876, 0.9086, 0.9269, 0.9426, 0.9561, 0.9675, 0.977, 0.985, 0.9915, 0.9968, 1.001, 1.0043, 1.0067, 1.0085, 1.0098, 1.0106, 1.011, 1.0111, 1.011, 1.0106, 1.0102, 1.0096, 1.009, 1.0083, 1);
  --glide-t: 292ms;
  /* Something appearing that deserves to be noticed: a tapback, the reveal, a new picture. This is the only one allowed to be playful. */
  --pop: linear(0, 0.0106, 0.0396, 0.0832, 0.1379, 0.2006, 0.2685, 0.3394, 0.4112, 0.4824, 0.5516, 0.6176, 0.6798, 0.7375, 0.7904, 0.8381, 0.8807, 0.9182, 0.9507, 0.9784, 1.0017, 1.0208, 1.036, 1.0478, 1.0566, 1.0626, 1.0662, 1.0679, 1.0679, 1.0664, 1.0639, 1.0605, 1.0565, 1.052, 1.0473, 1.0424, 1.0375, 1.0327, 1.0281, 1.0237, 1.0197, 1.0159, 1.0125, 1.0094, 1);
  --pop-t: 358ms;
  /* Getting out of the way. Faster than it arrived, because nobody wants to wait for a dismissal. */
  --drop: linear(0, 0.0113, 0.0409, 0.083, 0.1334, 0.1888, 0.2466, 0.3049, 0.3623, 0.4178, 0.4707, 0.5207, 0.5674, 0.6107, 0.6506, 0.6872, 0.7205, 0.7509, 0.7783, 0.803, 0.8253, 0.8453, 0.8631, 0.8791, 0.8933, 0.9059, 0.9172, 0.9271, 0.936, 0.9438, 0.9507, 0.9567, 0.9621, 0.9668, 0.971, 0.9746, 0.9778, 0.9806, 0.9831, 0.9852, 0.9871, 0.9888, 0.9902, 0.9915, 1);
  --drop-t: 267ms;

  /* NOT a spring, deliberately. For movement that never arrives anywhere:
     breathing, blinking, a pulsing dot, a bar filling, a slow deliberate gaze.
     A spring on a loop slams into an invisible wall at every seam. These keep
     their own duration — the easing is all this token provides. */
  --loop: cubic-bezier(.42, 0, .58, 1);
}

/* A browser without linear() would silently animate with the default ease,
   which is not a disaster but is not what was designed either. Say so once,
   here, rather than discovering it on someone's tablet. */
@supports not (transition-timing-function: linear(0, 1)){
  :root{
    --snap: cubic-bezier(.23, 1, .32, 1);
    --glide: cubic-bezier(.23, 1, .32, 1);
    --pop: cubic-bezier(.23, 1, .32, 1);
    --drop: cubic-bezier(.23, 1, .32, 1);
  }
}

/* Not a preference to be overridden by enthusiasm. Everything below stops. */
@media (prefers-reduced-motion: reduce){
  :root{
    --snap: linear; --snap-t: 1ms;
    --glide: linear; --glide-t: 1ms;
    --pop: linear; --pop-t: 1ms;
    --drop: linear; --drop-t: 1ms;
    --loop: linear;
  }
  *,*::before,*::after{
    animation-duration:1ms !important;
    animation-iteration-count:1 !important;
    transition-duration:1ms !important;
    scroll-behavior:auto !important;
  }
}
