:root {
  --text: #22201c;
  --muted: #5e5a52;
  --accent: #1f3f73;
  --border: #e6e0d4;
  --bg: #faf8f4;
  --soft: #f1ece2;
  --chip: #fffdf9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #ebe6dc;
    --muted: #a9a294;
    --accent: #8fb3ef;
    --border: #36322b;
    --bg: #1a1815;
    --soft: #24211c;
    --chip: #24211c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.93rem; margin: 4px 0; }

/* Nav */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 700; color: var(--text); }
.nav-links a { margin-left: 18px; font-size: 0.92rem; color: var(--muted); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* Bio */
.bio { display: flex; gap: 36px; align-items: flex-start; padding-top: 48px; }
.bio-photo img {
  width: 190px; height: 190px; object-fit: cover;
  border-radius: 50%; border: 1px solid var(--border);
}
.bio-text { flex: 1; min-width: 0; }
.bio-text h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
.subtitle { margin: 6px 0 14px; color: var(--muted); }
.bio-text p { margin: 0 0 12px; }
.links { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.9rem; color: var(--text);
}
.links svg { width: 16px; height: 16px; flex: none; }
.links a.icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.links a.icon svg { width: 18px; height: 18px; }
.links a { background: var(--chip); }
.links a.scholar { color: #4285F4; }
.links a.github { color: var(--text); }
.links a.linkedin { color: #0A66C2; }
.links a.cv svg { color: var(--accent); }
.links a.scholar:hover { color: #4285F4; }
.links a.linkedin:hover { color: #0A66C2; }
.links a.github:hover { color: var(--text); }
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Sections */
section { padding-top: 36px; }
h2 {
  font-size: 1.35rem; margin: 0 0 14px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
h3 { font-size: 1rem; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.note { margin: -6px 0 0; font-size: 0.85rem; color: var(--muted); }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: flex; align-items: baseline; gap: 14px; padding: 4px 0; }
.news .date { flex: 0 0 9ch; color: var(--muted); font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; white-space: nowrap; }

/* Publications */
.pub { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.pub:last-child { border-bottom: none; }
.pub-venue {
  flex: 0 0 104px; align-self: flex-start; text-align: center;
  background: var(--soft); border-radius: 6px; padding: 6px 4px;
  font-size: 0.82rem; font-weight: 600; color: var(--accent); line-height: 1.3;
}
.pub-venue span { font-weight: 400; color: var(--muted); }
.pub-title { font-weight: 600; }
.pub-authors, .pub-meta { font-size: 0.93rem; }
.pub-meta { color: var(--muted); font-style: italic; }
.pub-note { font-size: 0.82rem; color: var(--muted); }
.pub-authors sup { color: var(--accent); font-weight: 700; }
.pub-links { margin-top: 4px; }
.pub-links a {
  font-size: 0.8rem; margin-right: 8px; padding: 1px 9px;
  border: 1px solid var(--accent); border-radius: 4px;
}

/* Entries */
.entry { margin-bottom: 18px; }
.entry-head { display: flex; justify-content: space-between; gap: 16px; }
.when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.entry ul { margin: 6px 0; padding-left: 20px; }
.entry li { margin: 2px 0; font-size: 0.95rem; }
.tags span {
  display: inline-block; font-size: 0.75rem; margin: 2px 6px 0 0; padding: 1px 8px;
  background: var(--soft); border-radius: 999px; color: var(--muted);
}

/* Awards */
.awards { list-style: none; padding: 0; margin: 0; }
.awards li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; display: block; }

footer { margin-top: 48px; padding: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; text-align: center; }

/* Mobile */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .bio { flex-direction: column; align-items: center; text-align: center; padding-top: 28px; }
  .bio-text { width: 100%; }
  .bio-text p { text-align: left; }
  .bio-text p.subtitle { text-align: center; }
  .links { justify-content: center; }
  .bio-photo img { width: 150px; height: 150px; }
  .entry-head, .awards li { flex-direction: column; gap: 0; }
  .news li { flex-direction: column; gap: 0; }
  .pub { flex-direction: column; gap: 6px; }
  .pub-venue { align-self: flex-start; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
