#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 48px;
  height: 72px;
  transition: background var(--transition), border-bottom var(--transition), backdrop-filter var(--transition);
}

#navbar.scrolled {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(17, 17, 17, 0.92);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
}

.nav-logo svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-links {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 32px;
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-family: var(--font-body);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta .btn-primary {
  font-size: 14px;
  padding: 10px 24px;
}

.nav-active {
  color: #38BDF8 !important;
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile nav overlay - rendered outside stacking contexts via fixed + high z-index */
.mobile-nav-overlay {
  display: none;
}

@media (max-width: 768px) {
  #navbar {
    padding: 0 20px;
  }

  .nav-hamburger {
    display: block;
  }

  /* Hide desktop nav-links inside navbar on mobile */
  .nav-links {
    display: none !important;
  }

  .nav-cta {
    display: none;
  }

  /* Fullscreen overlay - sits as direct child of body, outside all stacking contexts */
  .mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #111111;
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 36px;
  }

  .mobile-nav-overlay.open {
    display: flex;
  }

  .mobile-nav-overlay a {
    font-family: var(--font-body);
    font-size: 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
  }

  .mobile-nav-overlay a:hover,
  .mobile-nav-overlay a.nav-active {
    color: #38BDF8;
  }

  .mobile-nav-close {
    position: absolute;
    top: 22px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
  }
}
