/* ── Masthead ─────────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--parchment);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}

/* Wordmark */
.brand {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand span {
  color: var(--slate-light);
  font-weight: 400;
  margin-left: 6px;
}

/* Header right cluster */
.hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Header buttons */
.hbtn span.short { display: none; }
.hbtn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.hbtn:hover {
  background: var(--parchment-dark);
  border-color: var(--forest-light);
  color: var(--forest);
}
.hbtn:active { transform: scale(0.97); transition: transform 0.16s cubic-bezier(0.23,1,0.32,1); }
.hbtn.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}
.hbtn.primary:hover { background: var(--forest-mid); border-color: var(--forest-mid); }

/* Hamburger (mobile only) */
.hbtn.menu { display: none; }


/* ── Mega-panel nav ───────────────────────────────────────────────────────── */
#nav-panel {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 190;
  background: var(--parchment);
  border-bottom: 1px solid var(--border-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 24px 32px 28px;
  display: none;
  transform: scale(0.98);
  opacity: 0;
  transform-origin: top center;
  transition: transform 0.18s cubic-bezier(0.23,1,0.32,1), opacity 0.18s ease;
}
  to   { transform: scale(1);    opacity: 1; }
}

.nav-col { padding: 0 20px 0 0; }
.nav-col:first-child { padding-left: 0; }

.nav-col-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-light);
  padding: 0 0 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

#nav-panel ul { list-style: none; }
#nav-panel ul li { margin: 0; }
#nav-panel ul li a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--slate);
  text-decoration: none;
  padding: 5px 6px;
  border-radius: 2px;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}
#nav-panel ul li a:hover {
  background: var(--forest-pale);
  color: var(--forest);
}
#nav-panel ul li a.active {
  color: var(--forest);
  font-weight: 600;
}

/* Backdrop for mega-panel */
#nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(0,0,0,0.15);
}
#nav-backdrop.open { display: block; }


/* ── Left-rail: hidden (replaced by mega-panel) ───────────────────────────── */
.rail { display: none; }
.wrap { display: block; }
.backdrop { display: none !important; }


/* ── Main content area ────────────────────────────────────────────────────── */
main {
  max-width: calc(var(--content-max) + var(--page-pad) * 2);
  margin: 0 auto;
  padding: 40px var(--page-pad) 80px;
  min-height: calc(100dvh - var(--header-h));
}


/* ── Mobile TOC ───────────────────────────────────────────────────────────── */
.mtoc {
  display: none;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  background: var(--white);
  border-radius: 2px;
}
.mtoc summary {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 10px 14px;
  cursor: pointer;
}
#mop { padding: 8px 14px 14px; }
#mop a {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--slate);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
#mop a:last-child { border-bottom: none; }
#mop a:hover { color: var(--forest); }


/* ── Collapsible Nav Groups (mega-panel internal) ─────────────────────────── */
.ng { overflow: hidden; }
.ng > ul {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.23,1,0.32,1), opacity 0.2s ease;
  opacity: 1;
}
.ng.collapsed > ul { max-height: 0 !important; opacity: 0; }
.ngl {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px 7px 12px; border-radius: 2px; transition: background 0.15s;
}
.ngl:hover { background: var(--forest-pale); }
.ngl .chevron {
  font-size: 10px; opacity: 0.5;
  transition: transform 0.22s cubic-bezier(0.23,1,0.32,1);
  display: inline-block; margin-left: 4px; flex-shrink: 0;
}
.ng.collapsed .ngl .chevron { transform: rotate(-90deg); }
.ng.has-active > .ngl { color: var(--forest); }


/* ── Mobile bottom nav bar ──────────────────────────────────────────────── */
#mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 200;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
}
.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item:active { color: var(--forest); transform: scale(0.95); }
.mbn-item.active { color: var(--forest); }
.mbn-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
@media (max-width: 640px) {
  #mobile-bottom-nav { display: grid; }
  main { padding-bottom: 72px; }
}



