/* Titillium Web from Google Fonts; license: assets/fonts/OFL.txt. */
@font-face {
  font-family: "Titillium Web";
  src: url("./assets/fonts/TitilliumWeb-Regular.woff2") format("woff2"),
    url("./assets/fonts/TitilliumWeb-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Titillium Web";
  src: url("./assets/fonts/TitilliumWeb-SemiBold.woff2") format("woff2"),
    url("./assets/fonts/TitilliumWeb-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --media-width: 220px;
  --media-gap: 24px;
  color-scheme: light;
  font-family: "Titillium Web", Verdana, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

main {
  max-width: 848px;
  margin: 36px auto 56px;
  padding: 0 24px;
  overflow-wrap: break-word;
}

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

h1 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 28px;
  color: #222;
  font-family: "Titillium Web", Verdana, Helvetica, sans-serif;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 400;
}

.english-name,
.chinese-name {
  white-space: nowrap;
}

.chinese-name {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", "SimSun", serif;
  font-size: 1em;
  font-weight: 400;
  letter-spacing: 0;
  color: inherit;
}

.profile-content {
  display: grid;
  grid-template-columns: var(--media-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--media-gap);
}

.profile-photo {
  width: var(--media-width);
}

.contact {
  margin-top: 12px;
  text-align: center;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.contact span {
  margin: 0 1px;
  color: #b4b4b4;
}

.x-handle {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.x-handle a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: #0f1419;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.15s;
}

.x-handle a:hover,
.x-handle a:focus-visible {
  background: #31363b;
  text-decoration: none;
}

.x-handle a:focus-visible {
  border-radius: 999px;
}

.x-handle svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.bio p + p {
  margin-top: 16px;
}

a {
  color: #1772d0;
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid #1772d0;
  outline-offset: 4px;
  border-radius: 2px;
  text-decoration: underline;
}

section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e8e8e8;
}

h2 {
  scroll-margin-top: 24px;
  margin-bottom: 20px;
  color: #222;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
}

h3 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.news li + li {
  margin-top: 6px;
}

.news time {
  color: #555;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.publications li + li {
  margin-top: 28px;
}

.publication h3 {
  font-size: 17px;
}

.publication h3 a,
.note-intro h3 a {
  color: inherit;
}

.publication,
.note-overview {
  display: grid;
  grid-template-columns: var(--media-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--media-gap);
}

.publication-info {
  grid-column: 2;
  min-width: 0;
}

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #191b20;
  isolation: isolate;
}

.preview-poster,
.preview video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview video {
  visibility: hidden;
}

.preview.has-frame video {
  visibility: visible;
}

/* Wide figures sit on a mat so every thumbnail keeps the same 16:9 box. */
.preview-figure {
  display: block;
  background: #fafaf9;
}

.preview-empty {
  background: none;
}

.preview-figure .preview-poster {
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
}

.preview-figure:focus-visible {
  outline: 2px solid #1772d0;
  outline-offset: 4px;
}

.preview-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(20 20 20 / 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.preview-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 10px;
  height: 11px;
  margin: auto;
  border-inline: 3px solid currentColor;
}

.preview-toggle[data-action="play"]::before {
  width: 10px;
  border: 0;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  translate: 1px 0;
}

.preview:hover .preview-toggle,
.preview-toggle:focus-visible {
  opacity: 1;
}

.preview-toggle:hover {
  background: rgb(20 20 20 / 0.75);
}

.preview-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .preview:not([data-autoplay="false"]).has-frame video,
  .preview:not([data-autoplay="false"]) .preview-toggle {
    visibility: hidden;
  }
}

.authors {
  margin-top: 2px;
  color: #4a4a4a;
}

.authors strong {
  color: #222;
}

strong {
  font-weight: 600;
}

.venue {
  margin-top: 2px;
  color: #555;
  font-style: normal;
}

.paper-links {
  margin-top: 3px;
}

.paper-links span {
  margin: 0 4px;
  color: #b4b4b4;
}

.github-stars {
  font-size: 0.9em;
  white-space: nowrap;
}

.note-media {
  min-width: 0;
  margin: 0;
}

.note-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #191b20;
}

.note-media figcaption,
.note-date,
.note-footnote {
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

.note-media figcaption {
  margin-top: 6px;
}

.note-date {
  margin: 2px 0 6px;
}

.note-intro h3 {
  margin: 0;
}

.note-media video:focus-visible {
  outline: 2px solid #1772d0;
  outline-offset: 4px;
  border-radius: 2px;
}

.note-back {
  margin-bottom: 28px;
  font-size: 15px;
}

.note-page h1 {
  display: block;
  margin: 8px 0 14px;
  text-align: left;
  font-size: 28px;
}

.note-main-video {
  max-width: 640px;
  margin-top: 24px;
}

.note-earlier-video {
  max-width: 400px;
  margin-top: 20px;
}

.note-parameters {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px 20px;
  margin: 0;
}

.note-parameters dt {
  color: #555;
}

.note-parameters dd {
  margin: 0;
}

.note-footnote {
  margin-top: 16px;
}

.education li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
}

.school-logo {
  display: block;
  width: 36px;
  height: 38px;
  object-fit: contain;
  justify-self: center;
}

.education li + li {
  margin-top: 18px;
}

.education li > div {
  min-width: 0;
}

.education h3 {
  font-weight: 400;
}

.education li > div > p {
  color: #555;
  font-size: 15px;
}

.dates {
  flex-shrink: 0;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.site-footer {
  margin-top: 40px;
  color: #555;
  font-size: 13px;
  text-align: right;
}

@media (max-width: 600px) {
  .note-parameters {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .note-parameters dd + dt {
    margin-top: 10px;
  }

  .publication,
  .note-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .publication-info {
    grid-column: 1;
  }

  .preview {
    max-width: 400px;
  }

  .preview-empty {
    display: none;
  }

  /* Stacked entries have no shared column to match, so show the figure whole. */
  .preview-figure {
    aspect-ratio: 928 / 359;
    background: #fff;
  }

  .preview-figure .preview-poster {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  main {
    margin: 28px auto 40px;
    padding: 0 20px;
  }

  h1 {
    margin-bottom: 24px;
  }

  .education li {
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 12px;
  }

  .school-logo {
    grid-row: span 2;
  }

  .education .dates {
    grid-column: 2;
  }

  .profile-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .profile-photo {
    justify-self: center;
  }
}
