/* Motion components from Nana's motion library (~/impeccable-test/motion-library, commit cee4a7f).
   Do not edit here: change the library snippet, then run tools/pull_motion.py. Site colours live in dawn-vigil.css. */
/* ---- media/liquid-reveal ---- */
/* Liquid reveal — a picture appears through a living, wobbling blob that swells from one point until it fills
     the frame, while the picture inside settles from a slight zoom. One of the house motion styles (liquid morph).
     Use: wrap any image (or any box) in .ml-liquid. It reveals once when it scrolls into view. Pictures that come
     into view together reveal one after another (a short cascade), so a whole grid flows in.
     Options (data-* on the root):
       data-origin="50% 70%"   where the blob starts (x y, in % of the frame)
       data-wobble="1"         how liquid the edge is (0 = a clean circle, 2 = very wobbly)
       data-auto="false"       do not reveal on scroll; call el.mlReveal() yourself
     JS API: el.mlReveal() → Promise (resolves when fully shown); el.mlHide() hides it again (instantly).
     Event: "ml-liquid:revealed" bubbles from the root when the reveal ends.
     Motion: the blob is a clip-path polygon on the picture, recalculated each frame (works in Chrome, Safari and Firefox); when the
     reveal ends the clip is removed so the picture is a normal element again. With prefers-reduced-motion the
     picture simply fades in. Without JS the picture just shows.
     Customise: --ml-duration (the swell, default 1150 ms), --ml-zoom (start zoom of the picture, default 1.14),
     --ml-cascade (gap between pictures revealed together, default 110 ms). */
  .ml-liquid {
    --ml-duration: 1150ms;
    --ml-zoom: 1.14;
    --ml-cascade: 110ms;
    position: relative; display: block; margin: 0; overflow: hidden;
  }
  .ml-liquid > img, .ml-liquid > picture, .ml-liquid > video { display: block; width: 100%; height: 100%; object-fit: cover; }
  /* the clip sits on the picture, not the frame: a frame clipped to nothing would never count as "in view" in Chrome */
  .ml-liquid.is-armed > * { clip-path: circle(0% at 50% 50%); transform: scale(var(--ml-zoom)); }
  @media (prefers-reduced-motion: reduce) {
    .ml-liquid.is-armed { opacity: 0; }
    .ml-liquid.is-armed > * { clip-path: none; transform: none; }
  }

/* ---- navigation/sliding-tabs ---- */
/* Sliding tabs — the highlight slides to whichever tab you pick.
     Customise: change the --ml-* variables below (on .ml-tabs, or on a more specific selector such as .my-header .ml-tabs).
     Tabs: add or remove <button class="ml-tabs__tab" role="tab"> elements; mark the starting one aria-selected="true".
     Keyboard: Left/Right arrows move between tabs, Home/End jump to the first/last.
     JS API: el.mlSelect(index) selects a tab. Event: "ml-tabs-change" bubbles from the root with
     detail { index, label, tab } whenever the selection changes.
     The easing is a spring (duration 420 ms, bounce 0.18) baked into CSS linear(); --ml-duration is its settle time. */
  .ml-tabs {
    --ml-surface: #1c1c1f;            /* track background */
    --ml-hair: rgba(255,255,255,.08); /* track outline */
    --ml-highlight: #3a3a3f;          /* sliding pill */
    --ml-text: #f5f5f7;               /* selected label */
    --ml-muted: #9a9aa0;              /* other labels */
    --ml-hover: #c8c8cd;              /* hovered label */
    --ml-focus: #6aa8ff;              /* keyboard focus ring */
    --ml-duration: 578ms;
    --ml-ease: linear(0, 0.03, 0.101, 0.196, 0.3, 0.406, 0.507, 0.599, 0.681, 0.752, 0.811, 0.86, 0.9, 0.931, 0.955, 0.973, 0.987, 0.996, 1.003, 1.007, 1.009, 1.01, 1.01, 1.01, 1.009, 1.008, 1.007, 1.006, 1.005, 1.004, 1.003, 1.002, 1.002, 1.001, 1.001, 1);
    position: relative; box-sizing: border-box; display: inline-flex; gap: 2px; margin: 0; padding: 4px; border-radius: 999px;
    background: var(--ml-surface); box-shadow: inset 0 0 0 1px var(--ml-hair);
  }
  .ml-tabs__ind {
    position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--ml-w, 0); transform: translateX(var(--ml-x, 0)); border-radius: 999px;
    background: var(--ml-highlight); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.4);
    transition: transform var(--ml-duration) var(--ml-ease), width var(--ml-duration) var(--ml-ease); pointer-events: none;
  }
  .ml-tabs__tab {
    position: relative; z-index: 1; box-sizing: border-box; margin: 0; padding: 9px 16px; border: 0; border-radius: 999px; background: none;
    font: inherit; font-size: 15px; line-height: normal; letter-spacing: inherit; text-transform: none; white-space: nowrap;
    color: var(--ml-muted); cursor: pointer; -webkit-appearance: none; appearance: none; transition: color 220ms ease;
  }
  .ml-tabs__tab[aria-selected="true"] { color: var(--ml-text); }
  .ml-tabs__tab:not([aria-selected="true"]):hover { color: var(--ml-hover); }
  .ml-tabs__tab:focus { outline: none; }
  .ml-tabs__tab:focus-visible { outline: 2px solid var(--ml-focus); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .ml-tabs { --ml-duration: 1ms; } }
