/* ==========================================================================
   SITE HEADER
   --------------------------------------------------------------------------
   neon.com structure (29 Sep): a flat full-width bar — wordmark left, the
   links right beside it, actions pushed right. Platform and Products open
   floating menu cards (MENUS, 15 Oct, after watershed.com).
   Shared by every page; the themes decide the rest (--font-nav, and
   --radius-control: pill on pine/v1, square on ember-light/v2).
   No literal colours: everything resolves to a token.
   ========================================================================== */

/* Three wrappers, as everywhere:

     <div id="navbar-placeholder">          sticky
       <header class="nav site-header">     the bar, full width
         <div class="padding-global">
           <div class="container nav__inner">

   --nav-logo-w reserves the wordmark's column. On desktop the links sit in
   the middle of the bar (2 Nov; they started right after the wordmark). */
:root { --nav-logo-w: 188px; }

#navbar-placeholder {           /* the sticky element is the WRAPPER, not the bar */
  position: sticky; top: 0; z-index: 998;
  min-height: calc(var(--nav-h) + var(--nav-float));
  padding-top: calc(var(--nav-float) + env(safe-area-inset-top, 0px));
  /* Pull the page up under the bar so a full-bleed .scene hero runs beneath
     it. Anything else gets the space back via the sibling rule. */
  margin-bottom: calc(-1 * (var(--nav-h) + var(--nav-float)));
  pointer-events: none;         /* the wrapper never blocks clicks */
}
#navbar-placeholder + :not(.scene) { margin-top: calc(var(--nav-h) + var(--nav-float)); }
/* Hide on scroll (29 Nov, user: "when scrolling down it hides but when
   scrolled back up it appears … everything done smoothly"): header.js sets
   html.is-nav-hidden while the page moves down and clears it as it moves up.
   The bar's wrapper slides up out of view; --nav-shown is the header's height
   while it shows and 0 while it hides, so what sticks under it (the Platform
   pages' jump bar, pinned sections) and the scroll padding follow it. */
:root { --nav-shown: calc(var(--nav-h) + var(--nav-float)); }
html.is-nav-hidden { --nav-shown: 0px; }
/* 500ms on the soft, even --motion-ease (29 Nov, user, after deepmatrix.vercel.app's header:
   "see how smooth the header hide and appear is"; 320ms on the sharp ease-out before) */
#navbar-placeholder { transition: transform 500ms var(--motion-ease); }
html.is-nav-hidden #navbar-placeholder { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { #navbar-placeholder { transition: none; } }
html { scroll-padding-top: calc(var(--nav-shown) + var(--space-5)); }

.nav {
  position: relative;           /* anchors the bar's ::before sliver */
  pointer-events: auto;
  --nav-bg: color-mix(in srgb, var(--ground) 88%, transparent);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
          backdrop-filter: blur(14px) saturate(1.3);
}
/* With a menu open, the bar turns solid so it reads clearly over the page. */
.nav:has(.nav-panel:not([hidden])) { background: var(--ground); }
/* (6 Oct) On phones the toolbar resizing the viewport can leave a
   sub-pixel sliver above the sticky bar, showing the page scrolling
   behind it. The bar's own background reaches 4px above its top edge
   so that sliver is always covered. */
.site-header::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 4px;
  background: var(--nav-bg, var(--ground)); pointer-events: none;
}

/* Phone menu open (14 Oct): the page under it dims, and a tap on the
   dimmed page closes the menu (header.js sets html.is-menu-open). Sits
   just under the sticky header wrapper (z 998). */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 997;
  background: color-mix(in srgb, var(--night-deep) 64%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--motion-base) var(--motion-ease), visibility 0s linear var(--motion-base);
}
html.is-menu-open body::after {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) { body::after { transition: none; } }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: color-mix(in srgb, var(--ground) 96%, transparent); }
}

.nav__inner {
  display: flex;
  align-items: center;
  height: var(--nav-h);
}

/* Wordmark: the drawn lockup, inlined so fill="currentColor" takes the
   active theme's --heading. One file serves every theme. */
.wordmark {
  flex: 0 0 var(--nav-logo-w);
  display: flex;
  align-items: center;
  color: var(--heading);
  text-decoration: none;
}
.wordmark__logo { display: block; height: 28px; width: auto; }   /* the logo box's minimum (DESIGN.md) */
/* Gate square: the loop, the gate diamond and the wordmark take the text
   colour; the core (the agents' inner loop) is forest on light grounds and
   mint on dark ones. Themes set --logo-in. */
.wordmark__in { fill: var(--logo-in, var(--heading)); }
.wordmark:hover { opacity: 0.8; }
/* 27 Nov (user: "why header brand link so wide? click area bug"): on desktop
   the bar is a three-column grid and the link stretched across its whole
   first column (526px at 1440, for a 119px logo), so empty bar beside the
   logo was clickable. The link is as wide as the logo. */
