/* ==========================================================================
   Navigation — grouped desktop menus (Stripe structure), transparent-over-hero
   header, compact-on-scroll bar, the live HaloVault lockbox pill, full-screen mobile
   sheet (x.ai), and the HaloVault product sub-nav. Loads after site.css.
   ========================================================================== */

/* ---------- Header bar ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: var(--z-header); height: var(--header-h); background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
.header--scrolled { box-shadow: 0 8px 30px rgba(11, 13, 18, .06); }
.header__inner { position: relative; height: 100%; display: flex; align-items: center; gap: 10px; }
.header__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .06em; font-size: 15px; text-transform: uppercase; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line); flex: none; }
.brand__mark img { width: 170%; max-width: none; height: auto; margin: -21% 0 0 -35%; }
.brand__mark--square img { width: 100%; margin: 0; }
.brand__sub { display: block; font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ---------- Desktop nav ---------- */
.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav__item { position: relative; }
.nav__item--mega { position: static; }
.nav__link, .nav__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 13px; border-radius: var(--radius-pill); border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-1); font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; transition: color .2s var(--ease), background .2s var(--ease); }
.nav__btn svg { width: 14px; height: 14px; opacity: .7; transition: transform .2s var(--ease); }
.nav__item.is-open .nav__btn svg { transform: rotate(180deg); }
.nav__link:hover, .nav__btn:hover, .nav__item.is-open > .nav__btn, .nav__item.is-active > .nav__btn, .nav__item.is-active > .nav__link, .nav__link[aria-current="page"] { color: var(--ink); background: var(--bg-2); text-decoration: none; }

