@import url("fonts.css");

:root {
  color-scheme: light;
  --bg: #fdfcf9;
  --surface: #ffffff;
  --surface-alt: #f1eee6;
  --ink: #1d2430;
  --muted: #4f4a42;
  --footer-muted: #68645c;
  --line: #ddd5c8;
  --blue: #214f82;
  --blue-dark: #153454;
  --gold: #9f7f42;
  --header-bg: rgba(253, 252, 249, 0.93);
  --rule: rgba(29, 36, 48, 0.16);
  --footer-rule: rgba(29, 36, 48, 0.08);
  --rule-light: rgba(29, 36, 48, 0.11);
  --radius: 8px;
  --max-width: 1380px;
  --page-gutter: clamp(2rem, 7vw, 8rem);
  --section-content-indent: clamp(0.9rem, 1.8vw, 1.7rem);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--blue);
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--blue-dark);
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.08rem 0.32rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 20;
  transform: translateY(-180%);
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  padding: 0.55rem 0.8rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--header-bg);
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 750;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.4vw, 1.6rem);
  color: var(--muted);
  font-size: 0.98rem;
}

.site-nav a {
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.28rem;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after,
.site-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.page-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  width: min(var(--max-width), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem) 0 3rem;
}

.home-shell {
  gap: clamp(1rem, 3vw, 2rem);
  padding-top: clamp(0.9rem, 2.5vw, 2rem);
}

.page-shell--content {
  padding-top: clamp(2rem, 5vw, 4.5rem);
}

.home-profile {
  display: grid;
  grid-template-columns: minmax(220px, 17rem) minmax(0, 52rem);
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(0.35rem, 1.4vw, 0.9rem) 0 clamp(0.5rem, 1.8vw, 1.1rem);
}

.home-visual {
  width: min(100%, 17rem);
}

.home-visual picture {
  aspect-ratio: 4 / 5;
  display: block;
  overflow: hidden;
  width: 100%;
}

.home-visual img {
  aspect-ratio: 4 / 5;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.1);
  transform-origin: center center;
  width: 100%;
}

.photo-credit {
  margin: 0.22rem 0 0;
  color: rgba(104, 100, 92, 0.7);
  font-size: 0.5rem;
  line-height: 1.15;
  text-align: left;
}

.photo-credit a,
.photo-credit .author-separator,
.photo-credit .author-coauthor {
  color: inherit;
  font-weight: 500;
  text-decoration-color: rgba(104, 100, 92, 0.32);
}

.photo-credit a:hover {
  color: var(--blue);
  text-decoration-color: currentColor;
}

.home-copy {
  max-width: 52rem;
}

.home-copy h1 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: clamp(2.4rem, 3.45vw, 3.25rem);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 0.85rem;
}

.name-chinese {
  display: inline-block;
  height: 0.62em;
  margin-top: 0.04em;
  width: auto;
}

.home-copy .intro {
  max-width: 46rem;
  border-left: 3px solid rgba(33, 79, 130, 0.58);
  color: #25364b;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.68;
  margin-bottom: 0;
  hyphens: auto;
  overflow-wrap: normal;
  padding: 0.08rem 0 0.08rem 1rem;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  text-wrap: pretty;
}

.profile-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.profile-contact a {
  color: var(--ink);
  font-weight: 650;
  text-decoration-color: rgba(29, 36, 48, 0.28);
}

.profile-contact [data-profile-email] {
  color: var(--ink);
  font-weight: 650;
  padding: 0.05rem 0;
}

.interest-highlight {
  color: var(--blue-dark);
  font-weight: 760;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 650;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0.65rem;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 1.7vw, 1.75rem);
  font-weight: 620;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.12rem;
  line-height: 1.3;
}

.affiliation {
  margin-bottom: 1rem;
  color: #36526f;
  font-weight: 650;
  line-height: 1.45;
}

.intro {
  color: var(--muted);
}

.research-accordion p,
.short-abstract,
.paper-card p:not(.authors) {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.68;
  hyphens: auto;
  overflow-wrap: normal;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  text-wrap: pretty;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.55rem;
  margin-top: 1rem;
}

.profile-contact a,
.contact-grid a,
.paper-actions a,
.button-secondary {
  display: inline-flex;
  min-height: auto;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 0.05rem 0;
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: color 180ms ease;
}

.contact-grid a:hover,
.paper-actions a:hover,
.button-secondary:hover {
  color: var(--blue-dark);
}

.content-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.section {
  padding: clamp(1rem, 3vw, 2rem) 0;
}

