/* --- 6. NAVBAR --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  transition: background .3s, box-shadow .3s;
}

.navbar.scrolled {
  background: rgba(239, 231, 211, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  z-index: 101;
  margin-right: auto;
}

.accent {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  position: relative;
  margin-left: auto;
  margin-right: 1.5rem;
}

.nav-item {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: color .2s;
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width .3s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
}

.nav-item:hover::after,
.nav-item.active::after {
  width: 100%;
  background: var(--gold);
}

.btn-outline-sm {
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--border-b);
  border-radius: 6px;
  padding: .4rem 1rem;
  color: var(--gold);
  transition: background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}

.btn-outline-sm:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

/* --- NAV PILL (Anime.js) --- */
#nav-pill {
  position: absolute;
  bottom: -6px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  border-radius: 1px;
  pointer-events: none;
  will-change: transform, width;
}

.nav-item.active::after,
.nav-item:hover::after {
  width: 0 !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 101;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

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

.hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: var(--nav-h);
  right: 1rem;
  background: rgba(239, 231, 211, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 230px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
  transform: translateX(110%) scale(.97);
  opacity: 0;
  transition: transform .3s cubic-bezier(.25, .46, .45, .94), opacity .3s;
}

.mobile-drawer.open {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.mob-link {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text2);
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  transition: color .2s;
}

.mob-link:hover {
  color: var(--text);
}

/* Theme Toggle (Fixed Bottom-Right) */
.theme-toggle-fixed {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: var(--card);
  border: 1px solid var(--border-b);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.theme-toggle-fixed:hover {
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
  transform: scale(1.1);
}

.theme-toggle-fixed:active {
  transform: scale(0.95);
}

[data-theme="dark"] .theme-toggle-fixed {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .theme-toggle-fixed:hover {
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .icon-moon {
  display: none;
}

html:not([data-theme="dark"]) .icon-sun {
  display: none;
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.85);
}

[data-theme="dark"] .mobile-drawer {
  background: rgba(15, 23, 42, 0.98);
}

/* Responsive for theme toggle */
@media (max-width: 768px) {
  .theme-toggle-fixed {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}
