/* The header on every page (nav.js): sticky, white, a thin line under it, its content as wide as the page's.
   Loaded after landing.css or styles.css, whose colour tokens it uses. Every text colour is at least 4.5:1 on white. */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  padding: 10px 16px; border-radius: 10px; background: var(--color-text); color: #ffffff;
  font: 600 15px/1.2 var(--font); text-decoration: none;
}
.skip-link:focus { top: 12px; color: #ffffff; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  max-width: none; margin: 0; padding: 0;
  background: #ffffff; border-bottom: 1px solid var(--color-border);
}
.site-header-inner {
  max-width: var(--page-max-width); margin: 0 auto; padding: 0 var(--gutter);
  min-height: 72px; display: flex; align-items: center; gap: var(--spacing-24, 24px);
}
.site-header.slim .site-header-inner { min-height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; color: var(--color-text); text-decoration: none; }
.brand:hover { color: var(--color-text); }
.brand .wordmark { display: block; width: 61px; height: 36px; }
.site-header.slim .brand .wordmark { width: 51px; height: 30px; }
.brand-name { padding-left: 12px; border-left: 1px solid var(--color-border); font: 600 16px/1.2 var(--font); letter-spacing: -0.01em; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 2px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--color-text); font: 500 15px/1.2 var(--font); letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap;
}
.nav-link:hover, .nav-trigger[aria-expanded="true"] { background: var(--color-panel); color: var(--color-text); }
.nav-link[aria-current="page"] { color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-trigger .icon { display: inline-flex; color: var(--color-muted); transition: transform 150ms; }
.nav-trigger[aria-expanded="true"] .icon { transform: rotate(180deg); }

.nav-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 41;
  width: 220px; padding: 8px;
  background: #ffffff; border: 1px solid var(--color-border); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(26, 26, 26, 0.12);
}
.nav-panel[hidden] { display: none; }
.nav-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* keeps the hover across the gap */
.nav-panel.right { left: auto; right: 0; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-panel-link {
  display: flex; align-items: center; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  color: var(--color-text); font: inherit; text-decoration: none;
}
.nav-panel-link:hover, .nav-panel-link:focus-visible { background: var(--color-panel); color: var(--color-text); }
.nav-panel-title { display: block; font: 600 15px/1.3 var(--font); }
.nav-signout { border-top: 1px solid var(--color-border); border-radius: 0 0 10px 10px; margin-top: 4px; }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--color-text); color: #ffffff;
  font: 600 15px/1.2 var(--font); letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap;
}
.nav-cta:hover { background: #000000; color: #ffffff; }
.nav-cta .icon { display: inline-flex; }

.nav-menu-button {
  display: none; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-right: -8px;
  border: 0; border-radius: 10px; background: none; color: var(--color-text); cursor: pointer;
}
.nav-menu-button:hover { background: var(--color-panel); }

.nav-mobile { border-top: 1px solid var(--color-border); background: #ffffff; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; }
.nav-mobile[hidden] { display: none; }
.nav-mobile-group { list-style: none; margin: 0 auto; padding: 12px var(--gutter); max-width: var(--page-max-width); display: grid; gap: 2px; }
.nav-mobile-group + .nav-mobile-group { border-top: 1px solid var(--color-border); }
.nav-mobile-link {
  display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 12px; margin: 0 -12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  color: var(--color-text); font: 500 17px/1.2 var(--font); text-decoration: none;
}
.nav-mobile-link:hover { background: var(--color-panel); color: var(--color-text); }
.nav-mobile-link[aria-current="page"] { color: var(--color-accent-text); }
body.nav-open { overflow: hidden; }

@media (max-width: 1023px) {
  .site-nav, .nav-desktop, .brand-name { display: none !important; }
  .nav-menu-button { display: inline-flex; }
  .nav-actions { gap: 4px; }
  .site-header-inner { min-height: 64px; gap: 12px; }
}
@media (min-width: 1024px) {
  .nav-mobile { display: none !important; }
}
/* On phones and tablets the header is fixed rather than sticky: iOS Safari drops position: sticky under the
   overflow-x: clip on html and body (styles.css, landing.css), so the bar scrolled away. The body is padded by the
   bar's height (64px, or 60px slim, plus the 1px line) so nothing starts underneath it. header[data-nav] matches
   before nav.js has run, so the page doesn't jump when it does. */
@media screen and (max-width: 1023px) {
  header[data-nav] { position: fixed; top: 0; left: 0; right: 0; z-index: 40; background: #ffffff; }
  body { padding-top: 65px; }
  body:has(> header[data-nav="app"]) { padding-top: 61px; }
  html { scroll-padding-top: 77px; }
}
@media (max-width: 380px) {
  .nav-cta { padding: 0 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-trigger .icon { transition: none; }
}
@media print {
  .site-header, .skip-link { display: none !important; }
}
