/* gh-nav-glass.css - NAV BAR order (2026-09-27): "each nav item framed in glass with the same treatment and behaviour as the
   hero (hero-blue gradient)". STAGED, not deployed.

   Layering: load AFTER gh-design.css, gh-site.css, each page's own <style> and gh-polish.css. It replaces gh-polish.css item D's
   `body.gh .gh-nav a` glass-pill rules (same selectors, later in the cascade, so no !important is needed on gh-design pages)
   and keeps polish's nav BAR (hero gradient ground, 14 px radius, tricolour edge). With gh-polish.css absent it still works:
   the items carry their own ground, so they read on the plain blue page.
   Self-contained: it defines its own keyframes (ghn-*) because the /v/ pages load neither gh-site.css nor gh-polish.css
   from their own <head>; there they get this file only through gh-footer-static.html (serve.py response injection).
   Rollback = remove the include(s). No token in gh-design.css is changed.

   What each item gets (the hero's recipe from gh-site.css, scaled to an item):
     ground   #071540 (--deep, the hero's --logo-ground) under the hero's radial glow
              radial-gradient(120% 140% at 22% 18%, #123489, rgba(18,52,137,.55) 38%, transparent 72%)
     glass    translucent 1 px frame, inner top highlight, inner bottom shade, backdrop blur where supported
     motion   glow-in (opacity 0 -> 1, scale .92 -> 1, 3 s ease-out, once) and one sheen pass (1.8 s ease-in-out, .4 s in,
              once), staggered .12 s per item. The resting (unanimated) style IS the finished state and the keyframes only
              fill backwards, so once they end nothing is left in document.getAnimations(); reduced motion = that resting
              state, no animation, no transition.
     states   hover / focus-visible lift the ground one step (#0A2566) and brighten the frame; focus = 3 px #FCD116 ring over a
              2 px #071540 gap ring (reads on dark and light grounds); aria-current = yellow frame + 3 px yellow underline
     size     >= 44 x 44 px targets, UI text >= 15 px, white text (>= 9:1 on every point of the ground)
     phone    <= 40rem: brand on its own row, the links wrap into full rows that share the width (no hamburger, no sideways
              scroll)
   Scopes: body.gh .gh-nav                           = every gh-design page (home, posits, full proof, pre-registrations, hull,
                                                       site index, 404, gated proof posits, /verify/, /v/)
           body:not(.gh) > nav[aria-label="Site"]    = the inline-styled site bar on the Evidence Room and the outage article
                                                       (inline style attributes, so colour/decoration need !important there) */

:root {
  --ghn-ground: #071540;
  --ghn-ground-hover: #0A2566;
  --ghn-glow: radial-gradient(120% 140% at 22% 18%, #123489 0%, rgba(18,52,137,.55) 38%, rgba(7,21,64,0) 72%);
  --ghn-highlight: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.03) 48%, rgba(255,255,255,0) 100%);
  --ghn-sheen: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.16) 50%, transparent 62%);
  --ghn-frame: rgba(255,255,255,.46);   /* >= 3:1 against the bar at its lightest (#002B7F, also the plain page) */
  --ghn-frame-hover: rgba(255,255,255,.72);
  --ghn-yellow: #FCD116;
  --ghn-step: .12s;
}

/* ---------- the bar: only what the items need (polish's bar ground + tricolour edge stay as they are) ---------- */
body.gh .gh-nav,
body:not(.gh) > nav[aria-label="Site"] {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
}
body.gh .gh-nav { padding-bottom: .75rem; }
body:not(.gh) > nav[aria-label="Site"] {
  gap: .45rem !important; align-items: center !important; padding: .6rem .75rem !important;
  background: linear-gradient(180deg, #002B7F 0%, #0B1640 100%) !important;   /* the hero blue, as on the gh-design pages */
}

/* ---------- each item: glass frame on the hero ground ---------- */
body.gh .gh-nav a,
body:not(.gh) > nav[aria-label="Site"] > a {
  --ghn-i: 0;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  box-sizing: border-box; min-height: 44px; min-width: 44px;
  margin: 0; padding: .45rem .85rem; border-radius: 12px;
  font-family: var(--font-ui, 'IBM Plex Sans', 'Segoe UI', Helvetica, Arial, sans-serif);
  font-size: max(15px, .92rem); font-weight: 500; line-height: 1.25; letter-spacing: .005em; white-space: normal; text-align: center;
  color: #FFFFFF; text-decoration: none;
  background: var(--ghn-ground);
  border: 1px solid var(--ghn-frame);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26), inset 0 -1px 0 rgba(0,0,0,.35), 0 8px 18px -12px rgba(0,0,0,.85);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body:not(.gh) > nav[aria-label="Site"] > a { color: #FFFFFF !important; text-decoration: none !important; font-weight: 500 !important; }
/* translucent ground where the browser can blur what is behind it (the blur needs something to show through) */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  body.gh .gh-nav a, body:not(.gh) > nav[aria-label="Site"] > a { background: rgba(7,21,64,.82); }
}

/* the hero's glow (gh-site.css .gh-hero::before), under the text, over the ground */
body.gh .gh-nav a::before,
body:not(.gh) > nav[aria-label="Site"] > a::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: var(--ghn-highlight), var(--ghn-glow);
}
/* the hero's sheen (gh-site.css .gh-hero::after): rests past the right edge, i.e. already passed */
body.gh .gh-nav a::after,
body:not(.gh) > nav[aria-label="Site"] > a::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--ghn-sheen);
  transform: translateX(101%);
}

