/* Layout: fixed identity column on the left (sidebar card on desktop), long-form research column on the right; stacks on phones. */
:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --fg: #1d2421;
  --muted: #5b6661;
  --rule: #dfe4e0;
  --accent: #1f6b57;
  --accent-soft: #e3efe9;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131816; --surface: #1a201d; --fg: #e6ebe8; --muted: #9aa6a0;
    --rule: #2b3430; --accent: #6cc3a6; --accent-soft: #1e2f28; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131816; --surface: #1a201d; --fg: #e6ebe8; --muted: #9aa6a0;
  --rule: #2b3430; --accent: #6cc3a6; --accent-soft: #1e2f28; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 64px;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.wrap {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 64px; align-items: start;
}
/* identity column */
aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 88px); display: grid; gap: 22px; }
.portrait {
  width: 100%; max-width: 220px; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 6px; display: block;
}
h1 {
  font-family: var(--display); font-weight: 500; font-size: 2.15rem; line-height: 1.12;
  margin: 0; text-wrap: balance; letter-spacing: -0.01em;
}
.maiden { display: block; font-size: 1.05rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
.role { margin: 0; color: var(--muted); }
.market {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 6px 12px; border-radius: 4px; justify-self: start;
}
.contact { display: grid; gap: 4px; font-size: 0.93rem; margin: 0; padding: 0; list-style: none; }
.contact span { color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--rule); padding-top: 18px; }
nav a {
  color: var(--fg); text-decoration: none; font-size: 0.92rem; padding: 4px 0;
}
nav a:hover { color: var(--accent); }
/* main column */
main { display: grid; gap: 56px; min-width: 0; }
section { display: grid; gap: 18px; scroll-margin-top: 84px; }
h2 {
  font-family: var(--body); font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin: 0;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.lede { font-family: var(--display); font-size: 1.28rem; line-height: 1.5; margin: 0; max-width: 62ch; }
p { margin: 0; max-width: 68ch; }
.fields { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fields li { border: 1px solid var(--rule); border-radius: 4px; padding: 4px 10px; font-size: 0.88rem; background: var(--surface); }
.fields li.primary { border-color: var(--accent); color: var(--accent); }
/* papers */
.paper { display: grid; gap: 10px; }
.paper + .paper { border-top: 1px solid var(--rule); padding-top: 26px; }
.tag { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.paper h3 {
  font-family: var(--display); font-weight: 500; font-size: 1.42rem; line-height: 1.28;
  margin: 0; text-wrap: balance; max-width: 40ch;
}
.paper p { color: var(--fg); font-size: 0.97rem; }
.result {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; font-size: 0.97rem;
  max-width: 64ch; color: var(--fg);
}
.result strong { font-variant-numeric: tabular-nums; }
/* teaching */
.teach { display: grid; gap: 22px; }
.job { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 16px; }
.job .where { font-weight: 600; }
.job .when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job .what { grid-column: 1 / -1; color: var(--muted); font-size: 0.95rem; }
/* links row */
.links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border: 1px solid var(--accent); color: var(--accent); background: var(--surface);
  padding: 9px 16px; border-radius: 4px; font-weight: 500; font-size: 0.93rem;
}
.btn:hover { background: var(--accent-soft); }
.btn.solid { background: var(--accent); color: var(--surface); }
.btn.solid:hover { opacity: 0.9; background: var(--accent); }
footer { color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--rule); padding-top: 18px; }
@media (max-width: 820px) {
  body { padding-block: 0 48px; }
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  aside { position: static; }
  nav { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* teaching page */
.course-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.course-list li {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 16px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
.course-list li:first-child { padding-top: 0; }
.course-list .name { font-family: var(--display); font-size: 1.15rem; }
.course-list .term { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.course-list .lvl { grid-column: 1 / -1; color: var(--muted); font-size: 0.88rem; }
.subhead { display: grid; gap: 2px; }
.subhead strong { font-weight: 600; }
.subhead span { color: var(--muted); font-size: 0.93rem; }
.more { font-weight: 500; }
@media (max-width: 480px) { .course-list li { grid-template-columns: minmax(0,1fr); } }
/* top navigation */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg); border-bottom: 1px solid var(--rule); margin-bottom: 40px;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding-block: 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
}
.topbar .brand { font-family: var(--display); font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.topbar nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; border: 0; padding: 0; }
.topbar nav a { font-weight: 500; }
.topbar nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 820px) { .topbar { margin-bottom: 28px; } .topbar-inner { padding-block: 12px; } }
.desc { color: var(--fg); font-size: 0.97rem; max-width: 66ch; }
.course-list.ta li { padding: 9px 0; }
.refs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.refs li { display: grid; gap: 2px; align-content: start; font-size: 0.93rem; }
.ref-name { font-family: var(--display); font-size: 1.15rem; }
.ref-title { color: var(--muted); }
.refs a { margin-top: 4px; overflow-wrap: anywhere; }