/* ═══ NAV ACCORDION ═══════════════════════════════════════ */
.rail {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  max-height: calc(100dvh - 52px);
  background: var(--parchment);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  overflow-y: auto;
  display: none;
  padding: 0;
}
.rail.open { display: block; }
#nav-panel {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  max-height: calc(85vh - 52px);
  overflow-y: auto;
  background: var(--parchment);
  border-bottom: 2px solid var(--brand);
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  z-index: 200;
  padding: 0;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 180ms cubic-bezier(0.23,1,0.32,1), opacity 180ms ease-out;
}
#nav-panel.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}
/* Nav panel inner grid */
#nav-panel .nav-panel-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  max-width: 1100px;
gap: 0;
  padding: 0;
}
/* Category section */
#nav-panel .nav-col {
  border-right: 1px solid var(--border);
  padding: 0;
}
#nav-panel .nav-col:last-child { border-right: none; }
/* Category header — clickable to collapse */
#nav-panel .nav-col-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  border-bottom: 1px solid var(--border);
  background: rgba(var(--brand-rgb, 30,80,120), 0.04);
  cursor: pointer;
  user-select: none;
}
#nav-panel .nav-col-label::after {
  content: "▾";
  font-size: 10px;
  transition: transform 200ms ease;
  color: var(--muted);
}
#nav-panel .nav-col.collapsed .nav-col-label::after {
  transform: rotate(-90deg);
}
/* Link list */
#nav-panel .nav-col ul {
  list-style: none;
  margin: 0;
  padding: 8px 0 12px;
  max-height: 400px;
  overflow-y: auto;
  transition: max-height 200ms ease, padding 200ms ease;
}
#nav-panel .nav-col.collapsed ul {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}
#nav-panel .nav-col ul li a {
  display: block;
  padding: 6px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
  line-height: 1.4;
}
#nav-panel .nav-col ul li a:hover {
  background: rgba(var(--brand-rgb, 30,80,120), 0.06);
  border-left-color: var(--brand);
  color: var(--brand);
}
#nav-panel .nav-col ul li a[aria-current="page"] {
  background: rgba(var(--brand-rgb, 30,80,120), 0.10);
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
/* Nav panel close bar at bottom */
#nav-panel .nav-panel-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(var(--brand-rgb, 30,80,120), 0.02);
}
/* Mobile: single column stacked */
@media (max-width: 640px) {
  #nav-panel {
    max-height: calc(100dvh - 52px);
    top: 52px;
  }
  #nav-panel .nav-panel-inner {
    grid-template-columns: 1fr;
  }
  #nav-panel .nav-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.nav-search-wrap {
  position: sticky;
  top: 0;
  background: var(--parchment);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}
#nav-search {
  flex: 1;
  border: 1px solid var(--border);
  background: white;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  border-radius: 2px;
  outline: none;
}
#nav-search:focus { border-color: var(--brand); }
#nav-search-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
  min-width: 60px;
}
.nav-accordion {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 16px;
}
.nac { border-bottom: 1px solid var(--border); }
.nac-hd {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background 120ms ease-out;
}
.nac-hd:hover { background: rgba(0,0,0,0.03); }
.nac-label { flex: 1; }
.nac-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--slate);
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 10px;
}
.nac-chevron {
  font-size: 9px;
  color: var(--slate);
  transition: transform 180ms ease-out;
  display: inline-block;
}
.nac-hd[aria-expanded="false"] .nac-chevron { transform: rotate(-90deg); }
.nac-body {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.nac-body[hidden] { display: none; }
.nac-body li { margin: 0; }
.nac-body a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px 6px 28px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background 100ms ease-out, color 100ms ease-out;
  line-height: 1.35;
}
.nac-body a:hover { background: rgba(0,79,144,0.06); color: var(--brand); }
.nac-body a.active { color: var(--brand); font-weight: 600; background: rgba(0,79,144,0.08); }
.nac-body a .dot { flex-shrink: 0; }
.nac-body a mark {
  background: rgba(0,79,144,0.18);
  color: var(--brand);
  border-radius: 1px;
  padding: 0 1px;
}
.nav-footer {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--slate);
  padding: 10px 20px 14px;
  letter-spacing: 0.04em;
}



/* ═══ MEGA-PANEL AUDIENCE BAR ══════════════════════════════ */
.nav-panel-audience-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--brand-rgb, 30,80,120), 0.03);
  flex-wrap: wrap;
}
.nav-panel-audience-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-left: auto;
}


/* ═══ AUDIENCE TOGGLE ══════════════════════════════════════ */
.nav-audience-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.nat-btn {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.nat-btn:hover {
  background: var(--parchment-dark);
  border-color: var(--forest-light);
  color: var(--forest);
}
.nat-btn.nat-active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}
/* Hide engineering categories in investor view */
.nac[data-eng-hidden] { display: none; }
/* Hide engineering cols in mega-panel when in investor view */
.nav-col[data-eng-hidden] { display: none !important; }
.home-cat-card[data-eng-hidden] { display: none !important; }




/* ═══ ACCORDION NAV (hidden — audience toggle HTML lives here for JS) ════ */
#nav-panel-accordion { display: none !important; }

