:root {
  --bg: #f7f5f0;          /* warm paper white */
  --text: #22252a;
  --muted: #5d6168;
  --faint: #8b8e93;
  --rule: #e4e0d7;
  --accent: #3b2159;      /* deep UCL purple */
  --accent-soft: #ece6f2;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-name {
  font-family: var(--serif); font-weight: 600; font-size: 21px;
  color: var(--text); letter-spacing: 0.005em;
}
.site-name:hover { text-decoration: none; }
nav { display: flex; gap: 30px; font-family: var(--sans); font-size: 15.5px; }
nav a { color: var(--muted); padding: 4px 0; }
nav a:hover { color: var(--text); text-decoration: none; }
nav a.active { color: var(--text); box-shadow: inset 0 -1.5px 0 var(--accent); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 64px;
  padding-top: 48px;
  min-height: calc(100vh - 140px);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 112px; align-self: start;
  font-family: var(--sans);
}
.portrait {
  display: block; width: 100%; height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(59,33,89,.08);
}
.sb-name {
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  margin: 20px 0 4px;
}
.sb-role { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.sb-role em { color: var(--text); }
.sb-logo { display: block; width: 120px; margin: 28px 0 0; opacity: .92; }
.sb-logo:hover { opacity: 1; }
.sb-logo img { display: block; width: 100%; height: auto; }
.sb-links {
  list-style: none; padding: 18px 0 0; margin: 18px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}
.sb-links li { display: flex; align-items: center; gap: 10px; padding: 4px 0; color: var(--muted); }
.sb-links li.sb-addr { align-items: flex-start; line-height: 1.45; }
.sb-links li.sb-addr svg { margin-top: 2px; }
.sb-links svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.sb-links a { color: var(--text); }
.sb-links a:hover { color: var(--accent); }

/* ---------- Main content ---------- */
main { max-width: 700px; padding-bottom: 40px; }
section { margin-bottom: 52px; }

h2 {
  font-family: var(--sans); font-weight: 600; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  margin: 0 0 20px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
h3 { font-weight: 600; font-size: 18px; line-height: 1.4; margin: 0; }

.page-title { font-weight: 600; font-size: 34px; line-height: 1.2; margin: 4px 0 10px; }
.page-intro { color: var(--muted); margin: 0 0 44px; }
.page-title + section { margin-top: 32px; }

/* Home */
.kicker {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  margin: 4px 0 14px;
}
.lead-text {
  font-size: 21px; line-height: 1.45; margin: 4px 0 26px; padding-bottom: 24px;
  letter-spacing: -0.005em; position: relative;
}
.lead-text::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 36px; height: 2px; background: var(--accent);
}
.lead p:not(.lead-text):not(.kicker) { margin: 0 0 16px; color: #33373d; }

.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.themes h3 { font-size: 17px; margin-bottom: 6px; }
.themes h3::before {
  content: ""; display: block; width: 22px; height: 2px;
  background: var(--accent); margin-bottom: 12px;
}
.themes p { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--muted); }
.more { margin: 22px 0 0; font-family: var(--sans); font-size: 15px; }

.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px;
  padding: 4px 0; font-family: var(--sans); font-size: 15.5px; line-height: 1.55; color: var(--text);
}
.news .date { color: var(--faint); font-variant-numeric: tabular-nums; }

/* Education */
.edu { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); }
.edu h4 {
  font-family: var(--sans); font-weight: 600; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  margin: 0 0 12px;
}
.edu ul { list-style: none; padding: 0; margin: 0; }
.edu li {
  display: grid; grid-template-columns: 56px 1fr; gap: 8px;
  padding: 3px 0; font-family: var(--sans); font-size: 16.5px; line-height: 1.5; color: var(--text);
}
.edu .deg { color: var(--faint); }

/* Research */
.awards { list-style: none; padding: 0; margin: 0; }
.awards li {
  display: grid; grid-template-columns: 60px 1fr; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--text);
}
.awards li:last-child { border-bottom: 0; }
.awards .date { color: var(--accent); font-weight: 600; font-size: 14.5px; padding-top: 1px; font-variant-numeric: tabular-nums; }

