:root {
  color-scheme: light;
  --page: #f7f8fa;
  --surface: #fff;
  --ink: #222830;
  --muted: #535d69;
  --rule: #dce2e9;
  --accent: #245886;
  --tint: #edf3f9;
  --display: Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font: 1rem/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
h1, h2, h3, p { margin: 0; }
.page-header {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.masthead-inner, .layout, footer { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.5rem; padding: .92rem 0; }
.wordmark { font: 700 1.18rem var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: .25rem 1.45rem; font-size: .875rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); text-decoration: underline; }

.layout { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.25rem); align-items: start; padding: 2.7rem 0 3.5rem; }
.profile { position: sticky; top: 5.75rem; }
.portrait { display: block; width: 9.5rem; height: 10.5rem; object-fit: cover; object-position: center 38%; border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 1.15rem; }
h1 { font: 700 2.05rem/1.08 var(--display); letter-spacing: -.042em; }
.affiliation, .location { color: var(--muted); font-size: .875rem; }
.affiliation { display: grid; gap: .2rem; margin-top: .65rem; }
.location { margin-top: .4rem; }
.profile-line { display: flex; align-items: flex-start; gap: .5rem; }
.profile-line > svg, .cv > svg { width: 1rem; height: 1rem; flex: none; color: var(--accent); }
.profile-line > svg { margin-top: .18rem; }
.cv { display: inline-flex; gap: .4rem; align-items: center; margin-top: 1rem; padding: .42rem .55rem; border: 1px solid #c9d7e5; border-radius: 6px; background: var(--tint); text-decoration: none; font-size: .875rem; font-weight: 600; }
.cv span { color: var(--muted); font-size: .8rem; font-weight: 400; }
.profile-links { list-style: none; padding: .9rem 0 0; margin: .9rem 0 0; border-top: 1px solid var(--rule); display: grid; gap: .3rem; font-size: .875rem; }
.profile-links a { text-decoration: none; }
.profile-links a:hover { text-decoration: underline; }

main { min-width: 0; }
section { scroll-margin-top: 5rem; }
section + section { margin-top: 2.4rem; }
.intro-label { font-weight: 650; font-size: .875rem; letter-spacing: .012em; color: var(--accent); margin-bottom: .58rem; }
.bio + .bio { margin-top: .65rem; }
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 1.15rem; }
.topic { padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: 9px; background: var(--surface); }
.topic h2 { font: 700 1.09rem/1.3 var(--display); }
.topic p { font-size: .875rem; color: var(--muted); margin-top: .25rem; }
.section-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 1rem; }
main > section > h2, .section-header h2 { font: 700 1.5rem/1.25 var(--display); letter-spacing: -.02em; }
.section-header, #education > h2, #internships > h2 { border-bottom: 1px solid var(--rule); padding-bottom: .65rem; margin-bottom: .95rem; }
.section-note { color: var(--muted); font-size: .8rem; }

.papers { display: grid; gap: .85rem; }
.paper { padding: 1.05rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); box-shadow: 0 2px 5px #22364a08; }
.with-media { display: grid; grid-template-columns: minmax(0, .67fr) minmax(0, 1fr); align-items: center; gap: 1.1rem; }
.paper-media { background: var(--page); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; display: grid; place-items: center; min-height: 8rem; }
.paper-media:hover { border-color: var(--accent); }
.paper-media img { display: block; width: 100%; height: auto; max-height: 13rem; object-fit: contain; }
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; margin-bottom: .38rem; font-size: .8rem; color: var(--muted); }
.venue { background: var(--tint); color: var(--accent); padding: .12rem .5rem; border-radius: 4px; font-weight: 650; }
.paper h3 { font: 700 1.05rem/1.35 var(--display); }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--accent); text-decoration: underline; }
.authors, .summary { font-size: .875rem; line-height: 1.55; color: var(--muted); margin-top: .35rem; }
.authors strong { color: var(--ink); }
.paper-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.paper-link {
  display: inline-flex; align-items: center; gap: .32rem;
  border: 1px solid var(--rule); border-radius: 5px; padding: .12rem .46rem;
  font-size: .8125rem; text-decoration: none;
}
.paper-link:hover { border-color: var(--accent); background: var(--tint); }
.paper-link > svg, .paper-link > img { width: .9rem; height: .9rem; flex: none; object-fit: contain; }
.repo-stars {
  display: inline-flex; align-items: center; gap: .2rem; padding-left: .34rem;
  border-left: 1px solid var(--rule); color: var(--ink); font-variant-numeric: tabular-nums;
}
.repo-stars[hidden] { display: none; }
.repo-stars svg { width: .77rem; height: .77rem; color: #966600; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.timeline { display: grid; gap: .95rem; }
.entry { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .1rem 1rem; }
.entry h3, .entry p { grid-column: 2; }
.entry h3 { grid-row: 1; font-size: .98rem; }
.entry p, .date { font-size: .875rem; }
.muted, .date { color: var(--muted); }
.date { grid-column: 1; grid-row: 1; font-variant-numeric: tabular-nums; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: 1rem 0 2rem; border-top: 1px solid var(--rule); font-size: .875rem; color: var(--muted); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 1.8rem; padding-top: 1.5rem; }
  .profile { position: static; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem; }
  .identity { display: flex; align-items: center; gap: 1rem; }
  .portrait { width: 5.5rem; height: 6.3rem; border-radius: 7px; margin: 0; }
  .profile-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
}
@media (max-width: 540px) {
  .masthead-inner, .layout, footer { width: calc(100% - 2rem); }
  .masthead-inner { flex-wrap: wrap; gap: .45rem 1rem; padding: .65rem 0; }
  nav { gap: .1rem .75rem; font-size: .8125rem; }
  .research-grid, .with-media, .entry { grid-template-columns: 1fr; }
  .with-media { gap: .8rem; }
  .entry h3, .entry p, .date { grid-column: 1; grid-row: auto; }
  .paper-media img { max-height: 11rem; }
}
