/* ==========================================================================
   vt99-shell.css — Vault-Tec Mission Terminal II (variant99) site shell
   Layer: sticky header (§5), mobile drawer (§6), site footer (§19).
   Primer reference: todo/new_design/primer/design-system-variant99.md §5–6, §19, §22.
   All colors/radii/fonts come from --vt-* tokens defined in vt99-tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   §5 Sticky header — blurred glass bar, 68px tall.
   Class names are prefixed vt- so nothing collides with legacy styles while
   both systems coexist during the transition.
   -------------------------------------------------------------------------- */
.vt-site-header,
.vt-header{
  position:sticky;top:0;z-index:400;
  background:rgba(12,15,26,.72);
  backdrop-filter:blur(18px);
  border-bottom:1px solid var(--vt-line-soft);
  transition:box-shadow .3s;
}
.vt-site-header.scrolled,
.vt-header.scrolled{
  box-shadow:0 10px 40px -18px rgba(0,0,0,.6); /* toggled via JS at scrollY>10 */
}
.vt-header-inner{display:flex;align-items:center;gap:22px;height:68px}

/* brand: gradient tile that tilts on hover with a bouncy spring curve */
.vt-brand{display:flex;align-items:center;gap:11px;flex:none}
.vt-brand__mark{
  width:36px;height:36px;border-radius:11px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--vt-blue),var(--vt-blue-2));color:#fff;
  box-shadow:0 4px 18px var(--vt-blue-glow);
  transition:transform .4s cubic-bezier(.34,1.56,.64,1); /* overshoot spring */
}
.vt-brand:hover .vt-brand__mark{transform:rotate(14deg) scale(1.06)}
.vt-brand__name{
  font-family:var(--vt-disp);font-weight:700;font-size:1.05rem;letter-spacing:.03em;
}
.vt-brand__name b{color:var(--vt-yellow);font-weight:700} /* second word always yellow */

/* nav pills; current page gets inset blue ring + yellow underline tab */
.vt-main-nav{display:flex;gap:4px;margin-left:auto}
.vt-main-nav a{
  position:relative;padding:9px 16px;border-radius:999px;color:var(--vt-text-2);
  font-size:.88rem;font-weight:600;
  transition:color .2s,background .2s;
}
.vt-main-nav a:hover{color:var(--vt-text);background:rgba(147,164,255,.07)}
.vt-main-nav a[aria-current]{
  color:#fff;background:var(--vt-blue-glow);
  box-shadow:inset 0 0 0 1px rgba(109,155,255,.35);
}
.vt-main-nav a[aria-current]::after{
  content:"";position:absolute;left:50%;bottom:-1px;
  transform:translateX(-50%);width:18px;height:3px;border-radius:99px;
  background:var(--vt-yellow);
}

/* Wiki dropdown: the "Wiki" link stays a regular nav pill that navigates to
   the item list; a floating section menu opens on hover/focus-within. */
/* flex+center keeps the wrapped pill on the same baseline as sibling links */
.vt-main-nav .vt-nav-drop{display:flex;align-items:center;position:relative}
.vt-nav-drop__menu{
  position:absolute;top:calc(100% + 10px);right:0;
  min-width:212px;padding:6px;
  background:var(--vt-panel);
  border:1px solid var(--vt-line);border-radius:16px;
  box-shadow:0 24px 50px -20px rgba(0,0,0,.7);
  opacity:0;visibility:hidden;transform:translateY(-6px);
  transform-origin:top right;
  transition:opacity .2s,transform .2s,visibility 0s linear .2s;
}
/* invisible bridge over the 10px gap so hover-open survives the trip */
.vt-nav-drop__menu::before{
  content:"";position:absolute;left:0;right:0;top:-12px;height:12px;
}
.vt-nav-drop:focus-within .vt-nav-drop__menu{
  opacity:1;visibility:visible;transform:none;
  transition:opacity .2s,transform .2s;
}
/* menu links opt out of the .vt-main-nav pill/underline states — inside the
   panel they are plain rows; explicit resets below beat those selectors */
