.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--nav-height);
  padding: 20px var(--gutter);
}

/* On desktop the menu is a pass-through wrapper, so .nav__links and the
   CTA stay direct flex children and keep the original three-up layout.
   Below --bp-md it becomes a real box and turns into the drawer. */
.nav__menu {
  display: contents;
}

/* The logo, links and hamburger are all white, so the bar needs a dark
   backdrop wherever it sits over light content. --solid applies it
   permanently, for pages that open on a light background.

   The backdrop lives on a pseudo-element, not on .nav itself: an element
   with backdrop-filter becomes the containing block for its position:fixed
   descendants, which would anchor the mobile drawer to the nav bar instead
   of the viewport. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: rgba(28, 8, 38, 0.65);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
  transition: opacity var(--duration-slow) var(--ease-out);
  pointer-events: none;
}

.nav.is-scrolled::before,
.nav--solid::before {
  opacity: 1;
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: white;
  transition: color var(--duration-base);
}


.nav__logo-hey {
  font-weight: 300;
  font-style: italic;
  font-family: var(--font-display);
  font-size: var(--text-xl);
}
.nav__logo-monika {
  font-weight: 500;
}
.nav__logo-blob {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-monika);
  margin-left: 2px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Links */
.nav__links {
  display: flex;
  gap: var(--space-lg);
}
.nav__links a {
  font-size: var(--text-sm);
  font-weight: 400;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.01em;
  transition: color var(--duration-base);
}
.nav__links a:hover {
  color: white;
}

.nav .btn--outline {
  color: white;
  border-color: rgba(255,255,255,0.5);
  padding: 8px 20px;
  font-size: var(--text-sm);
}
.nav .btn--outline:hover {
  background: white;
  color: var(--color-text-primary);
}


/* ── Hamburger toggle ──────────────────────────────────
   Hidden above --bp-md; the drawer only exists below it.
──────────────────────────────────────────────────────── */
.nav__toggle {
  display: none;
  position: relative;
  z-index: 2;              /* above the drawer, which sits at z-index 1 */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;             /* 44px minimum touch target */
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: white;
}

.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}

.nav.is-menu-open .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.is-menu-open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav.is-menu-open .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Keep the logo above the drawer overlay too */
.nav__logo {
  position: relative;
  z-index: 2;
}

/* ── Mobile drawer — see --bp-md in tokens.css ── */
@media (max-width: 768px) {
  .nav { padding: 12px var(--gutter); }

  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-2xl) var(--gutter);
    background: rgba(28, 8, 38, 0.97);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                visibility var(--duration-base);
  }

  .nav.is-menu-open .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__links {
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
  }

  .nav__links a {
    font-size: var(--text-xl);
    color: white;
  }

  .nav .btn--outline {
    padding: 12px 28px;
    font-size: var(--text-base);
  }
}
