:root {
  --ink: #1c1e21;
  --muted: #5b6472;
  --faint: #8a91a0;
  --accent: #2b4a7e;
  --line: #e7e9ee;
  --chip: #f2f4f7;
  --bg: #ffffff;
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

body { padding-top: var(--header-h); }

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

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

.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Layout ---------- */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0 8px;
  scroll-margin-top: calc(var(--header-h) + 8px);
}

#about { padding-top: 72px; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.2;
  margin-bottom: 18px;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 22px;
}

.interests-text {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.quick-links { display: flex; gap: 20px; flex-wrap: wrap; }

.quick-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.quick-links a:hover { border-bottom-color: var(--accent); }

/* ---------- Section headings ---------- */

h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin: 40px 0 18px;
}

h3:first-of-type { margin-top: 0; }

/* ---------- Papers ---------- */

.paper { margin-bottom: 28px; }

.paper-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.4;
}

.paper-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

.status { font-style: italic; }
.journal { font-style: italic; }

.paper-desc {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 6px;
  max-width: 46em;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.paper-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.paper-links a:hover { border-bottom-color: var(--accent); }

/* Expandable abstracts */

.abstract { margin-top: 7px; }

.abstract summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.abstract summary::-webkit-details-marker { display: none; }

.abstract summary::before { content: "+ "; }

.abstract[open] summary::before { content: "− "; }

.abstract summary:hover {
  background: var(--chip);
  border-color: var(--faint);
}

.abstract p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 8px;
  max-width: 46em;
  text-align: justify;
  hyphens: auto;
}

/* ---------- Presentations ---------- */

.pres-year {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pres-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.pres-year p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Teaching ---------- */

.teach-list {
  list-style: none;
  margin-bottom: 8px;
}

.teach-list li {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.course {
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Policy and Media ---------- */

.policy-text {
  margin-bottom: 16px;
  max-width: 46em;
}

.policy-text a {
  color: var(--accent);
  text-decoration: none;
}

.policy-text a:hover { text-decoration: underline; }

/* ---------- Justified prose ---------- */

.lede,
.interests-text,
.paper-desc,
.pres-year p,
.policy-text {
  text-align: justify;
  hyphens: auto;
}

/* ---------- Contact & footer ---------- */

#contact p { margin-bottom: 10px; }

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

#contact { padding-bottom: 48px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--faint);
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about-photo { order: -1; }
  .about-photo img { width: 200px; }
  .pres-year {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    height: auto;
  }
  .site-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 16px;
  }
  .site-nav a { font-size: 0.85rem; }
  h1 { font-size: 1.9rem; }
  .section { padding-top: 48px; }
}
