:root {
  color-scheme: light;
  --ink: #30221d;
  --muted: #705a4f;
  --rust: #87432d;
  --paper: #fcf6eb;
  --line: #d6c3b1;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", SimSun, Georgia, serif;
  --sans: system-ui, "PingFang SC", sans-serif;
  --english: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #eee3d6;
  font: 16px/1.75 var(--sans);
}
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 5px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.16; }
h2, h3 { text-wrap: balance; }
p, dd, figcaption { line-break: strict; }
h1:focus, h2:focus { outline: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.keep-together { display: inline-block; white-space: nowrap; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.ambient::after {
  content: ""; position: absolute; inset: 0; opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23644c40' opacity='.25' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
.ambient i {
  position: absolute; width: 66vw; height: 66vw; border-radius: 50%;
  background: radial-gradient(circle, #e3c3a8 0, transparent 68%);
  animation: drift 22s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { top: -35vw; right: -12vw; }
.ambient i:nth-child(2) { bottom: -44vw; left: -19vw; animation-delay: -9s; background: radial-gradient(circle, #d3bdab, transparent 70%); }
.ambient i:nth-child(3) { top: 42%; right: -47vw; animation-delay: -15s; }
@keyframes drift { to { transform: translate(-9vw, 9vh) scale(1.14); } }
.ambient-particle {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: var(--size, 4px);
  height: var(--size, 4px);
  border-radius: 50%;
  background: #a37a5d;
  opacity: .38;
  animation: mote-drift var(--duration, 18s) ease-in-out var(--delay, 0s) infinite alternate;
}
.ambient-particle:nth-child(3n) {
  border-radius: 0;
  background: #ab784e;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.ambient-particle:nth-child(3n + 1) { background: #fff9e6; box-shadow: 0 0 5px #fff3d4; }
@keyframes mote-drift {
  0% { opacity: .25; }
  58% { opacity: .65; }
  100% { opacity: .32; transform: translate(var(--drift, 16px), -31px) rotate(65deg); }
}

.shell { width: min(1232px, calc(100% - 80px)); margin: 0 auto; }
.masthead { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 700 20px/1.15 var(--serif); white-space: nowrap; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font: 10px/1.2 var(--sans); letter-spacing: .15em; }
.chapters { display: flex; gap: clamp(12px, 2.2vw, 32px); align-items: center; justify-content: center; }
.chapters a { position: relative; text-decoration: none; white-space: nowrap; font-size: 14px; color: var(--muted); padding: 8px 0; }
.chapters small { font: 11px var(--english); letter-spacing: .08em; color: var(--rust); }
.chapters a:hover, .chapters a[aria-current] { color: var(--rust); }
.chapters a[aria-current]::after { content: ""; position: absolute; inset: auto 0 2px; height: 1px; background: var(--rust); }
.music-switch {
  display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 44px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px;
  background: #fffaf16e; color: var(--muted); font-size: 12px; white-space: nowrap;
}
.music-switch:hover { background: var(--paper); }
.music-switch[aria-pressed="true"] { color: var(--rust); }
.music-state { min-width: 2em; text-align: center; font-size: 11px; }

.book { position: relative; perspective: 1900px; }
.spread {
  isolation: isolate;
  position: relative;
  min-height: clamp(515px, 67vh, 660px);
  padding: clamp(38px, 5vw, 82px);
  border: 1px solid #d9c5b4;
  border-radius: 6px 14px 14px 6px;
  background: radial-gradient(ellipse at 93% 0%, #f0dfcb 0%, transparent 56%), var(--paper);
  box-shadow: 0 3px 0 -1px #e0ccba, 0 7px 0 -3px #d4beab, 0 20px 48px #51301b13;
}
.spread::before {
  content: ""; pointer-events: none; position: absolute; z-index: -1; inset: 0 auto 0 0;
  width: 31px;
  background:
    repeating-linear-gradient(#986f533b 0 3px, transparent 3px 10px) 10px center / 1px calc(100% - 44px) no-repeat,
    linear-gradient(to right, #8e675424, transparent);
  border-radius: 6px 0 0 6px;
}
.spread::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 9px 10px auto auto;
  width: 116px;
  height: 82px;
  background: url("assets/paper-ornaments.svg") right top / contain no-repeat;
  pointer-events: none;
}
.book:not(.is-paged) .spread + .spread { margin-top: 24px; }
.spread.turn-forward { transform-origin: left center; animation: turn-in .48s cubic-bezier(.2,.75,.28,1) both; }
.spread.turn-back { transform-origin: right center; animation: turn-back .48s cubic-bezier(.2,.75,.28,1) both; }
@keyframes turn-in { from { opacity: .45; transform: rotateY(-8deg) translateX(12px); filter: brightness(.92); } }
@keyframes turn-back { from { opacity: .45; transform: rotateY(8deg) translateX(-12px); filter: brightness(.92); } }
.hero, .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 94px); align-items: center; }
.hero { grid-template-columns: .98fr 1.02fr; }
.hero > *, .two-col > * { min-width: 0; }
.hero-copy { container-type: inline-size; }
.kicker { display: flex; align-items: center; gap: 9px; color: var(--rust); font-size: 12px; font-weight: 650; letter-spacing: .17em; margin-bottom: 25px; }
.kicker i { width: 21px; height: 1px; background: currentColor; }
.kicker span { opacity: .64; }
h1 { font-size: clamp(33px, 16.4cqi, 91px); letter-spacing: -.07em; }
h1 span { color: var(--rust); }
h2 { font-size: clamp(38px, 5.3vw, 76px); letter-spacing: -.055em; margin-bottom: 20px; }
h3 { font-size: clamp(19px, 2vw, 29px); }
.roman { color: var(--rust); font: italic clamp(15px, 2vw, 25px) var(--english); margin: 16px 0 18px; }
.roman span { font-size: .61em; vertical-align: middle; margin: 0 .6em; }
.intro, .lede { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); max-width: 33em; text-wrap: pretty; }
.prose p { text-wrap: pretty; }
.prose p + p { margin-top: .3em; }
.body-note { margin-top: 18px; text-wrap: pretty; }
.birth { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin: 19px 0 0; }
.birth span { height: 12px; border-left: 1px solid var(--line); }
.birth a { color: var(--rust); }
.quote {
  display: inline-flex; gap: 19px; align-items: center;
  padding: 8px 12px 8px 6px; margin-top: 25px; border: 1px solid #d5b8a4;
  border-radius: 4px; background: #fffaf16e; font-family: var(--serif); color: var(--rust);
}
.quote small { font-size: 17px; }
.quote:hover, .paper-button:hover { background: #f0decb; }

.hero-photos { position: relative; padding: 18px 0 15px; }
.frame {
  background: #fffaf0;
  padding: 9px;
  border: 1px solid #d6beab;
  box-shadow: 0 9px 24px #3e291b26;
}
.photo { display: block; padding: 0; border: 0; background: #dac6af; width: 100%; cursor: zoom-in; }
.photo img { width: 100%; height: auto; object-fit: cover; transition: filter .2s; }
.photo:hover img { filter: brightness(1.08); }
figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; padding: 7px 1px 0; }
figcaption span:last-child { color: var(--rust); font: 11px var(--english); letter-spacing: .08em; white-space: nowrap; }
.hero-main { width: 69%; margin-left: 4%; transform: rotate(-5deg); }
.hero-main .photo img { height: clamp(255px, 41vh, 400px); object-position: 50% 42%; }
.hero-side { width: 49%; position: absolute; right: 0; bottom: 20px; transform: rotate(9deg); }
.hero-side .photo img { aspect-ratio: 1.45; object-position: 50% 41%; }
.spark {
  position: absolute;
  z-index: 1;
  left: -12px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--rust);
  font: 33px/1 var(--serif);
}
.spark:not(:hover, :focus-visible) { animation: glint 6s ease-in-out infinite; }
.spark:hover, .spark:focus-visible { background: var(--paper); border-color: var(--line); }
@keyframes glint { 50% { opacity: .5; transform: translateY(-7px) rotate(12deg); } }

.facts { margin-top: 21px; }
.facts > div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0; }
.facts dt { color: var(--rust); font-size: 13px; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.facts small { display: block; color: var(--muted); }
.snapshot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; align-items: center; }
.snapshot-pair .frame { min-width: 0; }
.snapshot-pair .frame:first-child { transform: rotate(-5deg); }
.snapshot-pair .frame:last-child { transform: rotate(5deg); }
.snapshot-pair img { aspect-ratio: 4/5; }

.music-tastes { margin-top: 13px; }
.music-tastes > div + div { margin-top: 10px; }
.music-tastes dt { color: var(--rust); font-size: 12px; font-weight: 600; }
.music-tastes dd { display: flex; flex-wrap: wrap; gap: 0 12px; }
.music-tastes dd span { white-space: nowrap; }
.music-spread { padding-block: clamp(34px, 4vw, 60px); }
.playlist-note { margin-top: 19px; border-left: 2px solid var(--line); padding: 6px 0 4px 14px; }
.eyebrow { display: block; color: var(--rust); font: 11px var(--sans); letter-spacing: .16em; }
.playlist-note h3, .course-sheet h3 { margin: 7px 0; }
.tracks { list-style: none; margin: 10px 0 0; padding: 0; }
.tracks li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0 10px; border-top: 1px solid var(--line); padding: 4px 0;
}
.tracks a { font: 15px Georgia, "Songti SC", serif; text-decoration: none; }
.tracks a:hover { color: var(--rust); text-decoration: underline; }
.tracks span { color: var(--muted); font-size: 12px; }
.playlist-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--rust); }
.record-scene { display: grid; justify-items: center; }
.record {
  display: grid; place-items: center; width: min(90%, 325px); aspect-ratio: 1; padding: 0;
  border-radius: 50%; border: 2px solid #533a30; box-shadow: 6px 12px 25px #4d2e2450;
  background:
    conic-gradient(from 25deg, #fff0 0deg, #fbe2ba26 38deg, #fff0 73deg, #fff0 175deg, #fbe2ba2f 215deg, #fff0 250deg),
    repeating-radial-gradient(circle, #2b2220 0 4px, #49342e 5px, #2b2220 7px);
}
.record span {
  display: grid; place-items: center; width: 36%; aspect-ratio: 1; border-radius: 50%;
  color: #f9e7d4; background: #8a4935; border: 6px double #ebc8a6;
  font: bold clamp(24px, 4vw, 49px) var(--serif);
}
.record[aria-expanded="true"] { animation: turn-record .7s ease-out; }
.record[aria-expanded="true"] span { background: #535e4e; }
@keyframes turn-record { from { transform: rotate(-55deg) scale(.98); } }
.record-caption { margin-top: 20px; min-height: 2em; color: var(--rust); font-family: var(--serif); }
.record-caption a { display: block; text-align: center; }

.paper-button {
  display: inline-flex; gap: 18px; align-items: center;
  border: 1px solid #bc947d; background: #fff9ef; border-radius: 4px;
  color: var(--rust); padding: 8px 13px; margin-top: 21px; text-decoration: none; font-size: 14px;
}
.court-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.court-main { grid-column: 1 / -1; }
.court-main .photo img { aspect-ratio: 16/9; }
.court-grid > .photo img { aspect-ratio: 2.05; }
.illustration { background: #fff9ee; border: 1px solid #d3bfaa; padding: 8px; box-shadow: 0 5px 14px #543c2314; }
.illustration img { width: 100%; height: auto; aspect-ratio: 1.52; object-fit: cover; }
.travel-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 3px 22px; }
.postcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 12px; }
.travel-index { margin-top: 20px; }
.travel-list {
  display: flex; flex-wrap: wrap; gap: 3px 17px; margin: 6px 0 0; padding: 0;
  list-style: none; color: var(--muted); font-size: 14px;
}
.travel-list li { white-space: nowrap; }

.timeline { list-style: none; padding: 0 0 0 23px; margin: 0; border-left: 1px solid #bd9b83; }
.timeline li { position: relative; padding: 0 0 15px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { position: absolute; left: -27px; top: 8px; content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rust); }
.timeline li > span { font-size: 12px; color: var(--rust); letter-spacing: .09em; }
.timeline h3 { margin: 3px 0; font-size: clamp(19px, 1.85vw, 27px); }
.timeline p { color: var(--muted); font-size: 14px; }
.timeline-stamp {
  display: grid; place-content: center; justify-items: center; width: 104px; aspect-ratio: 1;
  border-radius: 50%; border: 4px double #a36750; color: var(--rust); transform: rotate(-12deg);
  font: 11px var(--english); letter-spacing: .15em; margin: 28px 0 0 8px;
}
.timeline-stamp b { font-size: 29px; line-height: 1.2; }
.schools article { margin-top: 18px; }
.schools h3 { margin: 4px 0 7px; }
.schools h3 small { color: var(--rust); font: 13px var(--english); margin-left: 4px; }
.schools p, .research-list p { color: var(--muted); }
.schools a { color: var(--rust); font-size: 12px; }
.course-sheet {
  position: relative; background: repeating-linear-gradient(#fffcf2 0 27px, #eee4d5 28px, #fffcf2 29px);
  border: 1px solid var(--line); padding: clamp(17px, 3vw, 35px); box-shadow: 0 8px 20px #543c2316;
}
.route { display: flex; flex-wrap: wrap; gap: 0 .35em; color: var(--rust); font-size: 14px; }
.route span { white-space: nowrap; }
.course-sheet .facts > div { grid-template-columns: min(25%, 90px) 1fr; }
.research-list article { border-top: 1px solid var(--line); padding: 12px 0; }
.research-list article:last-child { border-bottom: 1px solid var(--line); }
.research-list h3 { font-size: 22px; }
.research-list p { font-size: 14px; margin-top: 4px; text-wrap: pretty; }
.orbit-button {
  display: grid; place-items: center;
  width: 148px; height: 88px; margin: 15px 0 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #9c795f;
}
.orbit-button > * { grid-area: 1 / 1; }
.orbit-button span { font: italic 32px/1 var(--english); }
.orbit-button:hover, .orbit-button:focus-visible { color: var(--rust); }

.folio { display: none; }
.is-paged + .folio { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 22px 0 15px; }
.folio-arrow {
  display: flex; align-items: center; justify-self: start; gap: 11px;
  text-decoration: none; color: var(--rust); font-size: 14px; padding: 8px 2px;
}
.folio-arrow:last-child { justify-self: end; }
.folio-arrow[aria-disabled="true"] { opacity: .55; cursor: default; }
.folio-arrow[aria-disabled="false"]:hover { text-decoration: underline; }
.folio-center { display: flex; align-items: center; gap: 14px; }
.page-count { color: var(--muted); font: 13px var(--english); letter-spacing: .13em; white-space: nowrap; }
.dots { display: flex; align-items: center; }
.dots a { display: grid; place-items: center; width: 20px; height: 28px; }
.dots a::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ab907e; transition: transform .2s, background .2s; }
.dots a[aria-current]::after, .dots a:hover::after { transform: scale(1.4); background: var(--rust); }
.colophon { display: flex; justify-content: space-between; border-top: 1px solid #cdb8a5; padding: 10px 0 16px; color: var(--muted); font-size: 11px; }

dialog { border: 1px solid var(--line); color: var(--ink); border-radius: 8px; background: var(--paper); box-shadow: 0 15px 65px #2b191e55; }
dialog::backdrop { background: #2c201ac4; }
.close { display: grid; place-items: center; border: 1px solid #b89781; border-radius: 50%; background: var(--paper); width: 40px; height: 40px; font: 25px/1 var(--sans); }
dialog form { display: flex; justify-content: end; margin-bottom: 10px; }
.lightbox { width: max-content; max-width: 94vw; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 75vh; object-fit: contain; margin: 0 auto; }
.letter { width: min(94vw, 520px); padding: 20px 26px 27px; }
.letter h2 { font-size: clamp(25px, 5.5vw, 38px); }
.letter .kicker { margin-bottom: 10px; }
.keepsake-mark {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  margin-bottom: 14px;
  border: 3px double #b98b73;
  border-radius: 50%;
  background: #f3e4d2;
  color: var(--rust);
  font: 34px/1 var(--serif);
}
.keepsake-text { color: var(--muted); text-wrap: pretty; }
.drink-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 15px; }
.drink-options button { padding: 6px 12px; border: 1px solid #b89781; background: #f6e6d4; border-radius: 4px; }
.drink-options button[aria-pressed="true"] { background: var(--rust); color: var(--paper); }
#drink-result { color: var(--rust); }

@media (max-width: 920px) {
  .masthead { gap: 14px; }
  .shell { width: calc(100% - 48px); }
  .hero, .two-col { gap: 28px; }
  .spread { padding: 35px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 28px); }
  .masthead { min-height: auto; flex-wrap: wrap; gap: 11px; padding: 14px 0 10px; }
  .brand { gap: 8px; font-size: 17px; }
  .brand img { width: 31px; height: 31px; }
  .brand small { font-size: 8px; }
  .chapters { order: 1; width: 100%; justify-content: space-between; gap: 7px; }
  .chapters a { font-size: 12px; }
  .chapters small { font-size: 10px; }
  .spread { min-height: 0; padding: 26px 21px 31px; }
  .spread::after { inset: 5px 5px auto auto; width: 72px; height: 51px; }
  .hero, .two-col { grid-template-columns: 1fr; }
  .hero { gap: 22px; }
  .hero-main .photo img { height: clamp(190px, 65vw, 300px); }
  .hero-side { bottom: 16px; }
  .kicker { margin-bottom: 15px; }
  .quote { margin-top: 15px; }
  h2 { font-size: clamp(37px, 9vw, 58px); margin-bottom: 12px; }
  .facts > div { grid-template-columns: 80px 1fr; }
  .record { width: min(67%, 248px); }
  .timeline-stamp { display: none; }
  .postcards { gap: 6px; }
  .postcards .illustration { padding: 4px; }
  .postcards figcaption { display: block; line-height: 1.25; }
  .postcards figcaption span { display: block; }
  .folio-center { display: contents; }
  .page-count { grid-area: 1 / 2; text-align: center; }
  .dots { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .dots a { width: 27px; }
  .folio-arrow { gap: 4px; font-size: 12px; white-space: nowrap; }
  .folio-arrow:last-child { grid-area: 1 / 3; }
  .keyboard-hint { display: none; }
}
@media (max-width: 350px) {
  .chapters small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