.wordmark { justify-self: start; }
/* The lockup's box (4 Nov): the svg slices from the left (xMinYMid slice),
   so it needs its width set; --lockup-w is the word's viewBox width
   (logo-unlock.py --apply writes it). It used to fold to the mark on scroll
   (4 Nov, after modal.com); since 5 Nov (user) the full lockup always shows. */
.wordmark__logo--folding { width: calc(28px * var(--lockup-w, 569.82) / 131.28); }
}

/* The lockup bakes in the name as outlines (drawn to match the mark, no
   font). To change the word, run web/explorations/logo-unlock.py --apply
   unlock-ai | unlock; it rewrites this logo, the footer's and the docs'. */

/* ---------------------------------------------------------------- NAV */

/* Links fill the bar's full height, so the pointer travels from a trigger
   straight into the menu card below without ever leaving its <li>. */
.site-nav { align-self: stretch; }
.site-nav ul {
  display: flex;
  align-items: stretch;
  gap: var(--space-6);
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { display: flex; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-nav, var(--font-control));
  font-size: 14px;               /* 2 Nov: after exa.ai's header (15px there), on even sizes */
  line-height: 20px;             /* set, so a link (Docs) and the menu buttons sit on one line */
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--motion-base) var(--motion-ease);
}
.nav-link:hover,
.nav-link[aria-expanded="true"] { color: var(--heading); }
.nav-link .caret {
  --icon-size: 14px;
  opacity: 0.7;
  transition: transform var(--motion-base) var(--motion-ease);
}
.nav-link[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* -------------------------------------------------------------- MENUS */

/* Menus (15 Oct): watershed.com's floating card, oxide.computer's insides.
   Platform and Products each open a black card under the bar, in the same
   spot, centred under the links. .nav-panel is a transparent
   holder whose top padding bridges the gap to the bar, so the pointer never
   leaves the <li> on its way in. The card sets its own tokens: black (a
   night-deep body in a thin night-2 frame) under the dark header, paper in
   a sand frame under the light one; cells split by hairlines.
     Platform  an intro cell (label, overview link, Book a demo), then three
               tiles: a line diagram on a faint dot grid over the label.
     Products  Modules with a Sage icon square each; Interfaces as rows on
               hairlines.
   Phones: MOBILE below folds both into plain lists.
   Earlier full-width drawer: web/explorations/header-drawer-v1/. */

.site-nav { position: relative; }          /* the menus' containing block */
.nav-panel { cursor: default; }

/* Text, at every width. */
.menu-intro__link,
.menu-feature__link,
.menu-tile,
.menu-link,
.menu-row,
.menu-box,
.menu-entry,
.menu-column__title { display: block; text-decoration: none; font-family: var(--font-nav, var(--font-control)); }
.menu-intro__link strong,
.menu-feature__link strong,
.menu-tile__text strong,
.menu-link__text strong,
.menu-row strong {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em;
  color: var(--heading);
}
.menu-intro__link > span,
.menu-feature__link > span:not(.menu-feature__art),
.menu-tile__text > span,
.menu-link__text > span,
.menu-row > span {
  display: block; margin-top: 2px;
  font-size: 14px; line-height: 1.45;
  color: var(--ink-muted);
}
.menu-column__label {
  display: block;
  font-family: var(--font-label); font-size: var(--size-label); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted);
}
/* The lists sit inside .site-nav, so they undo its bar-row ul and li. */
.menu-column ul { list-style: none; margin: 0; padding: 0; height: auto; }
.menu-column li { display: block; }

