/* aimlink.ai header and menus. Load after site.css; the rules join its cascade layers.
   Design after veo.com: logo with the menu right after it, Support and a compact pill CTA on the right,
   16 px type, a soft chip behind a hovered link, mega menus as a second glass card 4 px under the bar,
   and on phones a floating bar at the bottom with the logo up top.
   Motion after cibby.app: on the page grid at the top, the bar gathers into a floating glass pill after
   48 px (320 ms, cubic-bezier(.2, .7, .2, 1)), the CTA fills in, and the mark reacts once.
   Only transform, opacity and clip-path move. Geometry for the pill comes from assets/nav.js.
   Like cibby.app's, the bar is part of the background at the top: no glass, no lift, the links straight on the
   page (in the colour of the section under it) and the CTA as a plain word. Scrolled, the glass (a frosted card,
   white at 74 % over a 32 px blur on a light section, dark on a dark one) fades in inside the pill's shape, the CTA
   fills and the mark reacts. On the start page "scrolled" starts where the film ends (data-nav-origin, set by
   film.js). The bar is cibby.app's size: a 62 px pill (18 px / 9 px padding, 22 px radius) that is only as wide as its
   content, a 44 px mark with AIMLINK in bold next to it (white on the dark top, ink on the white pill), 14 px links, a
   40 px button. The header is pinned in index.html: dark at the top, frosted white once it is the pill
   (data-nav-theme-fixed, data-nav-theme-scrolled; nav.js). A mega menu does
   not hang from it as a second card: the pill's own glass grows into one card (wider than the pill, as tall as the
   panel) while the links stay where they are, so a parked pointer never moves from one link to another. */

