/* The floating menu, on every page since 11 November 2026 (Kyle, after The Quaker School's: "I like how it acts as its own
   floating box on the page, and how it opens a bigger box when I hover over it that takes up most of the page"; then "I love
   the floating menu ... roll [it] out"). The full-width bar it replaced is kept at /alt/previous-menu/ (nav: "classic").
   Base.astro puts html.nf on the page; navfloat.js adds html.nf-box once the page has moved up under the menu.

   How it behaves, with a mouse on a desktop (a phone keeps the usual menu):
   - at the top of the homepage the menu sits straight on the moving field, nothing behind it; at the top of any other page
     it is the bar it always was, in the tone of the page under it, until the page has moved up under it;
   - once you scroll, it becomes its own chalk box, set in from the page's edges, with soft corners and a fine edge (flat:
     no shadow, as the brand has it), and it still drops away as you read down and comes back as you scroll up;
   - hovering a heading grows that same box downwards to hold the panel, a little wider than the bar, while the page
     behind dims; the panel's links rise into place one after another and its pictures unroll from the top;
   - moving from one heading to the next only changes the box's height and cross-dissolves the content, as now.
   The box is the menu's own backdrop (.mg-back, made by site.js), moved up behind the bar, so it is one shape that grows
   rather than a bar with a sheet hung under it. Timings are the site's: movement 0.5s on --ease, colour 0.5s. */

