.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 0.5px solid var(--border-mid);
  background: var(--surface);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 62px;
}

.nav-brand {
  font-family: var(--ff-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  white-space: nowrap;
  text-decoration: none;
}

.nav-brand span { color: var(--accent); }

.nav-links { display: flex; gap: 0; margin-left: auto; }

.nav-link {
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  padding: 0 16px;
  height: 62px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

.theme-toggle {
  background: none;
  border: 0.5px solid var(--border-mid);
  color: var(--ink-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  margin-left: 12px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-alt); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: 0.5px solid var(--border-mid);
  color: var(--ink-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  margin-left: 12px;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0 1.25rem;
    min-height: 54px;
  }

  .nav-brand {
    font-size: 17px;
    padding: 14px 0;
  }

  .nav-hamburger {
    display: flex;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 0.5px solid var(--border);
    margin-left: 0;
    padding-bottom: 8px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    height: 44px;
    padding: 0 4px;
    font-size: 12px;
    border-bottom: none;
    border-left: 2px solid transparent;
  }

  .nav-link.active {
    border-bottom-color: transparent;
    border-left-color: var(--accent);
  }
}