/* Aptibit family UI kit: motion tokens. The ONE place any shared duration, easing or scroll timing lives.
   NAV-AND-FOOTER.md section 0.3 and 0.6. Every kit animation reads these and nothing else; components never
   define their own durations or easings. kit.js reads the timing tokens once at start-up (idle, threshold, to-top),
   so the scroll logic and the CSS can never disagree.

   Rules: animate transform, opacity and clip-path only; CSS transitions or WAAPI only, so every change is
   interruptible and reverses from where it is; never width, height, top or left. */
@layer kit.motion {
  :root {
    /* open and close: mega menus, the search palette, the Dock sheet, cookie settings, accordions */
    --kit-open: 320ms;
    --kit-close: 200ms;
    /* the Island on scroll */
    --kit-condense: 280ms;      /* scroll down past the threshold: full Island to the pill */
    --kit-expand: 280ms;        /* any scroll up: pill to the full Island */
    --kit-settle: 360ms;        /* scroll stopped for --kit-idle away from the top: back into the pill */
    --kit-idle: 1200ms;
    --kit-threshold: 120px;
    --kit-to-top: 600ms;        /* clicking the pill glides to the top */
    --kit-intent: 120ms;        /* hover intent before a mega menu opens */
    --kit-leave: 300ms;         /* pointer grace period before a mega menu closes */
    /* small things */
    --kit-glide: 260ms;         /* the hover pill behind Island items */
    --kit-tab: 240ms;           /* the active pill between Dock tabs */
    --kit-fade: 160ms;          /* contents swapping inside a shape */
    --kit-micro: 200ms;         /* underlines, icon swaps, field states */
    --kit-press: 120ms;         /* press and tap feedback */
    --kit-stagger: 20ms;        /* per group inside an opening panel */
    --kit-bars: 240ms;          /* the phone top bar and the Dock sliding away */
    /* easings */
    --kit-ease-settle: cubic-bezier(0.16, 1, 0.3, 1);   /* Settle: arrivals, opens, condense, expand */
    --kit-ease-close: cubic-bezier(0.4, 0, 1, 1);       /* departures and closes */
    --kit-ease-standard: cubic-bezier(0.2, 0, 0, 1);    /* colour and fades */
    /* distances */
    --kit-press-scale: 0.98;
    --kit-tap-scale: 0.96;
    --kit-lift: -2px;
    --kit-rise: 16px;
    --kit-panel-rise: 5px;      /* menu content fades up this far ... */
    --kit-content-delay: 60ms;  /* ... this long after its container starts to open */
    --kit-row-stagger: 24ms;    /* search results, per row, first 6 rows */
    --kit-scrim-lag: 40ms;      /* the backdrop fades on its own, slightly behind the panel */
    --kit-from-scale: 0.96;     /* a palette opens from, and closes back to, this scale at its trigger */
    --kit-rm-fade: 150ms;       /* reduced motion: every open and close is this fade, nothing moves */
  }
  /* Reduced motion: every state change is instant; nothing morphs. data-kit-motion="reduce" forces it (tests). */
  /* Reduced motion: nothing moves, scales or morphs; every open and close is a 150 ms fade (kit.css limits every kit
     transition to opacity under reduced motion). JS timers read the same 150 ms. */
  @media (prefers-reduced-motion: reduce) {
    :root {
      --kit-open: 150ms; --kit-close: 150ms; --kit-condense: 150ms; --kit-expand: 150ms; --kit-settle: 150ms; --kit-to-top: 0ms;
      --kit-glide: 0ms; --kit-tab: 0ms; --kit-fade: 150ms; --kit-micro: 0ms; --kit-press: 0ms; --kit-stagger: 0ms; --kit-bars: 150ms;
      --kit-content-delay: 0ms; --kit-row-stagger: 0ms; --kit-scrim-lag: 0ms; --kit-from-scale: 1;
      --kit-press-scale: 1; --kit-tap-scale: 1; --kit-lift: 0px; --kit-rise: 0px; --kit-panel-rise: 0px;
    }
  }
  :root[data-kit-motion="reduce"] {
    --kit-open: 150ms; --kit-close: 150ms; --kit-condense: 150ms; --kit-expand: 150ms; --kit-settle: 150ms; --kit-to-top: 0ms;
    --kit-glide: 0ms; --kit-tab: 0ms; --kit-fade: 150ms; --kit-micro: 0ms; --kit-press: 0ms; --kit-stagger: 0ms; --kit-bars: 150ms;
    --kit-content-delay: 0ms; --kit-row-stagger: 0ms; --kit-scrim-lag: 0ms; --kit-from-scale: 1;
    --kit-press-scale: 1; --kit-tap-scale: 1; --kit-lift: 0px; --kit-rise: 0px; --kit-panel-rise: 0px;
  }
}
/* Cookie bar (COOKIE-CONSENT.md, "Motion: slide up in, slide down out") */
@layer kit.motion {
  :root { --kit-cookie-delay: 600ms; --kit-cookie-in: 520ms; --kit-cookie-follow: 60ms; --kit-cookie-out: 360ms; }
  @media (prefers-reduced-motion: reduce) { :root { --kit-cookie-in: 0ms; --kit-cookie-out: 0ms; --kit-cookie-follow: 0ms; } }
  :root[data-kit-motion="reduce"] { --kit-cookie-in: 0ms; --kit-cookie-out: 0ms; --kit-cookie-follow: 0ms; }
}

/* Form controls (not motion, but shared measures every site must match): inline padding for every field */
@layer kit.motion {
  :root { --kit-field-pad: 14px; --kit-field-pad-lg: 16px; --kit-field-icon: 18px; --kit-field-gap: 10px; }
}