@layer sections {
  .skip-link {
    position: fixed; left: 16px; top: 12px; z-index: var(--z-skip-link);
    padding: 12px 18px; border-radius: var(--radius-pill);
    background: var(--action-bg); color: var(--action-fg); font-weight: 500;
    transform: translateY(-160%);
    transition: transform var(--duration-nav) var(--ease-out);
  }
  .skip-link:focus-visible { transform: none; box-shadow: 0 0 0 6px var(--bg); }
  .menu-open, .menu-open body { overflow: hidden; }

  /* ───────────── Desktop bar ───────────── */
  .site-header {
    --bar-top: calc(env(safe-area-inset-top, 0px) + 14px);
    --bar-h: 62px;
    --bar-gap: 8px;             /* under the bar */
    --nav-r: var(--radius-nav); /* the app's boxRadius, 26 (was 22) */
    --bar-inset: clamp(12px, 3.4vw, 48px); /* the wide bar's side inset (veo.com: 49 px at 1440) */
    --pill-w: 900px;            /* nav.js: the content plus room to breathe */
    --shift-start: 0px;         /* nav.js: how far the logo and menu move into the pill */
    --shift-end: 0px;           /* nav.js: how far Support and the CTA move into the pill */
    --inner-l: var(--gutter);   /* nav.js: where the logo sits on the page grid */
    --inner-r: var(--gutter);
    --mega-h: 0px;              /* nav.js: height of the open mega panel */
    /* The bar's own box follows the pill once scrolled and is page-wide (veo.com) at the top */
    --panel-l: calc(50% - var(--pill-w) / 2);
    --panel-w: var(--pill-w);
    --panel-pad-l: 24px;
    --panel-pad-r: 24px;
    /* The mega menu is exactly as wide as the bar above it (pill-wide once scrolled, page-wide at the top) */
    --mega-max: 76rem;          /* scrolled, the card the pill grows into is this wide at most */
    --mega-w: min(var(--mega-max), 100% - 2 * var(--bar-inset));
    --mega-l: calc(50% - var(--mega-w) / 2);
    --mega-pad-l: 28px;
    --mega-pad-r: 28px;
    position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
    height: calc(var(--bar-top) + var(--bar-h) + var(--bar-gap));
    pointer-events: none;
  }
  .site-header:not(.is-scrolled) {
    --panel-l: var(--bar-inset);
    --panel-w: calc(100% - 2 * var(--bar-inset));
    --panel-pad-l: calc(var(--inner-l) - var(--bar-inset));
    --panel-pad-r: calc(var(--inner-r) - var(--bar-inset));
    /* at the top the menu card is the whole bar, whose links sit on the page grid */
    --mega-w: var(--panel-w);
    --mega-l: var(--panel-l);
    --mega-pad-l: var(--panel-pad-l);
    --mega-pad-r: var(--panel-pad-r);
  }

  /* The bar's content always sits on the page grid; scrolled, the two groups slide into the pill */
  .nav {
    display: flex; align-items: center;
    width: min(100% - 2 * var(--gutter), var(--container)); height: var(--bar-h); margin: var(--bar-top) auto 0;
    color: var(--text);
  }
  .nav > * { pointer-events: auto; }
  .nav-logo + .nav-list { margin-left: 28px; }
  .nav-list { display: flex; align-items: center; }
  .nav-list-end { margin-left: auto; gap: 4px; }

  /* Glass: not there at the top (the bar is part of the page), forming inside the pill once scrolled, and growing into
     one card with the open mega menu (the whole bar at the top, up to --mega-max once scrolled). The box is tall
     enough for the largest card; only its clip-path (and opacity) moves, the content never resizes. */
  .nav-bg {
    position: absolute; top: 0; left: 0; right: 0; height: min(92vh, 64rem); pointer-events: none;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    opacity: 0;
    clip-path: inset(var(--bar-top) var(--bar-inset) calc(100% - var(--bar-top) - var(--bar-h)) round var(--nav-r));
    /* Back to the strip: the glass fades once it has started to widen */
    transition:
      clip-path var(--duration-morph) var(--ease-morph),
      opacity var(--duration-exit) var(--ease-out) 80ms,
      background-color var(--duration-nav) var(--ease-hover);
  }
  .site-header.is-scrolled .nav-bg {
    opacity: 1;
    clip-path: inset(var(--bar-top) calc(50% - var(--pill-w) / 2) calc(100% - var(--bar-top) - var(--bar-h)) round var(--nav-r));
    transition:
      clip-path var(--duration-morph) var(--ease-morph),
      opacity 160ms var(--ease-out),
      background-color var(--duration-nav) var(--ease-hover);
  }
  .site-header.is-open .nav-bg {
    opacity: 1;
    clip-path: inset(var(--bar-top) calc(100% - var(--mega-l) - var(--mega-w)) calc(100% - var(--bar-top) - var(--bar-h) - 4px - var(--mega-h)) var(--mega-l) round var(--nav-r));
    transition:
      clip-path var(--duration-morph) var(--ease-morph),
      opacity 160ms var(--ease-out),
      background-color var(--duration-nav) var(--ease-hover);
  }
  /* The lift arrives once the shape has settled (it is a separate box: clip-path would cut a shadow) */
  .nav-shadow {
    position: absolute; pointer-events: none; border-radius: var(--nav-r);
    top: var(--bar-top); height: var(--bar-h); left: var(--panel-l); width: var(--panel-w);
    box-shadow: var(--shadow-nav); opacity: 0;
    transition: opacity var(--duration-nav) var(--ease-out);
  }
  .site-header.is-scrolled .nav-shadow, .site-header.is-open .nav-shadow { opacity: 1; transition-delay: 120ms; }
  .site-header.is-open .nav-shadow { left: var(--mega-l); width: var(--mega-w); height: calc(var(--bar-h) + 4px + var(--mega-h)); }
  @media (prefers-reduced-transparency: reduce) {
    .nav-bg, .mega-bg, .mbar-bg { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  }

  /* Logo: 90% of the old 40 px mark, the same size in the wide bar and the pill. The recoil scales the lockup around the mark (brand.css). */
  .nav-logo { position: relative; min-height: 44px; gap: 0.5rem; color: var(--text); }
  .nav-logo svg { width: 40px; height: 40px; transition: transform var(--duration-morph) var(--ease-morph); }
  .nav-logo span { font: 700 1.875rem/1 var(--font-display); letter-spacing: 0.02em; color: var(--text); padding-top: 0.06em; }
  .nav-logo::after, .mbar-home::after {
    content: ""; position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%;
    box-shadow: 0 0 0 1.5px var(--accent-strong); opacity: 0; pointer-events: none;
  }
  .nav-logo::after { left: 1px; width: 34px; height: 34px; margin-top: -17px; }
  .mbar-home::after { left: 50%; margin-left: -13px; }

  /* Links: muted at rest, full on hover (cibby.app), with veo.com's chip behind them */
  .nav-link {
 position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 4px;
 min-height: 44px; padding: calc(0.1em + 2.4px) 12px 0; border: 0; border-radius: 14px; /* a 44 px target; the chip below stays 40 px. The extra drop puts Teko's baseline on the 36 px lockup. */
 background: transparent; cursor: pointer;
 font: 500 1.3125rem/1 var(--font-display); letter-spacing: 0.04em; white-space: nowrap; color: var(--text-muted);
 transition: color 160ms var(--ease-hover);
 }
  .nav-link:has(.chev) { padding-right: 6px; }
  .nav-link::before {
    content: ""; position: absolute; inset: 2px 0; z-index: -1; border-radius: inherit;
    background: color-mix(in srgb, var(--text) 9%, transparent);
    opacity: 0; transform: scale(0.92);
    transition: opacity 160ms var(--ease-hover), transform 260ms var(--ease-morph), background-color 160ms var(--ease-hover);
  }
  @media (hover: hover) and (pointer: fine) {
    .nav-link:hover { color: var(--text); }
    .nav-link:hover::before { opacity: 1; transform: none; }
    .nav-link:hover::before { background: color-mix(in srgb, var(--text) 7%, transparent); }
  }
  .nav-link:focus-visible { color: var(--text); }
  .nav-link:focus-visible::before { opacity: 1; transform: none; }
  .nav-link[aria-expanded="true"] { color: var(--text); }
  .nav-link[aria-expanded="true"]::before { opacity: 1; transform: none; }
  .nav-link .chev { width: 14px; height: 14px; transition: transform var(--duration-morph) var(--ease-morph); }
  .nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
  /* The current page carries cibby.app's dot; a menu button carries it when one of its pages is current
     (aria-current="true", set by apps/build_pages.py) */
  .nav-link::after {
    content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
    background: var(--accent-strong); box-shadow: 0 0 8px color-mix(in srgb, var(--accent-strong) 70%, transparent);
    opacity: 0; transform: translateY(3px) scale(0.5);
    transition: opacity 160ms var(--ease-hover), transform 180ms var(--ease-out);
  }
  .nav-link[aria-current] { color: var(--text); }
  .nav-link[aria-current]::after { opacity: 1; transform: none; }

  /* CTA: an outlined pill at the top (it reads as a button from the first paint: review pass), filled once the bar is a
     pill (cibby.app's moment); lifts 1 px on hover. Pill radius as every button in the app. */
  .nav-cta {
    position: relative; /* paints above the glass layer, like the other positioned items */
    min-height: 44px; padding: calc(0.1em + 2.4px) 18px 0; border-radius: var(--radius-pill); font-size: 1.3125rem; font-weight: 500;
    background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--accent-text);
    transition:
      background-color 260ms var(--ease-hover), color 260ms var(--ease-hover), box-shadow 260ms var(--ease-hover),
      translate var(--duration-morph) var(--ease-morph), transform var(--duration-exit) var(--ease-out);
  }
  .is-scrolled .nav-cta, .site-header.is-open .nav-cta { background: var(--action-bg); color: var(--action-fg); box-shadow: inset 0 0 0 1px transparent; }
  @media (hover: hover) and (pointer: fine) {
    .nav-cta:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--text) 9%, transparent); }
    .is-scrolled .nav-cta:hover, .site-header.is-open .nav-cta:hover { background: var(--action-bg-hover); box-shadow: inset 0 0 0 1px transparent; }
  }
  .nav-cta:active { transform: scale(var(--motion-press-scale)); }

  /* Scrolled: the groups gather into the pill (individual translate, so the mega panels inside the
     list items stay put) */
  .nav-logo, .nav-list > li > .nav-link { transition-property: color, translate; transition-duration: 160ms, var(--duration-morph); transition-timing-function: var(--ease-hover), var(--ease-morph); }
  .site-header.is-scrolled .nav-logo,
  .site-header.is-scrolled .nav-list:not(.nav-list-end) > li > .nav-link { translate: var(--shift-start) 0; }
  .site-header.is-scrolled .nav-list-end > li > .nav-link,
  .site-header.is-scrolled .nav-list-end > li > .nav-cta { translate: var(--shift-end) 0; }

  /* ───────────── Mega menus: a second glass card 4 px under the bar, as wide as the bar (veo.com) ───────────── */
  .mega-scrim {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: color-mix(in srgb, var(--color-night) 24%, transparent);
    opacity: 0; transition: opacity var(--duration-exit) var(--ease-out);
  }
  .mega-scrim.is-open { opacity: 1; pointer-events: auto; transition-duration: var(--duration-nav); }
  .mega-bg {
    display: none;   /* the card is .nav-bg now */
    position: absolute; pointer-events: none;
    top: calc(var(--bar-top) + var(--bar-h) + 4px); left: var(--mega-l); width: var(--mega-w); height: min(90vh, 54rem);
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-nav);
    opacity: 0;
    clip-path: inset(0 0 calc(100% - var(--mega-h)) 0 round var(--radius-nav));
    transition: clip-path var(--duration-morph) var(--ease-morph), opacity 160ms var(--ease-out);
  }
  .site-header.is-open .mega-bg { opacity: 1; }
  .mega {
    position: absolute; top: calc(var(--bar-top) + var(--bar-h) + 4px); left: var(--mega-l); width: var(--mega-w);
    padding: 28px var(--mega-pad-r) 28px var(--mega-pad-l);
    visibility: hidden; pointer-events: none;
    transition: visibility 0s linear var(--duration-exit);
  }
  .mega.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
  .mega::before {
    content: ""; position: absolute; top: 0; left: var(--mega-pad-l); right: var(--mega-pad-r); height: var(--line-hairline); background: var(--line);
    opacity: 0; transition: opacity var(--duration-press) var(--ease-out);
  }
  .mega.is-open::before { opacity: 1; transition: opacity 280ms var(--ease-out) 120ms; }

  /* Columns with a small heading and a hairline under it, as on veo.com; the apps and support menus pair
     the cards with a list of icon links, "built for" is cards only */
  .mega-panel {
    display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(15rem, 1fr); gap: 32px clamp(24px, 3vw, 48px);
    color: var(--text);
  }
  .mega-panel--cards { grid-template-columns: minmax(0, 1fr); }
  .mega-col { min-width: 0; }
  .mega-h {
 margin-bottom: 20px; padding-bottom: 12px; border-bottom: var(--line-hairline) solid var(--line);
 font: 500 1.875rem/1 var(--font-display); letter-spacing: 0.01em; color: var(--text-muted);
 }
  .mega-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  /* defence and law enforcement share the place of one card (23 Oct 2026; the start page's Built for does the same) */
  /* ... cut by a slanted line, as on the start page's lanes: defence above it (words at the top), law enforcement below it */
  .mega-pair { position: relative; min-width: 0; min-height: clamp(22rem, 48vh, 29rem); border-radius: var(--radius-panel); overflow: hidden; }
  .mega-pair .mega-item { position: absolute; inset: 0; min-height: 0; border-radius: 0; }
  .mega-pair .mega-item:first-child { clip-path: polygon(0 0, 100% 0, 100% calc(36% - 3px), 0 calc(56% - 3px)); align-content: start; }
  .mega-pair .mega-item:last-child { clip-path: polygon(0 calc(56% + 3px), 100% calc(36% + 3px), 100% 100%, 0 100%); }
  .mega-pair .mega-item:first-child::after { inset: 0 0 28%; background: linear-gradient(0deg, transparent, color-mix(in srgb, var(--color-night) 84%, transparent) 58%, color-mix(in srgb, var(--color-night) 92%, transparent)); }

  /* Cards: a device or a photo fills, the words sit at the bottom (veo.com's product cards) */
  .mega-item {
    --accent: var(--color-lime);
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; align-content: end; gap: 4px;
    --text-h: 9.5rem;           /* room the words need at the bottom of a card */
    min-height: clamp(22rem, 48vh, 29rem); padding: 22px;
    border-radius: var(--radius-panel); background: var(--color-night); color: var(--color-snow);
  }
  .mega-item .media { position: absolute; inset: 0; z-index: -2; margin: 0; border-radius: 0; background: var(--color-night); }
  .mega-item .media img { transition: transform 700ms var(--ease-out); }
  .mega-item::after {
    content: ""; position: absolute; inset: 28% 0 0; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--color-night) 84%, transparent) 58%, color-mix(in srgb, var(--color-night) 92%, transparent));
  }
  /* The three apps show their device, as in the device scene on the page (images/device-*.webp, shot from it on
     a transparent ground): GO on a phone, CLUB on an upright iPad, TARGET on a tablet. The device gets the room above the
     words (--text-h) and is fitted into it whole (object-fit: contain), so a small card or a short window
     shrinks the tablets instead of cutting them. Each app has its own colour behind it. */
  .mega-item--device::after { display: none; }
  .mega-item .media.is-device {
    display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); place-items: center;
    padding: 26px 22px calc(var(--text-h) + 6px);
    background:
      radial-gradient(62% 58% at 50% 36%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 72%),
      linear-gradient(180deg, var(--color-dusk), var(--color-night));
  }
  .mega-item .media.is-device img {
    display: block; width: 100%; height: 100%; object-fit: contain; object-position: center;
    filter: drop-shadow(0 12px 18px rgb(0 0 0 / 0.5));
  }
  .mega-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mega-item-title { font: 500 2rem/0.95 var(--font-display); letter-spacing: 0.01em; }
  .mega-item-sub { order: -1; font-size: var(--type-label-size); line-height: var(--type-label-leading); font-weight: 600; letter-spacing: var(--type-label-tracking); text-transform: uppercase; color: var(--accent); }
  .mega-item-desc { font-size: 0.9375rem; line-height: 1.45; color: var(--color-snow-2); text-wrap: pretty; }
  .mega-item .ring-arrow { width: 40px; height: 40px; color: var(--color-snow); }
  .mega-item .ring-arrow::before { box-shadow: inset 0 0 0 1.5px var(--accent); }
  @media (hover: hover) and (pointer: fine) { .mega-item:hover .media img { transform: scale(1.04); } }
  .mega-item:focus-visible .media img { transform: scale(1.04); }

  /* The list: an icon in a rounded chip, a bold title and a line of grey (veo.com's Tripods / Apps lists) */
  .mega-list { display: grid; gap: 8px; margin: -8px; }
  .mega-link {
    --accent: var(--color-lime);
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 8px; border-radius: var(--radius-field);
    transition: background-color var(--duration-hover) var(--ease-hover);
  }
  .mega-ic {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; color: var(--color-ink);
    background: color-mix(in srgb, var(--accent) 26%, var(--color-white));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
    transition: background-color var(--duration-hover) var(--ease-hover), transform var(--duration-hover) var(--ease-hover);
  }
  .mega-ic .ic { width: 34px; height: 34px; }
  .mega-link-title { font: 500 1.5rem/1.1 var(--font-display); letter-spacing: 0.02em; }
  .mega-link-desc { display: block; margin-top: 4px; color: var(--text-muted); font-size: 0.9375rem; line-height: 1.45; text-wrap: pretty; }
  @media (hover: hover) and (pointer: fine) {
    .mega-link:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
    .mega-link:hover .mega-ic { background: var(--accent); transform: scale(1.04); }
    .mega-link:hover .u-line::after { transform: scaleX(1); }
  }
  /* The chip follows the theme (as .nav-link::before): a white plate on the dark bar left the words at 1.4:1 */
  .mega-link:focus-visible { background: color-mix(in srgb, var(--text) 9%, transparent); }
  .mega-link:focus-visible .mega-ic { background: var(--accent); }
  .mega-link:focus-visible .u-line::after { transform: scaleX(1); }

  /* Narrower desktops: a slimmer list column, shorter cards */
  @media (max-width: 1199.98px) {
    .mega-panel { grid-template-columns: minmax(0, 2.1fr) minmax(13rem, 1fr); gap: 24px; }
    .mega-cards { gap: 14px; }
    .mega-pair { min-height: clamp(20rem, 46vh, 26rem); }
    .mega-pair .mega-item { padding: 14px; }
    .mega-item { padding: 16px; min-height: clamp(20rem, 46vh, 26rem); }
    .mega-item-title { font-size: 1.75rem; }
    .mega-item .media.is-device { padding-inline: 10px; }
  }
  /* Keep explanations available even when browser chrome or zoom leaves little height. */
  @media (min-width: 1024px) {
    .nav-bg { height: 100dvh; }
    .mega {
      max-height: calc(100dvh - var(--bar-top) - var(--bar-h) - 20px);
      overflow-y: auto;
      overscroll-behavior-y: contain;
      scroll-padding-block: 28px;
    }
  }
  @media (min-width: 1024px) and (max-width: 1199.98px) {
    .mega-item--device { --text-h: 12rem; }
  }

  /* Contents: out at once (opacity), in with a short stagger on the morph's curve */
  .mega .mega-h, .mega .mega-item, .mega .mega-link {
    opacity: 0; transform: translateY(8px);
    transition: opacity var(--duration-press) var(--ease-out), transform 0s linear var(--duration-press);
  }
  .mega.is-open .mega-h, .mega.is-open .mega-item, .mega.is-open .mega-link {
    opacity: 1; transform: none;
    transition: opacity 280ms var(--ease-out), transform var(--duration-morph) var(--ease-morph);
    transition-delay: calc(70ms + var(--i, -1) * 40ms + 40ms);
  }

  /* ───────────── Phones and tablets: logo up top, the bar at the bottom ───────────── */
  .mtop { position: absolute; z-index: var(--z-nav); top: calc(env(safe-area-inset-top, 0px) + 14px); left: var(--gutter); }
  .mbar { display: none; }

  @media (max-width: 1023.98px) {
    .site-header { height: 0; }
    .nav, .nav-bg, .nav-shadow, .mega-bg, .mega-scrim { display: none; }

    /* The bar and the sheet it grows into share one box; closed, only its bottom 64 px show */
    .mbar {
      --mb-gap: 12px;
      --mb-h: 56px;
      position: fixed; z-index: 1; display: block;
      left: var(--mb-gap); right: var(--mb-gap);
      top: calc(env(safe-area-inset-top, 0px) + var(--mb-gap)); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mb-gap));
      pointer-events: none; color: var(--text);
    }
    .mbar-scrim {
      position: fixed; inset: 0; z-index: -1; pointer-events: none;
      background: color-mix(in srgb, var(--color-night) 40%, transparent);
      opacity: 0; transition: opacity var(--duration-exit) var(--ease-out);
    }
    .mbar.is-open .mbar-scrim { opacity: 1; pointer-events: auto; transition-duration: var(--duration-nav); }

    .mbar-bg {
      position: absolute; inset: 0; pointer-events: none;
      background: var(--glass);
      -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
      clip-path: inset(calc(100% - var(--mb-h)) 0 0 0 round var(--radius-nav));
      transition: clip-path 280ms var(--ease-morph), background-color 280ms var(--ease-hover);
    }
    /* Open, the glass grows up to the menu's own height (nav.js sets --sheet-h per view), so a sub menu
       makes the sheet grow or shrink on the same curve: veo.com's dynamic panel, on the phone */
    .mbar.is-open .mbar-bg {
      clip-path: inset(max(0px, calc(100% - var(--sheet-h, 100%))) 0 0 0 round var(--radius-nav));
      background: color-mix(in srgb, var(--bg-alt) 95%, transparent);
      transition: clip-path var(--duration-morph) var(--ease-morph), background-color var(--duration-morph) var(--ease-hover);
    }

    .mbar-row {
      position: absolute; left: 0; right: 0; bottom: 0; height: var(--mb-h);
      display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10px;
      pointer-events: auto;
    }
    /* The lift under the closed bar (a separate layer: the clip would cut it) */
    .mbar-row::before {
      content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--radius-nav); pointer-events: none;
      box-shadow: var(--shadow-nav); transition: opacity var(--duration-nav) var(--ease-out);
    }
    .mbar.is-open .mbar-row::before { opacity: 0; }
    .mbar-home { position: relative; justify-self: start; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); }
    .mbar-home svg { width: 26px; height: 26px; transition: transform var(--duration-morph) var(--ease-morph); }
    .mbar-cta, .mbar-cta:hover { justify-self: center; min-height: 48px; padding-inline: 22px; background: var(--action-bg); color: var(--action-fg); box-shadow: none; }
    .mbar-toggle {
      justify-self: end; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
      border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
      transition: background-color var(--duration-hover) var(--ease-hover);
      -webkit-tap-highlight-color: transparent;
    }
    .mbar-toggle:active { background: color-mix(in srgb, var(--text) 10%, transparent); }
    /* Two lines that cross into the close mark */
    .burger { position: relative; display: block; width: 18px; height: 7.5px; }
    .burger span { position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform var(--duration-morph) var(--ease-morph); }
    .burger span:first-child { top: 0; }
    .burger span:last-child { bottom: 0; }
    .mbar.is-open .burger span:first-child { transform: translateY(3px) rotate(45deg); }
    .mbar.is-open .burger span:last-child { transform: translateY(-3px) rotate(-45deg); }

    /* The sheet: the menu anchored right above the bar, within thumb reach */
    .mbar-sheet {
      position: absolute; inset: 0 0 var(--mb-h) 0; display: flex; flex-direction: column;
      padding: 16px 16px 8px;
      visibility: hidden; pointer-events: none;
      transition: visibility 0s linear 280ms;
    }
    .mbar.is-open .mbar-sheet { visibility: visible; pointer-events: auto; transition: visibility 0s; }
    .mnav { position: relative; flex: 1; min-height: 0; }
    .mnav-view {
      position: absolute; left: 0; right: 0; bottom: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
      display: grid; align-content: end;
      visibility: hidden; opacity: 0; transform: translateX(16%);
      transition: opacity var(--duration-exit) var(--ease-out), transform var(--duration-morph) var(--ease-morph), visibility 0s linear var(--duration-morph);
    }
    .mnav-view.is-before { transform: translateX(-16%); }
    .mnav-view.is-current { visibility: visible; opacity: 1; transform: none; transition: opacity 260ms var(--ease-out) 60ms, transform var(--duration-morph) var(--ease-morph), visibility 0s; }
    /* Closed, the current view hides with the sheet (after its fold), so no scrollbar is left over the page */
    .mbar:not(.is-open) .mnav-view { visibility: hidden; overflow: hidden; transition: opacity var(--duration-exit) var(--ease-out), transform var(--duration-morph) var(--ease-morph), visibility 0s linear 280ms; }
    .mnav-list > li + li { border-top: var(--line-hairline) solid var(--line); }
    .mnav-link {
 display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
 min-height: 60px; padding: 8px 4px; border: 0; background: none; cursor: pointer; text-align: left;
 font: 500 1.875rem/1.1 var(--font-display); letter-spacing: 0.02em; color: var(--text);
 -webkit-tap-highlight-color: transparent;
 }
    /* You are here: the desktop dot, in front of the row (the row's own page, or the menu that holds it) */
    .mnav-link[aria-current] { position: relative; padding-left: 20px; }
    .mnav-link[aria-current]::before {
      content: ""; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
      background: var(--accent-strong);
    }
    .mnav-link[aria-current]:has(.mnav-txt)::before { top: calc(8px + 0.55em); }   /* on the name's line, not between it and its sub line */
    .mnav-link .icon { width: 20px; height: 20px; color: var(--text-muted); transform: rotate(-90deg); }
    .mnav-link .mnav-txt { display: grid; gap: 4px; }
    .mnav-sub { font-family: var(--font-text); font-size: var(--type-small-size); font-weight: 400; letter-spacing: 0; line-height: 1.35; text-transform: none; color: var(--text-muted); }
    .mnav-back {
      display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 44px; padding: 0 12px 0 4px;
      border: 0; background: none; cursor: pointer; color: var(--text-muted); font: 500 1.375rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase;
    }
    .mnav-back .icon { width: 20px; height: 20px; }
    .mnav-title { margin: 6px 4px 14px; font: 500 3.25rem/0.9 var(--font-display); letter-spacing: 0.01em; color: var(--text); }
    .mnav-title em { display: inline-block; font-style: italic; color: var(--emphasis); background: var(--emphasis-bg); line-height: 0.8; padding: 0.09em 0.13em 0.03em; }

    /* Open: the rows rise from the bar upward (the nearest row first) */
    .mnav-view > *, .mnav-list > li {
      opacity: 0; transform: translateY(14px);
      transition: opacity var(--duration-press) var(--ease-out), transform 0s linear var(--duration-press);
    }
    .mbar.is-open .mnav-view > *, .mbar.is-open .mnav-list > li {
      opacity: 1; transform: none;
      transition: opacity 260ms var(--ease-out), transform var(--duration-morph) var(--ease-morph);
      transition-delay: calc(90ms + var(--i, 0) * 30ms);
    }
    .mnav-view > .mnav-list { transform: none; opacity: 1; }

    /* Clear the bar at the bottom of the hero and the footer */
    .hero-content { padding-bottom: calc(clamp(3rem, 7vw, 6rem) + 80px + env(safe-area-inset-bottom, 0px)); }
    .site-footer { padding-bottom: calc(var(--space-5) + 80px + env(safe-area-inset-bottom, 0px)); }
  }
  @media (min-width: 1024px) { .mtop { display: none; } }
  @media (max-width: 599.98px) { .mbar-cta { padding: 0 18px; } }

  /* The reaction: when the bar compacts, the mark recoils and a ring goes out from it, once */
  @media (prefers-reduced-motion: no-preference) {
    .site-header.is-reacting .nav-logo svg, .site-header.is-reacting .mbar-home svg { animation: nav-recoil 520ms var(--ease-out); }
    .site-header.is-reacting .nav-logo::after, .site-header.is-reacting .mbar-home::after { animation: nav-impact 680ms var(--ease-out); }
  }
  @keyframes nav-recoil { 0% { transform: scale(1); } 24% { transform: scale(0.84); } 100% { transform: scale(1); } }
  @keyframes nav-impact { 0% { opacity: 0.9; transform: scale(0.55); } 100% { opacity: 0; transform: scale(2.1); } }
}

