/* ═══════════════════════════════════════════════════
   NAV.CSS — Navbar, Hamburger, Mobile Menu
   Somala Ajay Portfolio
═══════════════════════════════════════════════════ */

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 66px;
  background: transparent;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  border-bottom: 1px solid transparent;
}

/* Scrolled state — added via JS */
#navbar.scrolled {
  background: rgba(10,8,15,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.25);
}

[data-theme="light"] #navbar.scrolled {
  background: rgba(250,248,255,0.95);
}

/* ── Logo ── */
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: none;
  transition: color 0.2s;
}
.nav-logo span { color: var(--gold); }
.nav-logo:hover { color: var(--purple); }

/* ── Desktop Links ── */
.nav-links {
  display: flex;
  gap: 2.25rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  cursor: none;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s;
}

/* Animated underline on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.23,1,0.32,1);
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ── Hamburger button ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: none;
  padding: 8px;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  z-index: 400;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.23,1,0.32,1);
  transform-origin: center;
}

/* Open state */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--purple); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--purple); }

/* ── Mobile Menu — full screen overlay ── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(10,8,15,0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

[data-theme="light"] .mobile-menu {
  background: rgba(250,248,255,0.97);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

/* Decorative glow behind menu */
.mobile-menu::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.mobile-menu a {
  display: block;
  padding: 0.9rem 3rem;
  width: 100%;
  max-width: 280px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  cursor: none;
  position: relative;
  /* Staggered entry animation */
  opacity: 0;
  transform: translateY(20px);
  transition: color 0.2s, opacity 0.4s ease, transform 0.4s ease;
}

.mobile-menu a:last-of-type { border-bottom: none; }

.mobile-menu.open a { opacity: 1; transform: translateY(0); }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.05s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.10s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.20s; }
.mobile-menu.open a:nth-child(6) { transition-delay: 0.25s; }
.mobile-menu.open a:nth-child(7) { transition-delay: 0.30s; }

.mobile-menu a:hover { color: var(--purple); }

/* Close button inside mobile menu */
.mob-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: none;
  padding: 8px;
  transition: color 0.2s;
  z-index: 360;
}
.mob-close:hover { color: var(--purple); }
