@font-face {
  font-family: "Name Kai";
  src: url("../fonts/name-kai.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+8D39, U+9633;
}

/* Morandi palette: define UI colors here and reference tokens in components. */
:root {
  color-scheme: light;
  --paper: #fcf5ef;
  --surface: #fffaf6;
  --ink: #3e4341;
  --body-soft: #5b605d;
  --muted: #6a6e6b;
  --line: #dedfd7;
  --underline: #b8c1b5;
  /* Four accent families. Each: base (text on paper), -deep (text on its wash),
     -wash (surface), -hover (surface hover), -soft (decorative tint only). */
  --accent: #566d63;
  --accent-deep: #3f554b;
  --accent-wash: #e8ece6;
  --accent-hover: #dbe2d8;
  --accent-soft: #a5bab1;
  --rose: #806668;
  --rose-deep: #674e4f;
  --rose-wash: #f1e7e7;
  --rose-hover: #ead9da;
  --blue: #586d80;
  --blue-deep: #455868;
  --blue-wash: #e4eaf1;
  --blue-hover: #d5e0e9;
  --blue-soft: #a7b6c5;
  --ochre: #796b57;
  --ochre-deep: #615340;
  --ochre-wash: #eee9e2;
  --ochre-hover: #e5ddd1;
  --ochre-soft: #bfb2a2;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  /* These two carry an alpha channel, so they repeat their source token's RGB.
     Change --paper or --surface and these must follow; npm run check asserts it. */
  --header-glass: rgba(252, 245, 239, .94);   /* --paper at 94% */
  --video-overlay: rgba(52, 62, 55, .9);
  --video-border: rgba(255, 250, 246, .4);    /* --surface at 40% */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.75 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--ochre-soft), var(--accent-soft) 54%, var(--blue-soft)); background: linear-gradient(90deg in oklch, var(--ochre-soft), var(--accent-soft) 54%, var(--blue-soft)); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; transition: color .18s, background .18s; }
