@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/cormorant-regular.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('assets/fonts/cormorant-italic.woff2') format('woff2'); }

:root {
  --paper: #f4f0e8;
  --ink: #302c29;
  --red: #923e35;
  --muted: #80766c;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --zh: 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
  --edge: clamp(24px, 6vw, 112px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--zh); -webkit-font-smoothing: antialiased; }
body.viewer-open { position: fixed; top: var(--return-scroll, 0); left: 0; right: 0; overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
::selection { color: var(--paper); background: var(--red); }
.eyebrow { font: 10px/1.5 Georgia, serif; letter-spacing: .24em; }
.wordmark { font: italic 400 30px/1 var(--serif); letter-spacing: -.04em; }

.hero { height: 100vh; height: 100svh; min-height: 600px; position: relative; overflow: hidden; isolation: isolate; color: #fffdf8; background: #b9b5b1; }
.hero-image { position: absolute; inset: -3% 0; transform: translateY(var(--hero-shift, 0px)); }
.hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; animation: opening-image 2s var(--ease) both; }
.shade { position: absolute; inset: 0; background: linear-gradient(180deg, #24201b22, transparent 35%, #24201b18 55%, #18151280); }
.hero-top, .hero-bottom { position: absolute; left: var(--edge); right: var(--edge); display: flex; align-items: center; justify-content: space-between; }
.hero-top { top: 32px; }
.hero-top > span { margin-right: 66px; }
.hero-top > span, .hero-bottom { font: 9px/1.5 Georgia, serif; letter-spacing: .2em; }
.hero-title { position: absolute; left: var(--edge); bottom: 16%; opacity: var(--hero-opacity, 1); transform: translateY(var(--title-shift, 0px)); }
.hero-title > * { animation: opening-type 1.3s var(--ease) both; }
.hero-title .eyebrow { animation-delay: .15s; }
.hero h1 { font: 400 clamp(105px, 13vw, 208px)/.82 var(--serif); letter-spacing: -.055em; margin: 25px 0 32px; animation-delay: .25s; }
.hero h1 em { font-weight: 400; }
.hero .subtitle { margin: 0; font-size: 13px; letter-spacing: .22em; animation-delay: .4s; }
.enter { position: absolute; right: var(--edge); bottom: 17%; display: flex; align-items: center; gap: 24px; font-size: 12px; letter-spacing: .2em; animation: opening-type 1.4s .5s var(--ease) both; }
.enter small { display: block; font: 8px/1.5 Georgia, serif; letter-spacing: .15em; margin-top: 9px; opacity: .8; }
.enter-arrow { width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid #fff8; border-radius: 50%; font: 25px Georgia, serif; transition: background .3s, transform .5s var(--ease); }
.enter:hover .enter-arrow { transform: translateY(6px); background: #fff2; }
.hero-bottom { bottom: 28px; opacity: .8; }

.album-nav { position: fixed; inset: 0 0 auto; z-index: 5; padding: 18px var(--edge); display: flex; align-items: center; justify-content: space-between; background: #f4f0e8ed; backdrop-filter: blur(12px); transform: translateY(-110%); visibility: hidden; transition: transform .5s var(--ease), visibility .5s; }
.mobile-mark, .music-label { display: none; }
.album-nav.is-visible { visibility: visible; transform: translateY(0); }
.album-nav .wordmark { font-size: 25px; }
.album-nav > div { display: flex; gap: 28px; }
.album-nav > div a { color: var(--muted); font: 10px/1.5 Georgia, serif; letter-spacing: .15em; padding: 5px 0; }
.album-nav > div span { margin-left: 8px; font: 11px var(--zh); }
.album-nav a[aria-current] { color: var(--red); }
.reading-progress { position: absolute; height: 1px; background: var(--red); bottom: 0; left: 0; width: 100%; transform-origin: left; transform: scaleX(var(--progress, 0)); }
.album-nav { padding-right: calc(var(--edge) + 66px); }
.music-toggle { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid #8c80763d; border-radius: 50%; color: var(--ink); background: #f4f0e8d9; transition: background .3s; }
.music-toggle:hover { background: var(--paper); }
#music-toggle { position: fixed; z-index: 6; top: 10px; right: var(--edge); }
.music-bars { display: flex; align-items: center; gap: 3px; height: 16px; }
.music-bars i { width: 2px; height: 5px; border-radius: 2px; background: currentColor; }
.music-bars i:nth-child(2) { height: 12px; }
.music-bars i:nth-child(3) { height: 9px; }
.music-bars i:nth-child(4) { height: 6px; }
.is-playing .music-bars i { height: 13px; animation: music-pulse .9s ease-in-out infinite alternate; }
.is-playing .music-bars i:nth-child(2) { animation-delay: -.5s; animation-duration: .7s; }
.is-playing .music-bars i:nth-child(3) { animation-delay: -.2s; animation-duration: 1.1s; }
.is-playing .music-bars i:nth-child(4) { animation-delay: -.7s; }
.music-status { position: fixed; z-index: 6; top: 64px; right: var(--edge); max-width: calc(100vw - 44px); margin: 0; padding: 10px 14px; background: var(--paper); color: var(--ink); font-size: 11px; }
.music-status:empty { display: none; }

.chapter { padding: 80px var(--edge) 0; scroll-margin-top: 60px; }
.chapter-head { max-width: 1120px; margin: 0 auto 50px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.chapter-head .eyebrow { color: var(--red); margin: 0 0 20px; }
.chapter-head h2 { font: 400 clamp(48px, 5.4vw, 80px)/.95 var(--serif); letter-spacing: -.045em; margin: 0; }
.chapter-head h2 em { font-weight: 400; }
.chapter-note { padding: 0 0 5px; }
.chapter-note p { font-size: 12px; letter-spacing: .13em; margin: 0 0 14px; }
.chapter-note > span { color: var(--muted); font: 8px/1.5 Georgia, serif; letter-spacing: .17em; }
.gallery { max-width: 1120px; margin: auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.6vw, 40px); row-gap: clamp(36px, 5vw, 70px); align-items: start; }
.photo { margin: 0; min-width: 0; transform: translateY(calc(var(--parallax, 0px) + var(--reveal-offset, 0px))); }
.photo-link { border: 0; padding: 0; width: 100%; display: block; overflow: hidden; background: #e1ddd6; cursor: zoom-in; position: relative; }
.photo img { display: block; width: 100%; height: auto; transition: transform 1.1s var(--ease); }
.photo-link::after { content: '↗'; position: absolute; right: 15px; bottom: 15px; width: 38px; height: 38px; display: grid; place-items: center; background: #f4f0e8e8; color: var(--ink); border-radius: 50%; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s var(--ease); font: 20px Georgia, serif; }
.photo-link:focus-visible::after { opacity: 1; transform: none; }
.photo figcaption { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; font: 9px/1.5 Georgia, serif; letter-spacing: .14em; color: var(--muted); }
.photo figcaption .photo-note { letter-spacing: .08em; font-family: var(--zh); }
.gallery-white .photo:nth-child(1) { grid-column: 1 / 8; }
.gallery-white .photo:nth-child(2) { grid-column: 9 / 13; align-self: center; margin-top: 8%; }
.gallery-white .photo:nth-child(3) { grid-column: 2 / 7; }
.gallery-white .photo:nth-child(4) { grid-column: 7 / 12; margin-top: 18%; }
.gallery-white .photo:nth-child(5) { grid-column: 1 / 7; }
.gallery-white .photo:nth-child(6) { grid-column: 8 / 13; align-self: end; }
.interlude { padding: clamp(70px, 8vw, 110px) 24px; text-align: center; }
.interlude-mark { display: block; color: #b4a697; font: italic 44px/1 var(--serif); }
.interlude p { font: 400 clamp(34px, 4vw, 54px)/1.1 var(--serif); letter-spacing: -.02em; margin: 18px 0 24px; }
.interlude .eyebrow { color: var(--muted); font-size: 10px; }
.chapter-red { background: #ece2d9; padding-top: 75px; padding-bottom: 80px; }
.chapter-red .chapter-head { color: var(--red); }
.gallery-red .photo:nth-child(1) { grid-column: 1 / 6; margin-top: 17%; }
.gallery-red .photo:nth-child(2) { grid-column: 7 / 13; }
.gallery-red .photo:nth-child(3) { grid-column: 1 / 5; }
.gallery-red .photo:nth-child(4) { grid-column: 5 / 9; margin-top: 24%; }
.gallery-red .photo:nth-child(5) { grid-column: 9 / 13; margin-top: 48%; }
.gallery-red .photo:nth-child(6) { grid-column: 2 / 7; margin-top: 18%; }
.gallery-red .photo:nth-child(7) { grid-column: 8 / 13; }
.gallery .photo.collection:nth-child(n) { grid-column: 1 / -1; width: min(100%, 600px); justify-self: center; margin: 32px 0 0; }

footer { text-align: center; padding: 90px var(--edge) 30px; }
footer .eyebrow { color: var(--red); }
footer h2 { font: 400 clamp(76px, 11vw, 140px)/1 var(--serif); letter-spacing: -.045em; margin: 25px 0; }
footer h2 em { font-weight: 400; }
footer p:not(.eyebrow) { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.back-top { display: inline-flex; align-items: center; gap: 25px; font-size: 11px; letter-spacing: .15em; padding: 12px 0; border-bottom: 1px solid #b8aa9b; margin: 25px 0 70px; }
.back-top span { font-size: 23px; transition: transform .3s; }
.back-top:hover span { transform: translate(3px, -3px); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font: 8px/1.5 Georgia, serif; letter-spacing: .16em; }
footer .music-credit { margin: 0 0 26px; font: 9px/1.8 Georgia, serif; letter-spacing: .03em; }
.music-credit a { text-decoration: underline; text-underline-offset: 3px; }
.reveal { transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.reveal.is-waiting { opacity: 0; --reveal-offset: 32px; }
.reveal:not(.photo) { transform: translateY(var(--reveal-offset, 0px)); }

dialog { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100vh; height: 100dvh; color: #eee7dd; background: #211e1b; overscroll-behavior: contain; }
dialog::backdrop { background: #211e1b; }
dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: viewer-in .25s ease both; }
.viewer-top { padding: calc(8px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-label { font: 9px Georgia, serif; letter-spacing: .2em; color: #b5ada3; }
.count { margin: 6px 0 0; font: 12px/1.4 Georgia, var(--zh); letter-spacing: .08em; }
dialog button { border: 0; background: transparent; color: inherit; }
.viewer-actions .music-toggle { color: inherit; background: transparent; width: 48px; height: 48px; flex-basis: 48px; }
.close { width: 48px; height: 48px; padding: 0; font: 32px/1 Georgia, serif; }
.original-photo { display: grid; place-items: center; min-width: 48px; height: 48px; font-size: 12px; }
.viewer-strip { display: flex; min-height: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x pan-y pinch-zoom; }
.viewer-strip::-webkit-scrollbar, .filmstrip::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; min-width: 0; height: 100%; padding: 0 72px; display: flex; align-items: center; justify-content: center; position: relative; scroll-snap-align: start; scroll-snap-stop: always; }
.viewer-slide img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; -webkit-touch-callout: default; }
.viewer-loading { position: absolute; font-size: 12px; color: #b5ada3; }
.viewer-slide.is-loaded .viewer-loading { display: none; }
.viewer-bottom { min-width: 0; padding: 8px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.filmstrip { position: relative; display: flex; gap: 6px; overflow-x: auto; width: max-content; max-width: 100%; margin: auto; padding: 5px; scrollbar-width: none; overscroll-behavior-x: contain; }
.filmstrip button { flex: 0 0 48px; width: 48px; height: 64px; padding: 2px 4px; opacity: .45; transition: opacity .2s; }
.filmstrip button[aria-current] { opacity: 1; outline: 1px solid #f4f0e8; outline-offset: 1px; }
.filmstrip button:hover, .filmstrip button:focus-visible { opacity: 1; }
.filmstrip img { display: block; width: 40px; height: 60px; object-fit: contain; }
.viewer-controls { display: flex; align-items: center; justify-content: space-between; max-width: 350px; margin: 4px auto 0; gap: 16px; }
.prev, .next { width: 48px; height: 48px; border-radius: 50%; font: 23px Georgia, serif; }
.prev:hover, .next:hover { background: #fff1; }
.viewer-return { min-height: 48px; min-width: 116px; font-size: 13px; letter-spacing: .12em; }
.viewer-hint { display: block; text-align: center; margin-top: 2px; color: #b5ada3; font-size: 10px; letter-spacing: .04em; }
.noscript-note { text-align: center; padding: 30px; }

@keyframes opening-image { from { transform: scale(1.045); } to { transform: scale(1); } }
@keyframes opening-type { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes music-pulse { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (hover: hover) and (pointer: fine) {
  .photo-link:hover img { transform: scale(1.025); }
  .photo-link:hover::after { opacity: 1; transform: none; }
}
@media (min-aspect-ratio: 2/1) {
  .hero-image img { object-position: 50% 12%; }
}
@media (max-width: 700px) {
  :root { --edge: 18px; }
  html { scrollbar-gutter: auto; }
  .hero { min-height: 520px; }
  .hero-image { inset: 0; transform: none; }
  .hero-image img { object-position: 50% 40%; animation: none; }
  .shade { background: linear-gradient(180deg, #24201b15, transparent 40%, #24201b10 55%, #18151299); }
  .hero-top { top: max(24px, env(safe-area-inset-top)); left: max(24px, env(safe-area-inset-left)); }
  .hero-top .wordmark { font-size: 28px; }
  .hero-top > span { display: none; }
  .hero-title { left: 24px; bottom: calc(170px + env(safe-area-inset-bottom)); transform: none; opacity: 1; }
  .hero h1 { font-size: clamp(84px, 25vw, 138px); margin: 20px 0 24px; }
  .hero-title .eyebrow { font-size: 9px; }
  .hero .subtitle { font-size: 13px; letter-spacing: .14em; }
  .enter { bottom: calc(56px + env(safe-area-inset-bottom)); left: 24px; right: 24px; min-height: 64px; justify-content: space-between; font-size: 15px; letter-spacing: .12em; }
  .enter small { font: 11px/1.5 var(--zh); letter-spacing: .08em; }
  .enter-arrow { width: 52px; height: 52px; }
  .hero-bottom { bottom: calc(23px + env(safe-area-inset-bottom)); left: 24px; font-size: 9px; }
  .hero-bottom > span:first-child { display: none; }
  .album-nav { top: auto; bottom: 0; padding: 8px calc(116px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); transform: translateY(110%); gap: 4px; border-top: 1px solid #b8aa9b44; background: #f4f0e8f5; }
  .album-nav.is-visible { transform: translateY(0); }
  .album-nav .wordmark { display: grid; place-items: center; min-width: 48px; min-height: 48px; font: 13px var(--zh); letter-spacing: 0; }
  .desktop-mark { display: none; }
  .mobile-mark { display: inline; }
  .album-nav > div { gap: 4px; }
  .album-nav > div a { display: grid; place-items: center; min-width: 54px; min-height: 48px; padding: 8px; font-size: 0; letter-spacing: 0; border-radius: 24px; }
  .album-nav > div span { margin: 0; font-size: 13px; }
  .album-nav a[aria-current] { background: #923e3510; }
  .reading-progress { top: 0; bottom: auto; }
  #music-toggle { display: flex; align-items: center; justify-content: center; gap: 10px; width: 96px; height: 48px; top: calc(12px + env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); border-radius: 24px; }
  .music-label { display: inline; font-size: 12px; }
  .past-cover #music-toggle { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .music-status { top: calc(72px + env(safe-area-inset-top)); }
  .past-cover .music-status { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .chapter { padding-top: 50px; scroll-margin-top: 16px; }
  .chapter-head { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 28px; }
  .chapter-head h2 { font-size: clamp(40px, 11vw, 64px); }
  .chapter-head .eyebrow { font-size: 10px; margin-bottom: 15px; }
  .chapter-note { padding: 0; }
  .chapter-note p { font-size: 13px; margin-bottom: 9px; }
  .chapter-note > span { font-size: 9px; }
  .gallery { grid-template-columns: 1fr; row-gap: 32px; max-width: 540px; }
  .gallery .photo:nth-child(n) { grid-column: 1; width: 100%; margin: 0; align-self: auto; transform: none; }
  .gallery .photo:nth-child(3n + 2) { width: 92%; justify-self: end; }
  .gallery .photo.collection:nth-child(n) { width: 100%; margin-top: 16px; }
  .photo figcaption { font-size: 10px; padding-top: 12px; letter-spacing: .06em; }
  .photo-note { display: inline; }
  .photo-link::after { content: '看大图'; opacity: 1; transform: none; width: 60px; height: 30px; right: 10px; bottom: 10px; font: 11px var(--zh); border-radius: 16px; }
  .reveal { transition-duration: .55s; }
  .reveal.is-waiting { --reveal-offset: 16px; }
  .interlude { padding: 64px 22px; }
  .interlude-mark { font-size: 38px; }
  .interlude p { font-size: 34px; }
  .chapter-red { padding-bottom: 48px; }
  footer { padding-top: 65px; padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
  footer p:not(.eyebrow) { font-size: 12px; }
  footer .music-credit { font-size: 10px; line-height: 2; }
  .back-top { min-height: 48px; margin-bottom: 42px; font-size: 13px; }
  .footer-bottom { font-size: 8px; letter-spacing: .05em; }
  .viewer-top { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); gap: 6px; }
  .viewer-actions { gap: 0; }
  .viewer-slide { padding: 0 6px; }
  .viewer-bottom { padding-top: 4px; }
  .viewer-controls { margin-top: 2px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 440px; }
  .hero-image img { object-position: 50% 12%; }
  .viewer-top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 2px; }
  .viewer-bottom { padding-top: 0; }
  .filmstrip, .viewer-hint { display: none; }
  .viewer-controls { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-image, .hero-title, .photo, .reveal:not(.photo) { transform: none; }
  .hero-title, .reveal.is-waiting { opacity: 1; }
}
