nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 4vw;
  backdrop-filter: blur(18px) saturate(180%);
  background: rgba(10,10,15,.55);
  border-bottom: 1px solid var(--border);
  transition: background .4s;
}
[data-theme="light"] nav { background: rgba(248,247,254,.82); }
.logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links li { display: flex; align-items: center; }
.nav-links a { font-size: .85rem; font-weight: 500; color: var(--muted); text-decoration: none; letter-spacing: .03em; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.theme-btn { width: 68px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; position: relative; transition: border-color .2s, box-shadow .2s; }
.theme-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.theme-btn::after { content: ''; position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #2d1b69; box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: transform .55s var(--ease-back), background .4s, box-shadow .4s; z-index: 0; }
[data-theme="light"] .theme-btn::after { transform: translateX(30px); background: #f59e0b; box-shadow: 0 2px 14px rgba(245,158,11,.6); }
.theme-icon { width: 15px; height: 15px; position: absolute; top: 50%; z-index: 1; pointer-events: none; transition: color .3s, transform .5s var(--ease-back); }
.theme-icon:first-child { left: 11px;  transform: translateY(-50%) scale(.82); color: var(--muted); }
.theme-icon:last-child  { right: 11px; transform: translateY(-50%) scale(.82); color: var(--muted); }
[data-theme="dark"]  .theme-btn .theme-icon:first-child { transform: translateY(-50%) scale(1); color: #c8c0ff; }
[data-theme="light"] .theme-btn .theme-icon:last-child  { transform: translateY(-50%) scale(1); color: #fff; }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s var(--ease), opacity .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  nav { padding: 1rem 5vw; }
  .hamburger { display: flex; margin-left: auto; }
  .nav-links {
    display: none;
    position: fixed; top: 57px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: .5rem 0; z-index: 99;
  }
  @keyframes navOpen  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes navClose { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-6px); } }
  .nav-links.open    { display: flex; animation: navOpen .2s var(--ease) forwards; }
  .nav-links.closing { display: flex; animation: navClose .2s var(--ease) forwards; }
  .nav-links li { padding: 0; }
  .nav-links a { display: block; padding: .85rem 5vw; font-size: .95rem; }
  .nav-links li:last-child { padding: .75rem 5vw; }
}