a:hover { color: var(--accent-deep); text-decoration: underline; }
button, summary { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
img { display: block; max-width: 100%; }
strong { font-weight: 600; }
h1, h2, h3, p { margin: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; padding: 8px 16px; background: var(--surface); z-index: 100; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
#page_header { position: sticky; top: 0; z-index: 20; background: var(--header-glass); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.header_wrap { max-width: 1080px; padding: 18px 40px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.blog_title { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.3px; }
.menus_items { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-page { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); font-size: 13px; }
.site-page[aria-current] { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 6px; }
.menus_icon { display: none; }
:where(#page_main) { width: min(100%, 1080px); padding: 0 40px; margin: 0 auto; }
.intro-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 64px; padding: 60px 0 40px; align-items: start; }
.profile-sidebar { padding-top: 4px; }
.profile-identity { text-align: center; }
.profile-photo { width: 164px; height: auto; aspect-ratio: 4 / 5; margin: 0 auto; border-radius: 20px; object-fit: contain; background: var(--accent-wash); }
.profile-role { margin-top: 17px; color: var(--muted); font-size: 12px; line-height: 1.6; white-space: nowrap; }
.profile-role span { display: inline; color: var(--accent); }
.profile-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: fit-content; margin: 20px auto 0; }
.profile-links a { display: inline-flex; gap: 11px; min-height: 40px; align-items: center; font-size: 12px; }
.contact-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.profile-links a { color: var(--muted); }
.profile-links a:hover, .profile-links a:focus-visible { color: var(--accent-deep); }
.profile-links a:last-child { font-weight: 600; }
.hero-name { display: flex; flex-wrap: nowrap; align-items: center; column-gap: .32em; font-size: clamp(34px, 4vw, 44px); font-weight: 600; line-height: 1.2; letter-spacing: -.035em; margin-bottom: 23px; }
.hero-name-en { white-space: nowrap; }
.hero-name-zh { font-family: "Name Kai", "STXingkai", "Kaiti SC", KaiTi, cursive; font-size: .68em; color: var(--rose); font-weight: 400; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; }
.hero-bio { max-width: 710px; }
.hero-bio p + p { margin-top: var(--space-3); }
.hero-copy { color: var(--body-soft); }
.hero-history { color: var(--muted); font-size: 14px; }
.hero-bio a, .news-content a { text-decoration: underline; text-decoration-color: var(--underline); }
.news-section { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--line); }
h2 { font-size: 20px; line-height: 1.4; font-weight: 600; letter-spacing: -.5px; }
.news-section h2 { font-size: 16px; margin-bottom: var(--space-4); color: var(--rose); }
.education-section h2 { color: var(--blue); }
.selected-publications h2, .publications-page .page-title { color: var(--accent); }
.honors-section h2 { color: var(--ochre); }
.news-section h2::before, .education-section h2::before, .selected-publications h2::before, .honors-section h2::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 10px; vertical-align: middle; }
.news-list { padding: 0; margin: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: var(--space-4); padding-bottom: var(--space-3); font-size: 13px; line-height: 1.65; }
.news-list li:last-child { padding-bottom: 0; }
.news-date { color: var(--rose); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.news-content { color: var(--body-soft); }
.older-news { margin-top: var(--space-3); }
.older-news summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: 12px; padding: 6px 0; }
.older-news[open] .news-list { padding-top: 12px; }
.education-section, .selected-publications, .honors-section { padding: 32px 0 36px; border-top: 1px solid var(--line); }
.resume-section h2 { margin-bottom: var(--space-6); }
.resume-list { display: grid; gap: 24px; }
.resume-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.education-logo { width: 36px; height: 36px; object-fit: contain; margin-top: 3px; }
.resume-copy h3 { font-size: 14px; font-weight: 600; line-height: 1.5; }
.resume-copy p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 3px; }
.resume-meta { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 2px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-6); }
.section-heading-link { font-size: 12px; }
.section-heading-link::after { content: " ↗"; }
.publication-list { display: grid; gap: 32px; }
.publication-item { display: grid; grid-template-columns: 30% minmax(0, 1fr); align-items: start; gap: var(--space-6); }
.publication-teaser { position: relative; border-radius: 12px; overflow: hidden; background: var(--accent-wash); }
.publication-teaser video { display: block; width: 100%; aspect-ratio: var(--teaser-ratio, 16 / 9); object-fit: contain; }
.print-poster { display: none; }
.teaser-toggle { position: absolute; bottom: 8px; right: 8px; border: 1px solid var(--video-border); background: var(--video-overlay); color: var(--surface); border-radius: 6px; min-height: 32px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.publication-title { font-size: 16px; line-height: 1.5; font-weight: 600; letter-spacing: -.2px; margin: -3px 0 7px; }
.publication-title a { color: var(--ink); }
.publication-authors { color: var(--muted); font-size: 12px; line-height: 1.75; }
.publication-authors strong { color: var(--ink); }
.publication-venue { margin-top: 7px; color: var(--accent); font-size: 12px; font-weight: 600; }
.publication-venue em { font-style: normal; }
.publication-description { margin-top: 7px; font-size: 13px; color: var(--muted); }
.publication-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pub-link { display: inline-flex; align-items: center; min-height: 32px; padding: 3px 12px; background: var(--accent-wash); border-radius: 6px; font-size: 11px; font-weight: 500; }
.pub-link:hover { background: var(--accent-hover); text-decoration: none; }
.pub-link--paper { color: var(--blue-deep); background: var(--blue-wash); }
.pub-link--paper:hover { color: var(--blue-deep); background: var(--blue-hover); }
.pub-link--project { color: var(--rose-deep); background: var(--rose-wash); }
.pub-link--project:hover { color: var(--rose-deep); background: var(--rose-hover); }
.pub-link--code { color: var(--ochre-deep); background: var(--ochre-wash); }
.pub-link--code:hover { color: var(--ochre-deep); background: var(--ochre-hover); }
.pub-link:focus-visible { outline-offset: 2px; }
.honors-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.honors-list li { display: flex; justify-content: space-between; gap: 24px; font-size: 13px; }
.publications-main { padding-top: 48px; padding-bottom: 56px; }
.page-title { font-size: 32px; font-weight: 600; letter-spacing: -1px; margin-bottom: 36px; }
.publication-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
#page_footer { margin-top: 24px; border-top: 1px solid var(--line); }
.footer_wrap { max-width: 1080px; margin: auto; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.last-updated { font-variant-numeric: tabular-nums; }
.back-to-top { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 800px) {
  .intro-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding-top: 40px; }
  .profile-photo { width: 140px; }
  .resume-item { grid-template-columns: 36px minmax(0, 1fr); gap: 3px 16px; }
  .education-logo { grid-row: span 2; }
  .resume-meta { grid-column: 2; }
  .publication-item { grid-template-columns: 34% minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  :where(#page_main) { padding-inline: 24px; }
  .header_wrap { padding: 12px 24px; gap: 16px; }
  .menus_items { gap: 14px; }
  .site-page { font-size: 11px; min-height: 44px; }
  .blog_title { font-size: 13px; white-space: nowrap; }
  .intro-layout { display: block; padding-top: 30px; padding-bottom: 30px; }
  .profile-sidebar { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 30px; }
  .profile-identity { width: 180px; }
  .profile-photo { width: 116px; border-radius: 16px; }
  .profile-role { font-size: 12px; margin-top: 12px; }
  .profile-links { gap: 0; margin: 16px 0 0 20px; }
  .profile-links a { min-height: 44px; font-size: 13px; }
  .hero-name { font-size: 36px; margin-bottom: 20px; }
  .hero-history { font-size: 13px; }
  .news-section { margin-top: var(--space-6); }
  .news-list li { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .older-news summary { padding-block: 12px; }
  .education-section, .selected-publications, .honors-section { padding-block: 26px; }
  h2 { font-size: 19px; }
  .publication-item { grid-template-columns: 1fr; gap: 18px; }
  .publication-title { font-size: 16px; }
  .pub-link, .teaser-toggle { min-height: 44px; }
  .honors-list li { display: grid; gap: 2px; }
  .honors-list .resume-meta { grid-column: 1; }
  .section-heading { gap: 10px; }
  .section-heading-link { font-size: 11px; white-space: nowrap; }
  .footer_wrap { padding-inline: 24px; flex-wrap: wrap; gap: 2px 20px; }
  .last-updated { order: 3; flex-basis: 100%; }
}
@media print {
  @page { margin: 16mm; }
  body { font-size: 10pt; background: var(--surface); }
  body::before, #page_header, .skip-link, .teaser-toggle, .back-to-top { display: none; }
  :where(#page_main), .publications-main { width: 100%; padding: 0; }
  .intro-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 0 0 24px; }
  .profile-identity { width: 150px; }
  .profile-role { font-size: 10px; }
  .profile-photo { width: 100px; }
  .profile-links { margin: 12px auto 0; }
  .profile-links a { min-height: 24px; }
  .hero-name { font-size: 28px; }
  .publication-item { grid-template-columns: 30% minmax(0, 1fr); }
  .publication-item, .resume-item, .honors-list li { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .publication-teaser video { display: none; }
  .print-poster { display: block; width: 100%; height: auto; }
  .pub-link { background: none; text-decoration: underline; padding: 0; min-height: 24px; }
  .publication-title a, .pub-link { color: var(--ink); }
  .footer_wrap { padding: 12px 0; }
}
@media (max-width: 360px) {
  .header_wrap, :where(#page_main), .footer_wrap { padding-inline: 18px; }
  .menus_items { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