@media (min-width: 992px) {
  .nav-panel {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%);   /* centred under the links (2 Nov); `translate` is left to the open motion */
    padding-top: calc(var(--space-2) + 6px);   /* 10 Nov, user: 8px left the card touching the trigger box; 6px more opens a 6px gap under it. The padding is part of the panel, so the pointer crosses it without closing the menu */
  }

  /* Hover and open trigger (10 Nov, user): the link carries its own side
     padding, and a tinted box fills behind it — faint on hover, firmer while
     its menu is open. The bar's gap shrinks by the padding, so the labels
     sit where they did. */
  .site-nav ul { gap: var(--space-1); }
  .nav-link { position: relative; isolation: isolate; padding-inline: var(--space-3); padding-block: 6px; margin-block: -6px; }   /* the hit area is the 32px box (11 Nov, QA: 20px, the text's height, before) */
  .nav-link::before {
    content: ''; position: absolute; z-index: -1;
    left: 0; right: 0; top: 50%; height: var(--space-6); translate: 0 -50%;   /* a 32px box centred on the label (the nav row is only the text's height) */
    border-radius: var(--radius-control);
    transition: background var(--motion-base) var(--motion-ease);
  }
  .nav-link:hover::before,
  .nav-link:focus-visible::before { background: color-mix(in srgb, var(--heading) 7%, transparent); }
  .nav-link[aria-expanded="true"]::before { background: color-mix(in srgb, var(--heading) 10%, transparent); }
  /* On the paper bar near-black at those strengths reads as a grey slab
     (10 Nov, user): lighter steps there. */
  .site-header.is-light .nav-link:hover::before,
  .site-header.is-light .nav-link:focus-visible::before { background: color-mix(in srgb, var(--heading) 4%, transparent); }
  .site-header.is-light .nav-link[aria-expanded="true"]::before { background: color-mix(in srgb, var(--heading) 6%, transparent); }

  /* The card sets its own tokens. Dark by default: night-deep body in a
     night-2 frame, Sage green accents. Under the light header (.is-light,
     over Modules, Fit and FAQ) it turns paper: a paper body in a sand
     frame, Sage B900 accents, a softer shadow. */
  .menu-card, .nav-viewport {
    --ground: var(--night-deep);
    --ground-2: var(--night-2);
    --heading: var(--ember-cream);
    --ink: var(--ember-stone);
    --ink-muted: var(--ember-stone);
    --line: var(--ember-bark);
    --menu-accent: var(--sage-green);
    --menu-shadow-near: color-mix(in srgb, var(--night-deep) 56%, transparent);
    --menu-shadow: color-mix(in srgb, var(--night-deep) 72%, transparent);
  }
  .menu-card {
    width: min(760px, calc(100vw - var(--nav-logo-w) - var(--space-8)));
    padding: var(--space-1);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--ground-2);
    /* A subtle drop shadow: a tight one for the edge, a soft one for lift. */
    box-shadow: 0 var(--space-1) var(--space-2) var(--menu-shadow-near), 0 var(--space-4) var(--space-7) var(--menu-shadow);
    transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease);
  }
  .site-header.is-light .menu-card, .site-header.is-light .nav-viewport {
    --ground: var(--paper);
    --ground-2: color-mix(in srgb, var(--ember-black) 6%, var(--paper));   /* sand */
    --heading: var(--ember-black);
    --ink: var(--ember-bark);
    --ink-muted: var(--ember-muted);
    --line: color-mix(in srgb, var(--ember-black) 14%, var(--paper));
    --menu-accent: var(--sage-ink);
    --menu-shadow-near: color-mix(in srgb, var(--ember-black) 6%, transparent);
    --menu-shadow: color-mix(in srgb, var(--ember-black) 10%, transparent);
  }
  .menu-card--wide { width: min(960px, calc(100vw - var(--space-8))); }   /* Solutions: 960 (920 before), as Resources, so each use case's line fits one line (10 Nov, user) */
  .menu-card--tiles { width: min(780px, calc(100vw - var(--nav-logo-w) - var(--space-8))); }   /* 780 (700 before): every tile's line fits two lines (10 Nov, user) */
  .menu-card__body {
    overflow: hidden;
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--ground);
  }
  /* Cells on hairlines: the 1px gap shows the line behind them. */
  .menu-card__tiles,
  .menu-card__columns { display: grid; gap: var(--border-w); background: var(--line); }
  .menu-card__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* the intro cell left for the Products menu (4 Nov) */
  .menu-card__columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-card__columns--feature { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 0.9fr); }
  .menu-card__columns--resources { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
  .menu-card__columns--solutions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }   /* the use-case column wider, so each outcome sits on one line (10 Nov, user); 1.4 from 1.5 (24 Nov) so "Product Management and Business Analysis" also holds one line */
  /* Even descriptions (10 Nov, user: "sometimes 2 lines, sometimes 3"): the
     cards are sized so no line runs past two, every tile and box keeps room
     for two (so the cells sit level), and the lines break evenly. */
  .menu-tile__text > span, .menu-box > span { min-height: calc(2 * 1.5em); text-wrap: balance; }
  .menu-link__text > span { text-wrap: balance; }

  /* Products: the Platform feature (4 Nov, after modal.com). The mark as a
     dot matrix on a dark inset tile — dark under both header tones, like a
     product shot — then the overview link. Hover brightens the dots. */
  .menu-feature__art {
    display: grid; place-items: center;
    aspect-ratio: 16 / 11; margin-bottom: var(--space-3);
    border: var(--border-w) solid color-mix(in srgb, var(--ember-cream) 10%, var(--night-deep));
    border-radius: var(--radius);
    background:
      radial-gradient(55% 60% at 50% 55%, color-mix(in srgb, var(--sage-green) 12%, transparent), transparent 72%),
      var(--night-deep);
  }
  .menu-mark { display: block; width: 52%; height: auto; overflow: visible; transition: filter var(--motion-base) var(--motion-ease); }
  .menu-mark__dot { fill: var(--sage-green); }
  .menu-mark__dot--in { fill: var(--mint-green); }
  .menu-mark__stop { stop-color: var(--white); }
  .menu-mark__stop--dim { stop-color: color-mix(in srgb, var(--white) 38%, var(--night-deep)); }
  .menu-feature__link:hover .menu-mark,
  .menu-feature__link:focus-visible .menu-mark { filter: brightness(1.3); }
  .menu-feature__link:hover strong, .menu-feature__link:focus-visible strong { color: var(--menu-accent); }
  .menu-feature__link strong { transition: color var(--motion-base) var(--motion-ease); }
  .menu-intro, .menu-tile, .menu-column { background: var(--ground); }

  /* Platform: intro cell. */
  .menu-intro { display: flex; flex-direction: column; padding: var(--space-5); }
  .menu-intro .menu-column__label { margin-bottom: var(--space-3); }
  .menu-intro__cta {
    align-self: flex-start; margin-top: auto;
    display: inline-flex; align-items: center; min-height: 32px;
    padding-inline: var(--space-3);
    border: var(--border-w) solid color-mix(in srgb, var(--menu-accent) 48%, var(--ground));
    border-radius: var(--radius-control);
    font-family: var(--font-label); font-size: var(--size-label); font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--menu-accent); text-decoration: none;
    transition: background var(--motion-base) var(--motion-ease);
  }
  .menu-intro__cta:hover,
  .menu-intro__cta:focus-visible { background: color-mix(in srgb, var(--menu-accent) 12%, var(--ground)); }

  /* Platform: diagram tiles (the faint dot grid behind the art was removed
     on 4 Nov, user). */
  .menu-tile {
    display: flex; flex-direction: column;
    transition: background var(--motion-base) var(--motion-ease);
  }
  .menu-tile:hover,
  .menu-tile:focus-visible { background: color-mix(in srgb, var(--heading) 3%, var(--ground)); }
  .menu-tile__art {
    display: grid; place-items: center;
    padding: var(--space-5) var(--space-4);
  }
  .menu-tile__text { padding: 0 var(--space-5) var(--space-5); }

  .menu-diagram { display: block; width: 100%; max-width: 150px; height: auto; overflow: visible; }
  .menu-diagram use { fill: currentColor; stroke: none; }
  .menu-diagram .menu-diagram__muted   { color: color-mix(in srgb, var(--heading) 26%, var(--ground)); }
  .menu-diagram .menu-diagram__default { color: color-mix(in srgb, var(--heading) 70%, var(--ground)); }
  .menu-diagram .menu-diagram__lit     { color: var(--menu-accent); }
  .menu-diagram .menu-diagram__wire    { fill: none; stroke: color-mix(in srgb, var(--heading) 24%, var(--ground)); stroke-width: 1.25; }
  .menu-diagram .menu-diagram__frame   { fill: var(--ground); stroke: color-mix(in srgb, var(--heading) 45%, var(--ground)); stroke-width: 1.25; }
  .menu-diagram .menu-diagram__frame.menu-diagram__lit { stroke: var(--menu-accent); }
  .menu-tile:hover .menu-diagram__muted { color: color-mix(in srgb, var(--heading) 40%, var(--ground)); }
  /* On hover or focus each drawing plays once (10 Nov, user): Sage current
     runs along the wires into the end station (How it works, Interfaces),
     the waiting marks light in a wave (Governance's shields, Interfaces'
     surfaces), and the end station lights last. Leaving reverses at once,
     with no delays. Still for reduced motion. */
  .menu-diagram .menu-diagram__flow {
    fill: none; stroke: var(--menu-accent); stroke-width: 1.5;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    transition: stroke-dashoffset var(--motion-base) var(--motion-ease);
  }
  .menu-diagram .menu-diagram__end { transition: color var(--motion-base) var(--motion-ease), stroke var(--motion-base) var(--motion-ease); }
  .menu-diagram .menu-diagram__wave,
  .menu-diagram .menu-diagram__wake { transition: color var(--motion-base) var(--motion-ease); }
  .menu-tile:is(:hover, :focus-visible) .menu-diagram__flow { stroke-dashoffset: 0; transition-duration: 500ms; }
  .menu-tile:is(:hover, :focus-visible) .menu-diagram__wake { color: var(--menu-accent); transition-delay: 0ms; }
  .menu-tile:is(:hover, :focus-visible) .menu-diagram__wave { color: var(--menu-accent); transition-duration: 300ms; transition-delay: calc(var(--i, 0) * 70ms); }
  .menu-tile:is(:hover, :focus-visible) .menu-diagram__frame.menu-diagram__end { stroke: var(--menu-accent); transition-delay: 420ms; }
  .menu-tile:is(:hover, :focus-visible) use.menu-diagram__end { color: var(--menu-accent); transition-delay: 420ms; }
  @media (prefers-reduced-motion: reduce) {
    .menu-diagram :is(.menu-diagram__flow, .menu-diagram__end, .menu-diagram__wave, .menu-diagram__wake) { transition: none !important; }
  }

  /* Products: columns. */
  .menu-column { padding: var(--space-5); }
  .menu-column__label { margin-bottom: var(--space-3); }
  .menu-column ul { display: grid; gap: var(--space-1); }
  .menu-link {
    display: flex; align-items: flex-start; gap: var(--space-3);
    margin-inline: calc(-1 * var(--space-2));
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: background var(--motion-base) var(--motion-ease);
  }
  .menu-link:hover,
  .menu-link:focus-visible { background: color-mix(in srgb, var(--heading) 6%, transparent); }
  /* The icon alone, in Sage, no tinted square (10 Nov, user). */
  .menu-link__icon { flex: none; display: flex; margin-top: 1px; color: var(--ink-muted); transition: color var(--motion-base) var(--motion-ease); }   /* muted, Sage on hover (13 Nov, user: less green) */
  .menu-link:is(:hover, :focus-visible) .menu-link__icon { color: var(--menu-accent); }
  .menu-link__icon .icon { --icon-size: 20px; }

  /* By team: plain rows, no hairlines (10 Nov, user), on the same rhythm as
     the use-case links beside them (8px padding, 4px apart). */
  .menu-column .menu-rows { gap: var(--space-1); }
  .menu-row { padding-block: var(--space-2); }
  .menu-row:hover strong, .menu-row:focus-visible strong { color: var(--menu-accent); }
  .menu-row strong { transition: color var(--motion-base) var(--motion-ease); }

  /* Resources (10 Nov, after oxide.computer's Docs menu): each column opens
     with its title as a link, then a line and a small label; Documentation
     holds four boxed cards, the others rows on hairlines led by a DM Mono
     meta line (the question's number, the step). */
  .menu-column__title {
    display: inline-flex; align-items: center; gap: var(--space-2);
    font-family: var(--font-display); font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: var(--display-tracking);
    color: var(--heading); text-decoration: none;
    transition: color var(--motion-base) var(--motion-ease);
  }
  a.menu-column__title:hover, a.menu-column__title:focus-visible { color: var(--menu-accent); }
  .menu-column__title + .menu-boxes,
  .menu-column__title + .menu-entries { margin-top: var(--space-5); }

  .menu-column .menu-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .menu-box {
    display: flex; flex-direction: column; gap: var(--space-2); height: 100%;
    padding: var(--space-4);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease);
  }
  .menu-box:hover, .menu-box:focus-visible {
    background: color-mix(in srgb, var(--heading) 4%, var(--ground));
    border-color: color-mix(in srgb, var(--menu-accent) 40%, var(--line));
  }
  .menu-box strong { display: flex; align-items: center; gap: var(--space-2); font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--heading); }
  .menu-box strong .icon { --icon-size: 20px; flex: none; color: var(--ink-muted); transition: color var(--motion-base) var(--motion-ease); }   /* muted, Sage on hover (13 Nov) */
  .menu-box:is(:hover, :focus-visible) strong .icon { color: var(--menu-accent); }
  .menu-box > span { font-size: 14px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }

  .menu-column .menu-entries { gap: 0; }
  /* A row: the page's name, an arrow at the right (10 Nov, user). */
  .menu-entry {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding-block: var(--space-3);
    border-top: var(--border-w) solid var(--line);
    text-decoration: none;
  }
  .menu-entries li:last-child .menu-entry { border-bottom: var(--border-w) solid var(--line); }
  .menu-entry strong { font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--heading); transition: color var(--motion-base) var(--motion-ease); }
  .menu-entry:hover strong, .menu-entry:focus-visible strong { color: var(--menu-accent); }

  .menu-card__arrow {
    --icon-size: 14px; opacity: 0.6;
    transition: opacity var(--motion-base) var(--motion-ease), translate var(--motion-base) var(--motion-ease);
  }
  a:hover .menu-card__arrow,
  a:focus-visible .menu-card__arrow { opacity: 1; translate: 2px 0; }
}

