@font-face {
  font-family: "Future Letter Handwriting";
  src: url("assets/fonts/ZhiMangXing-LetterSubset.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Future Stroke Brush";
  src: url("assets/fonts/MaShanZheng-KeySentences.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --paper: #f7f2e9;
  --paper-warm: #f3ecdf;
  --ink: #48483f;
  --ink-soft: #6f7066;
  --sage: #71806b;
  --blue: #718494;
  --apricot: #b88969;
  --line: rgba(72, 72, 63, 0.24);
  --content-width: min(34rem, 42vw);
  color-scheme: light;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 220;
  padding: 0.65rem 0.85rem;
  color: var(--paper);
  background: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.75rem;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button {
    cursor: none;
  }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.cursor-dot {
  width: 29px;
  height: 7px;
  border: 1px solid rgba(91, 75, 51, 0.35);
  border-radius: 1px 3px 3px 1px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 45%),
    #c9a36f;
  filter: drop-shadow(1px 2px 1px rgba(72, 58, 40, 0.2));
  transform-origin: -8px 50%;
  transition: filter 220ms ease, opacity 250ms ease;
}

.cursor-dot::before,
.cursor-dot::after {
  position: absolute;
  top: -1px;
  height: 7px;
  content: "";
}

.cursor-dot::before {
  left: -9px;
  width: 9px;
  background: linear-gradient(90deg, #4d4a43 0 24%, #e1c49a 25% 100%);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.cursor-dot::after {
  right: -6px;
  width: 6px;
  border-left: 1px solid rgba(91, 75, 51, 0.28);
  border-radius: 0 3px 3px 0;
  background: #b98279;
}

.cursor-ring {
  width: 23px;
  height: 23px;
  border: 1px dashed rgba(72, 72, 63, 0.3);
  border-radius: 47% 53% 45% 55%;
  box-shadow: 2px 1px 0 rgba(184, 137, 105, 0.1);
  transition:
    width 300ms ease,
    height 300ms ease,
    border-color 300ms ease,
    opacity 250ms ease;
}

body.cursor-is-visible .cursor-dot,
body.cursor-is-visible.cursor-over-action .cursor-ring {
  opacity: 1;
}

body.cursor-over-action .cursor-dot {
  filter: drop-shadow(1px 3px 2px rgba(76, 91, 70, 0.32)) saturate(0.88);
}

body.cursor-over-action .cursor-ring {
  width: 39px;
  height: 39px;
  border-color: rgba(113, 128, 107, 0.58);
}

body.cursor-is-pressed .cursor-ring {
  width: 21px;
  height: 21px;
  border-color: rgba(184, 137, 105, 0.72);
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image:
    repeating-radial-gradient(circle at 30% 20%, transparent 0 1px, rgba(81, 70, 52, 0.08) 1.5px 2px),
    repeating-linear-gradient(91deg, transparent 0 8px, rgba(110, 98, 74, 0.025) 9px 10px);
  background-size: 7px 7px, 17px 17px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 3.5vw, 4rem);
  color: rgba(72, 72, 63, 0.76);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.site-title {
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.3vw, 2.2rem);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.85rem;
  border: 1px solid rgba(72, 72, 63, 0.24);
  border-radius: 999px;
  color: inherit;
  background: rgba(247, 242, 233, 0.74);
  box-shadow: 0 5px 16px rgba(72, 65, 52, 0.06);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color 300ms ease, background-color 300ms ease, border-color 300ms ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible,
.sound-toggle.needs-attention {
  color: var(--ink);
  border-color: rgba(113, 128, 107, 0.48);
  background: rgba(247, 242, 233, 0.94);
}

.sound-toggle.is-playing {
  border-color: rgba(113, 128, 107, 0.34);
  background: rgba(228, 232, 218, 0.78);
}

.sound-toggle:focus-visible,
.reopen-letter:focus-visible {
  outline: 1px solid var(--ink-soft);
  outline-offset: 5px;
}

.vinyl-player {
  position: relative;
  display: block;
  width: 1.55rem;
  height: 1.4rem;
  flex: 0 0 auto;
}

.vinyl-disc {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid rgba(72, 65, 52, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle, #d4b399 0 12%, transparent 13% 20%, rgba(239, 229, 213, 0.2) 21% 23%, transparent 24%),
    repeating-radial-gradient(circle, #4e4b44 0 1px, #36352f 2px 3px);
  box-shadow: 0 2px 5px rgba(72, 65, 52, 0.16);
  animation: vinyl-spin 8s linear infinite;
  animation-play-state: paused;
}

.vinyl-disc::after {
  position: absolute;
  inset: 48%;
  border-radius: 50%;
  content: "";
  background: var(--paper);
}

.vinyl-disc i {
  position: absolute;
  inset: 29%;
  border-radius: 50%;
  background: #b88969;
  opacity: 0.9;
}

.vinyl-tonearm {
  position: absolute;
  top: 0.06rem;
  right: 0.02rem;
  width: 0.58rem;
  height: 0.92rem;
  border-top: 1px solid #8b806e;
  border-right: 2px solid #8b806e;
  border-radius: 0 0.35rem 0 0;
  transform: rotate(-16deg);
  transform-origin: 90% 8%;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.vinyl-tonearm::after {
  position: absolute;
  right: -0.18rem;
  bottom: -0.08rem;
  width: 0.28rem;
  height: 0.16rem;
  border-radius: 1px;
  content: "";
  background: #9c725e;
}

.sound-toggle.is-playing .vinyl-disc {
  animation-play-state: running;
}

.sound-toggle.is-playing .vinyl-tonearm {
  transform: rotate(5deg);
}

.chapter-count {
  display: flex;
  gap: 0.42rem;
  font-variant-numeric: tabular-nums;
}

.chapter-count .divider {
  opacity: 0.35;
}

.progress {
  position: fixed;
  right: clamp(1.25rem, 3.5vw, 4rem);
  top: 50%;
  z-index: 40;
  display: grid;
  gap: 0.75rem;
  transform: translateY(-50%);
}

.progress::before {
  position: absolute;
  top: 0.62rem;
  bottom: 0.62rem;
  left: 50%;
  z-index: -1;
  width: 1px;
  content: "";
  background: linear-gradient(transparent, rgba(72, 72, 63, 0.18) 12%, rgba(72, 72, 63, 0.18) 88%, transparent);
  transform: translateX(-50%);
}

.progress a {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
}

.progress span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(72, 72, 63, 0.34);
  transition: transform 500ms ease, background-color 500ms ease;
}

.progress a.active span {
  background: var(--ink);
  transform: scale(2);
}

.chapter {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
  background: var(--paper);
}

.future,
.arrival {
  min-height: 112svh;
}

.chapter--immersive {
  min-height: 148svh;
  overflow: clip;
}

.chapter-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.chapter::before {
  position: absolute;
  top: clamp(4.8rem, 9vh, 7rem);
  left: clamp(1.5rem, 7.6vw, 7.6rem);
  z-index: 1;
  content: attr(data-chapter);
  color: rgba(72, 72, 63, 0.045);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 16vw, 15rem);
  font-weight: 400;
  line-height: 0.75;
  letter-spacing: -0.08em;
  pointer-events: none;
  transform: translateX(-0.08em);
}

.chapter::after {
  position: absolute;
  right: 5vw;
  bottom: 0;
  left: 5vw;
  z-index: 2;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(109, 103, 88, 0.16), transparent);
}

.art {
  position: absolute;
  inset: 0;
  z-index: -2;
  margin: 0;
  overflow: hidden;
  clip-path: inset(1.2% 0 1.2% 0);
  transition: clip-path 1.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.art::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.2s ease 350ms;
}

.chapter.is-visible .art::before {
  opacity: 1;
}

.chapter.is-visible .art {
  clip-path: inset(0);
}

.art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(247, 242, 233, 0.5) 0%, rgba(247, 242, 233, 0.08) 46%, transparent 72%);
}

.art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translate3d(
      calc(var(--parallax-x, 0px) + var(--entry-x, 0px)),
      calc(var(--parallax-y, 0px) + var(--entry-y, 0px)),
      0
    ) scale(var(--entry-scale, 1.025));
  filter: saturate(0.9) contrast(0.98);
  transition: transform 2.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.chapter.is-visible .art > img {
  transform: translate3d(var(--parallax-x, 0), var(--parallax-y, 0), 0) scale(1);
}

.chapter--immersive.is-visible .art > img {
  transform: translate3d(
      var(--parallax-x, 0),
      calc(var(--parallax-y, 0px) + var(--scene-drift, 0px)),
      0
    ) scale(calc(1 + var(--scene-zoom, 0)));
}

.night .art img {
  filter: saturate(0.78) contrast(0.96) brightness(0.94);
}

.night .art::before {
  background: linear-gradient(120deg, rgba(104, 122, 139, 0.12), transparent 58%);
}

.future .art::before {
  background: radial-gradient(circle at 72% 34%, rgba(245, 224, 185, 0.19), transparent 31%);
}

.home .art::before,
.arrival .art::before {
  background: radial-gradient(circle at 76% 30%, rgba(255, 225, 169, 0.22), transparent 34%);
}

.journey .art::before,
.epilogue .art::before {
  background: linear-gradient(165deg, rgba(255, 251, 235, 0.16), transparent 44%, rgba(137, 154, 119, 0.06));
}

.ambient-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease 1.1s;
}

