:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1d2329;
  --muted: #5b6670;
  --border: #e3e6ea;
  --accent: #00618a;
  --accent-soft: #e6f1f6;
  --badge-bg: #00618a;
  --badge-text: #ffffff;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181c;
    --surface: #1c2227;
    --text: #e4e8ec;
    --muted: #9aa5b0;
    --border: #2c343b;
    --accent: #5fb4dc;
    --accent-soft: #1d3340;
    --badge-bg: #2a5d77;
    --badge-text: #eaf6fc;
  }
}
:root[data-theme="dark"] {
  --bg: #14181c;
  --surface: #1c2227;
  --text: #e4e8ec;
  --muted: #9aa5b0;
  --border: #2c343b;
  --accent: #5fb4dc;
  --accent-soft: #1d3340;
  --badge-bg: #2a5d77;
  --badge-text: #eaf6fc;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
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; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.site-title:hover { text-decoration: none; }
.site-nav { display: flex; gap: 22px; font-size: 0.95rem; }
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 600; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 16px 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
}
.layout.single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }

.profile { position: sticky; top: 96px; align-self: start; }
.profile-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 58% 25%;
  border-radius: 10px;
  display: block;
}
.profile h1 {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 20px 0 6px;
}
.profile .role { margin: 0; color: var(--text); font-weight: 500; }
.profile .affil { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.93rem;
}
.contact-list a:hover { color: var(--accent); text-decoration: none; }
.contact-list svg { width: 18px; height: 18px; fill: currentColor; color: var(--muted); flex-shrink: 0; }
.contact-list a:hover svg { color: var(--accent); }

/* ---------- Content ---------- */
main section { margin-bottom: 48px; }
main section:last-child { margin-bottom: 0; }
h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 26px 0 10px;
}
h2 + h3 { margin-top: 4px; }
p { margin: 0 0 14px; }
.page-title {
  font-family: var(--serif);
  font-size: 2.1rem;
  margin: 0 0 8px;
}
.page-sub { color: var(--muted); margin-bottom: 36px; }

/* service list */
.role-list { list-style: none; padding: 0; margin: 0; }
.role-list li { padding: 5px 0; }
.role-list .label { font-weight: 600; }

/* timeline (experience / education) */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; margin-bottom: 22px; }
.entry:last-child { margin-bottom: 0; }
.entry .org { font-weight: 600; }
.entry .pos { color: var(--text); }
.entry .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; text-align: right; }
.entry .detail { grid-column: 1 / -1; color: var(--muted); font-size: 0.95rem; }
.entry .detail ul { margin: 4px 0 0; padding-left: 18px; }
.entry .detail p { margin: 2px 0; }

/* publications */
.pub-year {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--muted);
  margin: 30px 0 12px;
}
.pub-year:first-of-type { margin-top: 0; }
.pub {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
}
.pub + .pub { border-top: 1px dashed var(--border); }
.venue {
  display: inline-block;
  align-self: start;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.5;
  white-space: nowrap;
}
.pub-title { font-weight: 600; line-height: 1.4; margin-bottom: 3px; }
.pub-authors { font-size: 0.93rem; }
.pub-authors .me { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pub-venue { font-size: 0.93rem; color: var(--muted); font-style: italic; }
.pub-note { font-size: 0.85rem; color: var(--muted); }
.tba { font-style: normal; font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-left: 4px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 9px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
}
.pub-links a:hover { background: var(--accent-soft); text-decoration: none; }
.award { font-size: 0.88rem; margin-top: 4px; }

/* awards */
.award-list { list-style: none; padding: 0; margin: 0; }
.award-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 6px 0; }
.award-list .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.more-link { margin-top: 18px; font-weight: 500; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: 20px 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 28px; }
  .profile {
    position: static;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 4px 20px;
    align-items: start;
  }
  .profile-photo { grid-row: 1 / span 4; aspect-ratio: 1; border-radius: 50%; }
  .profile h1 { margin-top: 4px; font-size: 1.5rem; }
  .contact-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
}
@media (max-width: 560px) {
  .site-nav { gap: 14px; font-size: 0.9rem; }
  .site-title { font-size: 1.05rem; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .venue { justify-self: start; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry .when { text-align: left; }
  .award-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .profile { grid-template-columns: 88px minmax(0, 1fr); }
}
