/* ---------- tokens ---------- */
:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #676767;
  --faint: #9a9a9a;
  --line: #e7e6e3;
  --accent: #1f5fbf;
  --accent-soft: #e8f0fb;
  --award: #9a5b00;
  --award-soft: #fff3df;
  --status: #4f5b6b;
  --status-soft: #eef1f5;
  --badge: #1c1c1c;
  --badge-text: #ffffff;
  --radius: 8px;
  --measure: 760px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --surface: #171a1e;
    --text: #e8e8e6;
    --muted: #a3a3a0;
    --faint: #6f6f6c;
    --line: #262a30;
    --accent: #7fb3ff;
    --accent-soft: #17273d;
    --award: #ffc76b;
    --award-soft: #33270f;
    --status: #b3bcc9;
    --status-soft: #1f252d;
    --badge: #e8e8e6;
    --badge-text: #101214;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin: 0.35em 0; }
img { max-width: 100%; }

.page { max-width: var(--measure); margin: 0 auto; padding: 40px 24px 64px; }

/* ---------- masthead ---------- */
.masthead { display: flex; gap: 28px; align-items: center; margin-bottom: 20px; }
.avatar {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--line);
}
.masthead h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; line-height: 1.2; }
.tagline { margin: 0 0 2px; color: var(--muted); font-size: 16px; }
.tagline a { color: inherit; }
.email { margin: 0 0 12px; font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text); background: var(--surface);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.links i { font-size: 14px; }

/* ---------- section nav ---------- */
.sectionnav {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 10px 0; margin: 0 0 8px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
}
.sectionnav a {
  padding: 4px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.sectionnav a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ---------- sections ---------- */
.content h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 44px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.content h2:first-child { margin-top: 28px; }
.content h4 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }

/* news */
#news + ul { list-style: none; padding: 0; }
#news + ul li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; margin: 0.5em 0; }
#news + ul li strong { font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--faint); padding-top: 3px; }

/* ---------- publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub {
  display: grid; grid-template-columns: 168px 1fr; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.pub-thumb { position: relative; }
.pub-thumb img, .pub-thumb .placeholder {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: block;
}
.pub-thumb .badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 5px; background: var(--badge); color: var(--badge-text);
}
.pub-title { font-weight: 600; font-size: 16.5px; line-height: 1.35; margin: 0 0 4px; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font-size: 15px; margin: 0 0 2px; }
.pub-authors strong { font-weight: 600; }
.pub-venue { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.pub-summary { font-size: 14.5px; color: var(--text); margin: 0 0 8px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pub-links a {
  font-size: 12.5px; font-weight: 500; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface);
}
.pub-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.pill-award { background: var(--award-soft); color: var(--award); }
.pill-status { background: var(--status-soft); color: var(--status); }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--faint);
}
.footer a { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .page { padding: 28px 18px 48px; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 16px; }
  .avatar { width: 108px; height: 108px; }
  .masthead h1 { font-size: 26px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .pub-thumb { max-width: 320px; }
  #news + ul li { grid-template-columns: 1fr; gap: 2px; }
}
