:root {
  color-scheme: light;
  --ink: #20222a;
  --muted: #656773;
  --accent: #5845a3;
  --line: #e7e7ed;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid #a995ed; outline-offset: 5px; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
figure, p { margin: 0; }
main, .site-nav, footer { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.site-nav a { color: var(--muted); }
.site-nav a:first-child { font-weight: 650; color: var(--ink); }
.project-header { padding: 64px 0 48px; text-align: center; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 1000px; margin: 15px auto 26px; font-size: clamp(32px, 4.25vw, 48px); line-height: 1.18; font-weight: 750; letter-spacing: -.035em; text-wrap: balance; }
.authors { max-width: 900px; margin-inline: auto; font-size: 19px; line-height: 1.9; }
.authors a, .authors span { white-space: nowrap; }
.affiliation { margin-top: 5px; color: var(--muted); font-size: 16px; }
.resource-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 25px; }
.button { display: inline-flex; align-items: center; gap: 14px; padding: 8px 23px; border: 1px solid #dcdce4; border-radius: 24px; color: var(--ink); font-size: 15px; font-weight: 600; }
.button:hover { background: #f2f0f8; text-decoration: none; }
.button-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button-primary:hover { background: #40374f; }
.poem-figure { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center; padding: 20px 0 50px; }
.poem-animation { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f4f7f2; }
.poem-animation img { width: 100%; }
h2 { margin: 0 0 22px; font-size: 28px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
.poem-figure h2 { margin: 10px 0 26px; font-size: 32px; }
.poem { font-family: "KaiTi", "Kaiti SC", "Noto Serif CJK SC", "Songti SC", serif; font-size: clamp(25px, 2.7vw, 32px); line-height: 1.8; letter-spacing: .06em; color: #39304d; }
.poem-credit { margin: 12px 0 25px; color: var(--muted); font-size: 13px; }
.poem-figure figcaption > p:not(.poem):not(.eyebrow):not(.poem-credit) { font-size: 16px; color: #50515e; }
.animation-controls { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin-top: 22px; font-size: 14px; }
.text-button { background: transparent; color: var(--accent); border: 0; padding: 0; font-size: 14px; }
.text-button:hover { text-decoration: underline; }
.text-section { max-width: 880px; margin: 38px auto 65px; }
.text-section p + p { margin-top: 17px; }
.figure-section { padding: 44px 0 15px; border-top: 1px solid var(--line); margin-bottom: 45px; }
.figure-section h2 { text-align: center; margin-bottom: 30px; }
.figure-section figure > a { display: block; }
.figure-section img { width: 100%; }
.figure-section figcaption { max-width: 920px; margin: 20px auto 0; font-size: 15px; line-height: 1.65; color: var(--muted); }
.result-gallery h2 { margin-bottom: 12px; }
.gallery-intro { max-width: 700px; margin: 0 auto 40px; color: var(--muted); text-align: center; font-size: 15px; }
.result-panel + .result-panel { margin-top: 48px; }
.result-panel h3 { margin: 0 0 18px; font-size: 22px; line-height: 1.35; font-weight: 650; letter-spacing: -.02em; }
.result-panel figure > a { cursor: zoom-in; }
.result-panel figure > a + a { margin-top: 12px; }
.result-panel img { border-radius: 4px; }
.result-panel--split figure { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.result-panel--split figcaption { margin: 0; }
.citation-section { scroll-margin-top: 30px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
pre { margin: 0; padding: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #f7f7fa; font-size: 13px; line-height: 1.7; tab-size: 2; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.copy-status { min-height: 1.7em; margin-top: 8px; color: var(--muted); font-size: 13px; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 25px 0 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  main, .site-nav, footer { width: calc(100% - 40px); }
  .project-header { padding: 42px 0 32px; }
  .authors { font-size: 17px; }
  .poem-figure { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 10px 0 28px; }
  .poem-animation { width: min(100%, 440px); margin-inline: auto; }
  .poem-figure figcaption { max-width: 500px; margin-inline: auto; }
  .poem-figure h2 { margin-bottom: 16px; }
  .poem { font-size: 29px; }
  .text-section { margin: 35px auto 45px; }
  .figure-section { padding-top: 32px; margin-bottom: 30px; }
  .gallery-intro { margin-bottom: 30px; }
  .result-panel + .result-panel { margin-top: 36px; }
  .result-panel h3 { font-size: 20px; }
  .result-panel--split figure { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .result-panel--split figure > a { width: min(100%, 560px); margin-inline: auto; }
  h2 { font-size: 25px; }
  pre { padding: 17px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
