nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 64px;
  border-bottom: 1px solid var(--bd2);
}

/* Blur lives on a pseudo-element, not on `nav` itself: backdrop-filter on a
   fixed-position ancestor creates a new containing block for fixed-position
   descendants, which broke the full-screen mobile menu (it was positioning
   itself relative to this 64px bar instead of the viewport). */
nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 13, 26, 0.85);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--w);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--w3);
  text-decoration: none;
  padding: 8px 16px;
  text-transform: uppercase;
  transition: color var(--transition-fast);
  border-radius: var(--radius-btn);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.nav-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--w3);
  text-decoration: none;
  text-transform: uppercase;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-back:hover {
  color: var(--accent);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--w2);
  transition: all var(--transition-med);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 13, 26, 0.97);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: var(--z-mobile-menu);
  }
  .nav-links.open a {
    font-size: 16px;
    padding: 14px 24px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-links.open .nav-cta {
    margin-top: 12px;
  }
}