@layer sections {
  .mega-intro { max-width: 56ch; margin: -4px 0 var(--space-5); color: var(--text-muted); font: 400 var(--type-small-size)/1.5 var(--font-text); }
  .mnav-intro { margin: 0 4px 16px; max-width: 36ch; color: var(--text-muted); font: 400 var(--type-small-size)/1.5 var(--font-text); }
  @media (max-width: 1023.98px) {
    .mnav-view:first-child [data-mnav-open] { min-height: 84px; }
    .mnav-view:first-child .mnav-sub { max-width: 28ch; }
    .mnav-back { color: var(--text); }
  }
}

/* ───────────── Reduced motion: no morphs, no travel; colour and opacity only ───────────── */
@layer utilities {
  @media (prefers-reduced-motion: reduce) {
    .nav-bg, .nav-shadow, .mega-bg, .mbar-bg, .skip-link,
    .site-header.is-scrolled .nav-bg, .site-header.is-open .nav-bg, .site-header.is-scrolled .nav-shadow, .site-header.is-open .nav-shadow,
    .mbar.is-open .mbar-bg { transition: none; }
    .nav-logo, .nav-list > li > .nav-link, .nav-cta, .nav-logo svg, .mbar-home svg, .nav-link::before, .nav-link .chev, .burger span { transition-duration: 0s; }
    .nav-link::before, .nav-link::after { transform: none; }
    .nav-cta:hover { transform: none; }
    .mega .mega-h, .mega .mega-item, .mega .mega-link, .mnav-view > *, .mnav-list > li, .mnav-view, .mnav-view.is-before { transform: none; }
    .mega.is-open .mega-h, .mega.is-open .mega-item, .mega.is-open .mega-link,
    .mbar.is-open .mnav-view > *, .mbar.is-open .mnav-list > li { transition: opacity var(--duration-reduced) var(--ease-out); transition-delay: 0s; }
    .mnav-view, .mnav-view.is-current { transition: opacity var(--duration-reduced) var(--ease-out), visibility 0s linear var(--duration-reduced); }
    .mnav-view.is-current { transition: opacity var(--duration-reduced) var(--ease-out), visibility 0s; }
    .mega-item .media img { transition: none; }
    .mega-item:hover .media img, .mega-item:focus-visible .media img { transform: none; }
    .nav-cta:active { background: var(--action-bg-hover); }
  }
}

