:root {
  color-scheme: light;
  --bg: #fbfbf9;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #5a616b;
  --faint: #8a919b;
  --border: #e3e4e0;
  --accent: #0b4f8f;
  --accent-soft: #e7eff8;
  --shell: 1040px;
  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  --mono: "Geist Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0f12; --surface: #14171b; --ink: #eceef0; --muted: #a6adb7; --faint: #7b838e;
    --border: #262a30; --accent: #7db8f0; --accent-soft: #16263a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12; --surface: #14171b; --ink: #eceef0; --muted: #a6adb7; --faint: #7b838e;
  --border: #262a30; --accent: #7db8f0; --accent-soft: #16263a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.shell { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }
.u { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.u:hover { color: var(--accent); text-decoration-color: var(--accent); }
.mono { font-family: var(--mono); font-size: 0.82em; letter-spacing: -0.01em; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .shell { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.theme-toggle {
  margin-left: 6px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }

/* hero */
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 300; }
.hero h1 b { font-weight: 700; }
.hero .role { margin: 18px 0 0; font-size: 18px; color: var(--ink); }
.hero .topics { margin: 18px 0 0; font-size: 18px; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink); transition: border-color .15s, color .15s, background .15s;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.portrait { margin: 0; width: 200px; }
.portrait img { display: block; width: 200px; height: 250px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }

/* sections: heading on the left, content on the right */
.section { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 32px; padding: 44px 0; border-top: 1px solid var(--border); }
.section > h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); position: sticky; top: 84px; align-self: start; }
.section p { margin: 0 0 14px; }
.section p:last-child { margin-bottom: 0; }
.about p { font-size: 17px; }
.about b { font-weight: 600; }
h3 { margin: 30px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
h3:first-child { margin-top: 0; }

/* research cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; }
.card h4 { margin: 0 0 8px; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.card h4 .past { font-weight: 400; font-size: 13.5px; color: var(--faint); white-space: nowrap; }
.card p { margin: 0 0 14px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.card .tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
a.tag:hover { background: var(--accent); color: var(--bg); }

/* publications */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.filters button {
  font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pub { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.pub:first-of-type { border-top: 0; padding-top: 0; }
.pub .venue { font-family: var(--mono); font-size: 12.5px; color: var(--accent); line-height: 1.5; padding-top: 2px; }
.pub .venue span { display: block; color: var(--faint); }
.pub .title { font-weight: 600; line-height: 1.38; letter-spacing: -0.005em; }
.pub .authors { margin-top: 3px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.pub .authors .me { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pub .meta { margin-top: 4px; font-size: 13.5px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.pub .meta i { font-style: italic; }
.pub .meta .hl { color: var(--ink); font-weight: 600; }
.pub .meta a { color: var(--accent); font-weight: 500; }
.pub .meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: 13px; color: var(--faint); margin: 0 0 14px; }
[hidden] { display: none !important; }

/* rows: education, experience, awards, talks */
.rows { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; }
.row .when { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.row .what b { font-weight: 600; }
.row .what small { display: block; font-size: 14px; color: var(--muted); }
.row .where { font-size: 14px; color: var(--muted); white-space: nowrap; text-align: right; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 48px; color: var(--faint); font-size: 13.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .nav a { display: none; }
  .nav a.keep { display: inline-block; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 28px; }
  .portrait { order: -1; width: 120px; }
  .portrait img { width: 120px; height: 150px; }
  .section { grid-template-columns: 1fr; gap: 16px; padding: 34px 0; }
  .section > h2 { position: static; }
  .cards { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .pub .venue span { display: inline; margin-left: 8px; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .row .where { text-align: left; white-space: normal; }
}
@media print { .site-header, .filters, .theme-toggle { display: none; } }
