/* =============================================================================
   SITE HEADER  —  white bar, logo lockup, uppercase nav, gold active underline
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: #fff;
  box-shadow: var(--shadow-header);
  transition: box-shadow var(--dur) var(--ease);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: var(--header-h);
  transition: min-height var(--dur) var(--ease);
}

.site-header.is-scrolled .site-header__inner { min-height: var(--header-h-scroll); }
.site-header.is-scrolled { box-shadow: 0 3px 20px rgba(16, 40, 24, 0.13); }

/* -----------------------------------------------------------------------------
   BRAND LOCKUP
   -------------------------------------------------------------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  color: inherit;
  flex: none;
}
.brand:hover { color: inherit; }

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease);
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.site-header.is-scrolled .brand__mark { width: 46px; height: 46px; }

.brand__text { display: block; min-width: 0; }

.brand__name {
  display: block;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--green-600);
  white-space: nowrap;
}
.brand__name-2 {
  display: block;
  font-family: var(--font-head);
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--green-600);
}
.brand__tagline {
  display: block;
  max-width: 21ch;
  margin-top: 1px;
  font-size: 0.605rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.005em;
  color: var(--ink-muted);
}

/* -----------------------------------------------------------------------------
   PRIMARY NAV
   -------------------------------------------------------------------------- */
.nav { display: flex; align-items: center; }

.nav__list {
  display: flex;
  align-items: center;
  /* Wrapping is a safety net: if a label is ever made longer, items drop to a
     second row rather than being cut off at the edge of the bar. */
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 0.25rem;
  column-gap: clamp(0.7rem, -0.55rem + 1.55vw, 1.45rem);
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.nav__list li { margin: 0; }

.nav__link {
  position: relative;
  display: block;
  padding: 0.55rem 0;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #3A4A40;
  transition: color var(--dur-fast) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--gold-500);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--dur) var(--ease);
}
.nav__link:hover { color: var(--green-600); }
.nav__link:hover::after { width: 60%; }

.nav__link.is-active { color: var(--green-600); }
.nav__link.is-active::after { width: 100%; }

/* Short label in the bar; the full one only inside the slide-out menu. */
.nav__label--menu { display: none; }

/* -----------------------------------------------------------------------------
   HEADER ACTIONS  —  the JOIN THE CREW pill + mobile toggle
   -------------------------------------------------------------------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
  margin-left: clamp(0.6rem, -0.5rem + 1.6vw, 1.4rem);
}

.header-actions .btn {
  padding: 0.72rem 1.15rem;
  font-size: 0.755rem;
  letter-spacing: 0.055em;
  white-space: nowrap;
}
.header-actions .btn .icon { width: 16px; height: 16px; }

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--green-700);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.nav-toggle:hover { background: var(--green-tint); }
.nav-toggle .icon { width: 22px; height: 22px; stroke-width: 2; }
.nav-toggle .icon--close { display: none; }

/* -----------------------------------------------------------------------------
   MOBILE DRAWER
   -------------------------------------------------------------------------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(12, 38, 22, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }

/*
 * The drawer lives INSIDE .site-header, which is `position: sticky` with a
 * z-index — so it is its own stacking context. That makes the drawer's own
 * z-index only meaningful among the header's children; against the overlay
 * the browser compares .site-header (100) with .nav-overlay (190), and the
 * overlay wins, covering the drawer links AND the close button.
 * Lifting the whole header above the overlay while the drawer is open is what
 * actually decides the contest.
 */
body.nav-open .site-header { z-index: var(--z-drawer); }

@media (max-width: 1150px) {
  .nav-toggle { display: grid; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    width: min(340px, 86vw);
    display: block;
    padding: calc(var(--header-h-mobile) + 1.35rem) var(--space-5) var(--space-6);
    background: #fff;
    box-shadow: -14px 0 44px rgba(16, 40, 24, 0.2);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(102%);
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-out), visibility var(--dur-slow);
  }

  body.nav-open .nav { transform: none; visibility: visible; }
  body.nav-open .nav-toggle .icon--menu { display: none; }
  body.nav-open .nav-toggle .icon--close { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  /* In the menu there is room for the full names. */
  .nav__label--bar  { display: none; }
  .nav__label--menu { display: inline; }
  .nav__list li + li { border-top: 1px solid var(--border-soft); }

  .nav__link {
    padding: 0.95rem 0.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    white-space: normal;
  }
  .nav__link::after {
    left: 0;
    transform: none;
    width: 0;
    height: 2px;
    bottom: 0.55rem;
  }
  .nav__link.is-active::after { width: 28px; }

  /* The drawer gets its own Join button at the bottom */
  .nav__cta {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
  }
  .nav__cta .btn { width: 100%; }

  .nav__contact {
    margin-top: var(--space-5);
    display: grid;
    gap: 0.65rem;
    font-size: 0.85rem;
  }
  .nav__contact a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink-muted);
  }
  .nav__contact .icon { width: 17px; height: 17px; color: var(--green-600); }
}

@media (min-width: 1151px) {
  /* On desktop the Join item is the green pill button, not a menu link */
  .nav__cta, .nav__contact, .nav__item-cta { display: none; }
}

@media (max-width: 640px) {
  .site-header__inner { min-height: var(--header-h-mobile); gap: var(--space-3); }
  .site-header.is-scrolled .site-header__inner { min-height: 60px; }
  .brand__mark { width: 42px; height: 42px; }
  .site-header.is-scrolled .brand__mark { width: 38px; height: 38px; }
  .brand__name   { font-size: 0.86rem; }
  .brand__name-2 { font-size: 0.72rem; }
  .brand__tagline { display: none; }
  .header-actions > .btn { display: none; }   /* drawer carries the CTA */
}