.chapter.is-visible .ambient-scene {
  opacity: 1;
}

.scene-fragment {
  position: absolute;
  inset: 0;
  overflow: hidden;
  animation-play-state: paused;
  transform: translateZ(0);
  transform-origin: 50% 0;
  will-change: transform;
}

.chapter.is-ambient-active .scene-fragment {
  animation-play-state: running;
}

.scene-fragment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.9) contrast(0.98);
}

.scene-fragment--night-curtain {
  clip-path: polygon(43% 0, 69% 0, 66% 60%, 45% 60%);
  -webkit-mask-image: radial-gradient(ellipse 19% 54% at 56% 24%, #000 22%, rgba(0, 0, 0, 0.72) 48%, transparent 76%);
  mask-image: radial-gradient(ellipse 19% 54% at 56% 24%, #000 22%, rgba(0, 0, 0, 0.72) 48%, transparent 76%);
  animation: curtain-billow 7.8s ease-in-out infinite;
}

.scene-fragment--night-tree {
  clip-path: polygon(77% 17%, 89% 18%, 89% 55%, 76% 55%);
  -webkit-mask-image: radial-gradient(ellipse 12% 31% at 82% 36%, #000 12%, transparent 72%);
  mask-image: radial-gradient(ellipse 12% 31% at 82% 36%, #000 12%, transparent 72%);
  animation: foliage-sway 9.6s ease-in-out -2.4s infinite;
  transform-origin: 82% 49%;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: soft-light;
  will-change: opacity, transform;
}

.ambient-glow--moon {
  top: 8%;
  right: 12%;
  width: 20rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(211, 224, 238, 0.28), rgba(179, 199, 220, 0.08) 36%, transparent 69%);
  animation: moon-breathe 12s ease-in-out infinite;
}

.ambient-glow--sun {
  top: 16%;
  right: 4%;
  width: min(42rem, 47vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 224, 168, 0.31), rgba(255, 238, 203, 0.1) 38%, transparent 70%);
  animation: sunlight-breathe 14s ease-in-out -4s infinite;
}

.ambient-glow--homecoming {
  top: 10%;
  right: 7%;
  width: min(38rem, 44vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 208, 137, 0.32), rgba(255, 228, 183, 0.09) 42%, transparent 70%);
  animation: sunlight-breathe 11s ease-in-out -2s infinite;
}

.steam {
  position: absolute;
  top: 49%;
  left: 70.2%;
  width: 0.7rem;
  height: 2.8rem;
  border-left: 1px solid rgba(132, 127, 113, 0.2);
  border-radius: 50%;
  opacity: 0;
  animation: steam-rise 4.8s ease-out infinite;
}

.steam--two { left: 71%; animation-delay: -1.7s; animation-duration: 5.3s; }
.steam--three { left: 69.5%; animation-delay: -3.1s; animation-duration: 4.3s; }

.plant-shadow {
  position: absolute;
  top: 37%;
  right: 3%;
  width: 18%;
  height: 34%;
  background: radial-gradient(ellipse at center, rgba(116, 132, 89, 0.07), transparent 67%);
  transform-origin: 50% 100%;
  animation: shadow-sway 8.9s ease-in-out -2s infinite;
}

.scene-fragment--home-plant {
  clip-path: polygon(58% 13%, 72% 13%, 72% 49%, 57% 49%);
  -webkit-mask-image: radial-gradient(ellipse 11% 28% at 65% 31%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 11% 28% at 65% 31%, #000 10%, transparent 72%);
  animation: foliage-sway 10.6s ease-in-out -3.4s infinite;
  transform-origin: 65% 45%;
}

.scene-fragment--home-pets {
  clip-path: polygon(76% 40%, 97% 40%, 97% 98%, 72% 98%);
  -webkit-mask-image:
    radial-gradient(ellipse 11% 16% at 84% 49%, #000 8%, transparent 72%),
    radial-gradient(ellipse 17% 24% at 84% 82%, #000 8%, transparent 72%);
  mask-image:
    radial-gradient(ellipse 11% 16% at 84% 49%, #000 8%, transparent 72%),
    radial-gradient(ellipse 17% 24% at 84% 82%, #000 8%, transparent 72%);
  animation: pet-breathe 6.8s ease-in-out infinite;
  transform-origin: 84% 89%;
}

.scene-fragment--journey-grass {
  clip-path: polygon(0 58%, 48% 58%, 48% 100%, 0 100%);
  -webkit-mask-image: radial-gradient(ellipse 34% 36% at 22% 86%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 34% 36% at 22% 86%, #000 18%, transparent 78%);
  animation: grass-sway 8.4s ease-in-out -1.8s infinite;
  transform-origin: 22% 100%;
}

.scene-fragment--arrival-curtain {
  clip-path: polygon(35% 5%, 52% 5%, 51% 62%, 35% 62%);
  -webkit-mask-image: radial-gradient(ellipse 14% 45% at 43% 31%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse 14% 45% at 43% 31%, #000 18%, transparent 74%);
  animation: curtain-billow 8.7s ease-in-out -2.6s infinite;
}

.scene-fragment--epilogue-curtain {
  clip-path: polygon(73% 9%, 88% 9%, 88% 56%, 72% 56%);
  -webkit-mask-image: radial-gradient(ellipse 13% 40% at 80% 31%, #000 16%, transparent 74%);
  mask-image: radial-gradient(ellipse 13% 40% at 80% 31%, #000 16%, transparent 74%);
  animation: curtain-billow 7.2s ease-in-out -1.3s infinite;
}

.scene-fragment--epilogue-hair {
  clip-path: polygon(43% 31%, 55% 31%, 55% 55%, 43% 55%);
  -webkit-mask-image: radial-gradient(ellipse 9% 17% at 49% 42%, #000 12%, transparent 72%);
  mask-image: radial-gradient(ellipse 9% 17% at 49% 42%, #000 12%, transparent 72%);
  animation: hair-sway 6.7s ease-in-out -2.2s infinite;
  transform-origin: 49% 34%;
}

.wind-overlay {
  position: absolute;
  width: min(46rem, 48vw);
  height: auto;
  opacity: 0;
  filter: saturate(0.72);
  will-change: opacity, transform;
}

.wind-overlay--journey {
  top: 11%;
  left: 23%;
  animation: wind-crossing 14s linear -6s infinite;
}

.wind-overlay--epilogue {
  top: 3%;
  left: 15%;
  animation: wind-crossing 11.5s linear -3s infinite;
}

.ambient-scene *,
.ambient-scene *::before,
.ambient-scene *::after {
  animation-play-state: paused;
}

.chapter.is-ambient-active .ambient-scene *,
.chapter.is-ambient-active .ambient-scene *::before,
.chapter.is-ambient-active .ambient-scene *::after {
  animation-play-state: running;
}

.chapter-stage .copy {
  transform: translate3d(0, var(--scene-copy-y, 0px), 0);
  will-change: transform;
}

.copy {
  position: relative;
  z-index: 4;
  width: var(--content-width);
  padding-top: clamp(8rem, 17vh, 12rem);
  margin-left: clamp(1.5rem, 8vw, 8rem);
  padding-bottom: 5rem;
}

.eyebrow {
  margin: 0 0 2rem;
  color: var(--ink-soft);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.25em;
}

h1 {
  margin: 0 0 3rem;
  font-family: "Future Letter Handwriting", "STKaiti", "KaiTi", cursive;
  font-size: clamp(2.5rem, 5vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.opening .eyebrow,
.opening h1 {
  opacity: 0;
  transform: translateY(0.55rem);
  transition: opacity 1.1s ease, transform 1.1s ease;
}

.opening.is-visible .eyebrow,
.opening.is-visible h1 {
  opacity: 1;
  transform: translateY(0);
}

.opening.is-visible h1 {
  transition-delay: 180ms;
}

.lines {
  font-family: "Future Letter Handwriting", "STKaiti", "KaiTi", cursive;
  font-weight: 400;
  max-width: 31rem;
}

.lines p {
  margin: 0 0 1.7rem;
  font-size: clamp(1rem, 1.4vw, 1.26rem);
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 2;
  opacity: 1;
}

.written-line {
  display: inline-block;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  filter: blur(0.35px);
  transition:
    opacity 240ms ease,
    clip-path var(--write-duration, 1200ms) cubic-bezier(0.22, 0.68, 0.2, 1),
    filter var(--write-duration, 1200ms) ease;
  transition-delay: calc(var(--line-start, 120ms) + var(--line-order, 0) * var(--line-step, 170ms));
}

.chapter.is-visible .written-line {
  opacity: 1;
  clip-path: inset(0);
  filter: blur(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.stroke-writing-visual {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04em;
  max-width: 100%;
  vertical-align: top;
}

.stroke-writing-line {
  display: flex;
  align-items: center;
  min-height: 1.55em;
  white-space: nowrap;
}

.stroke-glyph {
  display: inline-block;
  flex: 0 0 1.02em;
  width: 1.02em;
  height: 1.34em;
  margin-right: 0.035em;
}

.stroke-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.stroke-glyph-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stroke-punctuation {
  display: inline-block;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(0.04em);
  transition: opacity 260ms ease;
  transition-delay: calc(220ms + var(--stroke-sequence, 0) * 280ms);
}

[data-stroke-writing].is-writing .stroke-punctuation,
[data-stroke-writing].is-written .stroke-punctuation {
  opacity: 1;
}

.emphasis {
  color: #4f5e50;
}

.future .emphasis {
  position: relative;
  margin-top: 2.8rem;
  padding-left: 1.2rem;
  font-size: clamp(1.16rem, 1.75vw, 1.5rem);
}

.future .emphasis::before {
  position: absolute;
  top: 0.35em;
  bottom: 0.35em;
  left: 0;
  width: 1px;
  content: "";
  background: linear-gradient(transparent, rgba(79, 94, 80, 0.42), transparent);
}

.alone {
  margin-top: 2.7rem !important;
  margin-bottom: 2.7rem !important;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem) !important;
  letter-spacing: 0.18em !important;
}

.arrival .alone {
  position: relative;
  width: max-content;
  padding: 0.25rem 1.2rem 0.35rem 0;
  color: #7f6553;
}

.arrival .alone::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(184, 137, 105, 0.5), transparent);
}

.thanks {
  margin-top: 3.2rem !important;
}

.signature {
  font-family: "Future Letter Handwriting", "STKaiti", "KaiTi", cursive;
  font-weight: 400;
  display: grid;
  gap: 0.45rem;
  margin-top: 3.5rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.2s ease 1s, transform 1.2s ease 1s;
}

.chapter.is-visible .signature {
  opacity: 1;
  transform: translateY(0);
}

.chapter-next {
  position: absolute;
  bottom: calc(2.2rem + max(0px, 100% - 100svh));
  left: clamp(1.5rem, 8vw, 8rem);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: color 350ms ease, opacity 900ms ease 850ms, transform 900ms ease 850ms;
}

.chapter.is-visible .chapter-next {
  opacity: 1;
  transform: translateY(0);
}

.chapter-next i {
  display: block;
  position: relative;
  width: 3rem;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: width 350ms ease;
}

.chapter-next i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 7px;
  height: 7px;
  content: "";
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.chapter-next:hover,
.chapter-next:focus-visible {
  color: var(--ink);
}

.chapter-next:hover i,
.chapter-next:focus-visible i {
  width: 4.25rem;
}

.chapter-next--opening {
  left: 50%;
  flex-direction: column;
  gap: 0.65rem;
  transform: translate(-50%, 8px);
}

.chapter.is-visible .chapter-next--opening {
  transform: translate(-50%, 0);
}

.chapter-next--opening i {
  width: 1px;
  height: 2.6rem;
  background: linear-gradient(var(--ink-soft), transparent);
  animation: breathe 2.4s ease-in-out infinite;
}

.chapter-next--opening i::after {
  display: none;
}

.night .art::after {
  background: linear-gradient(90deg, rgba(247, 242, 233, 0.94) 0%, rgba(247, 242, 233, 0.52) 38%, transparent 69%);
}

.home .copy,
.journey .copy {
  padding-top: clamp(6.5rem, 12vh, 9rem);
}

.final-copy {
  padding-top: clamp(6.5rem, 13vh, 9rem);
}

.music-credit {
  margin: 1.7rem 0 0;
  color: rgba(72, 72, 63, 0.55);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.music-credit a {
  text-underline-offset: 0.2em;
}

.letter-closing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  opacity: 0;
  background: #eee8dc;
  isolation: isolate;
  transition: opacity 700ms ease, visibility 0s linear 700ms;
}

.letter-closing::before,
.letter-closing::after {
  position: absolute;
  inset: -1rem;
  content: "";
  pointer-events: none;
}

.letter-closing::before {
  z-index: -2;
  background-image: image-set(
    url("assets/illustrations/07-walking-with-wind-768.webp") 1x,
    url("assets/illustrations/07-walking-with-wind-1536.webp") 2x
  );
  background-position: center;
  background-size: cover;
  opacity: 0;
  filter: blur(0) saturate(0.86);
  transform: scale(1.025);
}

.letter-closing::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 252, 245, 0.56), rgba(242, 235, 222, 0.78) 67%),
    rgba(244, 238, 227, 0.46);
  opacity: 0;
}

.letter-closing.is-active {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.letter-closing.is-active::before {
  animation: closing-backdrop-in 1.35s ease forwards;
}

.letter-closing.is-active::after {
  animation: closing-wash-in 1.1s ease forwards;
}

body.letter-is-closing {
  overflow: hidden;
}

.closing-content {
  position: relative;
  display: grid;
  width: min(35rem, calc(100vw - 2rem));
  place-items: center;
  text-align: center;
}

.closing-content:focus {
  outline: none;
}

.close-closing {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.7rem;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  opacity: 0;
  transition: color 250ms ease, opacity 600ms ease 2.8s;
}

.letter-closing.is-active .close-closing {
  opacity: 1;
}

.close-closing:hover,
.close-closing:focus-visible {
  color: var(--ink);
}

.envelope-stage {
  position: relative;
  width: min(31rem, 82vw);
  aspect-ratio: 3 / 2;
  margin-bottom: -0.2rem;
  filter: drop-shadow(0 1.2rem 1.6rem rgba(82, 67, 44, 0.11));
}

.watercolor-envelope {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateY(0.35rem) scale(0.97);
}

.watercolor-envelope--closed {
  z-index: 3;
}

.letter-slot {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: polygon(14% 0, 86% 0, 86% 56%, 14% 56%);
}

.closing-letter-paper {
  position: absolute;
  top: 2%;
  left: 22%;
  display: grid;
  width: 56%;
  height: 54%;
  align-content: start;
  justify-items: start;
  padding: 9% 9% 7%;
  border: 1px solid rgba(116, 97, 69, 0.15);
  color: rgba(71, 73, 62, 0.72);
  background:
    linear-gradient(rgba(255, 253, 247, 0.78), rgba(247, 240, 228, 0.9)),
    var(--paper-warm);
  box-shadow: 0 0.55rem 1rem rgba(82, 67, 44, 0.1);
  font-family: "Future Letter Handwriting", "STKaiti", cursive;
  font-size: clamp(0.68rem, 1.15vw, 0.9rem);
  letter-spacing: 0.09em;
  opacity: 0;
  transform: translateY(-42%) rotate(-0.6deg) scale(0.97);
}

.closing-letter-paper i {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 0.62em;
  background: rgba(105, 95, 78, 0.12);
}

.closing-letter-paper i:nth-of-type(2) {
  width: 88%;
}

.closing-letter-paper i:nth-of-type(3) {
  width: 64%;
}

.closing-letter-paper small {
  margin-top: auto;
  color: rgba(71, 73, 62, 0.48);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.48rem;
  letter-spacing: 0.18em;
}

.seal-bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: clamp(2.35rem, 5.5vw, 3.4rem);
  aspect-ratio: 1;
  border: 1px solid rgba(167, 103, 77, 0.25);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 0 0 rgba(173, 105, 78, 0.18);
  transform: translate(-50%, -50%) scale(0.72);
}

.letter-closing.is-active .watercolor-envelope--open {
  animation: open-envelope-in 720ms ease 80ms forwards, open-envelope-out 620ms ease 1.72s forwards;
}

.letter-closing.is-active .closing-letter-paper {
  animation: letter-into-envelope 1.55s cubic-bezier(0.22, 0.7, 0.22, 1) 380ms forwards;
}

.letter-closing.is-active .watercolor-envelope--closed {
  animation: closed-envelope-in 680ms ease 1.72s forwards;
}

.letter-closing.is-active .delivery-stage {
  animation: delivery-settle 720ms cubic-bezier(0.2, 0.7, 0.2, 1) 2.18s forwards;
}

.letter-closing.is-active .seal-bloom {
  animation: seal-bloom-in 760ms ease 2.08s forwards;
}

.closing-title {
  width: 100%;
  margin: 0.55rem 0 0;
  font-family: "Future Letter Handwriting", "STKaiti", cursive;
  font-size: clamp(1.5rem, 3.25vw, 2.35rem);
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(0.5rem);
}

.closing-subtitle {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-family: "Future Letter Handwriting", "STKaiti", cursive;
  font-size: clamp(0.92rem, 1.8vw, 1.15rem);
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(0.4rem);
}

.closing-date {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  opacity: 0;
}

.reopen-letter {
  margin-top: 2.2rem;
  padding: 0.65rem 0.15rem;
  border: 0;
  border-bottom: 1px solid rgba(72, 72, 63, 0.35);
  color: var(--ink-soft);
  background: transparent;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  opacity: 0;
  cursor: pointer;
}

.letter-closing.is-active .closing-title,
.letter-closing.is-active .closing-subtitle,
.letter-closing.is-active .closing-date,
.letter-closing.is-active .reopen-letter {
  animation: closing-copy-in 850ms ease 2.62s forwards;
}

.letter-closing.is-active .closing-subtitle {
  animation-delay: 2.76s;
}

.letter-closing.is-active .closing-date {
  animation-delay: 2.9s;
}

.letter-closing.is-active .reopen-letter {
  animation-delay: 3.06s;
}

@keyframes breathe {
  0%, 100% { opacity: 0.25; transform: scaleY(0.72); transform-origin: top; }
  50% { opacity: 0.8; transform: scaleY(1); transform-origin: top; }
}

@keyframes vinyl-spin {
  to { transform: rotate(360deg); }
}

@keyframes closing-backdrop-in {
  from { opacity: 0; filter: blur(0) saturate(0.9); transform: scale(1.025); }
  to { opacity: 0.62; filter: blur(2.2px) saturate(0.82); transform: scale(1.04); }
}

@keyframes closing-wash-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes open-envelope-in {
  from { opacity: 0; transform: translateY(0.65rem) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes open-envelope-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(0.12rem) scale(0.985); }
}

@keyframes letter-into-envelope {
  0% { opacity: 0; transform: translateY(-42%) rotate(-0.6deg) scale(0.97); }
  18% { opacity: 1; }
  76% { opacity: 1; }
  100% { opacity: 0; transform: translateY(72%) rotate(0.2deg) scale(0.9); }
}

@keyframes closed-envelope-in {
  from { opacity: 0; transform: translateY(0.12rem) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes delivery-settle {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(0.18rem) scale(0.94); }
}

@keyframes seal-bloom-in {
  0% { opacity: 0; box-shadow: 0 0 0 0 rgba(173, 105, 78, 0.2); transform: translate(-50%, -50%) scale(0.72); }
  42% { opacity: 0.72; }
  100% { opacity: 0; box-shadow: 0 0 0 0.7rem rgba(173, 105, 78, 0); transform: translate(-50%, -50%) scale(1.14); }
}

@keyframes closing-copy-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes curtain-billow {
  0%, 100% { transform: translate3d(0, 0, 0) skewX(0deg) scaleX(1); }
  35% { transform: translate3d(0.22rem, -0.06rem, 0) skewX(0.45deg) scaleX(1.004); }
  68% { transform: translate3d(-0.14rem, 0.08rem, 0) skewX(-0.3deg) scaleX(0.998); }
}

@keyframes foliage-sway {
  0%, 100% { transform: rotate(0deg) translate3d(0, 0, 0); }
  48% { transform: rotate(0.38deg) translate3d(0.12rem, -0.05rem, 0); }
  76% { transform: rotate(-0.2deg) translate3d(-0.08rem, 0.04rem, 0); }
}

@keyframes moon-breathe {
  0%, 100% { opacity: 0.5; transform: scale(0.96); }
  50% { opacity: 0.92; transform: scale(1.04); }
}

@keyframes sunlight-breathe {
  0%, 100% { opacity: 0.5; transform: translate3d(-1%, 1%, 0) scale(0.96); }
  50% { opacity: 0.95; transform: translate3d(1%, -1%, 0) scale(1.05); }
}

@keyframes steam-rise {
  0% { opacity: 0; transform: translate3d(0, 0.35rem, 0) scaleY(0.5); }
  28% { opacity: 0.42; }
  75% { opacity: 0.12; }
  100% { opacity: 0; transform: translate3d(0.18rem, -2rem, 0) scaleY(1.15); }
}

@keyframes shadow-sway {
  0%, 100% { opacity: 0.55; transform: rotate(-0.5deg) scaleX(0.98); }
  50% { opacity: 0.9; transform: rotate(1deg) scaleX(1.05); }
}

@keyframes pet-breathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.0035) translateY(-0.04rem); }
}

@keyframes grass-sway {
  0%, 100% { transform: skewX(0deg) translate3d(0, 0, 0); }
  42% { transform: skewX(0.35deg) translate3d(0.1rem, -0.04rem, 0); }
  78% { transform: skewX(-0.2deg) translate3d(-0.06rem, 0, 0); }
}

@keyframes hair-sway {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(0.28deg) translateX(0.11rem); }
}

@keyframes wind-crossing {
  0% { opacity: 0; transform: translate3d(-7vw, -2vh, 0) rotate(-2deg); }
  20% { opacity: 0.2; }
  72% { opacity: 0.14; }
  100% { opacity: 0; transform: translate3d(9vw, 5vh, 0) rotate(3deg); }
}

@media (max-width: 780px) {
  :root {
    --content-width: calc(100vw - 2rem);
  }

  html {
    scroll-snap-type: none;
  }

  .chapter--immersive {
    min-height: 100svh;
    padding-top: 0;
  }

  .chapter-stage {
    position: relative;
    display: flex;
    width: 100%;
    height: auto;
    min-height: 100svh;
    align-items: flex-end;
    overflow: hidden;
  }

  .chapter-stage .copy {
    transform: none;
  }

  .site-header {
    padding: 1.1rem 1.2rem;
  }

  .site-title {
    max-width: 70vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 0.85rem;
  }

  .sound-toggle {
    position: fixed;
    top: 3.8rem;
    right: 1rem;
    width: 2.85rem;
    height: 2.85rem;
    justify-content: center;
    padding: 0;
    font-size: 0.65rem;
  }

  .sound-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .progress {
    top: auto;
    right: 50%;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    gap: 0.45rem;
    padding: 0.52rem 0.72rem;
    border: 1px solid rgba(72, 72, 63, 0.12);
    border-radius: 999px;
    background: rgba(247, 242, 233, 0.78);
    box-shadow: 0 5px 18px rgba(72, 65, 52, 0.06);
    backdrop-filter: blur(8px);
    transform: translateX(50%);
  }

  .progress::before {
    display: none;
  }

  .progress a {
    width: 1rem;
    height: 1rem;
  }

  .chapter {
    display: flex;
    min-height: 100svh;
    align-items: flex-end;
    padding-top: 48svh;
  }

  .chapter.chapter--immersive {
    padding-top: 0;
  }

  .future,
  .arrival {
    min-height: 108svh;
  }

  .art {
    height: 61svh;
  }

  .art img {
    object-position: 66% center;
  }

  .opening .art img { object-position: 62% center; }
  .night .art img,
  .night .scene-fragment img { object-position: 66% center; }
  .future .art img { object-position: 69% center; }
  .home .art img,
  .home .scene-fragment img { object-position: 61% center; }
  .journey .art img,
  .journey .scene-fragment img { object-position: 67% center; }
  .arrival .art img,
  .arrival .scene-fragment img { object-position: 68% center; }
  .epilogue .art img,
  .epilogue .scene-fragment img { object-position: 64% center; }

  .scene-fragment {
    display: none;
  }

  .scene-fragment--night-curtain {
    display: block;
    clip-path: polygon(0 0, 74% 0, 70% 61%, 0 61%);
    -webkit-mask-image: linear-gradient(100deg, rgba(0, 0, 0, 0.78), #000 45%, transparent 94%);
    mask-image: linear-gradient(100deg, rgba(0, 0, 0, 0.78), #000 45%, transparent 94%);
  }

  .ambient-glow--moon {
    top: 10%;
    right: -34%;
    width: 24rem;
  }

  .ambient-glow--sun,
  .ambient-glow--homecoming {
    right: -45%;
    width: 28rem;
  }

  .steam {
    left: 89%;
  }

  .steam--two { left: 91%; }
  .steam--three { left: 87.5%; }

  .wind-overlay {
    width: 92vw;
  }

  .wind-overlay--journey,
  .wind-overlay--epilogue {
    top: 17%;
    left: -30%;
  }

  .epilogue .music-credit {
    max-width: 72%;
    margin-bottom: 2.8rem;
  }

  .art::after {
    background: linear-gradient(180deg, transparent 28%, rgba(247, 242, 233, 0.68) 70%, var(--paper) 100%);
  }

  .night .art::after {
    background: linear-gradient(180deg, transparent 20%, rgba(247, 242, 233, 0.72) 69%, var(--paper) 100%);
  }

  .copy,
  .home .copy,
  .journey .copy,
  .final-copy {
    width: calc(100% - 2rem);
    margin: 0 1rem;
    padding: 3.5rem 0 4rem;
  }

  h1 {
    margin-bottom: 2.2rem;
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .eyebrow {
    margin-bottom: 1.4rem;
  }

  .lines p {
    margin-bottom: 1.35rem;
    font-size: 1rem;
    line-height: 1.9;
  }

  .opening {
    padding-top: 43svh;
  }

  .chapter::before {
    top: auto;
    bottom: 1rem;
    left: auto;
    right: 1rem;
    font-size: 6rem;
    opacity: 0.6;
  }

  .chapter-next,
  .chapter-next--opening {
    right: 1rem;
    bottom: calc(3.4rem + max(0px, 100% - 100svh));
    left: auto;
    flex-direction: row;
    transform: translateY(8px);
  }

  .chapter.is-visible .chapter-next,
  .chapter.is-visible .chapter-next--opening {
    transform: translateY(0);
  }

  .chapter-next--opening i {
    width: 2.6rem;
    height: 1px;
    background: currentColor;
    animation: none;
  }

  .chapter-next--opening i::after {
    display: block;
  }

  .paper-grain {
    opacity: 0.1;
  }

  .envelope-stage {
    width: min(22rem, 90vw);
    margin-bottom: 0.1rem;
  }

  .closing-title {
    margin-top: 0.25rem;
    font-size: clamp(1.45rem, 7.6vw, 2rem);
  }

  .closing-subtitle {
    margin-top: 0.4rem;
  }

  .close-closing {
    top: 0.8rem;
    right: 0.8rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .written-line,
  .stroke-punctuation,
  .signature,
  .wind-leaves {
    opacity: 1;
    clip-path: none;
    filter: none;
    transform: none;
  }

  .ambient-scene {
    opacity: 0 !important;
  }

  .vinyl-disc {
    animation: none !important;
  }

  .letter-closing.is-active::before,
  .letter-closing.is-active::after,
  .letter-closing.is-active .watercolor-envelope--open,
  .letter-closing.is-active .watercolor-envelope--closed,
  .letter-closing.is-active .closing-letter-paper,
  .letter-closing.is-active .delivery-stage,
  .letter-closing.is-active .seal-bloom,
  .letter-closing.is-active .closing-title,
  .letter-closing.is-active .closing-subtitle,
  .letter-closing.is-active .closing-date,
  .letter-closing.is-active .reopen-letter {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    animation-fill-mode: forwards;
  }
}
