@charset "UTF-8";
:root {
  color-scheme: dark;
  --night: #101c32;
  --deep: #0b1527;
  --paper: #f4efe5;
  --ink: #23324a;
  --light: #f3eddf;
  --gold: #d8bd82;
  --muted: #a6b2c4;
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--light);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, figure { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
}
::selection { background: #d8bd8240; }
img { display: block; max-width: 100%; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Opening */
.opening {
  min-height: 560px;
  height: 100svh;
  max-height: 1180px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #101c32;
}
.opening-art {
  position: absolute;
  inset: 0 0 0 38%;
  z-index: -1;
}
.opening-art img {
  position: absolute;
  right: 0;
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  mask-image: linear-gradient(90deg, transparent 0%, #000 23%, #000 100%);
}
.opening:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, #101c32 0%, transparent 15%),
    linear-gradient(90deg, #101c32 8%, #101c32d9 29%, #101c3200 60%);
  pointer-events: none;
}
.opening-copy {
  position: absolute;
  left: 9%;
  top: 28%;
  max-width: 49%;
  padding-bottom: 100px;
}
h1 {
  font-weight: 400;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.7;
  letter-spacing: .06em;
  margin-top: 0;
}
.audio-invitation {
  width: min(390px, 100%);
  margin-top: 30px;
  color: #e9e3d7;
}
.audio-kicker {
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: .08em;
  color: #d8d3ca;
}
.audio-kicker span { color: var(--gold); margin-right: 3px; }
.audio-player {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 15px;
}
.audio-toggle {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d8bd8290;
  border-radius: 50%;
  background: #f3eddf12;
  color: var(--light);
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.audio-toggle:hover { background: #f3eddf22; border-color: var(--gold); }
.audio-toggle:active { transform: scale(.96); }
.audio-toggle-large { width: 50px; height: 50px; }
.audio-toggle-small { width: 34px; height: 34px; }
.audio-icon {
  display: block;
  padding-left: 2px;
  font: 12px / 1 var(--sans);
  letter-spacing: -.14em;
}
.audio-timeline { flex: 1; min-width: 0; }
.audio-progress {
  --progress: 0%;
  display: block;
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}
.audio-progress::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) 0 var(--progress), #dce1ea55 var(--progress) 100%);
}
.audio-progress::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) 0 var(--progress), #dce1ea55 var(--progress) 100%);
}
.audio-progress::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border: 0;
  border-radius: 50%;
  background: #ead9ad;
  box-shadow: 0 0 0 3px #101c3270;
  appearance: none;
}
.audio-progress::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #ead9ad;
}
.audio-progress:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.audio-time {
  margin-top: 1px;
  font: 10px / 1.5 var(--sans);
  letter-spacing: .08em;
  color: #aeb8c8;
}
.mini-player {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(460px, calc(100% - 32px));
  display: grid;
  grid-template-columns: auto auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border: 1px solid #d8bd8248;
  border-radius: 999px;
  background: #0b1527dc;
  box-shadow: 0 12px 34px #02081466;
  color: var(--light);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 48px));
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
  backdrop-filter: blur(16px);
}
.mini-player.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.mini-time {
  font: 10px / 1 var(--sans);
  letter-spacing: .04em;
  color: #c8ced8;
}
.mini-progress { height: 30px; }
.scroll-cue {
  position: absolute;
  bottom: 42px;
  left: 9%;
  display: flex;
  gap: 20px;
  align-items: center;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .13em;
  color: #b6bdc8;
  min-height: 44px;
}
/* A letter, set in natural paragraphs. */
.letter-section { background: var(--paper); color: var(--ink); padding-top: 100px; }
.letter { max-width: 646px; padding: 0 28px; margin: auto; }
.letter-salutation { margin-bottom: 30px; font-size: 18px; }
.letter-body { font-size: 18px; line-height: 2.05; letter-spacing: .02em; overflow-wrap: break-word; }
.letter-body > div + div, .letter-body p + p { margin-top: 26px; }
.letter-signature { margin-top: 38px; font-size: 17px; line-height: 2; }
.signature { text-align: right; }
.letter-dusk {
  margin-top: 88px;
  padding: 174px 24px 54px;
  /* Twilight: hold warm paper, then soft dusk-blue — not cement grey. */
  background: linear-gradient(
    var(--paper) 0%,
    #f2ebe3 38%,
    #d5dae8 55%,
    #7a879e 74%,
    #1a2740 92%,
    var(--night) 100%
  );
  text-align: center;
}
.bridge-copy { font-size: 19px; line-height: 2; color: var(--light); text-wrap: balance; }

