:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5d6270;
  --faint: #8b909c;
  --line: #e7e4dc;
  --accent: #1f5fbf;
  --accent-soft: #e8effa;
  --shadow: 0 1px 2px rgba(20, 22, 30, .04), 0 8px 24px rgba(20, 22, 30, .06);
  --radius: 14px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #181b21;
    --ink: #e8e9ec;
    --muted: #a6abb6;
    --faint: #7c818c;
    --line: #262a32;
    --accent: #7fb0ff;
    --accent-soft: #1b2738;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* Top navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.nav .brand { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.nav ul a { color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.nav ul a:hover { color: var(--ink); text-decoration: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: center; padding: 64px 0 48px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 6px; }
.hero .role { color: var(--muted); font-size: 1.05rem; margin: 0 0 20px; }
.hero p { margin: 0 0 14px; }
.hero .photo { width: 220px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; padding: 0; list-style: none; }
.tags li { background: var(--accent-soft); color: var(--accent); font-size: .82rem; font-weight: 500; padding: 4px 12px; border-radius: 999px; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: .87rem; font-weight: 500;
  transition: border-color .15s, color .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

/* Sections */
section { padding: 40px 0; border-top: 1px solid var(--line); }
section > h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: -.005em;
  margin: 0 0 8px;
}
section > .lede { color: var(--muted); margin: 0 0 28px; max-width: 680px; }

.areas { list-style: none; margin: -12px 0 28px; padding: 0; max-width: 680px; color: var(--muted); }
.areas li { padding: 8px 0 8px 16px; border-left: 2px solid var(--accent-soft); margin-bottom: 8px; }
.areas strong { color: var(--ink); font-weight: 600; }

/* Talk */
.talk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.talk .video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.talk iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.talk .meta { padding: 16px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.talk h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.talk .where { color: var(--muted); font-size: .92rem; }

/* Papers */
.paper {
  display: grid; grid-template-columns: 180px 1fr; gap: 28px;
  padding: 24px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow .2s, border-color .2s;
}
.paper:hover { box-shadow: var(--shadow); }
.paper .thumb { width: 180px; height: 150px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.paper .thumb img { width: 100%; height: 100%; object-fit: contain; }
.paper h3 { font-size: 1.08rem; line-height: 1.4; margin: 0 0 6px; font-weight: 600; }
.paper h3 a { color: var(--ink); }
.paper h3 a:hover { color: var(--accent); }
.paper .authors { color: var(--muted); font-size: .93rem; margin: 0; }
.paper .authors strong { color: var(--ink); font-weight: 600; }
.paper .venue { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; font-size: .88rem; }
.badge { font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.paper .venue em { color: var(--muted); }
.paper p { margin: 0 0 10px; font-size: .95rem; }
.paper .plinks { display: flex; gap: 14px; font-size: .88rem; font-weight: 500; margin-top: 4px; }
.paper.featured { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* Experience */
.job { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.job h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 2px; }
.job .org { margin: 0; color: var(--muted); font-size: .95rem; }
.job .when { color: var(--faint); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.job .desc { flex-basis: 100%; margin: 6px 0 0; font-size: .94rem; }

/* Lists */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card h3 { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding: 8px 0; border-top: 1px solid var(--line); font-size: .94rem; }
.card li:first-child { border-top: 0; padding-top: 0; }
.card .code { display: block; font-size: .78rem; font-weight: 600; color: var(--accent); letter-spacing: .02em; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--faint); font-size: .82rem; }
footer a { color: var(--muted); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav .brand { display: none; }
  .nav ul { gap: 18px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 32px; }
  .hero .photo { order: -1; width: 140px; border-radius: 50%; aspect-ratio: 1; object-position: 50% 20%; }
  .hero h1 { font-size: 2rem; }
  .paper { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .paper .thumb { width: 100%; height: 180px; }
  .grid2 { grid-template-columns: 1fr; }
}
