/* ============================================================
   site.css — SINGLE SOURCE OF TRUTH for shared site chrome.
   The primary nav (and dissertation subnav) live here and ONLY
   here. Do not copy these rules into page <style> blocks —
   that's how the nav drifted between pages before.
   Pages may define additional :root vars; identical core values
   below act as fallback for any page that forgets.
   ============================================================ */

:root {
  --bg: #FAF6EC;
  --ink: #0E1B2C;
  --ink-soft: rgba(14, 27, 44, 0.7);
  --ink-muted: rgba(14, 27, 44, 0.5);
  --accent: #D9622C;
  --rule: rgba(14, 27, 44, 0.12);
}

/* ============ PRIMARY NAV ============ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 56px;
  border-bottom: 1px solid var(--rule);
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-mark {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

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

.nav-links a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 200ms;
}

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

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
}

/* Pages with a long-scroll subnav (e.g. /dissertation) opt out of
   the sticky primary nav so the subnav takes the sticky slot. */
.nav.has-subnav { position: relative; }

/* ============ SUBNAV (on-this-page wayfinding) ============ */
.subnav {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 0 56px;
}

.subnav-links {
  display: flex;
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav-links::-webkit-scrollbar { display: none; }

.subnav-links a {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 13px 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 200ms, border-color 200ms;
}

.subnav-links a:hover { color: var(--ink); }
.subnav-links a.is-current { color: var(--accent); border-bottom-color: var(--accent); }

/* Keep anchored sections clear of the sticky chrome */
section[id], header[id] { scroll-margin-top: 58px; }

/* ============ MOBILE ============ */
@media (max-width: 720px) {
  .nav { padding: 20px 24px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 24px;
    gap: 14px;
    border-bottom: 1px solid var(--rule);
  }
  .subnav { padding: 0 24px; }
}
