@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap');

:root {
  --nav-bg: rgba(255, 255, 255, 0.06);
  --nav-border: rgba(255, 255, 255, 0.1);
  --link: rgba(255, 255, 255, 0.6);
  --link-hover: rgba(255, 255, 255, 0.95);
  --link-hover-bg: rgba(255, 255, 255, 0.07);
  --link-active: rgba(255, 255, 255, 1);
  --link-active-bg: rgba(255, 255, 255, 0.12);
  --dot: rgba(255, 255, 255, 0.3);
  --dot-hover: rgba(255, 255, 255, 0.8);
  --divider: rgba(255, 255, 255, 0.08);
  --brand: rgba(255, 255, 255, 0.9);
  --toggle-icon: rgba(255, 255, 255, 0.6);
  --toggle-hover: rgba(255, 255, 255, 0.95);
}

body.light {
  --nav-bg: rgba(255, 255, 255, 0.55);
  --nav-border: rgba(109, 40, 217, 0.15);
  --link: #6d28d9;
  --link-hover: #3b0764;
  --link-hover-bg: rgba(109, 40, 217, 0.07);
  --link-active: #3b0764;
  --link-active-bg: rgba(109, 40, 217, 0.1);
  --dot: rgba(109, 40, 217, 0.3);
  --dot-hover: #4c1d95;
  --divider: rgba(109, 40, 217, 0.08);
  --brand: #4c1d95;
  --toggle-icon: #6d28d9;
  --toggle-hover: #3b0764;
}

.nav-outer {
  width: 100%;
  padding: 12px 0;
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.nav-wrap::-webkit-scrollbar {
  display: none;
}

nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  position: relative;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.nav-brand a {
  color: var(--brand);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  padding: 7px 14px;
  border-radius: 8px;
  display: inline-block;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-brand a:hover {
  background: var(--link-hover-bg);
}

.nav-sep {
  width: 1px;
  height: 16px;
  background: var(--nav-border);
  margin: 0 2px;
  flex-shrink: 0;
}

.nav-item {
  position: relative;
}

nav a,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--link);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
}

nav a:hover,
.nav-trigger:hover {
  color: var(--link-hover);
  background: var(--link-hover-bg);
}

nav a.active,
.nav-trigger.active {
  color: var(--link-active);
  background: var(--link-active-bg);
}

.nav-trigger .chevron {
  width: 12px;
  height: 12px;
  opacity: 0.4;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.open .chevron {
  transform: rotate(180deg);
}

.dropdown {
  position: fixed;
  transform-origin: top center;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  background: rgba(15, 5, 30, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition:
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
}

body.light .dropdown {
  background: rgba(245, 243, 255, 0.95);
  border-color: rgba(109, 40, 217, 0.12);
}

.nav-item.open .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--link);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.dropdown a:hover {
  color: var(--link-hover);
  background: var(--link-hover-bg);
}

.dropdown a .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.dropdown a:hover .dot {
  background: var(--dot-hover);
}

.dropdown-divider {
  height: 1px;
  background: var(--divider);
  margin: 3px 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: 2px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--link-hover-bg);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: var(--toggle-icon);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

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