.content-stack > .section:first-child {
  padding-top: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-title-card {
  padding-bottom: clamp(0.35rem, 1vw, 0.8rem);
}

.page-title-card :is(h1, h2) {
  margin-bottom: 0;
  font-size: clamp(1.78rem, 3.1vw, 2.48rem);
}

.home-research {
  --home-research-offset: clamp(0rem, calc(30vw - 366px), 3rem);

  display: grid;
  gap: 0.95rem;
  width: min(calc(100% - var(--home-research-offset)), 72rem);
  margin: 0 auto 0 var(--home-research-offset);
}

.home-research-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.home-research-heading a {
  color: var(--blue-dark);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration-color: rgba(21, 52, 84, 0.32);
}

.home-research-heading h2 {
  margin-bottom: 0;
}

.research-accordion {
  display: grid;
  gap: 0;
}

.home-research-list {
  display: grid;
  gap: 0;
  margin-left: clamp(0.1rem, calc(12vw - 130px), var(--section-content-indent));
}

.research-item {
  margin-top: 1.05rem;
  border-top: 1px solid var(--rule-light);
  padding-top: 1.05rem;
}

.research-item:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.paper-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.paper-heading-row h3 {
  min-width: 0;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 650;
}

.paper-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.7rem clamp(0.75rem, 1.4vw, 1.25rem);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 460;
}

.paper-byline {
  min-width: 0;
}

.paper-status {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 460;
}

.paper-meta .author-self {
  color: var(--blue-dark);
  font-weight: 560;
}

.paper-meta .author-separator,
.paper-meta .meta-detail {
  color: var(--muted);
  font-weight: 460;
}

.paper-meta .author-coauthor {
  color: var(--muted);
  font-weight: 700;
}

.paper-heading-row .paper-status.meta-detail {
  color: rgba(79, 74, 66, 0.68);
  font-weight: 460;
}

.short-abstract {
  max-width: 60rem;
  margin: 0 0 0 clamp(0.75rem, 1.4vw, 1.25rem);
  color: var(--muted);
}

.short-abstract strong {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 760;
}

.research-accordion details,
.research-static {
  border-top: 1px solid var(--rule-light);
  padding: 0.75rem 0;
}

.research-accordion > :first-child {
  border-top: 0;
}

.research-accordion summary,
.research-static-line {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
}

.research-accordion summary {
  cursor: pointer;
  list-style: none;
}

.research-accordion summary::-webkit-details-marker {
  display: none;
}

.research-accordion summary::before {
  color: var(--blue-dark);
  content: "+";
  font-weight: 800;
  line-height: 1;
}

.research-accordion details[open] summary::before {
  content: "-";
}

.research-static-line::before {
  content: "";
}

.research-accordion summary > span,
.research-static-line > span {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 650;
}

.research-accordion summary small,
.research-static-line small {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.research-accordion summary small .author-self,
.research-accordion summary small .author-coauthor,
.research-accordion summary small .author-separator,
.research-accordion summary small .meta-detail,
.research-static-line small .author-self,
.research-static-line small .author-coauthor,
.research-static-line small .author-separator,
.research-static-line small .meta-detail {
  font-family: var(--font-sans);
  font-size: inherit;
  font-weight: 600;
}

.research-accordion summary small .author-self,
.research-static-line small .author-self {
  color: var(--blue-dark);
  font-weight: 700;
}

.research-accordion summary small .author-coauthor,
.research-static-line small .author-coauthor {
  color: var(--muted);
}

.research-accordion p {
  max-width: 62rem;
  margin: 0.65rem 0 0.35rem;
  color: var(--muted);
}

.research-section {
  display: grid;
  gap: 1.4rem;
}

.research-category {
  display: grid;
  gap: 0.8rem;
}

.research-category .section-heading {
  display: block;
  margin-bottom: 0;
}

.paper-list {
  display: grid;
  gap: 1.1rem;
  margin-left: clamp(0.1rem, calc(12vw - 130px), var(--section-content-indent));
}

.paper-list .paper-card + .paper-card {
  border-top: 1px solid var(--rule-light);
  padding-top: 1rem;
}

.paper-card {
  padding-top: 0.35rem;
  scroll-margin-top: 6rem;
}

.paper-card h3 {
  font-family: var(--font-serif);
  font-size: 1.36rem;
  font-weight: 650;
}

.featured-paper {
  background: transparent;
}

.authors {
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.author-self {
  color: var(--blue-dark);
  font-weight: 800;
}

.author-coauthor {
  color: var(--muted);
  font-weight: 650;
}

a.author-coauthor {
  text-decoration-color: rgba(79, 74, 66, 0.35);
}

a.author-coauthor:hover {
  color: var(--blue);
  text-decoration-color: currentColor;
}

.author-separator,
.meta-detail {
  color: var(--muted);
  font-weight: 600;
}

.paper-card p:not(.authors) {
  color: var(--muted);
}

.home-research .research-accordion p {
  margin: 0.65rem 0 0.35rem calc(var(--section-content-indent) + 1.85rem);
}

.research-section .paper-card p:not(.authors) {
  margin-left: var(--section-content-indent);
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.paper-actions a {
  min-height: auto;
  justify-content: flex-start;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 4vw, 2rem);
}

.split-section .section-heading {
  display: block;
  margin-bottom: 0;
}

.activity-category {
  border-top: 1px solid var(--rule-light);
}

.page-title-card + .activity-category {
  border-top: 0;
}

.activity-category .section-heading {
  display: block;
}

.activity-years {
  display: grid;
  gap: 0;
  margin-left: var(--section-content-indent);
}

.activity-year {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--rule-light);
  padding: 0.9rem 0;
}

.activity-year:first-child {
  border-top: 0;
  padding-top: 0;
}

.activity-year h3 {
  margin-bottom: 0;
  color: var(--blue-dark);
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 650;
}

.timeline {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.9rem;
  padding-bottom: 0.9rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline time {
  color: var(--blue-dark);
  font-weight: 800;
}

.timeline-full li {
  grid-template-columns: 8.2rem minmax(0, 1fr);
}

.compact-list {
  display: grid;
  gap: 0.65rem;
}

.compact-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.teaching-section,
.teaching-category {
  display: grid;
  gap: 0.8rem;
}

.teaching-category .section-heading {
  display: block;
  margin-bottom: 0;
}

.teaching-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-left: var(--section-content-indent);
}

.teaching-grid article {
  padding-top: 0.25rem;
}

.teaching-grid h3 {
  display: grid;
  grid-template-columns: 9.35rem max-content minmax(0, 1fr);
  gap: 0.45rem;
  margin-top: 0;
}

.course-term {
  color: var(--muted);
  font-weight: 620;
}

.course-title {
  color: var(--ink);
}

.course-separator {
  color: var(--muted);
}

.teaching-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty-note {
  margin-bottom: 0;
  color: var(--muted);
}

.button-secondary {
  background: transparent;
}

.cv-text-section {
  display: grid;
  gap: 1.1rem;
}

.cv-text-block {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--rule-light);
  padding-top: 0.95rem;
}

