/* Jiayi (Jane) Chen — personal academic site. Standalone stylesheet, no theme dependency. */
:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eef2f5;
  --ink: #1d2730;
  --ink-2: #4b5560;
  --ink-3: #6b7681;
  --rule: #e1e6ea;
  --accent: #244f6b;
  --accent-2: #2f6a8f;
  --accent-soft: #e6eff5;
  --warm: #b4581c;
  --warm-soft: #fbf0e8;
  --radius: 10px;
  --wrap: 1140px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171c; --surface: #1a2128; --surface-2: #212a32; --ink: #e6ebef; --ink-2: #b4bec7; --ink-3: #8c98a3;
    --rule: #2b353e; --accent: #8cc3e6; --accent-2: #a9d3ee; --accent-soft: #1c2d3a; --warm: #f0a26b; --warm-soft: #2e2219;
  }
}
:root[data-theme="dark"] {
  --bg: #12171c; --surface: #1a2128; --surface-2: #212a32; --ink: #e6ebef; --ink-2: #b4bec7; --ink-3: #8c98a3;
  --rule: #2b353e; --accent: #8cc3e6; --accent-2: #a9d3ee; --accent-soft: #1c2d3a; --warm: #f0a26b; --warm-soft: #2e2219;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--bg) 92%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.nav a { color: var(--ink-2); font-size: .92rem; font-weight: 500; padding: 4px 10px; border-radius: 6px; }
.nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

/* Two-column layout: profile sidebar + content */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding-top: 64px; padding-bottom: 64px; }
main { min-width: 0; }
.profile { position: sticky; top: 100px; align-self: start; text-align: center; }
.avatar { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; border: 1px solid var(--rule); }
.profile-name { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1.2; color: var(--ink); margin-bottom: 12px; }
.profile-role { color: var(--ink-2); font-size: 1rem; }
.profile-org { font-size: .95rem; margin-bottom: 10px; }
.profile-org a { color: var(--ink-2); }
.profile-email { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--ink-2); margin-bottom: 18px; word-break: break-all; }
.icons { display: flex; justify-content: center; gap: 6px; }
.icons a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; color: var(--accent); }
.icons a:hover { background: var(--accent-soft); text-decoration: none; }
.icons svg { width: 19px; height: 19px; fill: currentColor; }
.icons .icon-text { font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
h2.first { margin-top: 0; }

/* Typography */
h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 2.2rem; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.05rem; font-weight: 600; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
.page-head { margin-bottom: 8px; }
.page-head h1 { margin-top: -6px; }
.page-head .lede { color: var(--ink-2); font-size: 1.08rem; max-width: 68ch; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.section-link { font-size: .92rem; font-weight: 500; }

/* Hero */
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); background: var(--bg); }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--bg); border-color: var(--accent-2); }
.btn svg { width: 15px; height: 15px; flex: none; }

.callout { margin: 28px 0 8px; padding: 14px 18px; border-radius: var(--radius); background: var(--warm-soft); border-left: 4px solid var(--warm); color: var(--ink); }
.callout a { color: var(--warm); font-weight: 600; }
.bio { margin-top: 0; }
.bio p { font-size: 1.02rem; }
.thesis { font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; color: var(--ink); margin: 0 0 18px; padding-left: 16px; border-left: 3px solid var(--accent); }

/* Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 8px; font-size: 1rem; }
.card p { font-size: .92rem; color: var(--ink-2); margin-bottom: 10px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.card-num { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stat { border-top: 2px solid var(--accent); padding-top: 10px; }
.stat-num { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: .95rem; }
.news li:last-child { border-bottom: 0; }
.news .date { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
details.more summary { cursor: pointer; color: var(--accent); font-size: .92rem; font-weight: 500; margin-top: 8px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { display: none; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.pub:last-child { border-bottom: 0; }
.pub-venue { padding-top: 2px; }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; line-height: 1.3; background: var(--accent); color: var(--bg); }
.badge-workshop { background: var(--accent-soft); color: var(--accent); }
.badge-review, .badge-preprint { background: var(--surface-2); color: var(--ink-2); }
.pub-title { font-weight: 600; color: var(--ink); line-height: 1.4; }
.pub-authors { font-size: .92rem; color: var(--ink-2); margin-top: 3px; }
.pub-authors .me { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.pub-meta { font-size: .86rem; color: var(--ink-3); margin-top: 2px; }
.pub-summary { font-size: .92rem; color: var(--ink-2); margin: 8px 0 0; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { font-size: .78rem; font-weight: 600; padding: 2px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--accent); }
.pill:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: var(--ink-3); margin: 6px 0 0; }

/* Research page */
.thrust { margin: 0 0 8px; }
.project { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.project-name { font-weight: 700; color: var(--ink); }
.project-name .badge { margin-top: 6px; }
.project p { font-size: .96rem; margin: 0 0 6px; }
.result { font-size: .9rem; color: var(--accent); font-weight: 500; }
figure { margin: 24px 0; }
figure img { border-radius: var(--radius); border: 1px solid var(--rule); background: #fff; padding: 12px; }
figcaption { font-size: .88rem; color: var(--ink-3); margin-top: 8px; text-align: center; }
.directions { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.directions li { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--rule); }
.directions h3 { margin: 0 0 6px; }
.directions p { margin: 0; font-size: .95rem; color: var(--ink-2); }

/* Timeline / generic lists */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--ink-3); font-size: .92rem; font-variant-numeric: tabular-nums; }
.timeline .what { font-weight: 600; }
.timeline .where { color: var(--ink-2); font-size: .94rem; }
.timeline .detail { color: var(--ink-2); font-size: .9rem; margin-top: 2px; }

.mentees { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; list-style: none; padding: 0; margin: 0; }
.mentees li { padding: 10px 14px; border: 1px solid var(--rule); border-radius: 8px; }
.mentees .name { font-weight: 600; }
.mentees .now { font-size: .88rem; color: var(--ink-2); }
.mentees .tag { margin-left: 4px; vertical-align: 1px; }

.talk { margin-bottom: 28px; }
.talk h3 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 4px; }
blockquote { margin: 20px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-2); font-style: italic; }
blockquote p:last-child { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); color: var(--ink-3); font-size: .86rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 28px; }
.footer-links { display: flex; gap: 16px; align-items: flex-end; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 36px; }
  .profile { position: static; }
  .subpage .profile { display: none; }
}
@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mentees { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 1.8rem; }
  .pub, .project, .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .news li { grid-template-columns: 1fr; gap: 0; }
  .header-inner { justify-content: flex-start; }
  .nav a { padding: 4px 8px; font-size: .88rem; }
}
@media print {
  .site-header, .site-footer, .links { display: none; }
}
main li img { max-width: 320px; margin: 10px 0 4px; border-radius: 8px; }
code { font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
a.tag:hover { text-decoration: none; background: var(--accent); color: var(--bg); }
.tag-more { color: var(--ink-3); background: transparent; border: 1px dashed var(--rule); font-weight: 500; font-style: italic; }
.pub { scroll-margin-top: 90px; }
.pub:target { background: var(--accent-soft); border-radius: 8px; box-shadow: 0 0 0 10px var(--accent-soft); }
.avatar.avatar-full { width: 100%; height: auto; aspect-ratio: auto; border-radius: var(--radius); object-fit: contain; }
@media (max-width: 900px) { .avatar.avatar-full { max-width: 420px; } }
.student-list { margin: 0 0 8px; padding-left: 22px; }
.student-list li { margin: 4px 0; }

/* Fun Facts photo walk */
.fun-intro { font-size: 18px; color: var(--ink-2); margin-top: 0; }
.photo-walk { position: relative; margin-top: 28px; }
.walk-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: thin; padding-bottom: 10px; outline: none; position: relative;
}
.walk-item { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.walk-item img { height: 400px; width: auto; max-width: none; border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); }
.walk-item figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; text-align: left; }
.walk-btn {
  position: absolute; top: 200px; transform: translateY(-50%); width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
  font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.walk-btn:hover { background: var(--surface); }
.walk-prev { left: -14px; }
.walk-next { right: -14px; }
@media (max-width: 640px) {
  .walk-item img { height: 300px; max-width: 82vw; object-fit: cover; }
  .walk-item figcaption { max-width: 82vw; }
  .walk-btn { top: 150px; }
  .walk-prev { left: 4px; }
  .walk-next { right: 4px; }
}