/* A compact, opaque mobile dock: no viewport-sized blur layer during scrolling.
   The open sheet keeps the existing navigation, with clearer grouping and destinations. */
@layer sections {
  @media (max-width: 1023.98px) {
    .menu-open body { position: fixed; top: var(--menu-scroll-y, 0px); left: 0; right: 0; width: 100%; }
    .mbar { max-width: 34rem; margin-inline: auto; }
    .mbar-bg {
      top: auto; height: var(--mb-h); border-radius: 20px;
      background: var(--color-night); clip-path: none;
      -webkit-backdrop-filter: none; backdrop-filter: none; transition: none;
      box-shadow: 0 8px 24px -12px rgb(12 20 28 / .35);
    }
    .mbar.is-open .mbar-bg { height: var(--sheet-h, 100%); background: var(--color-white); clip-path: none; transition: none; }
    .mbar-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px; color: var(--color-white); background: var(--color-night); border-radius: 20px; }
    .mbar.is-open .mbar-row { border-radius: 0 0 20px 20px; }
    .mbar-home { color: var(--color-white); }
    .mbar-cta, .mbar-cta:hover { min-height: 44px; padding-inline: 16px; background: var(--color-lime); color: var(--color-night); font-size: 1.25rem; }
    .mbar-toggle { width: auto; min-width: 64px; padding-inline: 6px; grid-auto-flow: column; gap: 7px; color: var(--color-white); }
    .mbar-toggle-text { font: 600 .75rem/1 var(--font-text); letter-spacing: 0; }
    .mbar-sheet {
      --text: var(--color-night); --text-muted: var(--color-ink-2); --line: var(--color-line-light);
      top: auto; height: calc(var(--sheet-h, 100%) - var(--mb-h)); max-height: calc(100% - var(--mb-h));
      padding: 24px 20px 14px; color: var(--text);
    }
    .mnav-view { align-content: start; padding: 2px 2px 8px; scrollbar-width: thin; }
    .mnav-view, .mnav-view.is-before, .mnav-view.is-current { transform: none; transition: opacity 140ms var(--ease-out), visibility 0s linear 140ms; }
    .mnav-view.is-current { transition-delay: 0s; }
    .mnav-view:not(.is-current) { opacity: 0; visibility: hidden; transition: none; }
    .mbar .burger span { transition: none; }
    .mnav-view > *, .mnav-list > li { opacity: 1; transform: none; transition: none; }
    .mbar.is-open .mnav-view > *, .mbar.is-open .mnav-list > li { transition: none; }
    .mnav-list { display: grid; gap: 0; }
    .mnav-list > li + li { border-color: var(--color-line-light); }
    .mnav-link { min-height: 64px; padding: 12px 8px; font-size: 1.75rem; border-radius: 10px; }
    .mnav-link .mnav-txt { min-width: 0; gap: 6px; }
    .mnav-sub { color: var(--color-ink-2); font-size: .8125rem; line-height: 1.45; }
    .mnav-link .icon { flex: none; width: 22px; height: 22px; color: var(--color-moss); }
    .mnav-link .mnav-destination { transform: none; }
    .mnav-link[aria-current] { padding-left: 24px; background: var(--color-mint); color: var(--color-night); }
    .mnav-link[aria-current]::before { left: 9px; background: var(--color-moss); }
    .mnav-link:active { background: var(--color-stone); }
    .mnav-link:focus-visible, .mnav-back:focus-visible { outline: 2px solid var(--color-moss); outline-offset: -2px; }
    .mnav-view:first-child .mnav-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; }
    .mnav-view:first-child .mnav-list > li:has([data-mnav-open]) { grid-column: 1 / -1; border-top: 0; }
    .mnav-view:first-child [data-mnav-open] { min-height: 72px; padding: 14px 16px; background: var(--color-paper); }
    .mnav-view:first-child [data-mnav-open][aria-current] { background: var(--color-mint); padding-left: 24px; }
    .mnav-view:first-child .mnav-list > li:last-child [data-mnav-open] { min-height: 56px; background: transparent; padding-inline: 8px; }
    .mnav-back { min-height: 44px; padding-left: 4px; color: var(--color-moss); font-size: 1.25rem; }
    .mnav-title { margin: 10px 4px 12px; font-size: clamp(2.5rem, 8vw, 3.25rem); color: var(--color-night); }
    .mnav-intro { margin: 0 4px 16px; color: var(--color-ink-2); font-size: .875rem; }
    .mnav-list .brand-art > svg { max-width: 100%; }
    .get-sheet::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
  }
}

