/* ============================================================================
   VOID HORIZON — common site navigation bar (site-nav.css)

   ONE shared bar included on every static page so the whole model/lab/scene
   catalogue is reachable from a single place, no URL-hunting. It is deliberately
   SELF-CONTAINED: it declares its own colour tokens (--vhn-*) so it renders
   identically on the pages that never declare the game's :root palette
   (fx-lab, flight-lab, ship-stats, …). Matches the "starship bridge" brand —
   phosphor cyan on deep-space glass, Chakra Petch display / IBM Plex Mono body.
   Pure CSS: a checkbox hamburger on mobile and <details> dropdowns — no JS
   dependency, no third-party/CDN anything. A tiny inline script only sets
   aria-current on the active link.
   ========================================================================== */
.vh-nav {
  --vhn-panel:   rgba(8,15,28,.92);   /* glass bar fill                */
  --vhn-panel-2: #0a1322;             /* solid dropdown / burger fill  */
  --vhn-edge:    #163049;             /* hairline                      */
  --vhn-hover:   #0e1e30;             /* link hover / active fill      */
  --vhn-cyan:    #5fd4f5;             /* primary phosphor              */
  --vhn-cyan-hi: #aeebff;
  --vhn-text:    #c9d6e8;
  --vhn-dim:     #8fa2bd;
  --vhn-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --vhn-display: 'Chakra Petch', 'IBM Plex Mono', ui-monospace, monospace;

  position: sticky; top: 0; z-index: 9000;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  margin: 0; padding: 8px 16px;
  background: var(--vhn-panel);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--vhn-edge);
  font: 500 13px/1.3 var(--vhn-mono);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.vh-nav *, .vh-nav *::before, .vh-nav *::after { box-sizing: border-box; }

/* In-page anchor jumps must clear the sticky bar (html for normal pages, the
   #teaser scroll container on index.html). Harmless where those don't exist. */
html { scroll-padding-top: 60px; }
#teaser { scroll-padding-top: 60px; }

/* Brand — doubles as the HOME link (index.html). */
.vh-nav__brand {
  display: flex; align-items: center; gap: 7px;
  margin-right: auto; padding: 6px 8px 6px 0;
  color: var(--vhn-cyan); text-decoration: none;
  font-family: var(--vhn-display); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; font-size: 13px;
  white-space: nowrap;
}
.vh-nav__brand:hover { color: var(--vhn-cyan-hi); }
.vh-nav__brand .vhn-mark { font-size: 15px; line-height: 1; }

/* Links row */
.vh-nav__links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 3px; }
.vh-nav__links > a,
.vh-nav__group > summary {
  display: block; padding: 8px 11px; border-radius: 8px;
  color: var(--vhn-text); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.vh-nav__links > a:hover,
.vh-nav__group > summary:hover { background: var(--vhn-hover); color: var(--vhn-cyan); }
.vh-nav a[aria-current="page"] {
  color: var(--vhn-cyan); background: var(--vhn-hover); border-color: var(--vhn-edge);
}
.vh-nav__group[data-active] > summary { color: var(--vhn-cyan); }

/* Dropdown groups — native <details>/<summary>, no JS. */
.vh-nav__group { position: relative; }
.vh-nav__group > summary { list-style: none; }
.vh-nav__group > summary::-webkit-details-marker { display: none; }
.vh-nav__group > summary::after { content: "\00a0▾"; color: var(--vhn-dim); }
.vh-nav__menu { display: flex; flex-direction: column; gap: 2px; }
.vh-nav__menu a {
  display: block; padding: 8px 12px; border-radius: 7px;
  color: var(--vhn-text); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.vh-nav__menu a:hover { background: var(--vhn-hover); color: var(--vhn-cyan); }
.vh-nav__menu a[aria-current="page"] { color: var(--vhn-cyan); background: var(--vhn-hover); }

/* Hamburger — pure-CSS checkbox toggle (visible only on mobile). */
.vh-nav__toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vh-nav__burger {
  display: none; margin-left: auto; padding: 6px 11px; border-radius: 8px;
  border: 1px solid var(--vhn-edge); color: var(--vhn-cyan);
  background: var(--vhn-panel-2); font-size: 16px; line-height: 1.1; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.vh-nav__toggle:focus-visible + .vh-nav__burger { outline: 2px solid var(--vhn-cyan); outline-offset: 2px; }

/* ---- Desktop (≥721px): dropdown menus float on hover / open / focus ---- */
@media (min-width: 721px) {
  .vh-nav__group > .vh-nav__menu {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
    padding: 6px; border: 1px solid var(--vhn-edge); border-radius: 10px;
    background: var(--vhn-panel-2);
    box-shadow: 0 14px 30px rgba(0,0,0,.5);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .14s, transform .14s, visibility .14s;
  }
  .vh-nav__group:hover > .vh-nav__menu,
  .vh-nav__group[open] > .vh-nav__menu,
  .vh-nav__group:focus-within > .vh-nav__menu {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
}

/* ---- Mobile (≤720px): collapse links behind the hamburger ---- */
@media (max-width: 720px) {
  .vh-nav__burger { display: block; }
  .vh-nav__links {
    flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px;
    max-height: 0; overflow: hidden;
    transition: max-height .22s ease;
  }
  .vh-nav__toggle:checked ~ .vh-nav__links {
    max-height: 82vh; overflow: auto; margin-top: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .vh-nav__links > a, .vh-nav__group > summary { padding: 12px; }
  .vh-nav__group > .vh-nav__menu { padding: 2px 0 4px 14px; }
  .vh-nav__menu a { padding: 11px 12px; }
}
