:root {
  --header-full-height: 91px;
  --header-logo-full-width: 55.9px;
  --header-logo-full-height: 57.2px;
  --header-resize-motion: 720ms cubic-bezier(.4, 0, .2, 1);
  --nav-island-top: 16px;
  --nav-island-inset: clamp(16px, 2vw, 32px);
  --nav-island-gap: 16px;
  --nav-island-shadow: 0 4px 12px rgb(10 16 20 / 6%), 0 14px 36px rgb(10 16 20 / 10%);
  --header-reserved-height: calc(var(--header-full-height) + var(--nav-island-top) + var(--nav-island-gap));
}

html.has-sticky-header {
  scroll-padding-top: calc(var(--header-full-height) / 2 + var(--nav-island-top) + 18px);
}

.header-shell {
  height: var(--header-reserved-height);
  width: 100%;
  background: transparent;
}
.interior-page .header-shell { background: var(--paper); }

.header-shell > .site-header {
  position: fixed;
  inset: var(--nav-island-top) var(--nav-island-inset) auto;
  z-index: 40;
  width: auto;
  max-width: 1440px;
  margin-inline: auto;
  height: var(--header-full-height);
  border-radius: 10px;
  overflow: clip;
  box-shadow: var(--nav-island-shadow);
  transition: height var(--header-resize-motion);
}

.header-shell .header-logo {
  width: var(--header-logo-full-width);
  height: var(--header-logo-full-height);
  transition: width var(--header-resize-motion), height var(--header-resize-motion);
}

.header-shell .header-wordmark {
  transition: font-size var(--header-resize-motion);
}

.header-shell .brand {
  transition: gap var(--header-resize-motion);
}

.header-shell .desktop-nav a {
  transition: color .2s ease, padding var(--header-resize-motion);
}

.header-shell .menu-toggle {
  transition: width var(--header-resize-motion), height var(--header-resize-motion), padding var(--header-resize-motion);
}

.header-shell .menu-toggle span {
  transition: margin var(--header-resize-motion), transform .2s ease;
}

/* One animation clock owns all size changes. Retain only color and menu-icon
   interaction transitions; a second CSS clock would put the SVG behind it. */
.header-shell[data-header-synchronized] > .site-header,
.header-shell[data-header-synchronized] .header-logo,
.header-shell[data-header-synchronized] .header-wordmark,
.header-shell[data-header-synchronized] .brand,
.header-shell[data-header-synchronized] .menu-toggle {
  transition: none;
}
.header-shell[data-header-synchronized] .desktop-nav a { transition: color .2s ease; }
.header-shell[data-header-synchronized] .menu-toggle span { transition: transform .2s ease; }

.header-shell[data-header-compact="true"] > .site-header {
  height: calc(var(--header-full-height) / 2);
}

.header-shell[data-header-compact="true"] .header-logo {
  width: calc(var(--header-logo-full-width) * .62);
  height: calc(var(--header-logo-full-height) * .62);
}

.header-shell[data-header-compact="true"] .header-wordmark {
  font-size: 20px;
}

.header-shell[data-header-compact="true"] .brand {
  gap: 10px;
}

.header-shell[data-header-compact="true"] .desktop-nav a {
  padding-block: 8px;
}

.header-shell[data-header-compact="true"] a:focus-visible,
.header-shell[data-header-compact="true"] button:focus-visible {
  outline-offset: -3px;
}

.header-shell .header-contact,
.header-shell .header-contact:hover,
.header-shell .header-contact:focus-visible,
.header-shell + .mobile-nav [data-contact],
.header-shell + .mobile-nav [data-contact]:hover,
.header-shell + .mobile-nav [data-contact]:focus-visible {
  background: #000;
  color: #fff;
  border-color: #000;
}

.header-shell .header-contact {
  transition: padding var(--header-resize-motion), font-size var(--header-resize-motion), line-height var(--header-resize-motion);
}

.header-shell[data-header-compact="true"] .header-contact {
  padding: 7px 14px;
  font-size: 12px;
  line-height: 1.4;
}

.header-shell + .mobile-nav {
  position: fixed;
  top: calc(var(--nav-island-top) + var(--header-current-height, var(--header-full-height)) + 8px);
  left: var(--nav-island-inset);
  right: var(--nav-island-inset);
  z-index: 39;
  max-height: calc(100svh - var(--header-current-height, var(--header-full-height)) - var(--nav-island-top) - 20px);
  max-width: 1440px;
  margin-inline: auto;
  border-radius: 10px;
  box-shadow: var(--nav-island-shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.header-shell + .mobile-nav [data-contact] {
  padding: 13px 16px;
  margin-top: 12px;
  border: 1px solid #000;
}

.header-shell + .mobile-nav [data-contact] span {
  color: inherit;
}

@media (max-width: 1100px) {
  :root { --header-full-height: 80px; }
}

@media (max-width: 800px) {
  :root {
    --nav-island-top: 10px;
    --nav-island-inset: 12px;
    --nav-island-gap: 12px;
    --header-full-height: 76px;
    --header-logo-full-width: 49.4px;
    --header-logo-full-height: 50.7px;
  }
  .header-shell[data-header-compact="true"] .header-wordmark { font-size: 18px; }
  .header-shell[data-header-compact="true"] .menu-toggle {
    width: 36px;
    height: 34px;
    padding: 6px;
  }
  .header-shell[data-header-compact="true"] .menu-toggle span { margin: 5px 0; }
}

@media (max-width: 520px) {
  :root {
    --nav-island-inset: 10px;
    --header-full-height: 72px;
    --header-logo-full-width: 44.2px;
    --header-logo-full-height: 45.5px;
  }
}

@media (max-width: 800px) and (max-height: 500px) {
  :root { --nav-island-gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .header-shell > .site-header,
  .header-shell .header-logo,
  .header-shell .header-wordmark,
  .header-shell .brand,
  .header-shell .header-contact,
  .header-shell .desktop-nav a,
  .header-shell .menu-toggle,
  .header-shell .menu-toggle span {
    transition: none;
  }
}
