/* Shared navigation glass: SVG refraction with a CSS blur fallback. */
#nav { --glass-ink:#201c14; --glass-tint:rgba(255,255,255,.22); }
#nav .nav-side[data-glass-background="light"] { --glass-ink:#201c14; --glass-tint:rgba(255,255,255,.30); }
#nav .nav-side[data-glass-background="dark"] { --glass-ink:#fff; --glass-tint:rgba(12,12,16,.18); }
#nav .nav-side[data-glass-background="mixed"] { --glass-ink:#fff; --glass-tint:rgba(12,12,16,.68); }
#nav .nav-side {
  position:relative;
  background:linear-gradient(165deg,rgba(255,255,255,.22),transparent 36%,transparent 65%,rgba(255,255,255,.09)),var(--glass-tint);
  box-shadow:inset 0 1.5px 1px rgba(255,255,255,.9),inset 0 -1px 1px rgba(255,255,255,.38),inset 1px 0 2px rgba(255,255,255,.55),inset -2px 0 3px rgba(255,255,255,.5),0 5px 18px rgba(0,0,0,.15);
  -webkit-backdrop-filter:blur(6px) saturate(140%);
  backdrop-filter:blur(6px) saturate(140%);
  /* Fade the tint between background modes instead of switching instantly. */
  transition:background 250ms ease,box-shadow 250ms ease;
}
@media(prefers-reduced-motion:reduce){#nav .nav-side{transition:none;}}
#nav .nav-side.glass-refracts {backdrop-filter:var(--glass-filter) saturate(140%);}
#nav .nav-side-left .nav-pill.nlinks,#nav .nav-side-right .nav-pill-link,#nav .nav-side-right .nav-pill-link:hover {background:transparent;box-shadow:none;}
#nav .nav-pill {-webkit-mask-image:none;transform:none;}
#nav .nav-side-left .nav-pill.nlinks a,#nav .nav-side-right .nav-pill-link {color:var(--glass-ink);text-shadow:0 1px 5px rgba(0,0,0,.12);transition:color 250ms ease;}
@media(prefers-reduced-motion:reduce){#nav .nav-side-left .nav-pill.nlinks a,#nav .nav-side-right .nav-pill-link{transition:none;}}
#nav .nav-side-right .nav-pill-link:not(.nav-pill-audit)::before {background:transparent;}
#nav .nav-side-left .nlogo,#nav .nav-side-right .ncta {
  background:linear-gradient(145deg,rgba(255,255,255,.22),rgba(255,255,255,.03) 52%,rgba(255,255,255,.12));
  border-color:rgba(255,255,255,.4);color:var(--glass-ink);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.75),inset 0 -1px 1px rgba(255,255,255,.18);
}
#nav .nlogo .wh-w,#nav .nlogo:hover .wh-w {color:var(--glass-ink);transition:color 250ms ease;}
#nav .nlogo .wh-h,#nav .nlogo:hover .wh-h {color:#c9a84c;}
#nav .nav-side-left .nav-pill-highlight,#nav .nav-side-right .nav-pill-link::after {background:linear-gradient(130deg,rgba(255,255,255,.25),rgba(255,255,255,.06));box-shadow:inset 0 0 0 1px rgba(255,255,255,.4);}
#nav .nav-side-left .nlogo:hover,#nav .nav-side-right .ncta:hover {background:rgba(255,255,255,.22);}
#nav a:focus-visible,#nav button:focus-visible {outline:2px solid #c9a84c;outline-offset:3px;}
@media (max-width:768px),(hover:none) and (pointer:coarse) and (orientation:portrait) and (max-width:1366px){
 #nav .nav-side-left{border-radius:999px;margin-left:10px;}
 #nav .nav-side-left .nlogo{background:transparent;border-radius:inherit;border-color:transparent;box-shadow:none;}
 #nav .nav-hamburger{background:linear-gradient(145deg,rgba(255,255,255,.24),rgba(255,255,255,.06));box-shadow:inset 0 1px 1px rgba(255,255,255,.7);}
 #nav .nav-hamburger::before{color:var(--glass-ink);}
 #nav .nav-side-right .ncta{background:transparent;box-shadow:none;}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#nav .nav-side{background:#f5f3ef;}#nav .nav-side{--glass-ink:#201c14!important;}}
@media(prefers-reduced-transparency:reduce){#nav .nav-side{background:#f5f3ef;backdrop-filter:none!important;-webkit-backdrop-filter:none;}#nav .nav-side{--glass-ink:#201c14!important;}}
@media(prefers-reduced-motion:reduce){#nav *,#nav *::before,#nav *::after{transition:none!important;}}
/* Legal/error pages retain their compact full-width navigation and links. */
#nav.nav-doc{--glass-ink:#201c14;--glass-tint:rgba(255,255,255,.30);color:var(--glass-ink);background:linear-gradient(165deg,rgba(255,255,255,.22),transparent 36%,transparent 65%,rgba(255,255,255,.09)),var(--glass-tint);box-shadow:inset 0 1.5px 1px rgba(255,255,255,.9),inset 0 -1px 1px rgba(255,255,255,.38),inset 1px 0 2px rgba(255,255,255,.55),inset -2px 0 3px rgba(255,255,255,.5),0 5px 18px rgba(0,0,0,.15);-webkit-backdrop-filter:blur(6px) saturate(140%);backdrop-filter:blur(6px) saturate(140%);transition:background 250ms ease,box-shadow 250ms ease;}
#nav.nav-doc[data-glass-background="dark"]{--glass-ink:#fff;--glass-tint:rgba(12,12,16,.18);}
#nav.nav-doc[data-glass-background="mixed"]{--glass-ink:#fff;--glass-tint:rgba(12,12,16,.68);}
#nav.nav-doc .nav-logo,#nav.nav-doc .nav-back{color:var(--glass-ink);text-shadow:0 1px 5px rgba(0,0,0,.12);}
#nav.nav-doc .nav-logo b{color:#c9a84c;}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#nav.nav-doc{background:#f5f3ef;--glass-ink:#201c14!important;}}
@media(prefers-reduced-transparency:reduce){#nav.nav-doc{background:#f5f3ef;--glass-ink:#201c14!important;backdrop-filter:none!important;-webkit-backdrop-filter:none;}}
@media(prefers-reduced-motion:reduce){#nav.nav-doc{transition:none;}}


/* Pages without the sliding highlight still get a glass hover/active state. */
#nav .nav-side-left .nlinks:not(.has-highlight) a:hover,
#nav .nav-side-left .nlinks:not(.has-highlight) a.active{background:linear-gradient(130deg,rgba(255,255,255,.25),rgba(255,255,255,.06));box-shadow:inset 0 0 0 1px rgba(255,255,255,.4);}

/* Desktop interaction fixes: pads track their actual links; focus stays visible. */
@media (min-width:769px) and (hover:hover),(min-width:769px) and (pointer:fine),(min-width:769px) and (orientation:landscape),(min-width:769px) and (min-width:1367px){
 #nav .nav-side-right .nav-pill-link{margin-right:0;padding-inline:clamp(18px,2vw,28px);}
 #nav .nav-side-left .nav-pill.nlinks{overflow:visible;clip-path:none;}
 #nav .nav-side-left .nav-pill-highlight{top:0;bottom:0;}
 #nav .nav-side-right .nav-pill-link:focus-visible::after{opacity:1;}
 #nav .nav-side-left .nlogo:focus-visible,
 #nav .nav-side-right .ncta:focus-visible{background:rgba(255,255,255,.22);}
}

/* BEGIN ROUNDED NAV TRIAL — remove this block to restore edge-mounted ends. */
@media (min-width:769px) and (hover:hover),(min-width:769px) and (pointer:fine),(min-width:769px) and (orientation:landscape),(min-width:769px) and (min-width:1367px){
 /* 80px nav height minus 52px bars leaves a 14px top gap. */
 #nav:not(.nav-doc){padding-inline:14px;gap:16px;}
 #nav .nav-side-left,#nav .nav-side-right{border-radius:999px;padding:6px;}
 #nav .nav-side-left .nlogo,#nav .nav-side-right .ncta{border-radius:999px;border:1px solid rgba(255,255,255,.4);}
}
@media (min-width:769px) and (max-width:1100px) and (hover:hover),(min-width:769px) and (max-width:1100px) and (pointer:fine),(min-width:769px) and (max-width:1100px) and (orientation:landscape),(min-width:769px) and (max-width:1100px) and (min-width:1367px){
 #nav{--nav-cap-w:100px;}
 #nav .nav-side-left .nlogo{width:64px;}
 #nav .nav-side-left .nav-pill.nlinks a{padding-inline:10px;font-size:13px;}
 #nav .nav-side-right .nav-pill-link{padding-inline:14px;font-size:13px;}
 #nav .nav-side-right .ncta{font-size:13px;}
}
/* END ROUNDED NAV TRIAL */

/* The nav's blur is dropped while the hero is on screen, on desktop only.
   The hero repaints a CPU-raymarched canvas at 60Hz, and a backdrop-filter has
   to re-run over whatever changes beneath it, so the nav was re-filtering sixty
   times a second over moving artwork. Measured holding still on #hz at 1440
   @2x, 660+ frames per variant in both sweep orders:
     as shipped                     55.0fps, 3.8% of frames dropped
     blur off while hero in view    59.7fps, nothing dropped
     blur 6px -> 3px                56.6fps, 1.9% dropped  (halves it, no fix)
     SVG lens -> plain blur         57.2fps, 1.3% dropped
   Only switching it off clears it, and doing that just for the hero reads the
   same as doing it everywhere (60.2fps) while leaving the glass intact on every
   other section and page.
   body.hero-in-view is set by the observer at index.html:1701 and only on
   desktop, so the mobile nav is untouched -- and on mobile the hero is a video
   with both canvas layers display:none, where this cost does not exist (held
   still at 390 @2x: 60fps, nothing dropped, with or without the blur).
   Lowering the hero's own frame rate instead was not an option: the comment at
   hero/code-glyph-solid.js:602 records that 20fps made the idle orbit visibly
   step, which is why it renders at display rate when idle. */
@media (min-width:769px) and (hover:hover),(min-width:769px) and (pointer:fine),(min-width:769px) and (orientation:landscape),(min-width:769px) and (min-width:1367px){
  body.hero-in-view #nav .nav-side{-webkit-backdrop-filter:none;backdrop-filter:none;}
}

/* Mobile has direct navigation controls; omit the visible skip tab. */
@media (max-width:768px),(hover:none) and (pointer:coarse) and (orientation:portrait) and (max-width:1366px){.skip-link{display:none!important;}}
/* Centre the visible Bebas capitals, not just their line boxes (measured at DPR3). */
@media (max-width:768px),(hover:none) and (pointer:coarse) and (orientation:portrait) and (max-width:1366px){
 #nav .nlogo .wh-w,#nav .nlogo .wh-h{transform:translateY(.05em);}
 #nav .ncta{position:relative;top:.0416667em;}
 #nav .nav-hamburger::before{transform:translateY(.0625em);}
}
