@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/PTSerif-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/PTSerif-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "PT Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/PTSerif-Italic.ttf") format("truetype");
}

/* Palette and shared type scale */
:root {
  --ink: #243746;
  --body: #384753;
  --blue: #236294;
  --muted: #73818c;
  --line: #e2e8ed;
  --paper: #fff;
  --serif: "PT Serif","Noto Serif CJK SC","Source Han Serif SC","思源宋体",serif;
  --weight-normal: 400;
  --weight-bold: 700;
  --text-name: 28px;
  --text-section: 24px;
  --text-title: 18px;
  --text-body: 16px;
  --text-meta: 14px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--serif);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a:focus-visible,button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}

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

p,h1,h2,h3 {
  margin-top: 0;
}

h1,h2,h3 {
  color: var(--ink);
}

h1 {
  font-size: var(--text-name);
  font-weight: var(--weight-bold);
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: 0;
}

h2 {
  font-size: var(--text-section);
  font-weight: var(--weight-normal);
  font-style: italic;
  line-height: 1.4;
  margin: 0;
  letter-spacing: 0;
}

h3 {
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  margin: 0;
}

strong,b {
  font-weight: var(--weight-bold);
}

sup {
  font-size: inherit;
  vertical-align: super;
  line-height: 0;
}

.skip-link {
  position: absolute;
  top: -90px;
  left: 20px;
  padding: 8px;
  background: white;
  z-index: 20;
}

.skip-link:focus {
  top: 10px;
}

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  max-width: 1004px;
  margin: auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
}

.wordmark {
  font-size: var(--text-body);
  color: var(--ink);
  white-space: nowrap;
  margin-right: auto;
}

.header-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: var(--text-meta);
}

.header-nav a,.side-nav a {
  color: var(--body);
  white-space: nowrap;
  text-decoration: none;
}

.header-nav a {
  position: relative;
}

.header-nav a:hover,.header-nav a:focus-visible,.side-nav a:hover,.side-nav a:focus-visible {
  color: var(--blue);
  text-decoration: none;
}

.header-nav a.is-active,.side-nav a.is-active {
  color: var(--blue);
}

.header-nav a::after {
  content: "";
  position: absolute;
  height: 1px;
  background: var(--blue);
  bottom: -11px;
  left: 0;
  right: 0;
  opacity: 0;
}

.header-nav a.is-active::after,.header-nav a:hover::after,.header-nav a:focus-visible::after {
  opacity: 1;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  font-size: var(--text-meta);
  padding: 2px;
  border: 1px solid #ccd9e3;
  border-radius: 4px;
  background: var(--paper);
}

.language-switch button {
  padding: 4px 8px;
  min-height: 28px;
  line-height: 1.4;
  color: var(--blue);
  border-radius: 2px;
}

.language-switch button:hover {
  background: #edf4fa;
}

.language-switch button[aria-pressed=true] {
  color: #fff;
  background: var(--blue);
  font-weight: var(--weight-bold);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 40px;
}

.menu-toggle svg {
  width: 21px;
  height: 21px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.3;
}

.page {
  width: min(952px,calc(100% - 52px));
  margin: 0 auto;
}

/* Introduction and portrait */
.about-section {
  display: grid;
  grid-template-columns: minmax(0,1fr) 148px;
  gap: 44px;
  align-items: center;
  padding: 34px 0 38px;
}

.intro {
  min-width: 0;
}

