/* Weixi Zhai — an academic website with quiet editorial details. */
:root {
  --ink: #252b31;
  --muted: #626c75;
  --link: #174b78;
  --accent: #79545c;
  --paper: #fdfcf9;
  --line: #e6e2dd;
  --soft: #f6f4f1;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
::selection { color: var(--ink); background: #ead9df; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
button, input { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--serif); font-weight: 400; line-height: 1.3; }
p { margin-bottom: 16px; }
strong { font-weight: 600; }
[hidden], .project-card[hidden] { display: none !important; }
.container { width: min(940px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 99; top: 10px; left: 16px; padding: 8px 14px; background: #fff; border: 1px solid var(--link); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* The navigation remains visible, including on small screens. */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-family: var(--serif); font-size: 23px; line-height: 1.3; white-space: nowrap; }
.brand:hover { color: var(--link); text-decoration: none; }
.brand-mark { display: none; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 25px; }
.nav-links a { padding-block: 8px; color: #535d67; font-size: 13px; line-height: 1.5; }
.nav-links a:hover { color: var(--link); }
.nav-links a[aria-current="page"] { color: var(--link); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }

/* An introduction, a portrait, and direct links to the research record. */
.academic-profile { display: grid; grid-template-columns: minmax(0, 1fr) 165px; align-items: start; gap: 48px; padding-block: 43px 23px; }
.profile-copy h1 { margin-bottom: 6px; font-size: 38px; line-height: 1.22; letter-spacing: -.02em; }
.profile-copy h1::before, .page-header h1::before { display: block; width: 26px; height: 2px; margin-bottom: 13px; background: var(--accent); content: ""; }
.profile-field { margin-bottom: 18px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.profile-intro p { margin-bottom: 12px; font-size: 15px; line-height: 1.8; }
.profile-links, .hero-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 17px; }
.profile-links a, .hero-links a { font-size: 14px; }
.profile-portrait { padding-top: 6px; }
.profile-portrait img { width: 165px; height: 200px; object-fit: cover; object-position: center 29%; }
.profile-portrait figcaption, .portrait figcaption { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.opportunity-note { margin-block: 5px 31px; padding: 12px 17px; border-left: 2px solid var(--link); background: var(--soft); }
.opportunity-note p { margin: 0; font-size: 14px; line-height: 1.8; }

/* Compact sections put the research close to its supporting material. */
.academic-section { margin-block: 31px 35px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font-size: 25px; line-height: 1.35; }
.section-heading > a { flex-shrink: 0; font-size: 12px; }
.text-link { font-size: 14px; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-family: var(--sans); font-size: 13px; line-height: 1.6; font-weight: 400; }
.research-topics { margin: 0; padding: 0; list-style: none; }
.research-topics li { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 18px; margin-bottom: 10px; font-size: 14px; line-height: 1.75; }
.research-topics li:last-child { margin-bottom: 0; }
.research-topics strong { color: var(--ink); font-weight: 600; }
.research-topics span { color: #535d67; }

.publication-list { display: block; }
.publication { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 18px; padding-block: 14px 18px; border-bottom: 1px solid var(--line); }
.publication:first-child { padding-top: 0; }
.publication:last-child { padding-bottom: 0; border-bottom: 0; }
.publication-year { padding-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.publication h3 { font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.55; }
.publication-authors { margin-block: 5px 0; color: #4c5660; font-size: 13px; line-height: 1.7; }
.publication-venue { margin-block: 2px 0; color: var(--muted); font-size: 13px; font-style: italic; line-height: 1.65; }
.publication-highlight { margin-block: 4px 0; color: var(--accent); font-size: 13px; line-height: 1.65; }
.publication-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 5px; font-size: 12px; }
.publication .project-links { margin-top: 6px; }

.project-grid, .all-projects { display: block; }
.project-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 18px; padding-block: 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.project-card:first-child { padding-top: 0; }
.project-card:last-child { padding-bottom: 0; border-bottom: 0; }
.project-index { padding-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.project-body { min-width: 0; }
.project-meta { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-bottom: 3px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.project-body h3 { margin-bottom: 7px; font-family: var(--sans); font-size: 17px; font-weight: 500; line-height: 1.5; }
.project-body p { margin-bottom: 9px; font-size: 14px; line-height: 1.8; }
.project-summary { color: #424b54; }
.project-description { color: #535d67; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-block: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.project-links { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 9px; }
.project-links a { font-size: 13px; }
.page-index .project-description, .page-index .tags { display: none; }
.news-list { display: block; }
.news-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.news-item:last-child { margin-bottom: 0; }
.news-item time { padding-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.news-item h3 { font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1.7; }
.news-item p { margin-block: 3px 0; color: #58616a; font-size: 13px; line-height: 1.75; }

/* Performance documentation has its own small visual register. */
.creative-section { --media-accent: #79545c; --media-surface: #e9dde0; margin-block: 41px; }
.interactive-section { --media-accent: #3d6964; --media-surface: #e1ece9; }
.creative-section .section-heading { position: relative; margin-bottom: 22px; }
.creative-section .section-heading::after { position: absolute; bottom: -1px; left: 0; width: 32px; height: 1px; background: var(--media-accent); content: ""; }
.performance-work { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 29px; }
.performance-work + .performance-work { margin-top: 29px; }
.performance-media { position: relative; min-width: 0; }
.performance-poster { position: relative; display: block; padding: 6px; border: 1px solid #d3ceca; background: var(--media-surface); box-shadow: 3px 3px 0 var(--media-surface); }
.performance-poster:hover { border-color: var(--media-accent); text-decoration: none; }
.performance-poster img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.play-mark { position: absolute; bottom: 17px; left: 17px; display: grid; width: 33px; height: 33px; place-items: center; padding-left: 2px; border: 1px solid #d3ceca; border-radius: 50%; color: var(--media-accent); background: var(--paper); font-family: var(--sans); font-size: 11px; line-height: 1; }
.performance-media > .play-mark { bottom: 42px; pointer-events: none; }
.media-caption { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.performance-media iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid #d3ceca; background: var(--media-surface); }
.performance-copy { min-width: 0; }
.performance-meta { margin-bottom: 7px; color: var(--media-accent); font-size: 11px; line-height: 1.7; }
.performance-copy h3 { margin-bottom: 11px; font-family: var(--serif); font-size: 25px; line-height: 1.3; }
.performance-copy h3 a { color: var(--ink); }
.performance-copy h3 a:hover { color: var(--media-accent); }
.performance-subtitle { margin-bottom: 10px; color: var(--muted); font-size: 13px; font-style: italic; line-height: 1.7; }
.performance-description { margin-bottom: 12px; color: #424b54; font-size: 14px; line-height: 1.8; }
.performance-detail { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.performance-links { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 14px; }
.performance-links a { font-size: 13px; text-decoration: underline; text-decoration-color: #bec9d2; text-underline-offset: 4px; }
.performance-links a:hover { text-decoration-color: var(--media-accent); }

/* Inner pages use the same typography and simple document hierarchy. */
.page-header { max-width: 790px; padding-block: 40px 29px; }
.page-header h1 { margin-bottom: 13px; font-size: 35px; line-height: 1.25; letter-spacing: -.015em; }
.page-header > p:not(.eyebrow) { margin-bottom: 0; color: #58616a; font-size: 15px; line-height: 1.8; }
.page-end-link { margin-block: 25px 36px; font-size: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px 9px; margin-bottom: 27px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.filter-button { min-height: 34px; padding: 5px 9px; border: 0; border-radius: 0; color: #5c6670; background: transparent; font-size: 13px; line-height: 1.6; }
.filter-button:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.filter-button[aria-pressed="true"] { color: var(--link); background: #f2ecee; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.link-button, .button { display: inline; padding: 0; border: 0; color: var(--link); background: transparent; font-size: 14px; line-height: inherit; text-decoration: underline; text-underline-offset: 3px; }
.about-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: start; gap: 37px; margin-bottom: 42px; }
.portrait img { width: 180px; height: 218px; object-fit: cover; object-position: center 29%; }
.prose { min-width: 0; }
.prose p { margin-bottom: 16px; font-size: 15px; line-height: 1.85; }
.prose h2 { margin-block: 28px 17px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 25px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-block: 23px 12px; font-size: 20px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.education-list article { margin-bottom: 19px; }
.education-list article:last-child { margin-bottom: 0; }
.education-list h3 { margin: 0 0 3px; font-family: var(--sans); font-size: 15px; font-weight: 500; line-height: 1.6; }
.education-list p { margin-bottom: 2px; color: #59636c; font-size: 13px; line-height: 1.75; }
.contact-panel { max-width: 690px; padding-block: 4px 44px; }
.contact-panel .eyebrow { margin-bottom: 7px; }
.contact-panel h2 { margin-bottom: 13px; font-size: 25px; }
.contact-email { display: inline-block; margin-bottom: 21px; font-size: 20px; line-height: 1.6; overflow-wrap: anywhere; }
.contact-panel p:not(.eyebrow) { margin-bottom: 13px; color: #58616a; font-size: 15px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.contact-links a { font-size: 14px; }
.page-404 .page-header { padding-bottom: 23px; }
.page-404 main { min-height: 58vh; padding-bottom: 40px; }
.page-projects main, .page-publications main { padding-bottom: 39px; }

.site-footer { margin-top: 38px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; min-height: 83px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 22px; padding-block: 23px; }
.footer-inner p, .footer-inner a { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.footer-inner a:hover { color: var(--link); }

@media (max-width: 760px) {
  .container { width: calc(100% - 44px); }
  .header-inner { min-height: 76px; gap: 20px; }
  .brand { font-size: 21px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }
  .academic-profile { grid-template-columns: minmax(0, 1fr) 145px; gap: 29px; padding-top: 35px; }
  .profile-copy h1 { font-size: 35px; }
  .profile-portrait img { width: 145px; height: 180px; }
  .profile-field { font-size: 14px; }
  .profile-intro p { font-size: 14px; }
  .research-topics li { grid-template-columns: 190px minmax(0, 1fr); gap: 15px; }
  .about-layout { grid-template-columns: 150px minmax(0, 1fr); gap: 27px; }
  .portrait img { width: 150px; height: 185px; }
}
@media (max-width: 680px) {
  .performance-work { grid-template-columns: 1fr; gap: 19px; }
  .performance-meta { margin-bottom: 5px; }
  .performance-copy h3 { font-size: 24px; }
}
@media (max-width: 560px) {
  .container { width: calc(100% - 36px); }
  .header-inner { align-items: start; flex-direction: column; gap: 13px; padding-block: 19px 14px; }
  .brand { font-size: 22px; }
  .nav-links { width: 100%; gap: 22px; }
  .nav-links a { padding-block: 2px 4px; font-size: 12px; }
  .nav-links a[aria-current="page"] { text-underline-offset: 5px; }
  .academic-profile { grid-template-columns: minmax(0, 1fr) 104px; gap: 6px 18px; padding-top: 31px; padding-bottom: 18px; }
  .profile-copy { display: contents; }
  .profile-copy h1 { grid-column: 1; grid-row: 1; align-self: end; margin-bottom: 0; font-size: 31px; }
  .profile-field { grid-column: 1; grid-row: 2; margin-bottom: 0; font-size: 13px; }
  .profile-portrait { grid-column: 2; grid-row: 1 / span 2; padding-top: 1px; }
  .profile-portrait img { width: 104px; height: 132px; }
  .profile-portrait figcaption { font-size: 10px; }
  .profile-intro { grid-column: 1 / -1; grid-row: 3; padding-top: 12px; }
  .profile-intro p { font-size: 14px; line-height: 1.85; }
  .profile-links { grid-column: 1 / -1; grid-row: 4; gap: 7px 17px; margin-top: 0; }
  .profile-links a { font-size: 13px; }
  .opportunity-note { margin-block: 3px 27px; padding: 10px 13px; }
  .opportunity-note p { font-size: 13px; }
  .academic-section { margin-block: 27px 30px; }
  .section-heading { gap: 13px; margin-bottom: 15px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading > a { font-size: 11px; }
  .research-topics li { grid-template-columns: 1fr; gap: 2px; margin-bottom: 13px; font-size: 13px; }
  .publication, .project-card { grid-template-columns: 36px minmax(0, 1fr); gap: 11px; }
  .publication h3 { font-size: 15px; }
  .publication-year, .project-index { font-size: 12px; }
  .publication-authors, .publication-venue { font-size: 12px; }
  .project-body h3 { font-size: 16px; }
  .project-body p { font-size: 13px; }
  .project-meta { font-size: 11px; }
  .project-links { gap: 6px 15px; }
  .project-links a { font-size: 12px; }
  .news-item { grid-template-columns: 60px minmax(0, 1fr); gap: 11px; }
  .news-item time { font-size: 11px; }
  .news-item h3 { font-size: 13px; }
  .news-item p { font-size: 12px; }
  .creative-section { margin-block: 34px; }
  .creative-section .section-heading { margin-bottom: 19px; }
  .performance-copy h3 { font-size: 23px; }
  .performance-description { font-size: 13px; }
  .performance-links { gap: 7px 16px; margin-top: 12px; }
  .performance-links a { font-size: 12px; }
  .page-header { padding-block: 30px 25px; }
  .page-header h1 { font-size: 31px; }
  .page-header > p:not(.eyebrow) { font-size: 14px; }
  .filter-bar { gap: 5px 4px; }
  .filter-button { padding-inline: 7px; font-size: 12px; }
  .about-layout { grid-template-columns: 1fr; gap: 25px; }
  .portrait { max-width: 155px; }
  .portrait img { width: 155px; height: 190px; }
  .prose p { font-size: 14px; }
  .prose h2 { font-size: 24px; }
  .contact-email { font-size: 19px; }
  .contact-panel p:not(.eyebrow) { font-size: 14px; }
  .footer-inner { align-items: start; flex-direction: column; gap: 7px; padding-block: 20px; }
  .footer-inner p, .footer-inner a { font-size: 10px; }
}
@media (max-width: 359px) {
  .nav-links { gap: 16px; }
  .academic-profile { grid-template-columns: minmax(0, 1fr) 88px; column-gap: 15px; }
  .profile-copy h1 { font-size: 28px; }
  .profile-portrait img { width: 88px; height: 118px; }
}
@media print {
  body { color: #000; background: #fff; font-size: 11pt; }
  .container { width: 100%; }
  .site-header, .site-footer, .filter-bar, .skip-link { display: none; }
  .academic-profile, .page-header { padding-top: 0; }
  .opportunity-note { background: transparent; }
  .performance-poster { box-shadow: none; background: transparent; }
  .play-mark { display: none; }
  .publication, .project-card, .news-item, .performance-work { break-inside: avoid; }
}
