:root {
  --bg: #fff;
  --text: #1a1a1a;
  --muted: #5c6370;
  --faint: #6f757d;
  --accent: #2b62c4;
  --line: rgba(0, 0, 0, 0.09);
  --card: #f4f4f1;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --text: #e8e9eb;
    --muted: #a3aab2;
    --faint: #8a919a;
    --accent: #7eabf0;
    --line: rgba(255, 255, 255, 0.12);
    --card: #1a1d20;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.site-nav {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px 28px; flex-wrap: wrap; padding: 28px 0 8px;
}
.site-nav .brand {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: -0.02em; color: var(--text);
}
.site-nav .brand:hover { color: var(--accent); text-decoration: none; }
.site-nav ul {
  display: flex; gap: 18px; flex-wrap: wrap; list-style: none;
  margin: 0; padding: 0; font-size: 0.92rem;
}
.site-nav ul a { color: var(--muted); }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Hero (About) */
.hero { margin: 40px 0 12px; }
.hero::after { content: ""; display: block; clear: both; }
.hero-photo {
  float: right; width: 300px; height: 400px; max-width: none;
  object-fit: cover; object-position: center top; border-radius: 18px;
  margin: 0 0 20px 36px; shape-outside: inset(0 round 18px);
}
.hero h1 {
  font-family: var(--serif); font-size: 2.15rem; font-weight: 600; line-height: 1.15;
  margin: 0 0 6px; letter-spacing: -0.03em; color: var(--accent);
}
.role { color: var(--muted); margin: 0 0 14px; font-size: 1.02rem; }
.role a { color: var(--text); border-bottom: 1px solid var(--line); }
.role a:hover { text-decoration: none; border-color: var(--accent); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a {
  color: var(--muted); font-size: 0.78rem; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.bio { margin: 22px 0 0; }
.bio p { margin: 0 0 16px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.bio p:last-child { margin-bottom: 0; }
.bio strong { font-weight: 600; }

/* Page headings */
.page-title {
  font-family: var(--serif); font-size: 2rem; font-weight: 600;
  letter-spacing: -0.03em; margin: 28px 0 18px; line-height: 1.2;
}
.kicker { font-family: var(--serif); font-style: italic; color: var(--muted); margin: -8px 0 28px; }
.intro { color: var(--muted); margin: -6px 0 20px; font-size: 0.98rem; }
.label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--faint); font-weight: 600; margin: 40px 0 12px;
}
.year-group { margin: 0 0 40px; }
.year { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 16px; }

/* Papers */
.pub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 32px; }
.pub-tab {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; white-space: nowrap; min-height: 32px;
}
.pub-tab:hover { color: var(--text); border-color: var(--muted); }
.pub-tab[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pub-list { display: flex; flex-direction: column; gap: 12px; }
.pub-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.pub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}
.pub-meta { margin: 0 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.venue, .topic, .pub-link {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem;
  font-weight: 500; border-radius: 999px; padding: 3px 9px;
}
.venue { color: var(--text); background: var(--card); }
.topic { color: var(--muted); border: 1px dashed var(--line); }
.pub-title {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 600; line-height: 1.35;
  margin: 0 0 6px; letter-spacing: -0.02em;
}
.authors { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0 0 10px; }
.authors strong { color: var(--text); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-link { color: var(--muted); border: 1px solid var(--line); }
.pub-link:hover { color: var(--text); border-color: var(--text); text-decoration: none; }
.empty-note { color: var(--muted); font-size: 0.95rem; }

/* Timeline (News, Experience) */
.timeline { position: relative; padding-left: 1.5rem; margin: 0; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 0.28rem; top: 0.45rem; bottom: 0.45rem;
  width: 1px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 1.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.22rem; top: 0.5rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.tl-date { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); margin: 0 0 2px; }
.tl-desc { font-size: 0.95rem; line-height: 1.5; margin: 0; }
.tl-desc strong { font-weight: 600; }
.tl-role { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.35; }
.tl-org { font-size: 0.95rem; margin: 2px 0 4px; color: var(--muted); }
.tl-org a { color: var(--text); border-bottom: 1px solid var(--line); }
.tl-org a:hover { text-decoration: none; border-color: var(--accent); }
.tl-detail { font-size: 0.9rem; color: var(--muted); margin: 0; line-height: 1.5; }
.tl-detail span { color: var(--faint); }

/* Quiet lists (Awards, Service) */
.quiet { list-style: none; margin: 0; padding: 0; }
.quiet li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; line-height: 1.5; }
.quiet li.row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.quiet strong { font-weight: 600; }
.quiet p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.yr { font-family: var(--mono); font-size: 0.8rem; color: var(--faint); padding-top: 2px; }
.dim { color: var(--muted); }

/* Blog cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px;
}
.card h2 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.3; }
.card p { color: var(--muted); font-size: 0.92rem; margin: 0; line-height: 1.5; flex: 1; }
.explore { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin-top: 6px; }

/* Books */
.books { list-style: none; margin: 0; padding: 0; }
.book { padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.book-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; letter-spacing: -0.02em; }
.book-author { font-size: 0.85rem; color: var(--faint); margin-left: 6px; }
.book-alt { font-size: 0.92rem; color: var(--muted); margin: 2px 0 0; }
.book-note { color: var(--muted); font-size: 0.92rem; margin: 6px 0 0; }
.fav { font-family: var(--serif); font-style: italic; font-size: 0.92rem; color: var(--accent); margin-left: 6px; }

/* Photos */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.photo { margin: 0; }
.photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top;
  border-radius: 14px; border: 1px solid var(--line); display: block;
}

/* Footer */
.site-footer {
  margin: 56px 0 40px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 0.85rem; text-align: center;
}

@media (max-width: 720px) {
  .hero-photo { width: 220px; height: 293px; margin: 0 0 16px 20px; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { margin-top: 24px; }
  .hero-photo {
    float: none; display: block; width: min(240px, 72vw); height: auto;
    aspect-ratio: 3 / 4; margin: 0 auto 20px;
  }
  .hero h1 { font-size: 1.85rem; }
  .bio p { text-align: left; }
  .page-title { font-size: 1.75rem; }
  .site-nav { padding-top: 20px; }
  .pub-card { padding: 16px; }
}
