:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1b1f24;
  --text-muted: #5a6270;
  --accent: #1f4d8c;
  --accent-soft: #eaf1fb;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --bg-alt: #1a1e24;
    --surface: #1d2127;
    --border: #2c313a;
    --text: #e8eaed;
    --text-muted: #9aa3af;
    --accent: #7ea6e0;
    --accent-soft: #202a3a;
  }
}

:root[data-theme="dark"] {
  --bg: #14171c;
  --bg-alt: #1a1e24;
  --surface: #1d2127;
  --border: #2c313a;
  --text: #e8eaed;
  --text-muted: #9aa3af;
  --accent: #7ea6e0;
  --accent-soft: #202a3a;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1b1f24;
  --text-muted: #5a6270;
  --accent: #1f4d8c;
  --accent-soft: #eaf1fb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
  color: var(--text);
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.75rem;
}

p { color: var(--text); }

a { color: var(--accent); }

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 0.25rem;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.hero-lede {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.9rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.pub-external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}

.btn-external {
  border-color: var(--accent);
  color: var(--accent);
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
}

.btn-external:hover {
  background: var(--accent-soft);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.pub-stats {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.pub-subhead {
  margin-top: 0;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-lede {
  color: var(--text-muted);
  max-width: 700px;
  margin: -0.5rem 0 1.75rem;
}

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.info-card h3 { margin-top: 0; font-size: 1rem; }

.info-card dl { margin: 0; }
.info-card dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.9rem;
}
.info-card dt:first-child { margin-top: 0; }
.info-card dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.research-block {
  margin-bottom: 1.75rem;
}

.research-block p {
  color: var(--text-muted);
}

/* Publications */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pub;
}

.pub-list li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.pub-list li:last-child { border-bottom: 1px solid var(--border); }

.pub-citation {
  margin: 0 0 0.4rem;
  font-size: 0.97rem;
}

.pub-significance {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* CV timeline */
.cv-subhead:first-of-type { margin-top: 0.5rem; }

.timeline {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.timeline li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.timeline li:last-child { border-bottom: 1px solid var(--border); }

.tl-date {
  display: inline-block;
  min-width: 130px;
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-serif);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.contact-card:hover {
  border-color: var(--accent);
}

.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.contact-value {
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

/* Footer */
.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
    gap: 0.75rem;
  }

  .site-nav.open { display: flex; }

  .hero h1 { font-size: 2rem; }
}