/* dropdown panels */
.menu { position: absolute; top: calc(100% + 10px); left: 0; min-width: 280px; padding: 8px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(11, 13, 18, .14), 0 2px 6px rgba(11, 13, 18, .06); opacity: 0; visibility: hidden; transform: translateY(6px) scale(.98); transform-origin: top left; transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s; z-index: 6; }
.nav__item.is-open > .menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition-delay: 0s; }
.menu::before { content: ""; position: absolute; left: 22px; top: -6px; width: 10px; height: 10px; background: var(--bg); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.menu__link { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 12px; border-radius: 11px; color: var(--ink); font-weight: 500; font-size: var(--fs-1); }
.menu__link:hover, .menu__link:focus-visible { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.menu__link small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; line-height: 1.35; margin-top: 1px; }
.menu__link--plain { grid-template-columns: minmax(0, 1fr); }
.menu__icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.menu__icon svg { width: 16px; height: 16px; }
.menu__list { display: grid; gap: 2px; }

/* mega panel (Products) */
.menu--mega { left: 50%; width: min(960px, calc(100vw - 32px)); transform: translate(-50%, 6px) scale(.98); transform-origin: top center; padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.nav__item.is-open > .menu--mega { transform: translate(-50%, 0) scale(1); }
.menu--mega::before { left: 50%; margin-left: -5px; }
.menu__group { padding: 6px; }
.menu__group + .menu__group { border-left: 1px solid var(--line); }
.menu__kicker { display: block; padding: 8px 12px 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.menu__kicker b { display: block; margin-top: 3px; font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.menu__foot { grid-column: 1 / -1; margin-top: 4px; padding: 12px 12px 6px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-1); color: var(--muted); }

/* lab panel (two columns) */
.menu--lab { width: 560px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 12px; }
.menu--lab .menu__foot { grid-column: 1 / -1; }

/* over-hero state (added by JS at the top of hero pages) */
.header--over { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.header--over .brand, .header--over .nav-toggle, .header--over .theme-toggle { color: #fff; }
.header--over .brand__sub { color: rgba(255, 255, 255, .6); }
.header--over .nav__link, .header--over .nav__btn { color: rgba(255, 255, 255, .85); }
.header--over .nav__link:hover, .header--over .nav__btn:hover, .header--over .nav__item.is-open > .nav__btn, .header--over .nav__item.is-active > .nav__btn { color: #fff; background: rgba(255, 255, 255, .1); }
.header--over .nav-toggle, .header--over .theme-toggle { border-color: rgba(255, 255, 255, .3); }
.header--over .theme-toggle:hover, .header--over .nav-toggle:hover { background: rgba(255, 255, 255, .1); }
.header--over .btn--secondary { color: #fff; border-color: rgba(255, 255, 255, .35); }
.header--over .btn--secondary:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: #fff; }
.header--over:not(.nav-open) .btn--ghost { color: #fff; }
.header--over:not(.nav-open) .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* toggles */
.nav-toggle, .theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); background: transparent; border-radius: 10px; color: var(--ink); cursor: pointer; }
.nav-toggle { display: none; }
.nav-toggle svg, .theme-toggle svg { width: 18px; height: 18px; }
.nav-toggle:hover, .theme-toggle:hover { background: var(--bg-2); }
.nav-toggle .i-close { display: none; }
.nav-open .nav-toggle .i-menu { display: none; }
.nav-open .nav-toggle .i-close { display: block; }

/* ---------- The HaloVault lockbox pill ---------- */
.lockwrap { position: relative; }
.lockpill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.lockpill:hover, .lockwrap:focus-within .lockpill { text-decoration: none; color: var(--ink); border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(11, 13, 18, .12); }
.lockpill__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); flex: none; }
@media (prefers-reduced-motion: no-preference) { .lockpill__dot { animation: pulse 2.2s ease-in-out infinite; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); } 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .08); } }
.lockpill__tick { display: inline-block; min-width: 128px; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted); text-align: left; }
.lockpill__tick .m { color: #b4123a; background: rgba(225, 29, 72, .12); border-radius: 3px; padding: 0 2px; }
.lockpill__tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.header--over .lockpill { background: rgba(10, 10, 11, .55); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(8px); }
.header--over .lockpill__tick { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .75); }
.header--over .lockpill__tick .m { color: #ff9bb3; background: rgba(255, 120, 150, .2); }
.header--over .lockpill__tag { color: rgba(255, 255, 255, .6); }
.lockcard { position: absolute; top: calc(100% + 10px); right: 0; width: 320px; padding: 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(11, 13, 18, .16); opacity: 0; visibility: hidden; transform: translateY(6px) scale(.98); transform-origin: top right; transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s; z-index: 6; color: var(--text); font-size: var(--fs-1); }
.lockwrap:hover .lockcard, .lockwrap:focus-within .lockcard, .lockwrap.is-open .lockcard { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.lockcard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; color: var(--ink); }
.lockcard__head .obj__badge { margin: 0; }
.lockcard__steps { list-style: none; display: grid; gap: 4px; margin: 12px 0; counter-reset: s; }
.lockcard__steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); color: var(--ink); font-weight: 500; font-size: 13px; }
.lockcard__steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 10px; color: var(--accent); }
.lockcard__steps li.is-accent { background: var(--accent-soft); }
.lockcard p { color: var(--text); font-size: 13px; }
.lockcard .btn { width: 100%; margin-top: 12px; }

