/* =========================================================
   THE SIDE MENU'S MOTION (lab/css/menu.css; split out of account.css on 2026-11-14, order kept). The menu's look is in
   pages.css ("THE MENU"); its markup and spring are in lab/js/shell.js.
   ========================================================= */
/* ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   THE SIDE MENU MOVES AS ONE THING (user, 2026-11-14: "polish the animation and motion for the sidebar because if u hover and
   then quickly unhover ... it kinda goes clunky ... so its clean and doesnt break the aesthetic and the feeling").
   WHAT WAS CLUNKY (measured with a pointer going in and out fast): the sheet, the dim behind, the rail's label and every word
   each had their OWN timer, with different lengths and delays for opening and for closing. Reversing mid-way, the sheet froze
   for its .22 s closing delay, the words (which wait for the sheet) popped in late and were cut off, and the parts drifted
   out of step.
   NOW THERE IS ONE NUMBER, --mo, from 0 (the rail) to 1 (the open sheet). It alone moves; everything else is WORKED OUT from it
   each frame: how far the sheet has run out, how dark the page
   behind is, how much of the rail's label is left, and each word's fade (a word starts once the sheet has passed it, the
   lower ones a touch later).
   --mo IS MOVED BY A SPRING in shell.js ("THE MENU'S SPRING"), not by a css transition: a first try with a transition on the
   number still froze for a moment each time the pointer turned back (measured). The spring is critically damped: it starts
   gently, settles without overshoot in about half a second, and when the pointer turns back it keeps its speed and bends
   round, so nothing waits, nothing jumps and the parts cannot fall out of step. A 40 ms pause before opening (a pointer that
   only crosses the rail does not flick it) and an 80 ms grace before closing (a slip off the edge does not shut it); the
   sheet keeps moving during both. Without the script (.mo-js missing) the number simply follows :hover. Desktop only.
   ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@property --mo { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --dimw { syntax: "<number>"; inherits: false; initial-value: 1; }
@media (min-width: 761px) {
  .pg-bar { --mo: 0; }
  .pg-bar:not(.mo-js):is(:hover, :focus-within, .open) { --mo: 1; }
  /* the sheet's edge, the dim behind, the rail's own face */
  .pg-bar nav, .pg-bar:is(:hover, :focus-within, .open) nav { clip-path: inset(0 calc((1 - var(--mo)) * 264px) 0 0) !important; transition: none !important; }
  .pg-bar::before, .pg-bar:is(:hover, :focus-within, .open)::before { opacity: var(--mo) !important; transition: none !important; }
  html.atlas body.t-body .pg-bar .pg-home, html.atlas body.t-body .pg-bar:is(:hover, :focus-within, .open) .pg-home { --lf: clamp(0, var(--ml, calc(1 - var(--mo) * 2.6)), 1); opacity: calc(var(--lf) * var(--lf) * (3 - 2 * var(--lf))) !important; transition: none !important; }
  /* the page's name down the rail drifts 8px as it goes and comes, like the words (its own centring transform is kept) */
  .pg-bar .pg-home b { transform: translateX(-50%) translateY(calc((1 - var(--lf, 1)) * -8px)) !important; }
  /* the words: each fades and drifts in from --mo; pointing at one still dims the others (--dimw, eased on its own) */
  .pg-bar nav > .pg-legal { --i: 8; }
  html.atlas body.t-body .pg-bar nav :is(a, button, span), html.atlas body.t-body .pg-bar:is(:hover, :focus-within, .open) nav :is(a, button, span),
  html.atlas body.t-body .pg-bar nav > .pg-legal em, html.atlas body.t-body .pg-bar:is(:hover, :focus-within, .open) nav > .pg-legal em {
    --e: clamp(0, calc((var(--mw, var(--mo)) - .08 - var(--i, 0) * .04) * 1.6), 1); --dimw: 1;
    --s: calc(var(--e) * var(--e) * (3 - 2 * var(--e))); opacity: calc(var(--s) * var(--dimw)) !important;   /* --s = the fade with a soft start and a soft landing */ transform: translateX(calc((1 - var(--e)) * -8px)) !important; transition: color .35s ease, --dimw .4s ease !important; }
  html.atlas body.t-body .pg-bar nav:has(:is(a, button):hover) > :not(:hover):not(.pg-legal) { --dimw: .6; }
  html.atlas body.t-body .pg-bar nav:has(:is(a, button):hover) > :is(span[aria-current], a.is-here):not(:hover) { --dimw: .85; }
  html.atlas body.t-body .pg-bar nav:has(> :is(a, button):hover) > .pg-legal :is(a, span, em), html.atlas body.t-body .pg-bar nav > .pg-legal:has(a:hover) :is(a, span):not(:hover) { --dimw: .6; }
}

/* the menu's title, STELLAR, comes in like the page words (user, 2026-11-14: "the title of stellar. can u do the same u do with the
   pages"): it was simply uncovered by the sheet's edge. Now it fades and drifts 6px from the same number, just ahead of "Home".
   The crow beside it is the same element's picture and stays put on the rail: only the letters' ink and indent are eased. */
@media (min-width: 761px) {
  .pg-bar nav::before { --et: clamp(0, calc((var(--mw, var(--mo)) - .03) * 1.6), 1); color: rgb(247 237 232 / calc(var(--et) * var(--et) * (3 - 2 * var(--et)))) !important; text-indent: calc((1 - var(--et)) * -8px); }
}
/* the words and the title read --mw, the slower number that follows --mo (shell.js): they breathe in over about half a second
   once the sheet has mostly arrived, each a little after the one above, and leave ahead of the sheet's edge. */