.vt-nav-drop .vt-nav-drop__menu a{
  position:static;display:flex;align-items:center;
  min-height:44px;padding:10px 14px;border-radius:11px;
  background:transparent;box-shadow:none;
  color:var(--vt-text-2);font-size:.88rem;font-weight:600;white-space:nowrap;
  transition:background .2s,color .2s;
}
.vt-nav-drop .vt-nav-drop__menu a::after{content:none}
.vt-nav-drop .vt-nav-drop__menu a:hover{
  color:var(--vt-text);background:rgba(147,164,255,.07);box-shadow:none;
}
.vt-nav-drop .vt-nav-drop__menu a[aria-current]{
  color:var(--vt-yellow);background:rgba(255,210,51,.06);box-shadow:none;
}
.vt-nav-drop .vt-nav-drop__menu a[aria-current]:hover{
  color:var(--vt-yellow);background:rgba(255,210,51,.1);
}
@media(hover:hover){
  .vt-nav-drop:hover .vt-nav-drop__menu{
    opacity:1;visibility:visible;transform:none;
    transition:opacity .2s,transform .2s;
  }
}

/* --------------------------------------------------------------------------
   Global button system (ghost is the default look)
   -------------------------------------------------------------------------- */
.vt-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:42px;padding:0 20px;border-radius:12px;
  font-size:.87rem;font-weight:650;
  border:1px solid var(--vt-line);color:var(--vt-text-2);
  white-space:nowrap;position:relative;overflow:hidden;
  transition:color .2s,border-color .2s,
             transform .2s cubic-bezier(.34,1.56,.64,1),
             box-shadow .25s,background .2s;
}
.vt-btn:hover{
  color:var(--vt-text);
  border-color:rgba(147,164,255,.25);
  transform:translateY(-1px);
}

/* primary blue: gradient + glow + periodic shine sweep */
.vt-btn--blue{
  background:linear-gradient(135deg,var(--vt-blue),#5279ff);
  border-color:transparent;color:#fff;
  box-shadow:0 4px 20px var(--vt-blue-glow);
}
.vt-btn--blue:hover{
  color:#fff;
  box-shadow:0 8px 30px rgba(59,110,246,.45);
  transform:translateY(-2px);
}
.vt-btn--blue::after{
  content:"";position:absolute;top:0;left:-80%;width:50%;height:100%;
  background:linear-gradient(105deg,transparent,rgba(255,255,255,.35),transparent);
  transform:skewX(-20deg);
  animation:vt-shine 3.4s ease-in-out infinite;
}
@keyframes vt-shine{0%,60%{left:-80%}100%{left:160%}}

/* --------------------------------------------------------------------------
   Language switcher — dashed pill, yellow on hover
   -------------------------------------------------------------------------- */
.vt-lang-pill{
  display:inline-flex;align-items:center;min-height:42px;padding:0 15px;
  border-radius:12px;border:1px dashed var(--vt-line);
  color:var(--vt-text-3);font-size:.8rem;font-weight:700;
  transition:color .2s,border-color .2s;
}
.vt-lang-pill:hover{color:var(--vt-yellow);border-color:rgba(255,210,51,.4)}

/* --------------------------------------------------------------------------
   Hamburger — hidden ≥769px, shown ≤768px (Flat Mode swap per §22).
   44×44 bordered rounded square with three 2px bars.
   -------------------------------------------------------------------------- */
.vt-menu-toggle{
  display:none;width:44px;height:44px;flex:none;
  align-items:center;justify-content:center;
  flex-direction:column;gap:5px;
  border:1px solid var(--vt-line);border-radius:11px;
  transition:border-color .2s,background .2s;
}
.vt-menu-toggle span{
  width:18px;height:2px;border-radius:99px;background:var(--vt-text-2);
}

/* --------------------------------------------------------------------------
   §6 Mobile drawer — right-side slide-in panel + dimmed blurred backdrop.
   JS contract lives in public-shell.js: it toggles [data-state="open"] on
   .ui-site-drawer / .ui-site-drawer-backdrop and locks body.ui-shell-locked.
   Those hooks stay; this block only restyles the surfaces via vt- classes.
   Slide curve cubic-bezier(.32,.72,0,1), backdrop blur per primer §6.
   -------------------------------------------------------------------------- */
.vt-drawer{
  display:flex;flex-direction:column;gap:6px;
  position:fixed;top:0;right:0;bottom:0;
  width:min(330px,88vw);height:100dvh;z-index:690;
  padding:26px 22px;
  background:
    linear-gradient(160deg, rgba(59,110,246,.06), rgba(14,17,31,.98) 45%, rgba(255,210,51,.03)),
    var(--vt-panel);
  border-left:1px solid var(--vt-line);
  color:var(--vt-text);
  transform:translateX(105%);
  visibility:hidden; /* stays rendered for the slide-out transition */
  /* visibility hides late on close (after the slide) and shows instantly on open,
     so the JS focus call right after open lands on a visible control */
  transition:transform .4s cubic-bezier(.32,.72,0,1),visibility 0s linear .4s;
}
.vt-drawer[data-state="open"]{
  transform:none;visibility:visible;
  transition:transform .4s cubic-bezier(.32,.72,0,1),visibility 0s;
}

.vt-drawer__header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding-bottom:16px;margin-bottom:10px;
  border-bottom:1px solid var(--vt-line-soft);
}
.vt-drawer__header .vt-brand{min-height:44px} /* keep brand tap target at 44px */
.vt-drawer__close{
  width:44px;height:44px;min-width:44px;flex:none;
  display:grid;place-items:center;padding:0;
  border:1px solid var(--vt-line);border-radius:11px;
  background:transparent;color:var(--vt-text-2);cursor:pointer;
  transition:border-color .2s,color .2s,background .2s;
}
.vt-drawer__close:hover{
  border-color:rgba(255,210,51,.35);
  background:rgba(255,210,51,.06);color:var(--vt-yellow);
}

