@font-face {
  font-family: "Ernie Local";
  src: local("Adobe Handwriting Ernie"), local("AdobeHandwriting-Ernie");
}
@font-face {
  font-family: Corinthia;
  src: url("/jesunswu-signature.woff2") format("woff2");
  font-display: swap;
}
:root {
  --paper: #f8f6ef;
  --ink: #262520;
  --secondary: #605c52;
  --accent: #8a472e;
  --line: #cbc6ba;
  --gutter: clamp(20px, 5.3vw, 84px);
  --space: clamp(2.8rem, 6vw, 6rem);
  --reading: Georgia, "Songti SC", "Noto Serif CJK SC", "Songti TC", SimSun, serif;
  --ui: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--ui); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--ink); background: #ebd7bf; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--reading); font-weight: 400; text-wrap: balance; }
.frame { width: min(calc(100% - 2 * var(--gutter)), 78rem); margin-inline: auto; }
.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4.5vw, 5rem);
  min-height: clamp(72px, 6.7vw, 98px);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--ink);
}
.signature {
  display: inline-block;
  font: 400 clamp(2.2rem, 3.3vw, 3.25rem)/1 adobe-handwriting-ernie, "Ernie Local", Corinthia, cursive;
  font-synthesis: none;
  transform: rotate(-2deg);
  transform-origin: left center;
}
.sections { display: flex; align-items: center; flex-wrap: wrap; column-gap: clamp(.85rem, 2.2vw, 2.4rem); }
.sections a, .language summary { display: inline-flex; align-items: center; min-height: 44px; }
.sections a, .language, .site-footer { font: 500 clamp(.79rem, 1.05vw, .95rem)/1.35 var(--ui); }
.sections a[aria-current="page"], .sections a:hover {
  text-decoration: underline; text-underline-offset: .42em; text-decoration-thickness: 1px;
}
.language { position: relative; margin-left: auto; flex-shrink: 0; }
.language summary { gap: .65rem; cursor: pointer; list-style: none; }
.language summary::-webkit-details-marker { display: none; }
.language summary::after {
  content: ""; width: .4rem; height: .4rem;
  border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg);
}
.language[open] summary::after { transform: translateY(2px) rotate(225deg); }
.language nav {
  position: absolute; top: 100%; right: 0; width: 9.5rem;
  padding: .32rem; background: var(--paper); border: 1px solid var(--line);
}
.language nav a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: .5rem .75rem; }
.language nav a:hover, .language nav a:focus-visible { background: #eee9de; }
.language [aria-current]::after { content: "✓"; }
.banner {
  display: block; width: 100%; height: auto; aspect-ratio: 1672 / 686;
  object-fit: cover; object-position: center top; margin-top: clamp(1.15rem, 2.4vw, 2.5rem);
}
.biography, .journey, .literature-intro {
  display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.35fr);
  align-items: start; column-gap: clamp(2.4rem, 7vw, 7rem);
}
.biography { padding-block: var(--space); }
h1 { font-size: clamp(3.3rem, 6.3vw, 6.5rem); letter-spacing: -.06em; line-height: .99; }
#about, .journey, .poem { scroll-margin-block-start: 1.5rem; }
.roles {
  max-width: 34em; margin-top: 1.45rem; color: var(--secondary);
  font: 400 .9rem/1.75 var(--ui); text-wrap: pretty;
}
.bio-text, .journey li p { font: 400 clamp(1.05rem, 1.42vw, 1.27rem)/1.7 var(--reading); }
.bio-text { max-width: 63ch; }
.bio-text p + p { margin-top: 1.15em; }
.bio-text .closing { margin-top: 1.7em; color: var(--accent); font-size: .96em; }
html:lang(zh) .bio-text, html:lang(zh) .journey li p { line-height: 1.95; }
.journey { border-top: 1px solid var(--ink); padding-block: var(--space); }
.journey h2 { font-size: clamp(2rem, 3.65vw, 3.65rem); line-height: 1.1; letter-spacing: -.04em; }
.journey ol { padding: 0; margin: 0; list-style: none; }
.journey li { border-top: 1px solid var(--line); padding: 1.5rem 0 1.8rem; }
.journey li:first-child { border: 0; padding-top: 0; }
.journey h3 { font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.24; margin-bottom: .55em; }
.journey li p + p { margin-top: .45em; }
.literature-intro {
  grid-template-columns: minmax(0, 1.38fr) minmax(15rem, .82fr);
  align-items: end; padding-block: var(--space);
}
.literature-intro h1 { font-size: clamp(3.1rem, 6.8vw, 6.8rem); line-height: 1.02; }
html:lang(zh) .literature-intro h1 { font-size: clamp(2.4rem, 5vw, 5rem); letter-spacing: -.045em; line-height: 1.18; }
.poem-index a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .85rem 0; border-top: 1px solid var(--line); font: 400 1.06rem/1.4 var(--reading);
}
.poem-index a span:last-child { font-family: var(--ui); color: var(--accent); }
.poem { border-top: 1px solid var(--ink); padding: var(--space) 0; }
.poem h2 { font-size: clamp(2rem, 4.1vw, 4.3rem); line-height: 1.09; letter-spacing: -.04em; max-width: 25ch; }
.poem-credit, .edition-label, .inscription { font: 400 .9rem/1.6 var(--ui); color: var(--secondary); }
.poem-credit { margin: .7rem 0 clamp(1.7rem, 4vw, 3.7rem); }
#chaozha-zashi .poem-credit [lang="zh-Hans"] { font-style: italic; }
.edition-label { margin-bottom: 1.2rem; color: var(--accent); }
.verses { font: 400 clamp(1.08rem, 1.5vw, 1.35rem)/1.65 var(--reading); }
.verse + .verse { margin-top: .7em; }
.original, .translation { display: block; min-width: 0; }
.translation { white-space: pre-line; }
html:lang(en) .verse { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.6fr); column-gap: clamp(2rem, 6vw, 6rem); }
html:lang(en) .verse + .verse { margin-top: 1.35em; }
html:lang(en) .original { font-size: .92em; line-height: 1.85; }
html:lang(en) #tunlu-mingzhi .original { font-weight: bold; }
.inscription { margin-top: 2rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; color: var(--secondary); }
.site-footer a { display: inline-flex; align-items: center; gap: .6rem; min-height: 38px; }
.easter-egg {
  position: fixed; z-index: 3; right: max(8px, env(safe-area-inset-right)); bottom: max(5px, env(safe-area-inset-bottom));
  padding: 5px 6px; color: rgb(255 255 255 / 0); font: 500 10px/1.2 var(--ui); letter-spacing: .045em;
}
.easter-egg:hover, .easter-egg:focus-visible { color: #000; }
.missing { min-height: 65vh; display: grid; align-content: center; gap: 1.5rem; }
.missing a { text-decoration: underline; }
@media (max-width: 780px) {
  .biography, .journey, .literature-intro { grid-template-columns: 1fr; row-gap: 2rem; }
  .literature-intro { align-items: start; }
  .poem-index { max-width: 36rem; }
  .roles { max-width: none; margin-top: 1rem; }
  .bio-text { max-width: none; }
  html:lang(en) .verse { grid-template-columns: 1fr; gap: .55rem; }
  html:lang(en) .verse + .verse { margin-top: 1.85em; }
}
@media (max-width: 600px) {
  .masthead { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "signature language" "sections sections"; gap: 0 1rem; padding-top: max(.8rem, env(safe-area-inset-top)); }
  .signature { grid-area: signature; justify-self: start; }
  .language { grid-area: language; }
  .sections { grid-area: sections; column-gap: clamp(.75rem, 4vw, 1.3rem); }
  .sections a { font-size: .84rem; }
  .literature-intro h1 { font-size: clamp(2.75rem, 11vw, 4.3rem); }
  .poem-index a { min-height: 44px; }
  .journey h3 { text-wrap: pretty; }
}
@media (prefers-reduced-motion: no-preference) {
  .easter-egg { transition: color 120ms ease; }
}
