/* ============================================================
   nav.css — navigation bar, active underline, dark toggle
   ============================================================ */

/* ── NAV BAR ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 242, 235, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 56px;
}

html.dark nav {
  background: rgba(24, 23, 26, 0.88);
}

/* ── NAV NAME (left side) ── */
.nav-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

html.dark .nav-name {
  color: #f0ebe2;
}

/* ── NAV LINKS ── */
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  position: relative;   /* needed for .nav-indicator positioning */
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a.active {
  color: var(--ink);
}

html.dark .nav-links a {
  color: #a09a94;
}

html.dark .nav-links a:hover {
  color: var(--accent);
}

html.dark .nav-links a.active {
  color: #f0ebe2;
}

/* ── SLIDING UNDERLINE INDICATOR ── */
.nav-indicator {
  position: absolute;
  bottom: -1px;       /* sits flush on the nav border */
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: left  0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

/* ── DARK MODE TOGGLE BUTTON ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3em 0.75em;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
  margin-left: 1.5rem;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.theme-toggle svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Icon visibility — swap on dark mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
html.dark .icon-sun  { display: block; }
html.dark .icon-moon { display: none; }