/* Open and close (desktop): the card fades in and settles 6px. `hidden`
   still drives it; @starting-style gives the opening frame and
   allow-discrete holds display until the close finishes. */
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .nav-panel {
    transition:
      opacity var(--motion-base) var(--motion-ease),
      translate var(--motion-base) var(--motion-ease),
      display var(--motion-base) allow-discrete;
  }
  .nav-panel[hidden] {
    opacity: 0; translate: 0 -6px;
    transition-duration: var(--motion-fast);
  }
  @starting-style {
    .nav-panel:not([hidden]) { opacity: 0; translate: 0 -6px; }
  }
}

/* ------------------------------------------------------- MENU VIEWPORT */
/* (10 Nov, user: the behaviour of sv-efferd.pages.dev's header-three, a
   bits-ui NavigationMenu, in our own look.) With header.js running
   (.has-viewport), the three menus share one frame: header.js moves the
   panels into .nav-viewport under the links, and the frame there carries
   the card's look (night-2 body, hairline, 6px corners, the two-layer
   shadow; paper and sand under the light header). It opens with a short
   fade and a settle from 96%, then follows the open menu's size between
   menus (300ms, the long ease-out); the menus slide through it, the new one
   in from the side the pointer moved towards and the old one out the other
   way. Without the script each card opens in place, as above. */