/* stagger: one step per item, brand first */
body.gh .gh-nav a:nth-child(2), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(2) { --ghn-i: 1; }
body.gh .gh-nav a:nth-child(3), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(3) { --ghn-i: 2; }
body.gh .gh-nav a:nth-child(4), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(4) { --ghn-i: 3; }
body.gh .gh-nav a:nth-child(5), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(5) { --ghn-i: 4; }
body.gh .gh-nav a:nth-child(6), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(6) { --ghn-i: 5; }
body.gh .gh-nav a:nth-child(7), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(7) { --ghn-i: 6; }
body.gh .gh-nav a:nth-child(n+8), body:not(.gh) > nav[aria-label="Site"] > a:nth-child(n+8) { --ghn-i: 7; }

/* once, then rest. Keyframes give only the START; the end is the resting style above, and fill is backwards only, so a
   finished item holds no animation at all. */
@media (prefers-reduced-motion: no-preference) {
  body.gh .gh-nav a::before, body:not(.gh) > nav[aria-label="Site"] > a::before {
    animation: ghn-glow 3s ease-out calc(var(--ghn-i) * var(--ghn-step)) 1 backwards;
  }
  body.gh .gh-nav a::after, body:not(.gh) > nav[aria-label="Site"] > a::after {
    animation: ghn-sheen 1.8s ease-in-out calc(.4s + var(--ghn-i) * var(--ghn-step)) 1 backwards;
  }
}
@keyframes ghn-glow { from { opacity: 0; transform: scale(.92); } }
@keyframes ghn-sheen { from { transform: translateX(-101%); } }

/* ---------- states ---------- */
body.gh .gh-nav a:hover, body:not(.gh) > nav[aria-label="Site"] > a:hover,
body.gh .gh-nav a:focus-visible, body:not(.gh) > nav[aria-label="Site"] > a:focus-visible {
  background-color: var(--ghn-ground-hover);
  border-color: var(--ghn-frame-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(0,0,0,.35), 0 0 0 1px rgba(143,164,224,.35), 0 10px 24px -12px rgba(18,52,137,.95);
}
body.gh .gh-nav a:focus-visible, body:not(.gh) > nav[aria-label="Site"] > a:focus-visible {
  outline: 3px solid var(--ghn-yellow); outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ghn-ground), inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(0,0,0,.35);
}
body.gh .gh-nav a[aria-current="page"], body:not(.gh) > nav[aria-label="Site"] > a[aria-current="page"] {
  border-color: var(--ghn-yellow);
  box-shadow: inset 0 -3px 0 var(--ghn-yellow), inset 0 1px 0 rgba(255,255,255,.26), 0 8px 18px -12px rgba(0,0,0,.85);
}

/* ---------- the brand item: mark + wordmark in one frame ---------- */
body.gh .gh-nav .brand {
  justify-content: flex-start; padding: .3rem .9rem .3rem .3rem;
  font-family: var(--font-display, 'Cormorant Garamond', 'Times New Roman', Georgia, serif); font-size: 1.25rem; font-weight: 700; line-height: 1.1;
}
body.gh .gh-nav .brand .gh-mark { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.22); }
body:not(.gh) > nav[aria-label="Site"] > a:first-child { font-weight: 600 !important; }

/* ---------- phone: two-part wrap, no hamburger ---------- */
@media (max-width: 40rem) {
  body.gh .gh-nav, body:not(.gh) > nav[aria-label="Site"] { gap: .45rem; padding: .55rem .55rem .75rem; }
  body:not(.gh) > nav[aria-label="Site"] { gap: .45rem !important; padding: .55rem .55rem .75rem !important; }
  body.gh .gh-nav a, body:not(.gh) > nav[aria-label="Site"] > a { flex: 1 1 auto; padding: .4rem .8rem; }
  body.gh .gh-nav .brand, body:not(.gh) > nav[aria-label="Site"] > a:first-child { flex: 1 0 100%; justify-content: flex-start; }
}

/* ---------- reduced motion: the finished state (gh-design.css already does this for .gh; this covers the non-gh bar) ---------- */
@media (prefers-reduced-motion: reduce) {
  body.gh .gh-nav a, body.gh .gh-nav a::before, body.gh .gh-nav a::after,
  body:not(.gh) > nav[aria-label="Site"] > a, body:not(.gh) > nav[aria-label="Site"] > a::before, body:not(.gh) > nav[aria-label="Site"] > a::after {
    animation: none !important; transition: none !important;
  }
}

/* ---------- Windows high contrast: a plain framed link ---------- */
@media (forced-colors: active) {
  body.gh .gh-nav a, body:not(.gh) > nav[aria-label="Site"] > a { border: 1px solid LinkText; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.gh .gh-nav a::before, body.gh .gh-nav a::after,
  body:not(.gh) > nav[aria-label="Site"] > a::before, body:not(.gh) > nav[aria-label="Site"] > a::after { display: none; }
}

/* ---------- print: no ground, no glass ---------- */
@media print {
  body.gh .gh-nav a, body:not(.gh) > nav[aria-label="Site"] > a {
    background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; color: inherit !important; border-color: #002B7F; }
  body.gh .gh-nav a::before, body.gh .gh-nav a::after,
  body:not(.gh) > nav[aria-label="Site"] > a::before, body:not(.gh) > nav[aria-label="Site"] > a::after { display: none; }
}
