/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5f5f5b;
  --rule: #e4e2dc;
  --accent: #0f5c6e;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(15, 92, 110, 0.08);
  --focus: #d97706;

  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 44rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131416;
    --bg-elev: #1b1d20;
    --text: #ebe9e4;
    --text-muted: #a3a29c;
    --rule: #2c2f33;
    --accent: #6fc3d6;
    --accent-contrast: #0e1b1f;
    --accent-soft: rgba(111, 195, 214, 0.12);
    --focus: #fbbf24;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131416;
  --bg-elev: #1b1d20;
  --text: #ebe9e4;
  --text-muted: #a3a29c;
  --rule: #2c2f33;
  --accent: #6fc3d6;
  --accent-contrast: #0e1b1f;
  --accent-soft: rgba(111, 195, 214, 0.12);
  --focus: #fbbf24;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.75rem, 7vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; margin-top: 2.25rem; }

p { margin: 0 0 1.1em; }

.muted { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 4px;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  color: var(--text);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
}

/* ---------- Layout ---------- */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  padding: clamp(4rem, 12vh, 7rem) 0 clamp(3rem, 8vh, 5rem);
}

.portrait {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 1.75rem;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.lede {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.35;
  margin-bottom: 1rem;
}

.sub {
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.section {
  padding: clamp(2.5rem, 6vh, 4rem) 0;
  border-top: 1px solid var(--rule);
}

.highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}
.highlights li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.highlights li:last-child { border-bottom: 1px solid var(--rule); }
.highlights strong { font-weight: 600; }

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
