/* Fixed site header, primary navigation, mega menu, "On this page" bar. */

.site-header {
  position: fixed;
  z-index: 300;
  inset: 0 0 auto;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(17,16,21,.1);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { flex: 0 0 auto; }
.site-header .brand img { width: 164px; height: auto; }
.menu-toggle { display: none; }

.global-nav { display: flex; align-items: center; gap: 25px; }
.global-nav > a:not(.btn), .mega-menu > summary {
  position: relative;
  padding: 30px 0 27px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.global-nav > a:not(.btn)::after, .mega-menu > summary::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 19px;
  left: 0;
  height: 2px;
  background: var(--violet);
  transition: right 160ms ease;
}
.global-nav > a:not(.btn):hover::after,
.global-nav > a[aria-current="page"]::after,
.mega-menu[open] > summary::after,
.mega-menu > summary[aria-current="page"]::after { right: 0; }
.global-nav a:focus-visible, .global-nav summary:focus-visible, .menu-toggle:focus-visible, .page-subnav a:focus-visible { outline: 3px solid rgba(97,24,215,.32); outline-offset: 4px; }

/* Mega menu */
.mega-menu { position: static; }
.mega-menu > summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.mega-menu > summary::-webkit-details-marker, .mega-group > summary::-webkit-details-marker { display: none; }
.mega-menu > summary span { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 160ms ease; }
.mega-menu[open] > summary span { transform: translateY(2px) rotate(225deg); }
.mega-panel {
  position: fixed;
  z-index: 320;
  top: 80px;
  right: 0;
  left: 0;
  padding: 34px 0 22px;
  border-top: 1px solid rgba(17,16,21,.08);
  border-bottom: 1px solid rgba(17,16,21,.13);
  background: var(--menu-bg);
  box-shadow: 0 30px 70px rgba(23,14,39,.17);
}
.mega-intro { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.mega-intro span { color: var(--violet); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mega-intro p { max-width: 560px; margin: 5px 0 0; color: var(--muted); font-size: .74rem; }
.mega-intro > a { color: var(--ink); font-size: .72rem; font-weight: 850; text-underline-offset: 5px; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mega-group { min-width: 0; padding: 21px 22px 23px; border-right: 1px solid var(--line); }
.mega-group:first-child { padding-left: 0; }
.mega-group:last-child { padding-right: 0; border-right: 0; }
.mega-group > summary { list-style: none; cursor: pointer; }
.mega-group > summary span, .mega-group > summary b, .mega-group > summary small { display: block; }
.mega-group > summary span { color: var(--violet); font-size: .78rem; font-weight: 900; letter-spacing: .1em; }
.mega-group > summary b { margin-top: 8px; font-size: .9rem; line-height: 1.25; }
.mega-group > summary small { min-height: 34px; margin-top: 8px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.mega-links { margin-top: 18px; display: grid; gap: 4px; }
.mega-links a { padding: 9px 10px; border-radius: 9px; color: var(--ink); font-size: .7rem; font-weight: 760; line-height: 1.35; text-decoration: none; }
.mega-links a:first-child { background: color-mix(in srgb, var(--violet) 8%, transparent); }
.mega-links a:hover, .mega-links a[aria-current="page"] { color: var(--violet); background: color-mix(in srgb, var(--violet) 8%, transparent); }
.mega-utility { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: var(--muted); }
.mega-utility a { color: var(--ink); font-size: .7rem; font-weight: 850; text-underline-offset: 5px; }
.mega-specialty { display: flex; align-items: center; gap: 10px; font-size: .65rem; }
.mega-specialty span { color: var(--muted); font-size: .54rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.mega-specialty b { color: var(--ink); }

/* "On this page" bar */
.page-subnav {
  position: fixed;
  z-index: 250;
  top: 80px;
  right: 0;
  left: 0;
  height: 46px;
  border-bottom: 1px solid rgba(17,16,21,.1);
  background: var(--card);
  backdrop-filter: blur(14px);
}
.page-subnav-inner { height: 100%; display: flex; align-items: center; gap: 24px; overflow: hidden; }
.page-subnav-label { flex: 0 0 auto; color: var(--violet); font-size: .64rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.page-subnav-links { min-width: 0; display: flex; align-items: center; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.page-subnav-links::-webkit-scrollbar { display: none; }
.page-subnav a { flex: 0 0 auto; color: var(--muted); font-size: .77rem; font-weight: 760; text-decoration: none; white-space: nowrap; }
.page-subnav a:hover, .page-subnav a[aria-current="location"] { color: var(--ink); }

/* Fixed header offsets for the first section */
.page-subnav + main .breadcrumb { padding-top: 154px !important; }
.page-subnav + main .hero { padding-top: 190px; }
.page-subnav + main .prose-page { padding-top: 226px; }
body.nav-open { overflow: hidden; }

@media (max-width: 1180px) {
  .global-nav { gap: 18px; }
  .site-header .brand img { width: 150px; }
  .global-nav > a:not(.btn), .mega-menu > summary { font-size: .78rem; }
  .site-header .btn-small { padding-inline: 15px; }
}

@media (max-width: 940px) {
  .header-inner { min-height: 70px; }
  .site-header .brand img { width: 142px; }
  .menu-toggle { width: 46px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 999px; display: grid; place-items: center; color: var(--ink); background: var(--card); cursor: pointer; }
  .menu-toggle > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .menu-lines { width: 18px; display: grid; gap: 5px; }
  .menu-lines i { display: block; height: 1.5px; background: currentColor; transition: transform 180ms ease; }
  .menu-toggle[aria-expanded="true"] .menu-lines i:first-child { transform: translateY(3.25px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-lines i:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .global-nav {
    position: absolute;
    z-index: 310;
    top: 70px;
    right: 0;
    left: 0;
    height: calc(100dvh - 70px);
    padding: 22px max(22px, calc((100vw - 760px) / 2)) 50px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    background: var(--paper);
  }
  html.nav-ready .global-nav { display: none; }
  html.nav-ready .global-nav.is-open { display: flex; }
  .global-nav > a:not(.btn), .mega-menu > summary { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 1.25rem; }
  .global-nav > a:not(.btn)::after, .mega-menu > summary::after { display: none; }
  .global-nav > .btn { width: 100%; margin-top: 24px; }
  .mega-menu > summary { justify-content: space-between; }
  .mega-panel { position: static; padding: 20px 0 2px; border: 0; background: transparent; box-shadow: none; }
  .mega-intro { margin-bottom: 18px; align-items: start; }
  .mega-intro > a { display: none; }
  .mega-grid { grid-template-columns: 1fr; border-bottom: 0; }
  .mega-group, .mega-group:first-child, .mega-group:last-child { padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .mega-group > summary { padding: 16px 2px; position: relative; }
  .mega-group > summary::after { content: "+"; position: absolute; right: 3px; top: 23px; color: var(--violet); font-size: 1rem; }
  .mega-group[open] > summary::after { content: "−"; }
  .mega-group > summary small { min-height: 0; padding-right: 32px; }
  .mega-links { margin: 0 0 14px; }
  .mega-links a { padding: 10px 11px; font-size: .76rem; }
  .mega-utility { padding: 16px 0 4px; align-items: flex-start; flex-direction: column; }
  .page-subnav { top: 70px; height: 44px; }
  .page-subnav-inner { gap: 16px; }
  .page-subnav + main .breadcrumb { padding-top: 134px !important; }
  .page-subnav + main .hero { padding-top: 166px; }
  .page-subnav + main .prose-page { padding-top: 176px; }
}

@media (max-width: 520px) {
  .page-subnav-label { display: none; }
  .page-subnav-links { gap: 12px; }
  .mega-intro p { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-lines i, .mega-menu > summary span { transition: none; }
}
