/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Nav Controls (theme toggle + color picker) */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
  cursor: none;
}

.theme-toggle:hover {
  background: var(--accent-glow);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.theme-toggle:hover svg {
  color: var(--accent);
}

/* Hide the inactive icon */
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Color Picker Dots */
.color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
  padding: 0;
}

.color-dot:hover {
  transform: scale(1.25);
}

.color-dot.active {
  border-color: var(--text);
  transform: scale(1.25);
}

.color-dot[data-color="green"] { background: #a3e635; }
.color-dot[data-color="orange"] { background: #f97316; }
.color-dot[data-color="purple"] { background: #6c63ff; }
.color-dot[data-color="blue"] { background: #3b82f6; }
.color-dot[data-color="grey"] { background: #9ca3af; }

/* Hamburger Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

.mobile-link {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.mobile-link:hover {
  color: var(--accent);
}