/* nav rows: padded pills; current page gets a yellow accent bar (§6) */
.vt-drawer__nav{display:flex;flex-direction:column;gap:6px}
.vt-drawer__nav a{
  position:relative;
  padding:13px 14px;border-radius:12px;
  color:var(--vt-text-2);font-size:.95rem;font-weight:600;text-decoration:none;
  transition:background .2s,color .2s,border-color .2s;
}
.vt-drawer__nav a:hover{
  border-color:rgba(109,155,255,.35);
  background:rgba(59,110,246,.07);color:var(--vt-text);
}
.vt-drawer__nav a[aria-current]{
  background:rgba(255,210,51,.08);color:var(--vt-yellow);
  box-shadow:inset 0 0 0 1px rgba(255,210,51,.38);
}

/* Wiki group: native <details> disclosure styled like the other nav rows */
.vt-drawer__nav .vt-drawer__group > summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:48px;padding:13px 14px;border-radius:12px;
  color:var(--vt-text-2);font-size:.95rem;font-weight:600;cursor:pointer;
  list-style:none;user-select:none;
  transition:background .2s,color .2s;
}
.vt-drawer__nav .vt-drawer__group > summary::-webkit-details-marker{display:none}
.vt-drawer__nav .vt-drawer__group > summary:hover{
  background:rgba(59,110,246,.07);color:var(--vt-text);
}
.vt-drawer__group[open] > summary{color:var(--vt-text)}
.vt-drawer__chevron{
  flex:none;width:8px;height:8px;
  border-right:2px solid var(--vt-text-3);
  border-bottom:2px solid var(--vt-text-3);
  transform:rotate(45deg);
  transition:transform .25s cubic-bezier(.22,1,.36,1);
}
.vt-drawer__group[open] > summary .vt-drawer__chevron{transform:rotate(-135deg)}
/* subnav: quiet indented rows under the parent link; the current page falls
   back to the standard drawer a[aria-current] state — no extra decoration */
