:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1f2b;
  --muted: #5b6577;
  --border: #e3e7ee;
  --accent: #1f5fbf;
  --accent-soft: #e6eefb;
  --work: #1f5fbf;
  --research: #8a3fbf;
  --education: #1d8a5c;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.05);
}
:root[data-theme="dark"] {
  --bg: #0f131a; --surface: #171c25; --text: #e6e9ef; --muted: #9aa4b5; --border: #273040;
  --accent: #6ea3f5; --accent-soft: #1c2a42; --work: #6ea3f5; --research: #c18cf0; --education: #5cc99a;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 600; color: var(--text); }
.nav nav { display: flex; align-items: center; gap: 20px; }
.nav nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav nav a:hover { color: var(--text); }
.theme-btn { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); padding: 6px; cursor: pointer; display: grid; }
.theme-btn:hover { color: var(--text); }

/* Sections */
section { padding: 56px 0 8px; }
h1, h2 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 26px; margin: 0 0 24px; }
h3 { font-size: 17px; margin: 0; line-height: 1.35; }

/* Hero */
.hero { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: center; padding-top: 64px; }
.avatar { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.hero h1 { font-size: 42px; margin: 0; line-height: 1.1; }
.subtitle { color: var(--muted); margin: 6px 0 16px; font-weight: 500; }
.bio p { margin: 0 0 10px; max-width: 62ch; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.keyword { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500; transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-sm { padding: 4px 10px; font-size: 13px; gap: 5px; }

/* Timeline */
.filters { display: flex; gap: 6px; margin: -8px 0 20px; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer;
}
.filters button.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-dot { position: absolute; left: -27px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--c); }
.tl-work { --c: var(--work); } .tl-research { --c: var(--research); } .tl-education { --c: var(--education); }
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.tl-period { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.tl-org { color: var(--muted); font-size: 14px; }
.tl-card p { margin: 6px 0 0; font-size: 15px; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tag-work { --c: var(--work); } .tag-research, .tag-paper { --c: var(--research); } .tag-education, .tag-thesis { --c: var(--education); } .tag-preprint { --c: var(--work); }

.more-btn {
  display: block; margin: 4px 0 0 28px; font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, color .15s;
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }
.more-btn[hidden] { display: none; }

/* Publications */
.pubs { display: grid; gap: 16px; }
.pub { display: grid; grid-template-columns: 240px 1fr; gap: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.pub-img { border-radius: 8px; overflow: hidden; background: var(--bg); aspect-ratio: 400 / 260; }
.pub-img img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.pub-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pub-authors { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { margin: 2px 0 12px; font-size: 14px; font-style: italic; color: var(--muted); }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }

.footer { color: var(--muted); font-size: 13px; padding-top: 48px; padding-bottom: 40px; text-align: center; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 20px; text-align: center; padding-top: 40px; }
  .avatar { width: 150px; height: 150px; margin: 0 auto; }
  .hero h1 { font-size: 34px; }
  .bio p { margin-left: auto; margin-right: auto; }
  .links, .keywords { justify-content: center; }
  .pub { grid-template-columns: 1fr; }
  .nav nav { gap: 12px; }
  .nav nav a:not(:hover) { font-size: 13px; }
  .brand { font-size: 15px; }
}
@media (max-width: 420px) { .brand { display: none; } }
