:root {
  color-scheme: light;
  --ink: #211e1c;
  --muted: #5f5955;
  --accent: #8c382e;
  --accent-deep: #6a281f;
  --surface: #fff;
  --warm: #f7f5f2;
  --line: #e8e2db;
  --gutter: clamp(1.5rem, 5vw, 3.5rem);
  --section-space: clamp(3rem, 8vw, 6.5rem);
  --ease: cubic-bezier(.2, .65, .25, 1);
  --header-height: 3.75rem;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem / 1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; }
font[face] { font-family: inherit; }
font[size] { font-size: inherit; }
img { max-width: 100%; }
a {
  color: var(--accent);
  text-underline-offset: .2em;
  text-decoration-thickness: .07em;
  overflow-wrap: anywhere;
}
a:hover { color: var(--accent-deep); }
a font[color] { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #f1dbd4; color: var(--ink); }

.container {
  width: min(calc(100% - 2 * var(--gutter)), 69rem);
  margin-inline: auto;
}
.container .container { width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: #fcfaf8;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    background: rgb(252 250 248 / .9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.header-inner {
  position: relative;
  width: min(calc(100% - 2rem), 74rem);
  min-height: var(--header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 2.75rem;
}
.site-brand img {
  display: block;
  width: clamp(8.25rem, 14vw, 10rem);
  height: auto;
  mix-blend-mode: multiply;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.site-nav a {
  padding: .4rem .75rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 550;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current] {
  background: #f1e7e1;
  color: var(--accent-deep);
}
.menu-toggle { display: none; }

.hero {
  background: linear-gradient(180deg, #f7f3ed 0%, #f9f6f2 58%, #fff 100%);
  padding: clamp(3.5rem, 7.5vw, 6rem) 0 0;
}
.hero-inner {
  width: min(calc(100% - 3rem), 84rem);
  margin-inline: auto;
}
.hero-copy { text-align: center; }
.hero h1 {
  font-size: clamp(3.55rem, 9.2vw, 7.25rem);
  font-weight: 730;
  letter-spacing: -.052em;
  line-height: .98;
}
.hero-role {
  margin: clamp(1rem, 2.4vw, 1.5rem) auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 520;
  line-height: 1.42;
  text-wrap: balance;
}
.hero-affiliation { display: block; text-wrap: balance; }
.hero-caption {
  display: grid;
  margin-top: .85rem;
  color: var(--accent);
  font-size: clamp(.8rem, 1.5vw, .95rem);
  font-weight: 600;
  text-wrap: balance;
}
.hero-caption span { grid-area: 1 / 1; }
.hero-caption span + span { opacity: 0; }
.photo-gallery {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  --photo-width: 74rem;
  width: min(100%, var(--photo-width));
  margin: clamp(1.5rem, 4vw, 2.9rem) auto 0;
  overflow: visible;
}
.gallery-viewport, .gallery-slide {
  position: absolute;
  inset: 0;
}
.gallery-viewport { touch-action: pan-y pinch-zoom; }
.hero-media .gallery-viewport {
  position: relative;
  inset: auto;
  width: min(100%, var(--photo-width));
  aspect-ratio: 37 / 20;
  margin-inline: auto;
  overflow: hidden;
  border-radius: clamp(1.25rem, 3vw, 2.25rem);
  background: #ded6c4;
  box-shadow: 0 1.1rem 2.7rem rgb(57 39 27 / .13);
}
.gallery-slide {
  visibility: hidden;
  opacity: 0;
}
.gallery-slide[data-current] {
  visibility: visible;
  opacity: 1;
}
.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media img { object-position: center 54%; }
.gallery-controls:not([hidden]) {
  position: absolute;
  z-index: 1;
  right: clamp(.65rem, 2vw, 1.25rem);
  bottom: clamp(.65rem, 2vw, 1.25rem);
}
.gallery-controls:not([hidden]), .hero-gallery-playback {
  display: flex;
  align-items: center;
  gap: .2rem;
  padding: .22rem;
  border: 1px solid rgb(255 255 255 / .36);
  border-radius: 999px;
  background: rgb(33 30 28 / .81);
  color: #fff;
}
.hero-gallery-playback { display: contents; }
.hero-media .gallery-controls:not([hidden]), .hero-media .hero-gallery-playback {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent-deep);
}
.hero-media .gallery-controls:not([hidden]) {
  position: static;
  width: fit-content;
  margin: .75rem auto 0;
}
.gallery-controls button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.gallery-controls button[hidden] { display: none; }
.gallery-controls button:hover { background: rgb(255 255 255 / .17); }
.gallery-controls button:focus-visible { outline-color: #fff; outline-offset: -3px; }
.hero-media .gallery-controls button:hover { background: #f1e7e1; }
.hero-media .gallery-controls button:focus-visible { outline-color: var(--accent); }
.gallery-position {
  min-width: 2rem;
  text-align: center;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gallery-arrow {
  width: .55rem;
  height: .55rem;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: translateX(-1px) rotate(45deg);
}
[data-gallery-step="-1"] .gallery-arrow { transform: translateX(1px) rotate(-135deg); }
.gallery-play-icon {
  width: 0;
  height: 0;
  border-block: .38rem solid transparent;
  border-left: .58rem solid currentColor;
}
[data-playing="true"] .gallery-play-icon {
  width: .6rem;
  height: .75rem;
  border: solid currentColor;
  border-width: 0 2px;
}

main > section:not(.hero) { padding-block: var(--section-space); }
.grey-bg { background: var(--warm); }
.profile {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  grid-template-areas: "photo details" "quote details";
  gap: 1rem;
}
.profile-photo, .profile-details, .profile-quote {
  border-radius: clamp(1.15rem, 2.8vw, 1.8rem);
}
.profile-photo {
  grid-area: photo;
  aspect-ratio: 1.38;
  background: var(--warm);
}
.profile-photo img { object-position: center 61%; }
.profile-photo [data-fit="contain"] img { object-fit: contain; background: #fff; }
.profile-details {
  grid-area: details;
  display: grid;
  align-items: center;
  padding: clamp(1rem, 3.7vw, 2.75rem);
  border: 1px solid var(--line);
  background: #fcfbf9;
  min-width: 0;
}
.profile-details table { width: 100%; border-collapse: collapse; }
.profile-details tr + tr { border-top: 1px solid var(--line); }
.profile-details th, .profile-details td {
  padding: .72rem 0;
  text-align: left;
  vertical-align: top;
  font-size: .95rem;
}
.profile-details th {
  padding-right: clamp(.65rem, 2vw, 1.5rem);
  color: var(--muted);
  font-weight: 600;
}
.profile-details td { overflow-wrap: anywhere; }
.profile-quote {
  grid-area: quote;
  padding: clamp(1.15rem, 2.8vw, 2rem);
  background: #eee5dc;
  color: #4d352b;
}
.profile-quote p:first-child {
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
  letter-spacing: .045em;
}
.profile-quote img { display: block; width: 7rem; height: auto; margin-top: .75rem; mix-blend-mode: multiply; }

.bio {
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr);
  align-items: start;
  gap: clamp(1rem, 5vw, 3.5rem);
}
.bio-copy {
  max-width: 69ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--muted);
}
.bio-copy p + p { margin-top: 1rem; }
main section:not(.hero) h2 {
  font-size: clamp(2.1rem, 5.3vw, 4rem);
  font-weight: 700;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.portfolio_area, .cw-section-title { margin-bottom: clamp(1.4rem, 3.5vw, 2.5rem); }
.portfolio_area > p { margin-top: .75rem; color: var(--muted); }
#Experiment .row + .row:has(.portfolio_area) { margin-top: 3rem; }

.heading > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#education .heading > ul, #Experiment .heading > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
#Experiment .heading > ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
#education .heading > ul > li, #Experiment .heading > ul > li {
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--surface);
}
.heading > ul h3 { font-size: 1.1rem; }
.heading > ul ul {
  padding-left: 1.05rem;
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}
.heading > ul ul li + li { margin-top: .2rem; }
.heading ul > br { display: none; }

#publications .heading > h3 {
  margin-top: 2rem;
  padding-block: .5rem .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  letter-spacing: -.045em;
}
#publications ol {
  margin: 0;
  padding-left: 2rem;
}
.publication-entry {
  padding: .9rem .2rem 1rem .35rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  break-inside: avoid;
}
.publication-entry::marker { color: var(--muted); font-size: .85rem; }
.publication-authors, .publication-citation {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}
.publication-title {
  margin-block: .18rem;
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  line-height: 1.36;
}
.publication-resources { margin-top: .3rem; font-size: .9rem; }
.publication-resources img {
  width: 1rem;
  height: 1rem;
  margin-right: .18rem;
  vertical-align: -.15em;
  object-fit: contain;
}
.publication-resources a:has(img) {
  display: inline-block;
  text-decoration: none;
}
.publication-resources a:has(img):hover { text-decoration: underline; }
.publication-resources a u { text-decoration: none; }
.publication-resources font[color="red"] { color: var(--accent-deep); }

.cw-section-content ul, .cw-output-list {
  margin: 0;
  padding-left: 1.5rem;
}
.cw-section-content li + li { margin-top: .5rem; }
.cw-section-content li::marker { color: var(--accent); }
.cw-subheading {
  margin-bottom: .65rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}
.cw-output-list + .cw-subheading { margin-top: 2rem; }

#cve-title { margin: 0 0 .85rem; font-size: 1.1rem; }
.table-container {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.table-container table { width: 100%; border-collapse: collapse; min-width: 48rem; }
.table-container th, .table-container td {
  padding: .68rem .85rem;
  text-align: left;
  font-size: .87rem;
}
.table-container th { background: #eee6df; }
.table-container tbody tr:nth-child(even) { background: #fbf9f7; }
.table-container td { border-top: 1px solid var(--line); }
.table-container td a { white-space: nowrap; }

footer {
  padding: 2.6rem var(--gutter);
  border-top: 1px solid var(--line);
  background: #fcfaf8;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
footer .container { width: 100%; }
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem 1.4rem;
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
}
.footer-bottom img { display: block; margin: 0 auto .85rem; border-radius: 50%; }

@media (max-width: 47.99rem) {
  .header-inner { flex-wrap: wrap; }
  .site-nav { flex-wrap: wrap; }
  .site-header[data-menu] .menu-toggle {
    display: grid;
    place-content: center;
    gap: .32rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 1.05rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(.22rem) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-.22rem) rotate(-45deg); }
  .site-header[data-menu] .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + .35rem);
    inset-inline: 0;
    padding: .55rem;
    max-height: calc(100dvh - var(--header-height) - 1rem);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: #fcfaf8;
    box-shadow: 0 .65rem 1.4rem rgb(57 39 27 / .13);
  }
  .site-header[data-menu="open"] .site-nav { display: grid; }
  .site-nav a { min-height: 2.75rem; padding: .6rem .8rem; }
  .profile {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "photo" "details" "quote";
  }
  .bio { grid-template-columns: minmax(0, 1fr); }
  #publications ol { padding-left: 1.5rem; }
  .publication-entry { padding-left: .1rem; }
}

@media (min-width: 64rem) {
  .hero-media {
    display: grid;
    grid-template-columns: 1fr min(var(--photo-width), calc(100% - 8rem)) 1fr;
    align-items: center;
    justify-items: center;
    width: 100%;
  }
  .hero-media .gallery-viewport {
    grid-area: 1 / 2;
    width: 100%;
  }
  .hero-media .gallery-controls:not([hidden]) { display: contents; }
  .hero-media [data-gallery-step] {
    grid-row: 1;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .hero-media [data-gallery-step="-1"] { grid-column: 1; }
  .hero-media [data-gallery-step="1"] { grid-column: 3; }
  .hero-gallery-playback {
    display: flex;
    grid-area: 2 / 2;
    margin-top: .75rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :root { scroll-behavior: smooth; }
  .hero h1, .hero-role, .hero-caption, .hero-media {
    animation: arrive .66s var(--ease) both;
  }
  .hero-role { animation-delay: .07s; }
  .hero-caption { animation-delay: .14s; }
  .hero-media { animation-name: lift; }
  .hero-caption span:first-child { animation: caption-out .3s ease 2.8s forwards; }
  .hero-caption span + span { animation: caption-in .45s ease 2.9s forwards; }
  .reveal { animation: arrive .56s var(--ease) both; }
  .site-nav a { transition: color .2s, background-color .2s; }
  .site-header[data-menu="open"] .site-nav { animation: arrive .25s var(--ease) both; }
  .menu-toggle span { transition: transform .24s var(--ease); }
  .gallery-slide { transition: opacity .42s var(--ease), visibility .42s; }
  .gallery-controls button { transition: background-color .22s; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .site-brand img { transition: transform .25s var(--ease); }
  .site-brand:hover img { transform: translateY(-2px); }
  #education .heading > ul > li, #Experiment .heading > ul > li { transition: transform .24s var(--ease); }
  #education .heading > ul > li:hover, #Experiment .heading > ul > li:hover { transform: translateY(-4px); }
}

@keyframes arrive {
  from { opacity: .35; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lift {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}
@keyframes caption-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes caption-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
