:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5c6470;
  --rule: #e4e1da;
  --accent: #1d3f6e;
  --accent-soft: #e8eef6;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --text: #e6e4df;
    --muted: #9aa1ab;
    --rule: #2e3238;
    --accent: #8fb3e6;
    --accent-soft: #1f2a3a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.1rem; margin: 2.2rem 0 1.2rem; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 .9rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
h3 { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .6rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 18px; padding-bottom: 14px; }
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.brand-name { font-size: 1.35rem; font-weight: 600; }
.brand-role { font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--sans); font-size: .9rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Home */
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; margin-top: 2.6rem; }
.hero h1 { margin-top: 0; }
.portrait { width: 220px; height: auto; border-radius: 4px; display: block; background: var(--rule); }
.lede { font-size: 1.12rem; }
.button {
  display: inline-block; font-family: var(--sans); font-size: .88rem; font-weight: 500;
  background: var(--accent); color: var(--bg); text-decoration: none;
  padding: 9px 18px; border-radius: 4px;
}
.button:hover { opacity: .9; }

/* Publication lists */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.pubs li:last-child { border-bottom: 0; }
.ext {
  font-family: var(--sans); font-size: .72rem; font-weight: 500; letter-spacing: .03em;
  background: var(--accent-soft); padding: 2px 7px; border-radius: 3px; text-decoration: none; white-space: nowrap;
}
.jump { font-family: var(--sans); font-size: .88rem; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 280px; gap: 40px; }
.side h2 { margin-top: 0; }
.edu { margin: 0; }
.edu dt { font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--accent); margin-top: 1rem; }
.edu dd { margin: .1rem 0 0; font-size: .97rem; }
.interests { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }

/* Teaching */
.dept { color: var(--muted); margin: -.4rem 0 .8rem; }
.courses { width: 100%; border-collapse: collapse; font-size: .98rem; }
.courses td { padding: .5rem .6rem .5rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.courses .code { font-family: var(--sans); font-size: .82rem; font-weight: 600; white-space: nowrap; width: 8.5rem; }
.courses .terms { color: var(--muted); text-align: right; white-space: nowrap; }

/* Contact */
.contact-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 24px; max-width: 520px; }

/* Footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; padding-top: 18px; padding-bottom: 28px; }

/* Phones */
@media (max-width: 720px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.7rem; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .portrait { width: 160px; }
  .about-grid, .interests { grid-template-columns: 1fr; gap: 0; }
  .side h2 { margin-top: 2.4rem; }
  .courses .terms { white-space: normal; text-align: left; display: block; padding-top: 0; }
  .courses td { display: block; border-bottom: 0; padding: 0; }
  .courses tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
  .courses .code { width: auto; }
}