/* ───────────── Get the apps: one sheet with the three apps (review pass, 8 Oct 2026) ─────────────
   Opened by every "Get the apps" (the bar, the phone bar, the menu, the page buttons with data-get-apps) and by a link
   to #get (the QR codes point to aimlink.ai/#get). Without JS the links go to the page's own close (#get in the
   footer). A modal <dialog>: focus is held inside, Esc and a click outside close it, focus returns to the button.
   Desktop: a dark card in the middle. Phones: a sheet that rises from the bottom, within thumb reach. */
@layer sections {
  .get-open, .get-open body { overflow: hidden; }
  .get-sheet {
    pointer-events: auto; visibility: visible; /* it lives in the header, which lets the page through and may be veiled */
    width: min(100% - 2 * var(--gutter), 46rem); max-height: min(100svh - 2rem, 50rem); margin: auto; padding: 0;
    border: 0; border-radius: var(--radius-panel); background: var(--color-night); color: var(--text);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7), inset 0 0 0 1px rgb(255 255 255 / .08);
    overflow: auto; overscroll-behavior: contain;
  }
  .get-sheet::backdrop { background: color-mix(in srgb, var(--color-night) 62%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .get-sheet[open] { animation: get-in var(--duration-morph) var(--ease-out); }
  .get-sheet[open]::backdrop { animation: get-fade var(--duration-nav) var(--ease-out); }
  @keyframes get-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
  @keyframes get-fade { from { opacity: 0; } }
  .get-in {
    --pad-t: clamp(1.5rem, 1rem + 2vw, 2.5rem); --pad-r: var(--pad-t); --x-in: clamp(1rem, 0.6rem + 1.4vw, 1.75rem);
    position: relative; display: grid; gap: var(--space-6); padding: var(--pad-t) var(--pad-r);
  }
  .get-head { grid-area: 1 / 1; display: grid; gap: var(--space-3); padding-right: 56px; }
  .get-title { font: 500 clamp(2.75rem, 2rem + 3vw, 4rem)/0.88 var(--font-display); letter-spacing: 0.005em; }
  .get-title em { font-style: italic; color: var(--emphasis); }
  .get-lede { max-width: 40ch; color: var(--text-muted); }
  /* The close stays in reach when the sheet scrolls (a short phone): sticky in the dialog's own scroll, over the content */
  .get-x {
    grid-area: 1 / 1; justify-self: end; align-self: start; position: sticky; top: var(--x-in); z-index: 1;
    margin: calc(var(--x-in) - var(--pad-t)) calc(var(--x-in) - var(--pad-r)) 0 0;
    width: 44px; height: 44px;
  }
  .get-x svg { width: 20px; height: 20px; }
  .get-x-txt { display: none; }
  .get-apps { display: grid; }
  .get-app { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: start; padding-block: var(--space-5); border-top: var(--line-hairline) solid var(--line); }
  .get-app > img { width: 52px; height: 52px; grid-row: span 3; }
  .get-app-name { font: 500 var(--type-title-size)/1 var(--font-display); letter-spacing: 0.01em; padding-top: 0.15em; }
  .get-app-for { color: var(--text-muted); font-size: var(--type-small-size); line-height: var(--type-small-leading); }
  .get-app .store-row { justify-content: flex-start; align-items: center; margin-top: var(--space-2); }
  .get-app .get-beta { margin-top: var(--space-2); color: var(--text-muted); font-size: var(--type-small-size); line-height: var(--type-small-leading); }
  .get-app .get-beta a { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
  .get-free { color: var(--text-subtle); font-size: var(--type-small-size); }
  .menu-open .get-sheet { overflow: auto; }
  @media (max-width: 599.98px) {
    .get-sheet { width: 100%; max-width: none; max-height: calc(100svh - 2.5rem); margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
    .get-sheet[open] { animation-name: get-up; }
    @keyframes get-up { from { transform: translateY(100%); } }
    .get-in { --pad-t: var(--space-5); --pad-r: 20px; --x-in: 12px; padding: var(--pad-t) var(--pad-r) calc(var(--space-6) + env(safe-area-inset-bottom, 0px)); }
    /* Phones: the close says what it does */
    .get-head { padding-right: 0; }
    .get-title { padding-right: 112px; }
    .get-x { width: auto; grid-auto-flow: column; gap: 6px; padding: 0 14px 0 16px; border-radius: var(--radius-pill); }
    .get-x-txt { display: inline; font: 500 1.25rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; padding-top: 0.1em; }
    .get-app { grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--space-3); }
    .get-app > img { width: 32px; height: 32px; }
    .get-app .store-row { gap: var(--space-2); flex-wrap: nowrap; }
    .get-app .store-btn--badge { --badge-h: 44px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .get-sheet[open] { animation: get-fade var(--duration-reduced) linear; }
  }
}
