/* ─── Header — fixed pill nav + fullscreen menu ──────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 16px var(--gutter);
  color: var(--ink);
  transition: background var(--duration) ease-out, color var(--hover-duration) ease-out;

  /* Over the dark hero photo: transparent, off-white wordmark. */
  &.site-header--overlay:not(.is-scrolled) {
    color: var(--on-dark);
  }

  /* Solid (inner pages, light heroes, or scrolled past the hero). */
  &.site-header--solid,
  &.is-scrolled {
    background: color-mix(in srgb, var(--bg-color) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* Inner pages and light heroes: the fixed header must not cover content. */
body:not(.home) .site-main,
.home--layout-2,
.home--layout-4,
.home--layout-5 {
  padding-top: var(--header-h);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;

  &:hover {
    color: inherit;
  }
}

.site-header__logo img {
  width: 100%;
  height: auto;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Under 768px the nav collapses to "Start your plan" + "Menu". */
.site-header__pill--wide {
  display: none;

  @media (min-width: 768px) {
    display: inline-flex;
  }
}

/* ─── Fullscreen menu — black overlay, big display links, accent bar ─── */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 16px var(--gutter) 0;
  background: var(--stage);
  color: var(--on-dark);
  overflow-y: auto;
}

.menu-overlay__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: calc(var(--header-h) - 32px);
}

.menu-overlay__brand:hover {
  color: var(--on-dark);
}

.menu-overlay__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.menu-overlay__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;

  a {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.02em;
    font-size: clamp(40px, 6vw, 88px);
    color: var(--on-dark);

    &:hover,
    &:focus-visible {
      color: var(--accent);
    }
  }

  .current-menu-item > a {
    color: var(--accent);
  }
}

/* Links reveal one by one when the menu opens. */
@media (prefers-reduced-motion: no-preference) {
  .menu-overlay.is-open .menu-overlay__list li {
    animation: evs-rise 0.5s var(--ease) both;
  }

  .menu-overlay.is-open .menu-overlay__list li:nth-child(2) { animation-delay: 0.05s; }
  .menu-overlay.is-open .menu-overlay__list li:nth-child(3) { animation-delay: 0.1s; }
  .menu-overlay.is-open .menu-overlay__list li:nth-child(4) { animation-delay: 0.15s; }
  .menu-overlay.is-open .menu-overlay__list li:nth-child(5) { animation-delay: 0.2s; }
  .menu-overlay.is-open .menu-overlay__list li:nth-child(n + 6) { animation-delay: 0.25s; }
}

.menu-overlay__bar {
  height: 6px;
  margin: 24px calc(-1 * var(--gutter)) 0;
  background: var(--accent);
}

@keyframes evs-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
