/* Site header.
 *
 * Desktop reproduces the export's nav exactly -- same sticky bar, same
 * space-between layout, same type and colours -- but from classes rather than
 * inline styles, because the mobile state needs to override them.
 *
 * Selectors are deliberately a notch more specific than the global `a:hover`
 * in site.css, so link colours here do not depend on stylesheet order.
 */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  font-family: 'Manrope', sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14, 17, 19, 0.08);
}

.nav__home { display: flex; align-items: center; }
.nav__logo { height: 34px; width: auto; display: block; }

/* `contents` keeps the links row and the CTA as direct children of the bar's
   flex layout, so grouping them for mobile costs nothing on desktop. */
.nav__menu { display: contents; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
  flex-wrap: wrap;
}

.nav .nav__link {
  font-weight: 600;
  /* 15px in the export, which read as timid next to the 34px wordmark and the
     hero type; 17px balances the bar without competing with the logo */
  font-size: 17px;
  color: #0E1113;
  text-decoration: none;
}
.nav .nav__link:hover { color: #0B5C54; }
.nav .nav__link[aria-current="page"] { color: #0B5C54; }

.nav .nav__cta {
  background: #0E1113;
  color: #F7F4EF;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
/* the export held this colour in an inline style, which outranked a:hover;
   from a class it needs saying explicitly or the label goes dark on dark */
.nav .nav__cta:hover { color: #F7F4EF; background: #1B2023; }

/* hamburger: hidden until the bar runs out of room */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav__bars,
.nav__bars::before,
.nav__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #0E1113;
  transition: transform 160ms ease, opacity 120ms ease;
}
.nav__bars::before,
.nav__bars::after {
  content: '';
  position: absolute;
}
.nav__bars::before { transform: translateY(-7px); }
.nav__bars::after { transform: translateY(7px); }

.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .nav__bars,
  .nav__bars::before,
  .nav__bars::after { transition: none; }
}

/* ---------------------------------------------------------------------- */

@media (max-width: 799px) {
  .nav { position: sticky; }

  .nav__toggle { display: inline-flex; position: relative; }

  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 4px clamp(20px, 5vw, 56px) 20px;
    background: #F7F4EF;
    border-bottom: 1px solid rgba(14, 17, 19, 0.08);
    box-shadow: 0 18px 30px rgba(14, 17, 19, 0.1);
  }

  /* the button sits immediately before the panel, so its state drives the
     panel's visibility with no class bookkeeping in JS */
  .nav__toggle[aria-expanded="true"] + .nav__menu { display: flex; }

  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  /* 47px rows: the export's 21px links were well under any tap-target floor */
  .nav .nav__link {
    padding: 13px 2px;
    border-bottom: 1px solid rgba(14, 17, 19, 0.07);
  }

  .nav .nav__cta {
    margin-top: 16px;
    padding: 15px 22px;
    font-size: 15px;
    text-align: center;
  }
}
