/* ==========================================================================
   Site header
   Solid white background: the supplied logo PNG has an opaque white ground.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--c-line);
  box-shadow: 0 8px 24px -20px rgba(20, 20, 20, 0.35);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

/* Brand ------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: none;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand-logo {
  height: 40px;
  width: auto; /* preserves the logo's intrinsic 531 × 287 proportions */
}

.brand-name {
  padding-left: 14px;
  border-left: 1px solid var(--c-line);
  color: var(--c-ink-2);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Navigation -------------------------------------------------------------- */

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  position: relative;
  display: block;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  color: var(--c-muted);
  font-size: 0.93rem;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-list a:hover {
  color: var(--c-ink);
  background: var(--c-bg-soft);
}

.nav-list a.is-active {
  color: var(--c-ink);
  font-weight: 600;
}

.nav-list a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-red);
}

/* Mobile toggle ----------------------------------------------------------- */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  place-items: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: #cfd1d6;
  background: var(--c-bg-soft);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}

.nav-toggle-bars::before {
  top: 1px;
}

.nav-toggle-bars::after {
  top: 9px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 5px;
  transform: rotate(-45deg);
}

/* Tablet & mobile: collapse nav into a disclosure panel (JS-enhanced only) */
@media (max-width: 1279.98px) { /* keep in sync with js/header.js */
  .js .nav-toggle {
    display: grid;
  }

  .js .primary-nav {
    position: absolute;
    top: 100%;
    /* .header-inner is also the .container, so its box already includes the gutter */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px var(--gutter) 20px;
    background: #fff;
    border-bottom: 1px solid var(--c-line);
    box-shadow: 0 24px 40px -28px rgba(20, 20, 20, 0.35);
  }

  .js .primary-nav:not(.is-open) {
    display: none;
  }

  .js .primary-nav.is-open {
    animation: nav-in 0.3s var(--ease-out) both;
  }

  .js .nav-list {
    flex-direction: column;
  }

  .js .nav-list a {
    padding: 14px 12px;
    font-size: 1rem;
  }

  .js .nav-list a.is-active::after {
    right: auto;
    width: 18px;
    bottom: 8px;
  }

  .js .header-cta {
    align-self: flex-start;
  }
}

@media (max-width: 479.98px) {
  .brand {
    gap: 10px;
  }

  .brand-logo {
    height: 32px;
  }

  .brand-name {
    padding-left: 10px;
    font-size: 0.8rem;
  }
}

@keyframes nav-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