.vt-drawer__subnav{
  display:flex;flex-direction:column;gap:2px;
  padding:0 0 6px;margin:0;
}
.vt-drawer__subnav a{
  min-height:44px;padding:10px 14px 10px 38px;border-radius:12px;
  color:var(--vt-text-2);font-size:.9rem;font-weight:500;text-decoration:none;
  transition:background .2s,color .2s;
}
.vt-drawer__subnav a:hover{
  background:rgba(59,110,246,.07);color:var(--vt-text);
}
.vt-drawer__actions{
  display:flex;flex-direction:column;gap:8px;
  margin-top:auto;padding-top:16px;
  border-top:1px solid var(--vt-line-soft);
}
.vt-drawer__actions .vt-btn,
.vt-drawer__actions .ui-button{width:100%}
.vt-drawer__languages{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
  margin-top:4px;
}

.vt-drawer-backdrop{
  position:fixed;inset:0;z-index:600;
  padding:0;border:0;cursor:pointer;
  background:rgba(8,10,18,.7);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  opacity:0;pointer-events:none;
  transition:opacity .3s;
}
.vt-drawer-backdrop[data-state="open"]{opacity:1;pointer-events:auto}
.vt-drawer-backdrop[hidden]{display:none}

/* Touch targets ≥44px for drawer controls on touch layouts */
@media(max-width:768px){
  .vt-drawer__actions .vt-btn,
  .vt-drawer__actions .ui-button{height:44px;min-height:44px}
  .vt-drawer__languages .vt-lang-pill{min-height:44px}
}

/* --------------------------------------------------------------------------
   §22 Responsive — Flat Mode: navigation swaps to hamburger + drawer,
   ghost login button drops out on touch layouts.
   -------------------------------------------------------------------------- */
@media(max-width:768px){
  .vt-main-nav{display:none}
  .vt-menu-toggle{display:flex}
  .vt-header-actions .vt-btn--ghost,
  .vt-header-actions .ui-button{display:none}
  /* actions (lang + burger) hug the right edge when nav collapses */
  .vt-header-actions{margin-left:auto}
}

/* --------------------------------------------------------------------------
   §19 Footer — three-column grid over a subtle mountain silhouette.
   Markup keeps the .ui-site-footer / .ui-site-footer__group legacy classes:
   style.css scopes its generic footer rule away from .ui-site-footer, and
   public-shell.js (initFooterAndConsent) queries .ui-site-footer__group to
   sync <details open> with the desktop breakpoint. Everything visual here is
   restyled with vt- classes and --vt-* tokens; double-class selectors simply
   out-rank the legacy single-class rules that load earlier.
   -------------------------------------------------------------------------- */
.ui-site-footer.vt-footer{
  margin-top:90px;padding:0;
  border-top:1px solid var(--vt-line-soft);
  background:rgba(16,20,38,.5);
  position:relative;z-index:1;overflow:hidden;
  color:var(--vt-text-2);
  font-family:var(--vt-sans);font-size:.92rem;line-height:1.5;text-align:left;
}

/* mountain silhouette fed by the site-wide sprite gradient #mtnGrad */
.vt-footer__mountains{
  position:absolute;left:0;right:0;bottom:0;width:100%;height:90px;
  opacity:.3;pointer-events:none;
}

.vt-footer__grid{
  display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:40px;
  padding:54px 0 42px;position:relative;
}
.vt-footer__brand p{
  color:var(--vt-text-3);font-size:.9rem;line-height:1.55;
  margin:14px 0 0;max-width:36ch;
}

/* disclosure columns: summary doubles as the §10-style eyebrow heading on
   desktop and as the tappable accordion row ≤768px */