.paper {
  position: relative;
  padding: 22px 0 22px 22px;
  border-left: 2px solid var(--rule);
  transition: border-color .2s ease;
}
.paper + .paper { margin-top: 6px; }
.paper:hover { border-left-color: var(--accent); }
.paper-topic {
  margin: 0 0 6px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent);
}
.paper h3 {
  font-family: var(--sans); font-weight: 600; font-size: 17px; line-height: 1.45;
  letter-spacing: -0.003em; color: var(--text);
}
.authors { margin: 6px 0 0; font-family: var(--sans); font-size: 15.5px; color: var(--muted); }
.honor {
  margin: 4px 0 0; font-family: var(--sans); font-size: 14.5px; color: var(--muted);
  display: flex; gap: 8px; align-items: baseline;
}
.honor::before { content: "✦"; font-size: 10px; color: var(--accent); transform: translateY(-1px); }

details { margin-top: 12px; }
summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--accent);
  cursor: pointer; list-style: none; user-select: none;
  padding: 3px 12px; border: 1px solid #d9d1e2; border-radius: 999px;
  transition: background .15s ease;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 16px; line-height: 1; }
details[open] summary::after { content: "−"; }
summary:hover { background: var(--accent-soft); }
.abstract {
  margin-top: 14px; padding: 16px 20px;
  background: #fbfaf7; border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--sans); font-size: 15.5px; line-height: 1.65; color: #3a3d42;
}
.abstract p { margin: 0; }

.pubs { margin: 0; padding-left: 0; list-style: none; counter-reset: pub; }
.pubs li {
  counter-increment: pub; position: relative;
  padding: 10px 0 10px 34px; border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 15.5px; line-height: 1.55; color: var(--muted);
}
.pubs li:last-child { border-bottom: 0; }
.pubs li::before {
  content: counter(pub); position: absolute; left: 0; top: 10px;
  font-size: 13.5px; color: var(--faint); font-variant-numeric: tabular-nums;
}
.pubs em { color: var(--text); }

/* Teaching */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 8px 0 48px;
}
.stats > div { padding: 14px 18px 12px; }
.stats > div + div { border-left: 1px solid var(--rule); }
.stats > div:first-child { padding-left: 0; }
.stat-num {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.2;
  color: var(--text); font-variant-numeric: lining-nums;
}
.stat-num span { font-size: 14px; font-weight: 400; color: var(--faint); margin-left: 2px; }
.stat-num.stat-word { font-size: 13px; line-height: 26px; color: var(--accent); }
.stat-label { margin: 4px 0 0; font-family: var(--sans); font-size: 13.5px; line-height: 1.45; color: var(--muted); }

.course { padding: 4px 0 0; }
.course-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.course-head h3 { font-size: 21px; }
.code {
  flex: none; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 8px; background: #fbfaf7;
}
.course-meta { margin: 4px 0 0; font-family: var(--sans); font-size: 15px; color: var(--muted); }
.rate strong { color: var(--accent); font-weight: 600; font-size: 15.5px; }
.course-more { margin-top: 10px; }
.course-desc { margin: 12px 0 0; padding-left: 14px; border-left: 2px solid var(--rule); font-size: 16px; color: #33373d; }
.course-honor {
  margin: 8px 0 0; font-family: var(--sans); font-size: 15px; color: var(--text);
  display: flex; gap: 8px; align-items: baseline;
}
.course-honor::before { content: "✦"; font-size: 10px; color: var(--accent); }
.topics-label {
  margin: 18px 0 8px; font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint);
}
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--sans); font-size: 14px; color: var(--text);
  background: #fbfaf7; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 12px;
}
.terms { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.terms li {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 2px 9px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 20px; padding-bottom: 36px;
  font-family: var(--sans); font-size: 13.5px; color: var(--faint);
}
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .shell { padding: 0 20px; }
  .header-inner { height: 56px; }
  .site-name { font-size: 19px; }
  nav { gap: 16px; font-size: 14.5px; }
  .layout { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .sidebar {
    position: static;
    display: grid; grid-template-columns: 110px 1fr; column-gap: 20px;
    padding-bottom: 28px; border-bottom: 1px solid var(--rule);
  }
  .sb-name { margin-top: 0; }
  .sb-links { grid-column: 1 / -1; }
  .portrait { grid-row: span 2; }
  .sb-logo { grid-column: 1 / -1; width: 110px; }
  .themes { grid-template-columns: 1fr; gap: 20px; }
  .edu li { grid-template-columns: 44px 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { padding: 16px 0; }
  .stats > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .course-head { flex-direction: column; gap: 4px; }
  .lead-text { font-size: 19px; }
}