.cv-text-block h3 {
  margin-bottom: 0;
  color: var(--blue-dark);
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 650;
}

.cv-text-block > p {
  margin-bottom: 0;
  color: var(--muted);
}

.cv-pdf-section {
  display: grid;
  gap: 0.9rem;
}

.cv-pdf-details {
  display: grid;
  gap: 0.9rem;
}

.cv-preview-toggle {
  width: max-content;
  cursor: pointer;
  list-style: none;
}

.cv-preview-toggle::-webkit-details-marker {
  display: none;
}

.cv-pdf-details .preview-hide {
  display: none;
}

.cv-pdf-details[open] .preview-show {
  display: none;
}

.cv-pdf-details[open] .preview-hide {
  display: inline;
}

.cv-pdf-frame {
  display: block;
  width: 100%;
  aspect-ratio: 210 / 297;
  max-height: min(88vh, 1120px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.cv-pdf-frame p {
  margin: 1rem;
  color: var(--muted);
}

.contact-card {
  display: grid;
  gap: 1rem;
}

.resource-list {
  display: grid;
  gap: 0.65rem;
}

.resource-list p {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 0;
  padding-top: 0.35rem;
}

.resource-list strong {
  color: var(--blue-dark);
}

.resource-list a,
.resource-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: auto 0 0;
  border-top: 1px solid rgba(29, 36, 48, 0.07);
  color: rgba(104, 100, 92, 0.76);
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 0.65rem max(calc(var(--page-gutter) / 2), calc((100vw - var(--max-width)) / 2)) 0.5rem;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    width: 100%;
    gap: 0.65rem 1rem;
    padding-bottom: 0;
    white-space: normal;
  }

  .home-profile {
    grid-template-columns: minmax(210px, 15rem) minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
  }
}

@media (max-width: 680px) {
  :root {
    --section-content-indent: 0.75rem;
  }

  .site-header {
    gap: 0.45rem;
    padding: 0.65rem 1rem 0.7rem;
  }

  .wordmark {
    font-size: 1.45rem;
  }

  .site-nav {
    gap: 0.35rem 0.85rem;
  }

  .page-shell {
    width: min(100% - 2.7rem, var(--max-width));
    padding-top: 1rem;
  }

  .home-shell {
    padding-top: 0.75rem;
  }

  .home-research {
    --home-research-offset: 0rem;
  }

  .home-profile {
    grid-template-columns: 1fr;
  }

  .home-visual {
    width: min(9.5rem, 58vw);
  }

  .home-research-heading {
    grid-template-columns: 1fr;
  }

  .home-research-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }

  .home-research-list {
    margin-left: 0.1rem;
  }

  .paper-list {
    margin-left: 0.1rem;
  }

  .research-accordion summary,
  .research-static-line {
    grid-template-columns: 1.15rem minmax(0, 1fr);
    gap: 0.25rem 0.55rem;
  }

  .research-accordion summary small,
  .research-static-line small {
    grid-column: 2;
  }

  .research-accordion summary small,
  .research-static-line small {
    text-align: left;
  }

  .home-copy .intro,
  .research-accordion p,
  .short-abstract,
  .paper-card p:not(.authors) {
    hyphens: manual;
    text-align: left;
  }

  .paper-meta {
    gap: 0.65rem;
  }

  .paper-heading-row {
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
  }

  .home-research .research-accordion p {
    margin-left: calc(var(--section-content-indent) + 1.7rem);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline li,
  .timeline-full li,
  .activity-year,
  .cv-text-block,
  .resource-list p {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .site-footer {
    flex-direction: column;
    width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .cv-pdf-frame {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
