:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --muted: #7a7a72;
  --rule: #e5e2d8;
  --accent: #7a1f1f;
  --accent-soft: #a34a4a;

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --w-main: 960px;
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* NAV */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.topnav .brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.topnav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.topnav a {
  color: var(--ink);
  text-decoration: none;
}
.topnav a:hover,
.topnav a[aria-current="page"] { color: var(--accent); }

/* MAIN */
main {
  max-width: var(--w-main);
  margin: 0 auto;
  padding: var(--s-4) 1.5rem var(--s-5);
}

/* INTRO */
.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  align-items: start;
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.intro h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.intro .affiliation {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 var(--s-2);
}
.intro-text p {
  margin: 0 0 var(--s-2);
}
.intro .contact {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.intro .contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
.intro .contact a:hover {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-soft);
}
.headshot {
  width: 200px;
  height: auto;
  border-radius: 2px;
  border: 1px solid var(--rule);
  display: block;
  background: var(--surface);
}

/* SECTIONS */
section { margin-bottom: var(--s-5); }
section h2 {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 var(--s-3);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
section p {
  margin: 0 0 var(--s-2);
}
section p + p { margin-top: var(--s-2); }

/* BANNER — full-width photo strip under the nav */
.banner {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 38%;
}

/* SUBSECTION LABEL — small caps label with a rule running to the right */
.subsection-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-3);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.subsection-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
section h2 + .subsection-label { margin-top: 0; }

/* PAPER */
.paper {
  padding: var(--s-2) 0;
  border-top: 1px solid var(--rule);
}
.subsection-label + .paper { border-top: none; padding-top: 0; }
.paper-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}
.paper-body h3 + .meta { margin-top: 0.3rem; }
.paper-body .meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
.paper-body .abstract {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0 0 var(--s-2);
}

/* TEACHING — one row per course: course · institution · years */
.teaching-note {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 var(--s-1);
}
.teaching {
  list-style: none;
  padding: 0;
  margin: 0;
}
.teaching li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-1) 0;
  border-bottom: 1px solid var(--rule);
}
.teaching li:last-child { border-bottom: none; }
.teaching .course { font-size: 1.1rem; }
.teaching .where,
.teaching .when {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}
.teaching .when { min-width: 5.5rem; text-align: right; }

/* FOOTER */
footer {
  max-width: var(--w-main);
  margin: 0 auto;
  padding: var(--s-3) 1.5rem var(--s-4);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}
footer p { margin: 0; }

/* RESPONSIVE */
@media (max-width: 720px) {
  body { font-size: 18px; }
  main { padding-top: var(--s-4); }
  .intro {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }
  .intro h1 { font-size: 2rem; }
  .headshot { width: 150px; }
  .banner { height: 150px; }
  .teaching li { grid-template-columns: 1fr auto; gap: 0 var(--s-2); }
  .teaching .where { grid-row: 2; }
  .topnav {
    padding: 0.7rem 1rem;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }
  .topnav ul { gap: 1rem; flex-wrap: wrap; }
  .topnav .brand { font-size: 0.98rem; }
}
