:root {
  --text: #111827;
  --muted: #4b5563;
  --light: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --soft: #f7f8fa;
  --accent: #0b3c7d;
  --accent-soft: #e8eef7;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8eaee;
    --muted: #b4bac4;
    --light: #8d95a1;
    --border: #2a303a;
    --bg: #111418;
    --soft: #181c22;
    --accent: #8fb8f0;
    --accent-soft: #1c2a3f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }

.menu { display: flex; gap: 22px; font-size: 0.92rem; }
.menu a { color: var(--muted); }
.menu a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 44px;
  align-items: start;
  padding: 56px 0 48px;
}

h1 {
  font-family: var(--serif);
  font-size: 2.9rem;
  line-height: 1.08;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle { margin-top: 10px; font-size: 1.05rem; color: var(--muted); }

.tagline {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--text);
}

.bio { margin: 16px 0 0; color: var(--muted); }

.links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }

.links a {
  padding: 6px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.links a.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.links a.primary:hover { opacity: 0.9; color: var(--bg); }

.photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--soft);
}

.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sections ---------- */
section { padding: 48px 0; border-top: 1px solid var(--border); }

h2 {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0 0 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; margin: 0; }

.lead-sub { margin: 14px 0 0; color: var(--muted); }

.hint { margin: 30px 0 12px; font-size: 0.85rem; color: var(--light); }

/* ---------- Research themes (expandable) ---------- */
.themes { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }

.theme + .theme { border-top: 1px solid var(--border); }

.theme summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 6px 10px;
  align-items: start;
  padding: 18px 20px;
}

.theme summary::-webkit-details-marker { display: none; }
.theme summary:hover { background: var(--soft); }
.theme summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.num { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); font-weight: 600; padding-top: 1px; }

.theme h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.one-line { margin: 4px 0 0; color: var(--muted); font-size: 0.96rem; }

.count { display: inline-block; margin-top: 8px; font-size: 0.8rem; color: var(--light); }

.chev { width: 10px; height: 10px; margin-top: 8px; border-right: 2px solid var(--light); border-bottom: 2px solid var(--light); transform: rotate(45deg); transition: transform 0.15s ease; }
.theme[open] .chev { transform: rotate(-135deg); margin-top: 12px; }
.theme[open] summary { background: var(--soft); }

.theme-body { padding: 4px 20px 20px 64px; background: var(--soft); }
.theme-body p { margin: 0 0 12px; color: var(--muted); font-size: 0.96rem; }

.mini { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 0.94rem; }
.mini li { padding-left: 14px; position: relative; }
.mini li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.venue { color: var(--light); white-space: nowrap; }

/* ---------- Publications ---------- */
.note { margin: -8px 0 20px; font-size: 0.88rem; color: var(--light); }

h3.group { margin: 30px 0 14px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--light); }
h3.group:first-of-type { margin-top: 0; }

.pubs { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }

.pubs li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; }

.where { font-size: 0.84rem; font-weight: 600; color: var(--accent); padding-top: 2px; }

.pub-title { font-weight: 500; color: var(--text); }
.pub-title:hover { color: var(--accent); }

.authors { margin-top: 2px; font-size: 0.92rem; color: var(--muted); }
.authors b { color: var(--text); font-weight: 600; }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  vertical-align: 2px;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 28px 0 44px; font-size: 0.88rem; color: var(--light); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 36px; }
  .hero > div:last-child { order: -1; }
  .photo { max-width: 170px; }
  h1 { font-size: 2.2rem; }
  .tagline, .lead { font-size: 1.15rem; }
  .menu { gap: 16px; }
  section { padding: 36px 0; }
  .theme-body { padding-left: 20px; }
  .pubs li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Publications page ---------- */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: 2.3rem; }
.page-head .note { margin: 12px 0 0; }
section.year { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 20px; padding: 32px 0; }
section.year:first-of-type { border-top: none; }
section.year h2 { margin: 0; font-size: 1.5rem; color: var(--accent); position: sticky; top: 76px; align-self: start; }
.menu a.current { color: var(--text); font-weight: 600; }
section.year .pubs li { grid-template-columns: 76px minmax(0, 1fr); }
@media (max-width: 720px) {
  section.year { grid-template-columns: 1fr; gap: 12px; padding: 26px 0; }
  section.year h2 { position: static; }
  section.year .pubs li { grid-template-columns: 1fr; }
}