@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  html.nf {
    --nf-top: .875rem;                                                         /* the gap above the box: a little more than the bar's own padding, so it reads as floating (Kyle, 11 November 2026) */
    --nf-in: max(1rem, calc((100% - min(1280px, 100% - 4rem)) / 2 - 1.5rem));   /* the box: the bar's column and 1.5rem more, never nearer the edge than 1rem */
  }
  /* The box is part of every page from its first paint (Kyle, 11 November 2026: pages "load with the old nav which then has
     an awkward transition into the new floating nav"). On an ordinary page the bar's own band is simply the colour of the
     page under it (look.css's tone), with no line, so the box floats on the page from the start; once the page has moved up
     under the bar the band steps aside, at once, since what shows through is the same colour. Over the homepage's moving
     field the band is never there, and the box comes in once you scroll, as on The Quaker School's. */
  html.nf .head { border-bottom-color: transparent !important; transition: transform .5s var(--ease); }
  html.nf:is(.nf-box, .wl-top) .head { background: transparent !important; }
  /* the bar's contents sit in the middle of the box, above it */
  html.nf .head > .wrap { position: relative; z-index: 1; width: min(1280px, 100% - 4rem); translate: 0 var(--nf-top); }
  /* nothing navy behind the bar over the field: the box is the backdrop now */
  html.nf .head.on-field::before { display: none; }
  /* out of the way as you read down, all of it, box included */
  html.nf .head.off { transform: translateY(calc(-100% - 2 * var(--nf-top))); }

  /* ---------- the box at rest: drawn by the stylesheet, so it is there before any script runs ---------- */
  html.nf .head::after {
    content: ""; position: absolute; z-index: -1; top: var(--nf-top); left: var(--nf-in); right: var(--nf-in); height: var(--hh);
    background: var(--chalk); border: 1px solid var(--rule); border-radius: 8px; pointer-events: none; transition: opacity .45s ease, border-radius .5s var(--ease);
  }
  /* It lies under everything else in the bar, the opening box included: that box is the same chalk, starts exactly on top of
     it and only ever grows, so while it is open it covers this one edge and all, and when it has folded back the two are one
     shape again. Nothing has to be switched off or back on at the handover, so nothing can arrive late (until 11 November
     2026 it was hidden while the menu was open and put back half a second after, which also made it pop in late when the
     page first moved up under the bar). */
  /* a page that opens on navy (Documents, Our Experts, Contact) opens as the homepage does (Kyle, 11 November 2026: "stick
     to the model ... used on the homepage, whereby it's invisible until I begin scrolling down"): the bar is the page's
     navy with chalk type, no box, until the page moves up under it, or the pointer comes onto it. */
  /* at the top of the homepage the box comes in while the pointer (or the keyboard) is on the bar, as The Quaker School's
     does, and stays while it moves along it: hovering Contact after Services no longer folds the box away (Kyle, 11 November
     2026); it goes once the pointer leaves the bar */
  html.nf:is(.wl-top, .bar-dark):not(.nf-box):not(:has(.head > .wrap:hover, .head > .wrap :focus-visible)):not(:has(.head .mg-back.on)) .head::after { opacity: 0; transition: opacity .4s ease .1s; }
  html.nf:is(.wl-top, .bar-dark):not(.nf-box) .head::after { transition: opacity .35s ease, border-radius .5s var(--ease); }

  /* at the top of the homepage or a navy page, a panel closed because the pointer has gone: the box folds back and fades as it
     goes, rather than folding back to the bar's size and then vanishing */
  html.nf:is(.wl-top, .bar-dark):not(.nf-box):not(:has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head.mgjs .mg-back:not(.on) {
    --mg-t: .45s var(--ease-fold); transition: opacity .4s ease .12s, clip-path var(--mg-t);
  }

  /* ---------- the box opening: the menu's own backdrop (.mg-back, made by site.js), laid exactly over the box at rest, takes
     over the moment a heading opens and grows to hold the panel, a touch wider and taller than the bar, as if it opens out;
     it hands back to the box at rest once it has folded away again ----------
     It is drawn at its open size all the time and shown through a clip that opens out from the bar's own shape (20 November
     2026, Kyle: the top "expands upward a touch" and "it's a little jolty"). It used to grow by moving its edges, and the
     browser puts a box's edges on whole pixels: filmed frame by frame, the top went up its 4px in four steps of one pixel,
     three frames on each. A clip's edge moves by fractions of a pixel, so it glides. The fine edge is the backdrop itself, in
     the rule's colour, with the chalk laid 1px inside it (::before) under the same clip, so the edge travels with the clip. */
  html.nf .head.mgjs .mg-back {
    display: block; position: absolute; z-index: 0;
    top: calc(var(--nf-top) - .25rem); left: calc(var(--nf-in) - .5rem); right: calc(var(--nf-in) - .5rem); height: calc(var(--hh) + var(--mgh, 0px) + .25rem);
    /* its own corners rounded too (Kyle, 26 November 2026: "sometimes ... the corners of the menu box are squared"): the
       browser now and then draws a composited layer without its clip-path, and the rule-coloured edge showed square at the
       corners behind the chalk. The clip at rest sits inside these corners, and open it matches them, so nothing else moves */
    background: var(--rule); border: 0; border-radius: 8px;
    /* at rest: exactly the box at rest (the bar's place and size, corners 8px) */
    clip-path: inset(.25rem .5rem var(--mgh, 0px) .5rem round 8px);
    opacity: 0; visibility: visible; transform: none; will-change: clip-path;
    /* folding back: out and in, so it leaves without a lurch and meets the bar softly. It hands back to the box at rest, which
       lies under it, with a short fade over its last moments, not in one frame: the clip's edge can fall between pixels where
       the box at rest has its edge on one, and switching in one frame showed as a flicker of the fine edge as it landed */
    --mg-t: .45s var(--ease-fold); transition: opacity .16s linear .3s, clip-path var(--mg-t);
  }
  html.nf .head.mgjs .mg-back::before {
    content: ""; position: absolute; inset: 1px; background: var(--chalk); border-radius: var(--r-card);
    clip-path: inset(.25rem .5rem var(--mgh, 0px) .5rem round 7px); transition: clip-path var(--mg-t);
  }
  html.nf .head.mgjs .mg-back.on {
    opacity: 1; clip-path: inset(0 0 0 0 round 8px);
    /* taking over from the box at rest the same way: over its first few frames, while it is still almost the same shape */
    --mg-t: .5s var(--ease-soft); transition: opacity .1s linear, clip-path var(--mg-t);
  }
  html.nf .head.mgjs .mg-back.on::before { clip-path: inset(0 0 0 0 round 7px); }
  /* where the box was not showing yet (the top of the homepage or a navy page, the pointer going straight to a heading), it
     comes in with the same fade as the box at rest rather than all at once */
  html.nf:is(.wl-top, .bar-dark):not(.nf-box) .head.mgjs .mg-back.on {
    transition: opacity .35s ease, clip-path var(--mg-t);
  }
  /* a fine rule under the bar, drawn across as the box opens */
  html.nf .head.mgjs .mg-back::after {
    content: ""; position: absolute; top: calc(var(--hh) + .25rem); left: calc(1.5rem + 1px); right: calc(1.5rem + 1px); height: 1px; background: var(--rule);
    transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s ease;
  }
  html.nf .head.mgjs .mg-back.on::after { transform: none; transition: transform .6s var(--ease-soft) .08s; }
  html.nf .head.mgjs.mg-swap .mg-back.on::after { transition: none; }

  /* the page behind dims with the box's own timing: in as it opens, out as it folds back, never left behind by it */
  html.nf body::before { transition: opacity .45s ease .05s, visibility 0s .5s; }
  html.nf:has(.head.mgjs .mg-back.on) body::before { transition: opacity .5s ease, visibility 0s; }

  /* the panels sit inside the box (they move down with the bar's contents); no backdrop of their own */
  html.nf .head.mgjs .ddm.mega { background: none; border: 0; }
  /* the bar's contents now hold the panels, so the panel's columns line up with the logo, not with the page */
  html.nf .head .ddm.mega .wrap.mg { width: 100%; }

  /* ---------- the bar's words, dark whenever the box is showing (over the field and over navy sections alike) ---------- */
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.mnav > a, .dd > button, .mnav > button.sxb-word) { color: var(--ink) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.mnav > a, .dd > button, .mnav > button.sxb-word):hover,
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .dd.open > button { color: var(--brick-word) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.dd .chev, .mnav > button.sxb-word svg) { color: var(--brick-word) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .mnav > :is(a, button.sxb-word)::after { background: var(--brick-word) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.portal, .wrap > .audsw) { color: var(--navy) !important; border-color: var(--navy) !important; background: transparent !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.portal, .wrap > .audsw):hover { background: var(--stone) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head :is(.portal, .wrap > .audsw) svg { color: var(--brick-word) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .wrap > .sxb-icon { color: var(--ink) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .sxb-sep { background: var(--rule) !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .logo .lg-n { opacity: 1 !important; }
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .logo .lg-r { opacity: 0 !important; }
  /* a site's name beside the logo (the VCT site's lockup): its light colours whenever the box is chalk, the name in the
     site's --lg-label-ink (navy if it sets none) and the rule before it in --lg-rule */
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .logo .lg-label { color: var(--lg-label-ink, var(--navy)) !important; --lg-rule: var(--navy) !important; }
  /* with one heading open, the others step back (a colour change, eased like every other) */
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .mnav:has(.dd.open) > :is(a, button.sxb-word),
  html.nf:is(:not(.wl-top):not(.bar-dark), .nf-box, :has(.head .mg-back.on), :has(.head > .wrap:hover, .head > .wrap :focus-visible)) .head .mnav:has(.dd.open) > .dd:not(.open) > button { color: #6B6E75 !important; }

  /* ---------- the menu and the section bar are one box (Kyle, 11 November 2026: "Can they live in the same bar together
     that's condensed as in-page only when I'm scrolling down, but then when I scroll up expands to include the top level nav
     too?") ----------
     On the service pages, once the section bar has come in, it hangs from the menu's box as its second row: the two meet
     with a hairline and square corners, one shape. Reading down, the menu's row folds up into the top and fades while the
     section row moves up by the same distance on the same curve, so the box simply gets shorter: the section row alone,
     with the S. at its start. Scrolling back up, the menu's row comes back down above it and the box grows again. */
  html.nf .snav-a { left: var(--nf-in); right: var(--nf-in); border: 1px solid var(--rule); border-radius: 8px; background: var(--chalk) !important; border-color: var(--rule) !important;
    transition: transform .5s var(--ease), opacity .4s, border-radius .2s ease, border-top-color .2s ease; }
  /* joined: square where they meet, at once, as the menu's row comes down onto it */
  html.nf .snav-a.show { transform: translateY(calc(var(--hh) + var(--nf-top))); border-top-color: transparent !important; border-top-left-radius: 0; border-top-right-radius: 0;
    transition: transform .5s var(--ease), opacity .4s, border-radius 0s, border-top-color 0s; }
  /* alone: its top corners round and its top edge draws in only as it arrives, once the menu's row has gone */
  html.nf .snav-a.show.up { transform: translateY(var(--nf-top)); border-top-color: var(--rule) !important; border-top-left-radius: 8px; border-top-right-radius: 8px;
    transition: transform .5s var(--ease), opacity .4s, border-radius .25s ease .3s, border-top-color .25s ease .3s; }
  /* the section row on its own carries no S. (Kyle, 11 November 2026): it reads as the same row it was under the menu */
  html.nf .snav-a .smark { display: none !important; }
  /* its contents on the same column as the menu row's, so the label starts under the logo and the button ends under the
     portal's: the box sits 1.5rem outside that column, or 1rem where the window is narrow (navfloat --nf-in) */
  html.nf .snav-a .wrap { width: calc(100% - 3rem); }
  @media (max-width: 1360px) { html.nf .snav-a .wrap { width: calc(100% - 2rem); } }
  /* the line between the two rows is drawn in from the box's edges, as the open menu's is, rather than running into them */
  html.nf:has(.snav-a.show:not(.up)) .head::after { border-bottom-color: transparent; }
  html.nf .snav-a::before { content: ""; position: absolute; top: 2px; z-index: 1;   /* just clear of the menu row's box, which overlaps this row by its two borders */ left: 1.5rem; right: 1.5rem; height: 1px; background: var(--rule); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
  html.nf .snav-a.show:not(.up)::before { opacity: 1; transition: opacity 0s; }
  /* on the house type scale (brand rules section 4): the section's name as the 12px label; its pages as navigation, 16px
     Medium like the menu row above them; each page's number in the label style too, quiet until it is the page you are on;
     the button the same size and weight as the portal's above it */
  html.nf .snav-a .lab { font-size: .75rem; letter-spacing: .12em; font-weight: 600; font-stretch: 80%; }
  /* the page's own section bar sits a step below the site's menu (Kyle, 11 November 2026): the house small size, 14px, in the
     menu's Medium, so the header leads and the bar follows */
  html.nf .snav-a a.l { font-size: .875rem; font-weight: 500; gap: .5rem; align-items: baseline; }
  html.nf .snav-a a.l b { font-size: .75rem; font-weight: 600; letter-spacing: .12em; font-stretch: 80%; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
  html.nf .snav-a a.l:hover b { color: var(--ink); }
  html.nf .snav-a a.l.on b { color: var(--brick-word); }
  html.nf .snav-a .cta { padding: .5625rem 1rem; font: 500 .875rem/normal var(--sans); border-width: 1px; height: 37px; box-sizing: border-box; }
  html.nf .snav-a a.l { transition: color .5s ease; }   /* colour eases over half a second, as every colour on the site does */
  html.nf:has(.snav-a.show:not(.up)) .head::after { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  /* the menu's row folds away with the section row, rather than leaving it behind */
  /* the menu's row goes quickly, so its outline is never seen in mid air, and comes back a beat after it starts down */
  html.nf:has(.snav-a.show) .head.off { transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .5s var(--ease), opacity .22s ease; }
  html.nf:has(.snav-a.show) .head:not(.off) { transition: transform .5s var(--ease), opacity .35s ease .1s; }
  html.nf.bar-dark .snav-a a.l { color: var(--ink-soft) !important; }
  html.nf.bar-dark .snav-a :is(a.l.on, a.l:hover) { color: var(--navy) !important; }
  html.nf.bar-dark .snav-a a.l b { color: var(--taupe) !important; }
  html.nf.bar-dark .snav-a a.l.on b { color: var(--brick-word) !important; }
  html.nf.bar-dark .snav-a .lab { color: var(--taupe) !important; }
  html.nf.bar-dark .snav-a .smark { color: var(--navy) !important; --logo-dot: var(--brick) !important; }
  html.nf.bar-dark .snav-a .ink { background: var(--brick) !important; }
  html.nf.bar-dark .snav-a .cta { background: var(--navy) !important; border-color: var(--navy) !important; color: var(--chalk) !important; }
  html.nf.bar-dark .snav-a .cta:hover { background: transparent !important; color: var(--navy) !important; }

  /* ---------- the panel's contents arriving: as one, with the box (Kyle, 11 November 2026: "Can the nav bar content not load
     in a more harmonious and fluent way?") ----------
     Each column (the section's pages, then each card, picture and words together) rises a little and comes in a beat after
     the one before it, while the box opens; nothing has an entrance of its own, so the pictures keep only the site's hover:
     104% inside their frame over 1.2s. Going: everything fades at once. Moving between headings: a cross-dissolve only. */
  html.nf .head.mgjs .ddm.mega .mg-col { opacity: 0; transform: translateY(.875rem); transition: opacity .15s ease, transform 0s .2s, color .5s ease, background-color .5s ease, border-color .5s ease; }
  html.nf .head.mgjs:not(.mg-swap) .dd.open .ddm.mega .mg-col {
    opacity: 1; transform: none;
    transition: opacity .45s ease calc(.1s + var(--c, 0) * .06s), transform .6s var(--ease) calc(.1s + var(--c, 0) * .06s), color .5s ease, background-color .5s ease, border-color .5s ease;
  }
  html.nf .head.mgjs .ddm.mega .mg-col:nth-child(2) { --c: 1; }
  html.nf .head.mgjs .ddm.mega .mg-col:nth-child(3) { --c: 2; }
  /* moving between headings, only the arriving section's columns are put in place, under its words while they are still
     unseen; the leaving section's go with it as they are (until 20 November 2026 they jumped to the end of their rise when a
     heading was left within half a second of opening) */
  html.nf .head.mgjs.mg-swap .dd.open .ddm.mega .mg-col { opacity: 1; transform: none; transition: opacity .15s ease-out, color .5s ease, background-color .5s ease, border-color .5s ease; }

  /* ---------- the search grows out of the box (Kyle, 11 November 2026: "does the current animation from the nav bar into it
     work, and from the search screen back out to the nav bar?") ----------
     The search screen opens from the box's own shape and size to the whole screen, and closes back into it, rather than
     fading in over the page. Its top row is the bar's: the logo the same size in the same place, and Close where the bar's
     last button is, so the logo holds still to the pixel both ways (brand rules: what stays, stays still). The search words
     come in once it has opened; on the way out they go first, then it folds back into the box. search.js waits --sx-out. */
  @keyframes nf-sx-open { from { clip-path: inset(var(--nf-top) var(--nf-in) calc(100% - var(--nf-top) - var(--sx-h)) var(--nf-in) round 8px); } to { clip-path: inset(0 0 0 0 round 0px); } }
  @keyframes nf-sx-close { from { clip-path: inset(0 0 0 0 round 0px); } to { clip-path: inset(var(--nf-top) var(--nf-in) calc(100% - var(--nf-top) - var(--sx-h)) var(--nf-in) round 8px); } }
  /* the last stretch of the way back: the search screen, now the box's own shape, dissolves into the bar under it, so the
     bar's words come up in place of the logo row and Close rather than replacing them in one frame (Kyle, 11 November
     2026: "It jolts back into the site's default state at the end, it needs to be much sleeker") */
  @keyframes nf-sx-dissolve { to { opacity: 0; } }
  /* the shape it opens from and folds back into is the bar's own: one row, or two where the section bar hangs from it */
  html.nf .sx { --sx-h: var(--hh); }
  html.nf:has(.snav-a.show:not(.up)) .sx { --sx-h: calc(var(--hh) + 57px); }
  @keyframes nf-sx-words-out { to { opacity: 0; } }
  html.nf .sx { --sx-out: 560; }
  html.nf .sx-box { animation: nf-sx-open .6s var(--ease) both; }
  html.nf .sx.sx-closing .sx-box { animation: nf-sx-close .5s var(--ease) .06s both, nf-sx-dissolve .24s ease .32s both; }
  html.nf .sx.sx-closing .sx-in > :not(.sx-top) { animation: nf-sx-words-out .18s ease both; }
  html.nf .sx-field { animation-delay: .16s; }
  html.nf .sx-try { animation-delay: .24s; }
  /* the top row, lined up with the bar */
  html.nf .sx-in { width: min(1280px, 100% - 4rem); }
  html.nf .sx-box { scrollbar-gutter: stable both-edges; }   /* where scroll bars take room, the row stays centred on the screen as the bar is */
  html.nf .sx-top { height: calc(var(--hh) + 2 * var(--nf-top)); }
  html.nf .sx-top img { width: auto; height: 50px; }
  /* opened while the menu has stepped away (reading down, then / or Ctrl K): no box to grow from, so it fades as before */
  html.nf:has(.head.off) .sx-box { animation: sx-fade .3s ease both; }
  html.nf:has(.head.off) .sx.sx-closing .sx-box { animation: sx-out .32s cubic-bezier(.4,0,.2,1) both; }
  /* ---------- the gate: its strip is just the logo, in the bar's place (Kyle, 11 November 2026: the outline where the bar will
     be was "a touch distracting"); the gate's logo is laid over the bar's (site.js pinLogo), so it holds still both ways ---------- */
  html.nf .gate[data-gv] .gate-logo { background: transparent; border-bottom-color: transparent; }
  /* the welcome's logo sits where the bar's does from its very first frame (20 November 2026, Kyle: from the Investor site or
     Adviser site switch, the logo "jolts upward for a moment before falling into place"). The bar's contents sit
     --nf-top down in the floating box; the welcome's logo was drawn without that and only pulled down to match once its
     script had run (gateflow.js pin), so the new page showed it 14px high, then dropped it. The script now only corrects
     a fraction of a pixel, if anything. */
  html.nf :is(.gf .gf-logo, .gate .gate-logo) { translate: 0 var(--nf-top); }

  /* no blur on the page behind as it opens: drawing the blur on every frame halved the frame rate (34 frames a second, 19
     dropped, against a steady 60 without it; measured 11 November 2026, Kyle: "a bit jolted (low frame rate almost)"). The
     page dims instead, as it does under the menu, which the graphics card does on its own. */
  html.nf.sx-open body > :is(main, footer, header) { animation: none !important; }
  html.nf.sx-open body::before { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }
  html.nf.sx-open.sx-closing body::before { opacity: 0; transition: opacity .45s ease .08s, visibility 0s .55s; }
  /* drawn on a layer of its own for the whole time it is open, not just while it moves: handing the finished screen back to
     the page's own drawing at the end of the opening put its words half a pixel over, a small jolt (Kyle, 11 November 2026) */
  html.nf .sx-box { will-change: clip-path, transform; transform: translateZ(0); }
  /* at the top of the homepage the box may not be there to fold back into (the pointer has left the bar): it fades as it lands */
  html.nf:is(.wl-top, .bar-dark):not(.nf-box) .sx.sx-closing .sx-box { animation: nf-sx-close .5s var(--ease) .06s both, nf-sx-words-out .2s ease .36s both; }
}

/* ---------- leaving for another page from an open panel ----------
   The page changes at once and the bar eases into the next page's, as on any move between pages; the open box, which went
   with the page you left, folds back up into the bar as it goes, quickly, instead of fading over the page arriving (Base.astro
   marks the move vt-menu). */
@keyframes nf-vt-fold {
  from { clip-path: inset(-1.5rem -1.5rem -48rem -1.5rem); }
  to { clip-path: inset(-1.5rem -1.5rem calc(-1 * var(--nf-top, 0px) - 1px) -1.5rem); opacity: 0; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  html.nf.vt-page.vt-menu::view-transition-old(sn-head) { animation: nf-vt-fold .4s var(--ease) both; }
}

@media (hover: hover) and (pointer: fine) and (min-width: 901px) and (prefers-reduced-motion: reduce) {
  html.nf .head.mgjs .mg-back, html.nf .head.mgjs .mg-back::before, html.nf .head.mgjs .mg-back::after { transition: opacity .2s ease !important; }
  html.nf .head.mgjs .ddm.mega .mg-col { transform: none !important; transition: opacity .2s ease !important; }
  html.nf .sx-box, html.nf .sx.sx-closing .sx-box { animation: none !important; }
}