/* ---------- HaloVault product sub-nav ---------- */
.subnav { position: sticky; top: var(--header-h); z-index: calc(var(--z-header) - 1); height: 52px; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.subnav__inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.subnav__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 14px; white-space: nowrap; }
.subnav__brand:hover { text-decoration: none; color: var(--ink); }
.subnav__brand .brand__mark { width: 26px; height: 26px; border-radius: 7px; }
.subnav__brand .brand__sub { display: inline; margin: 0 0 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: none; font-weight: 500; }
.subnav__links { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: 8px; }
.subnav__links::-webkit-scrollbar { display: none; }
.subnav__links a { flex: none; padding: 7px 12px; border-radius: var(--radius-pill); color: var(--text); font-size: var(--fs-1); font-weight: 500; white-space: nowrap; }
.subnav__links a:hover, .subnav__links a.is-current { color: var(--ink); background: var(--bg-2); text-decoration: none; }
.subnav__links a.is-current { background: var(--ink); color: #fff; }
.subnav__end { margin-left: auto; flex: none; }
@media (max-width: 720px) { .subnav__end { display: none; } .subnav__brand .brand__sub { display: none; } }

/* ---------- Mobile: full-screen sheet ---------- */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-grid; }
  .nav { position: fixed; inset: var(--header-h) 0 0 0; z-index: var(--z-drawer); display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px var(--gutter) 32px; overflow: auto; background: #0a0a0b; color: #fff; overscroll-behavior: contain; }
  .nav-open .nav { display: flex; }
  /* backdrop-filter would make the header the containing block of the fixed sheet, so drop it while open */
  .header.nav-open { background: #0a0a0b; border-color: rgba(255, 255, 255, .1); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .header.nav-open .brand, .header.nav-open .nav-toggle, .header.nav-open .theme-toggle { color: #fff; border-color: rgba(255, 255, 255, .3); }
  .header.nav-open .lockpill { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); color: #fff; }
  .header.nav-open .header__end .btn { color: #fff; border-color: rgba(255, 255, 255, .35); }
  .header.nav-open .header__end .btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .nav__item { padding: 18px 0 6px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .nav__item--mega { position: relative; }
  .nav__btn { pointer-events: none; padding: 0 0 8px; min-height: 0; border-radius: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
  .nav__btn svg { display: none; }
  .nav__item > .nav__link { display: flex; padding: 12px 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: #fff; border-radius: 0; }
  .menu, .menu--mega, .menu--lab { position: static; width: auto; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; display: block; }
  .menu::before { display: none; }
  .menu__group { padding: 0; }
  .menu__group + .menu__group { border-left: 0; margin-top: 10px; }
  .menu__kicker { padding: 6px 0 4px; color: #a6a0ff; }
  .menu__kicker b { color: #fff; }
  .menu__link { grid-template-columns: minmax(0, 1fr); padding: 11px 0; border-radius: 0; color: #fff; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
  .menu__link:hover, .menu__link:focus-visible { background: transparent; color: #c4c0ff; }
  .menu__link small { color: rgba(255, 255, 255, .55); font-size: 13px; }
  .menu__icon { display: none; }
  .menu__foot { padding: 12px 0 0; border-top: 0; color: rgba(255, 255, 255, .6); }
  .menu__foot .btn { color: #fff; border-color: rgba(255, 255, 255, .35); }
  .nav__foot { display: grid; gap: 12px; padding-top: 22px; }
  .nav__foot .btn { width: 100%; color: #fff; border-color: rgba(255, 255, 255, .35); }
  .nav__foot .btn--primary { background: #fff; color: #0a0a0b; }
  .nav__foot .lockcard { position: static; opacity: 1; visibility: visible; transform: none; width: auto; background: #101114; border-color: rgba(255, 255, 255, .12); color: #b9bec9; box-shadow: none; }
  .nav__foot .lockcard__head, .nav__foot .lockcard__steps li, .nav__foot .lockcard p { color: #fff; }
  .nav__foot .lockcard__steps li { background: rgba(255, 255, 255, .06); }
  .nav__foot .lockcard__steps li.is-accent { background: rgba(166, 160, 255, .16); }
  .nav__foot .lockcard .btn { background: #fff; color: #0a0a0b; }
  @media (prefers-reduced-motion: no-preference) {
    .nav-open .nav > * { animation: rise .45s var(--ease) both; }
    .nav-open .nav > :nth-child(2) { animation-delay: 50ms; } .nav-open .nav > :nth-child(3) { animation-delay: 100ms; } .nav-open .nav > :nth-child(4) { animation-delay: 150ms; } .nav-open .nav > :nth-child(5) { animation-delay: 200ms; } .nav-open .nav > :nth-child(6) { animation-delay: 250ms; }
  }
  /* lab pages: their plain session list rides the same sheet (outranks lab.css) */
  .header.nav-open .nav.lab-nav a { display: flex; align-items: center; min-height: 52px; padding: 12px 0; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; white-space: normal; }
  .header.nav-open .nav.lab-nav a:hover, .header.nav-open .nav.lab-nav a.is-active { background: transparent; color: #c4c0ff; }
  .lockwrap .lockcard { display: none; }
  .lockpill__tick, .lockpill__tag { display: none; }
  .lockpill { padding: 0 12px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .brand__sub { display: none; } .lockpill__name { display: none; } .lockpill { padding: 0 10px; gap: 0; } .nav-toggle, .theme-toggle { width: 44px; height: 44px; } }
@media (min-width: 1081px) { .nav__foot { display: none; } .nav .lockcard { display: none; } }