/* The star maps are equal pages in one timeline; place and time do all the talking. */
.sky-section { padding: 54px 28px 0; background: var(--night); text-align: center; }
.sky-content { max-width: 680px; margin: auto; }
.sky-section h2 { font-size: 27px; font-weight: 400; line-height: 1.8; letter-spacing: .08em; text-wrap: balance; }
.sky-memory { margin: 96px auto 0; }
.sky-content > .sky-memory:first-of-type { margin-top: 42px; }
.sky-memory h3 { font-size: 22px; font-weight: 400; letter-spacing: .14em; line-height: 1.8; }
.sky-date { margin-top: 10px; font: 11px / 2 var(--sans); letter-spacing: .1em; color: var(--muted); }
.sky-chart { width: 100%; max-width: 430px; height: auto; margin: 18px auto 0; }
.sky-memory figcaption {
  margin-top: 20px;
  color: #b7c0ce;
  font-size: 14px;
  line-height: 2;
  letter-spacing: .05em;
}
.memory-turn {
  margin: 190px auto 116px;
  color: #7f8da2;
  font-size: 13px;
  line-height: 2;
  letter-spacing: .16em;
}
.memory-turn span { display: block; height: 24px; color: #58677d; }
.memory-turn p { margin-top: 56px; }
.sky-memory-past {
  position: relative;
  isolation: isolate;
}
.sky-memory-past::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -70px -20px -50px;
  background: radial-gradient(circle at 50% 55%, #7d5d3526, transparent 66%);
  pointer-events: none;
}
.sky-memory-past .sky-date { color: #b6a486; }
.sky-memory-past figcaption { color: #c7b89e; }
.past-realization {
  max-width: 580px;
  margin: 132px auto 0;
  padding: 0 18px 170px;
  color: var(--light);
  font-size: 18px;
  line-height: 2.1;
  letter-spacing: .03em;
  text-wrap: balance;
}
.past-realization p + p { margin-top: 22px; }

/* The second half returns from the night sky to the letter. */
.letter-after { padding-top: 0; }
.letter-after::before {
  content: "";
  display: block;
  height: 250px;
  background: linear-gradient(var(--night), #40526e 42%, #d6dbe6 72%, var(--paper));
}
.letter-after .letter { padding-top: 88px; }
.letter-after .letter-passage + .letter-passage { margin-top: 82px; }
.all-you {
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 42px;
  margin-top: 150px;
  text-align: center;
  color: var(--ink);
  font-size: 18px;
  line-height: 2.1;
  letter-spacing: .03em;
}
.all-you-line {
  margin-top: 18px;
  font-size: 27px;
  letter-spacing: .16em;
}
.letter-finale { padding: 240px 0 220px; }
.letter-closing { font-size: 18px; line-height: 2.1; }
.letter-closing p + p { margin-top: 6px; }

/* The photograph is the final image, with no caption after the letter has ended. */
.ending {
  padding: 0 28px 110px;
  background: var(--paper);
}
.ending-photo { max-width: 680px; margin: 0 auto; }
.ending-photo img { width: 100%; height: auto; }

.reveal { transition: opacity .8s ease; }
.reveal.is-pending { opacity: 0; }
.sky-memory.reveal { transition: opacity 1.2s ease, transform 1.2s ease; }
.sky-memory.reveal.is-pending { transform: translateY(18px); }
.sky-memory-past.reveal { transition-duration: 1.8s; }
@media (min-width: 1500px) {
  .opening-copy { left: 13%; }
  .scroll-cue { left: 13%; }
  .opening-art { right: 5%; }
}
@media (max-width: 700px) {
  .opening { height: 100svh; min-height: 600px; max-height: 1050px; }
  .opening-art { inset: auto 0 0; height: min(100%, 150vw); width: 100%; }
  .opening-art img { width: 100%; object-fit: contain; object-position: center bottom; mask-image: linear-gradient(transparent, #000 19%, #000); }
  .opening:after { background: linear-gradient(0deg, #101c32 0%, transparent 12%, transparent 58%, #101c3280 82%, #101c32bb 100%); }
  .opening-copy { left: 0; right: 0; top: clamp(48px, 10svh, 92px); text-align: center; max-width: none; padding: 0 24px; }
  h1 { font-size: 28px; line-height: 1.85; }
  .audio-invitation { width: min(330px, 100%); margin: 24px auto 0; }
  .audio-kicker { font-size: 13px; }
  .audio-player { gap: 14px; margin-top: 12px; text-align: left; }
  .audio-toggle-large { width: 46px; height: 46px; }
  .mini-player {
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    gap: 9px;
    padding: 9px 12px;
  }
  .mini-player .audio-toggle-small { width: 32px; height: 32px; }
  .scroll-cue { bottom: 14px; left: 0; right: 0; justify-content: center; font-size: 11px; }
  .letter-section { padding-top: 72px; }
  .letter-after { padding-top: 0; }
  .letter-body { font-size: 17px; line-height: 2; letter-spacing: .01em; }
  .letter-salutation { font-size: 17px; }
  .letter-body > div + div, .letter-body p + p { margin-top: 24px; }
  .letter-signature { font-size: 16px; margin-top: 32px; }
  .letter-dusk { margin-top: 62px; padding-top: 138px; padding-bottom: 38px; }
  .bridge-copy { font-size: 17px; }
  .sky-section { padding: 44px 24px 0; }
  .sky-section h2 { font-size: 23px; letter-spacing: .04em; }
  .sky-memory { margin-top: 72px; }
  .sky-content > .sky-memory:first-of-type { margin-top: 32px; }
  .sky-memory h3 { font-size: 20px; }
  .sky-chart { max-width: 350px; }
  .sky-memory figcaption { margin-top: 16px; font-size: 13px; }
  .memory-turn { margin-top: 150px; margin-bottom: 94px; font-size: 12px; }
  .memory-turn p { margin-top: 46px; }
  .past-realization { margin-top: 108px; padding-bottom: 138px; font-size: 17px; }
  .letter-after::before { height: 210px; }
  .letter-after .letter { padding-top: 66px; }
  .letter-after .letter-passage + .letter-passage { margin-top: 66px; }
  .all-you { min-height: 84svh; margin-top: 110px; font-size: 17px; gap: 34px; }
  .all-you-line { font-size: 25px; }
  .letter-finale { padding: 210px 0 170px; }
  .letter-closing { font-size: 17px; }
  .ending { padding: 0 20px 76px; }
}
@media (max-width: 365px) {
  h1 { font-size: 25px; }
  .letter { padding: 0 23px; }
  .sky-section h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .reveal.is-pending { opacity: 1; transform: none; }
  .mini-player { transition: none; }
}
@media print {
  .reveal.is-pending { opacity: 1; }
  .mini-player, .audio-invitation { display: none; }
  .sky-memory, .ending-photo { break-inside: avoid; }
}
