@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/figtree-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/figtree-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #16181d;
  --ink-2: #454a55;
  --muted: #7d828d;
  --line: #eceae6;
  --tint: #faf8f5;
  --accent: #c2410c;
  --accent-soft: #fff1e6;

  --font: "Figtree", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --wrap: 63rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; text-underline-offset: .18em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: #ffe2cc; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 3rem);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.08rem;
}
.brand:hover { text-decoration: none; }
.brand img { width: 1.6rem; height: 1.6rem; }

.nav {
  display: flex;
  gap: 1.75rem;
}
.nav a {
  color: var(--ink-2);
  font-size: 1.02rem;
  font-weight: 500;
}
.nav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(60rem 30rem at 100% 0%, #fff4e6 0%, rgba(255, 244, 230, 0) 70%),
    #fff;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: 3.5rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4.5rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.6rem, 5.8vw, 3.9rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.035em;
}
h1 .zh {
  margin-left: .2em;
  font-size: .5em;
  font-weight: 400;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
}

.roles {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1.75rem;
}
.roles > div {
  padding: 0 1.25rem;
  border-left: 1px solid var(--line);
}
.roles > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.roles dt {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.roles dd {
  margin: .1rem 0 0;
  font-size: 1.02rem;
  font-weight: 600;
}
.roles dd a { color: var(--ink); }

.bio {
  max-width: 38rem;
  margin: 0 0 1rem;
  color: var(--ink-2);
}
.bio strong { color: var(--ink); font-weight: 600; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .9rem .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: .98rem;
  font-weight: 500;
  transition: border-color .2s, background .2s;
}
.socials a:hover {
  text-decoration: none;
  border-color: #f2c9ac;
  background: var(--accent-soft);
}
.socials svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.portrait { margin: 0; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 20px 40px -24px rgba(22, 24, 29, .45);
}

/* ---------- Sections ---------- */

.section { padding: 3.75rem 0 4rem; }
.section-tint { background: var(--tint); }

h2 {
  margin: 0 0 1.5rem;
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.section-head h2 { margin: 0; }
.more { font-size: 1rem; font-weight: 500; }

/* ---------- Education ---------- */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.row h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}
.row h3 a { color: var(--ink); }
.row h3 a:hover { color: var(--accent); }
.row p {
  margin: .15rem 0 0;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  font-size: .98rem;
  color: var(--muted);
  text-align: right;
}
.row-side .date {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Publications ---------- */

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.pub {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.pub-fig {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0;
  padding: .6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  transition: border-color .2s, box-shadow .2s;
}
.pub-fig:hover {
  border-color: #e2ddd6;
  box-shadow: 0 10px 24px -16px rgba(22, 24, 29, .35);
}
.pub-fig img {
  max-height: 100%;
  object-fit: contain;
}

.pub-body h3 {
  margin: 0 0 .45rem;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.pub-body h3 a { color: var(--ink); }
.pub-body h3 a:hover { color: var(--accent); }

.authors {
  margin: 0 0 .45rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.authors b {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #f0b58c;
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}

.venue {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .6rem;
  font-size: .98rem;
  color: var(--muted);
}
.badge {
  padding: .05rem .55rem;
  border-radius: 6px;
  background: #f1f0ee;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 700;
}
.badge-pub {
  background: var(--accent-soft);
  color: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.1rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.note {
  margin: 1rem 0 0;
  font-size: .94rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  font-size: .94rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: min(96vw, 100rem);
  max-width: none;
  max-height: 94vh;
  padding: clamp(.75rem, 2vw, 1.5rem);
  border: 0;
  border-radius: 14px;
  background: #fff;
  cursor: zoom-out;
  overflow: auto;
}
.lightbox::backdrop { background: rgba(22, 24, 29, .6); }
.lightbox img {
  width: 100%;
  max-height: calc(94vh - 3rem);
  object-fit: contain;
}

/* ---------- Small screens ---------- */

@media (max-width: 48rem) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }
  .portrait {
    order: -1;
    width: 11rem;
  }
  .roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
  }
  .roles > div { padding: 0; border: 0; }
  .nav { gap: 1.1rem; }
  .nav a[href="#education"] { display: none; }

  .row { flex-direction: column; gap: .35rem; }
  .row-side {
    flex-direction: row;
    align-items: baseline;
    gap: .75rem;
    text-align: left;
  }

  .pub { grid-template-columns: 1fr; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