@media (min-width: 992px) {
  .nav-viewport {
    position: absolute; top: 100%; left: 50%; z-index: 1;
    translate: -50% 0;
    padding-top: calc(var(--space-2) + 6px);   /* the bridge from the bar, as the panels' own */
    pointer-events: none;
  }
  .nav-viewport[data-state="open"] { pointer-events: auto; }
  .nav-viewport__frame {
    position: relative; overflow: hidden;
    width: var(--viewport-w, 0px); height: var(--viewport-h, 0px);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--ground-2);
    box-shadow: 0 var(--space-1) var(--space-2) var(--menu-shadow-near), 0 var(--space-4) var(--space-7) var(--menu-shadow);
    transform-origin: top center;
    transition:
      width var(--motion-menu) var(--motion-ease-out),
      height var(--motion-menu) var(--motion-ease-out),
      opacity var(--motion-base) var(--motion-ease-out),
      scale var(--motion-base) var(--motion-ease-out),
      background var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease);
  }
  .nav-viewport[data-state="closed"] .nav-viewport__frame { opacity: 0; scale: 0.96; transition-duration: var(--motion-menu), var(--motion-menu), var(--motion-fast), var(--motion-fast), var(--motion-base), var(--motion-base); }
  .nav-viewport[data-state="closed"] { visibility: hidden; transition: visibility 0s linear var(--motion-fast); }
  .nav-viewport__frame.is-instant { transition: none; }   /* the first open takes its size at once */

  /* The panels inside it: each card sits at the frame's top left, its own
     frame handed to the shared one (a transparent border keeps its size). */
  .nav-viewport .nav-panel {
    position: absolute; top: calc(-1 * var(--border-w)); left: calc(-1 * var(--border-w));
    padding: 0; transform: none; translate: none; opacity: 1; transition: none;
  }
  .nav-viewport .menu-card { border-color: transparent; background: none; box-shadow: none; }
  .nav-viewport .nav-panel[data-motion^="to-"] { pointer-events: none; }
}
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .nav-viewport .nav-panel[data-motion="from-end"]   { animation: nav-menu-from-end var(--motion-menu) var(--motion-ease-out) both; }
  .nav-viewport .nav-panel[data-motion="from-start"] { animation: nav-menu-from-start var(--motion-menu) var(--motion-ease-out) both; }
  .nav-viewport .nav-panel[data-motion="to-end"]     { animation: nav-menu-to-end var(--motion-menu) var(--motion-ease-out) both; }
  .nav-viewport .nav-panel[data-motion="to-start"]   { animation: nav-menu-to-start var(--motion-menu) var(--motion-ease-out) both; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-viewport__frame { transition: none; }
}
@keyframes nav-menu-from-end   { from { opacity: 0; translate: var(--space-9) 0; } }
@keyframes nav-menu-from-start { from { opacity: 0; translate: calc(-1 * var(--space-9)) 0; } }
@keyframes nav-menu-to-end     { to { opacity: 0; translate: var(--space-9) 0; } }
@keyframes nav-menu-to-start   { to { opacity: 0; translate: calc(-1 * var(--space-9)) 0; } }