.portrait {
  display: block;
  justify-self: end;
  align-self: start;
  width: 148px;
  padding: 6px;
  background: #f7f8f9;
  border-radius: 8px;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.portrait:focus,.portrait:focus-visible {
  outline: none;
  box-shadow: none;
}

.avatar {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.alternate-name {
  font: inherit;
  color: inherit;
  white-space: nowrap;
  letter-spacing: inherit;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 16px;
  font-size: var(--text-meta);
}

.intro>p {
  margin: 0 0 10px;
}

.intro>p:last-of-type {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

/* Publications and figure preview */
.publication {
  display: grid;
  grid-template-columns: 225px minmax(0,1fr);
  gap: 28px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.publication:last-child {
  border-bottom: 0;
}

.publication-list>.publication:first-child {
  padding-top: 14px;
}

.figure-link {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16/10;
  padding: 0;
  overflow: hidden;
  align-self: center;
  border-radius: 3px;
  cursor: zoom-in;
}

.figure-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.preview-open {
  overflow: hidden;
}

.figure-preview {
  width: max-content;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 96px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.figure-preview::backdrop {
  background: rgba(0,0,0,.72);
}

.figure-preview>img {
  width: auto;
  height: auto;
  max-width: min(1200px,calc(100vw - 48px));
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
}

.preview-close {
  position: absolute;
  top: -44px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
}

.preview-close:hover {
  background: rgba(255,255,255,.18);
}

.preview-close:focus-visible {
  outline-color: #fff;
}

.preview-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.paper-copy {
  font-size: var(--text-meta);
  line-height: 1.5;
}

.publication h3 {
  margin: 0 0 6px;
  line-height: 1.5;
}

.publication h3 a {
  color: var(--ink);
}

.authors {
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 6px;
}

.authors strong {
  color: var(--ink);
}

.co-author,.author-note {
  opacity: .65;
}

.venue {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  font-size: inherit;
  color: var(--body);
  margin: 0 0 8px;
  line-height: inherit;
}

.venue-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border: 1px solid #d6e3ed;
  border-radius: 3px;
  background: #edf4fa;
  color: #245c85;
  white-space: nowrap;
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.venue-label>span {
  color: #a0b3c3;
  font-weight: var(--weight-normal);
}

.venue-name {
  color: var(--body);
  opacity: .65;
}

.summary {
  font-size: inherit;
  color: var(--body);
  margin: 0 0 8px;
  line-height: inherit;
}

.paper-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: inherit;
  line-height: inherit;
}

.profile-links a,.paper-links a {
  font-size: var(--text-meta);
  font-weight: var(--weight-normal);
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.profile-links a:hover,.profile-links a:focus-visible,.paper-links a:hover,.paper-links a:focus-visible {
  text-decoration-thickness: 2px;
}

.paper-links span {
  color: #a8b2ba;
}

/* Honors, service and timestamp */
.lower-sections {
  display: block;
  margin-top: 32px;
  padding-bottom: 32px;
}

.updated-note {
  margin: 0;
  padding: 0 0 24px;
  text-align: right;
  font-size: var(--text-meta);
  color: var(--muted);
}

.lower-sections section+section {
  margin-top: 32px;
}

.honor-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  line-height: 1.5;
}

.honor-list li {
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  gap: 10px;
  margin-bottom: 7px;
}

.honor-list li:last-child {
  margin-bottom: 0;
}

.honor-list time {
  font-size: var(--text-meta);
  color: var(--muted);
  padding-top: 2px;
}

.placeholder-copy {
  color: var(--muted);
  margin: 10px 0 0;
}

/* Alternative sidebar layout */
.side-layout {
  display: grid;
  grid-template-columns: 252px minmax(0,1fr);
  gap: 32px;
  max-width: 1008px;
  margin: 0 auto;
  padding: 30px 27px 0;
}

.side-rail {
  border-right: 1px solid var(--line);
  padding-right: 18px;
  align-self: start;
  position: sticky;
  top: 24px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--text-meta);
  margin: 0 0 18px;
  padding-top: 0;
}

.side-nav a.is-active {
  position: relative;
}

.side-nav a.is-active::before {
  content: "";
  width: 10px;
  height: 1px;
  background: var(--blue);
  position: absolute;
  left: -16px;
  top: 50%;
}

.side-rail .language-switch {
  justify-content: flex-start;
  margin: 0;
}

.side-main {
  min-width: 0;
}

.side-main .about-section {
  grid-template-columns: minmax(0,1fr) 120px;
  gap: 24px;
  padding: 0 0 38px;
}

.side-main .portrait {
  width: 120px;
}

.side-main .publication {
  grid-template-columns: 170px minmax(0,1fr);
  gap: 24px;
}

.mobile-b-header {
  display: none;
}

/* Responsive layouts */
@media(min-width:1600px) {
  .page {
    width: min(999px,calc(100% - 80px));
  }

  .header-inner {
    max-width: 1051px;
  }

  .side-layout {
    max-width: 1071px;
    grid-template-columns: 252px minmax(0,1fr);
    gap: 36px;
  }

}

@media(max-width:1000px) {
  .header-inner {
    gap: 23px;
  }

  .header-nav {
    gap: 19px;
  }

  .about-section {
    gap: 30px;
  }

  .publication {
    grid-template-columns: 200px minmax(0,1fr);
    gap: 24px;
  }

  .side-layout {
    grid-template-columns: 160px minmax(0,1fr);
    gap: 26px;
    padding: 32px 24px 0;
  }

  .side-rail {
    padding-right: 18px;
  }

  .side-main .publication {
    grid-template-columns: 140px minmax(0,1fr);
    gap: 20px;
  }

  .side-main .about-section {
    grid-template-columns: minmax(0,1fr) 104px;
    gap: 20px;
  }

  .side-main .portrait {
    width: 104px;
  }

}

@media(max-width:900px) {
  html {
    scroll-padding-top: 80px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto 36px;
    grid-template-rows: 60px;
    gap: 0 10px;
    min-height: 60px;
    padding: 0 21px;
  }

  .wordmark {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  .header-inner>.language-switch {
    grid-column: 2;
    grid-row: 1;
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
  }

  .menu-toggle[aria-expanded=true] {
    color: var(--blue);
    border-color: #b9ccdc;
  }

  .header-nav {
    display: none;
    grid-column: 1/-1;
    grid-row: 2;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 2px 12px;
    width: 100%;
    margin: 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--line);
  }

  .header-nav.is-open {
    display: grid;
  }

  .header-nav a {
    padding: 10px 0;
    width: 100%;
    white-space: normal;
    line-height: 1.5;
  }

  .header-nav a.is-active {
    font-weight: var(--weight-bold);
  }

  .header-nav a::after {
    display: none;
  }

  .mobile-b-header {
    display: block;
  }

  .side-layout {
    display: block;
    padding: 0 21px;
    max-width: 680px;
  }

  .side-rail {
    display: none;
  }

}

@media(max-width:760px) {
  .page {
    width: calc(100% - 42px);
  }

  .about-section,.side-main .about-section {
    display: block;
    position: relative;
    padding: 26px 0 30px;
  }

  .intro h1 {
    padding-right: 104px;
    min-height: 116px;
    margin-bottom: 10px;
  }

  .portrait,.side-main .portrait {
    position: absolute;
    top: 26px;
    right: 0;
    width: 88px;
    padding: 4px;
  }

  .profile-links {
    margin-top: 14px;
    gap: 6px 18px;
  }

  .section-heading {
    gap: 12px;
  }

  .publication,.side-main .publication {
    grid-template-columns: 104px minmax(0,1fr);
    gap: 6px 16px;
    padding: 21px 0;
    align-items: start;
  }

  .paper-copy {
    display: contents;
  }

  .paper-copy>h3 {
    grid-column: 2;
    margin-bottom: 0;
  }

  .paper-copy>p,.paper-copy>.venue,.paper-copy>.paper-links {
    grid-column: 1/-1;
    margin-bottom: 0;
  }

  .figure-link {
    align-self: start;
    margin-top: 5px;
  }

  .venue {
    gap: 5px 6px;
  }

}

@media(max-width:360px) {
  .header-inner {
    column-gap: 6px;
    padding: 0 16px;
  }

  .page {
    width: calc(100% - 32px);
  }

  .side-layout {
    padding: 0 16px;
  }

  .publication,.side-main .publication {
    grid-template-columns: 88px minmax(0,1fr);
    column-gap: 13px;
  }

}

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

}