.vt-footer .vt-footer__summary{
  display:flex;align-items:center;justify-content:space-between;
  min-height:44px;margin:0;padding:0;
  list-style:none;cursor:default;
  font-size:.7rem;font-weight:800;letter-spacing:.2em;text-transform:uppercase;
  color:var(--vt-text-3);
}
.vt-footer__links{display:grid;gap:2px}
.vt-footer__links a{
  width:fit-content;max-width:100%;
  padding:6px 0;
  color:var(--vt-text-2);font-size:.92rem;font-weight:500;
  text-decoration:none;overflow-wrap:anywhere;
  transition:color .2s,transform .25s;
}

/* slide-right hover is a pointer affordance — desktop-only per plan */
@media(hover:hover){
  .vt-footer__links a:hover{color:var(--vt-yellow);transform:translateX(5px)}
}

.vt-footer__bottom{
  position:relative;
  display:flex;flex-direction:column;gap:10px;
  border-top:1px solid var(--vt-line-soft);
  padding:22px 0 32px;
}
.vt-footer__bottom p{margin:0}
.vt-footer__bottom p:first-child{
  font-family:var(--vt-mono);font-size:.8rem;color:var(--vt-text-2);
  font-variant-numeric:tabular-nums;
}
.vt-footer__bottom p:last-child{color:var(--vt-text-3);font-size:.78rem;max-width:100ch}

/* --------------------------------------------------------------------------
   §22 Flat Mode footer: two-column grid with full-width brand, native
   <details> accordions with a CSS chevron. Overrides the legacy mobile
   group rules from public-shell.css via the higher-specificity selectors.
   -------------------------------------------------------------------------- */
@media(max-width:768px){
  .vt-footer__grid{grid-template-columns:1fr 1fr;gap:28px;padding:40px 0 32px}
  .vt-footer__brand{grid-column:1/-1}
  .vt-footer .ui-site-footer__group{display:block;border-top:none}
  .vt-footer .vt-footer__summary{
    min-height:48px;width:100%;cursor:pointer;
    font-size:.68rem;letter-spacing:.18em;
  }
  /* CSS-drawn chevron replaces the legacy icon hook (no .ui-icon rendered) */
  .vt-footer .vt-footer__summary::after{
    content:"";flex:none;width:8px;height:8px;margin-right:2px;
    border-right:2px solid var(--vt-text-3);
    border-bottom:2px solid var(--vt-text-3);
    transform:rotate(45deg);
    transition:transform .25s cubic-bezier(.22,1,.36,1);
  }
  .vt-footer .ui-site-footer__group[open] .vt-footer__summary::after{
    transform:rotate(-135deg);
  }
  /* ≥44px touch targets for link rows */
  .vt-footer__links{padding-bottom:6px}
  .vt-footer__links a{
    display:flex;align-items:center;min-height:44px;padding:4px 0;
  }
}
@media(max-width:480px){
  .vt-footer__grid{grid-template-columns:1fr;gap:8px;padding:36px 0 28px}
  .vt-footer__brand{margin-bottom:20px}
}

/* --------------------------------------------------------------------------
   Reduced motion — footer link slide and chevron rotation settle instantly.
   -------------------------------------------------------------------------- */
@media(prefers-reduced-motion:reduce){
  .vt-footer__links a,
  .vt-footer__links a:hover{transform:none;transition:none}
  .vt-footer .vt-footer__summary::after,
  .vt-footer .ui-site-footer__group[open] .vt-footer__summary::after{transition:none}
}

/* --------------------------------------------------------------------------
   Reduced motion — gate this sheet's animations and movement effects
   (no forced-specificity declarations, no shorthand all-property transitions).
   -------------------------------------------------------------------------- */
@media(prefers-reduced-motion:reduce){
  .vt-brand__mark,
  .vt-brand:hover .vt-brand__mark,
  .vt-btn,
  .vt-btn:hover{transform:none}
  .vt-btn--blue::after{animation:none}
  .vt-site-header,
  .vt-header,
  .vt-drawer,
  .vt-drawer-backdrop,
  .vt-drawer__nav a,
  .vt-drawer__close,
  .vt-btn{transition:none}
  .vt-drawer__chevron,
  .vt-drawer__group[open] > summary .vt-drawer__chevron{transition:none}
}