/* Scroll (10 Nov, after header-three): over the top of the page the bar is
   clear, the page's own band showing through; once the page moves it
   settles into its night-2 glass (paper over the light bands). An open menu
   or the phone menu keeps it solid. header.js sets .is-scrolled. */
.site-header { transition: background-color var(--motion-base) var(--motion-ease), -webkit-backdrop-filter var(--motion-base) var(--motion-ease), backdrop-filter var(--motion-base) var(--motion-ease); }
.site-header.has-scroll-state:not(.is-scrolled):not(.is-open):not(:has(.nav-panel:not([hidden]))) {
  --nav-bg: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* Tone switch (26 Nov, user: the header's dark-to-light change flickered):
   for the frame the tone changes (header-tone.js sets .is-retoning for two
   frames), nothing on the bar fades — the text snapped while the ground
   faded, leaving dark text on dark grey for a frame. The bar becomes the
   band under it at once; hover fades are untouched otherwise. */
.is-retoning, .is-retoning *, .is-retoning *::before, .is-retoning *::after { transition: none !important; }

/* Phones (after header-three's mobile menu): the full-screen menu fades in
   behind and its contents settle from 97%. */
@media (max-width: 991px) and (prefers-reduced-motion: no-preference) {
  .site-header.is-open .site-nav,
  .site-header.is-open .site-actions { transform-origin: top center; animation: nav-drawer-in var(--motion-menu) var(--motion-ease-out) both; }
}
/* 30 Nov (user: opening the menu on a phone, "the header becomes transparent
   for a second so background items are seen"): the menu's ground is solid
   from its first frame. It used to fade in from transparent (and the bar's
   own colour transition ran too), so the page showed through the bar and
   the whole menu while it opened; now only the links and the button settle
   in, over a ground that is already there. */
@media (max-width: 991px) { .site-header.is-open { transition: none; } }
@keyframes nav-drawer-in { from { opacity: 0; scale: 0.97; } }

/* ---------------------------------------------------------------- ACTIONS */

.site-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Desktop: wordmark | links | actions, the links centred on the bar. */
@media (min-width: 992px) {
  .nav__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .site-actions { justify-self: end; }
}

/* Header button: .btn--compact in buttons.css (15 Oct). */

/* The shortcut chip. Still used by page buttons; header buttons dropped
   theirs for the cleaner bar, but their data-shortcut keys still work. */
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  border-radius: calc(var(--radius-control) * 0.5);
  background: var(--badge-shade);
  font-family: var(--font-control);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: inherit;
}

/* ---------------------------------------------------------------- MOBILE */

.nav-toggle { display: none; }

@media (max-width: 991px) {
  .site-nav, .site-actions { display: none; }
  .wordmark { flex-basis: auto; margin-right: auto; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    padding-inline: 0;
    margin-right: -11px;          /* the bars, not the 40px target, line up with the gutter */
    background: none;
    border: 0;                    /* 2 Nov: no box, as on exa.ai */
    border-radius: var(--radius-control);
    font-family: var(--font-nav, var(--font-control));
    font-size: 14px;
    color: var(--heading);
    cursor: pointer;
  }

  /* Hamburger (6 Oct): three bars that fold into a close mark when open.
     2 Nov, after exa.ai's icon: 2px rounded bars on whole pixels (0, 6,
     12), so all three render the same weight; they were 1.5px at 5.25px
     steps and blurred unevenly. */
  .nav-toggle__bars { position: relative; display: block; width: 18px; height: 14px; }
  .nav-toggle__bars i {
    position: absolute; left: 0; width: 100%; height: 2px; border-radius: 1px;
    background: currentColor;
    transition: translate var(--motion-base) var(--motion-ease), rotate var(--motion-base) var(--motion-ease), opacity var(--motion-fast) var(--motion-ease);   /* translate, not top: the morph stays off the main thread (4 Nov) */
  }
  .nav-toggle__bars i:nth-child(1) { top: 0; }
  .nav-toggle__bars i:nth-child(2) { top: 6px; }
  .nav-toggle__bars i:nth-child(3) { top: 12px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { translate: 0 6px; rotate: 45deg; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { translate: 0 -6px; rotate: -45deg; }

  /* Open (2 Nov, after exa.ai's phone menu): the drawer fills the screen.
     Logo and close on top, the links scroll in the middle, Book a demo is
     pinned to the bottom above a hairline. The page behind doesn't scroll. */
  html.is-menu-open { overflow: hidden; }
  .site-header.is-open {
    position: fixed; inset: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--ground);
  }
  .site-header.is-open > .padding-global { height: 100%; }
  .site-header.is-open .nav__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: var(--nav-h) minmax(0, 1fr) auto;
    grid-template-areas: "logo toggle" "links links" "actions actions";
    height: 100%;
  }
  .site-header.is-open .wordmark { grid-area: logo; }
  .site-header.is-open .nav-toggle { grid-area: toggle; }
  .site-header.is-open .site-nav {
    grid-area: links;
    align-self: stretch;          /* the bar centres its items; the links start at the top of their row and scroll in it */
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-block: var(--space-2) var(--space-5);
  }
  .site-header.is-open .site-actions {
    grid-area: actions;
    position: relative;
    display: grid;
    grid-auto-rows: 46px;         /* the button at full height, full width */
    align-items: stretch;
    margin-left: 0;
    padding-block: var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
  .site-header.is-open .site-actions::before {
    content: ''; position: absolute; top: 0; left: calc(50% - 50vw); right: calc(50% - 50vw);
    height: var(--border-w); background: var(--line);
  }
  .site-header.is-open .site-nav ul { flex-direction: column; height: auto; gap: 0; }
  .site-header.is-open .site-nav li { flex-direction: column; }
  /* Top-level links (after exa.ai; 18px on 64px rows since 30 Nov): the caret
     at the far right. */
  .site-header.is-open .nav-link {
    justify-content: space-between;
    width: 100%;
    padding-block: var(--space-4);
    font-size: 18px; font-weight: 500; line-height: 32px;   /* 16 + 32 + 16: a 64px row */   /* buttons don't inherit it; links do */
    color: var(--heading);
  }
  .site-header.is-open .nav-link .caret { --icon-size: 20px; }
  /* 30 Nov (user, after neon.com and modal.com): 18px on 64px rows, a
     hairline under each section, its open menu inside it. */
  .site-header.is-open .site-nav > ul > li { border-bottom: var(--border-w) solid var(--line); }

  /* The menus fold into the stacked menu (30 Nov, user: "our links look very
     small … neon when opened also show link title and desc, we should keep
     icons too. also check modal"; after neon.com's and modal.com's phone
     menus): each entry is its 20px muted icon, its name at 16px weight 500
     and its line at 14px muted under it, 12px apart — the desktop menu's own
     icons and lines, which were hidden here (names only at 14px, 37px apart,
     after exa.ai, 2 Nov). The two How it fits entries carry a phone-only icon
     in place of their drawings (shield-check, monitor). The team rows keep no
     icon, as on desktop. */
  .site-header.is-open .nav-panel { position: static; padding: 0; }
  .site-header.is-open .nav-panel > .menu-card { padding-bottom: var(--space-5); }   /* on the contents, so a section folds to nothing (header.js fold) */
  .menu-card__columns { display: grid; gap: var(--space-3); }
  .menu-column__label { display: block; padding-block: var(--space-4) var(--space-2); margin: 0; font-size: 11px; }
  .menu-intro__link, .menu-feature__link, .menu-row, .menu-box, .menu-entry { display: block; padding-block: var(--space-3); }
  .menu-link, .menu-tile { display: flex; align-items: flex-start; gap: var(--space-3); padding-block: var(--space-3); }
  /* The menus' accent on the phone drawer too (30 Nov, user: on the light drawer
     the icons were Sage green, the dark grounds' green; the desktop menu's light
     accent is Sage B900, set only inside its card): Sage on dark, B900 on light. */
  .site-header { --menu-accent: var(--sage-green); }
  .site-header.is-light { --menu-accent: var(--sage-ink); }
  .menu-link__icon, .menu-tile__icon { flex: none; display: flex; margin-top: 1px; color: var(--menu-accent); }   /* Sage at rest on phones (30 Nov, user: "make the icon color already green"); no hover there */
  .menu-link__icon .icon, .menu-tile__icon .icon { --icon-size: 20px; width: 20px; height: 20px; }
  .menu-column__title { display: block; padding-block: var(--space-2); font-family: var(--font-label); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; }
  .menu-box strong, .menu-entry strong { font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--heading); }
  .menu-intro__link strong, .menu-feature__link strong, .menu-tile__text strong, .menu-link__text strong, .menu-row strong { font-size: 16px; font-weight: 500; line-height: 1.4; }
  .menu-tile__text, .menu-link__text { display: block; min-width: 0; padding: 0; }
  .menu-tile__text > span, .menu-link__text > span, .menu-row > span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; min-height: 0; color: var(--ink-muted); }
  .menu-intro .menu-column__label, .menu-intro__cta, .menu-tile__art, .menu-feature__art,   /* phones: the Platform feature is a plain entry */
  .menu-feature__link > span:not(.menu-feature__art),
  .menu-card__arrow,
  .menu-box strong .icon, .menu-box > span,
  .menu-intro__link > span { display: none; }
}

/* The Platform menu, after oxide.computer's Product menu (27 Nov, user):
   "How it works" as a column of three text links at the left, "How it fits"
   as two illustrated tiles at the right under their own label. */
@media (min-width: 992px) {
  .menu-card--tiles:has(.menu-card__tiles--platform) { width: min(840px, calc(100vw - var(--space-8))); }   /* 840: room for the links' lines (27 Nov) */
  .menu-card__tiles--platform { grid-template-columns: 280px minmax(0, 1fr); }
  .menu-card__tiles--platform .menu-link__text > span { min-height: calc(2 * 1.5em); text-wrap: pretty; }   /* regular wrapping, not balanced (27 Nov, user: the even halves "look weird"); pretty only keeps a last word from standing alone */   /* every line keeps two lines' room, so the three links sit evenly */
  .menu-card__tiles--platform .menu-link__text strong { white-space: nowrap; }
  .menu-fits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--border-w); background: var(--line); }
  .menu-fits__label { grid-column: 1 / -1; margin: 0; padding: var(--space-5) var(--space-5) 0; background: var(--ground); }
  .menu-fits .menu-tile:first-of-type { position: relative; }
  .menu-fits__label + .menu-tile, .menu-fits__label + .menu-tile + .menu-tile { margin-top: calc(-1 * var(--border-w)); }   /* the label and the tiles as one surface, the hairline only between the two tiles */
}

/* Resources in the other menus' make (27 Nov, user: its boxed cards "look
   different than platform and solutions"): the two docs entries are menu
   links — a 20px muted icon, the name and its line, a tint on hover — side
   by side, no boxes. */
@media (min-width: 992px) {
  .menu-column .menu-boxes--links { gap: var(--space-1) var(--space-3); }
  .menu-boxes--links .menu-link__text > span { min-height: calc(2 * 1.5em); text-wrap: pretty; }
}

/* The two How it fits entries' icons are for the phone menu only (30 Nov). */
@media (min-width: 992px) { .menu-tile__icon { display: none; } }
