/* Immersive romance pass
   One shared light changes character across five chapters. The layer is decorative;
   all meaning and controls remain in the document underneath it. */

:root {
  --sky-a: 213 143 158;
  --sky-b: 240 196 148;
  --sky-c: 157 149 183;
  --sky-opacity: 0.78;
  --sky-contrast: 1;
  --route-progress: 0;
}

body[data-tone="blue"] {
  --sky-a: 100 143 152;
  --sky-b: 180 164 198;
  --sky-c: 214 156 168;
  --sky-opacity: 0.84;
}

body[data-tone="warm"] {
  --sky-a: 230 160 128;
  --sky-b: 244 207 165;
  --sky-c: 174 84 107;
  --sky-opacity: 0.94;
}

body[data-tone="ink"] {
  --sky-a: 180 101 118;
  --sky-b: 224 160 131;
  --sky-c: 138 95 126;
  --sky-opacity: 0.72;
}

body[data-tone="day"] {
  --sky-a: 201 131 120;
  --sky-b: 232 185 165;
  --sky-c: 138 101 117;
  --sky-opacity: 0.66;
  --sky-contrast: 0.88;
}

main > .memory-sky {
  z-index: 1;
}

.memory-sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease;
}

body.has-entered .memory-sky {
  opacity: var(--sky-opacity);
}

.memory-sky__field {
  position: absolute;
  z-index: 1;
  inset: -8%;
  isolation: isolate;
  mix-blend-mode: screen;
  transform-origin: 52% 48%;
  animation: memory-sky-drift 26s cubic-bezier(0.37, 0, 0.23, 1) infinite alternate;
  will-change: transform;
}

body[data-tone="day"] .memory-sky__field {
  mix-blend-mode: multiply;
}

@keyframes memory-sky-drift {
  from {
    transform: translate3d(
      calc(var(--ambient-x, 0px) * 0.13 - 0.8vw),
      calc(var(--ambient-y, 0px) * 0.1 - 0.7vh),
      0
    ) rotate(-0.35deg) scale(1.01);
  }
  to {
    transform: translate3d(
      calc(var(--ambient-x, 0px) * 0.13 + 1.1vw),
      calc(var(--ambient-y, 0px) * 0.1 + 1.2vh),
      0
    ) rotate(0.55deg) scale(1.035);
  }
}

.memory-sky__halo {
  position: absolute;
  top: 4%;
  right: -4%;
  width: min(62vw, 940px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.8;
  background:
    radial-gradient(circle at 44% 47%, rgb(var(--sky-b) / 0.17) 0 4%, rgb(var(--sky-a) / 0.09) 22%, rgb(var(--sky-c) / 0.035) 46%, transparent 70%);
  box-shadow: inset 0 0 0 1px rgb(var(--sky-b) / 0.055);
  transition: background 1.6s ease, opacity 1.6s ease;
}

.memory-sky__halo::before,
.memory-sky__halo::after {
  position: absolute;
  inset: 13%;
  border: 1px solid rgb(var(--sky-a) / 0.09);
  border-left-color: transparent;
  border-radius: 48% 52% 46% 54%;
  content: "";
  transform: rotate(-14deg);
}

.memory-sky__halo::after {
  inset: 28%;
  border-color: rgb(var(--sky-b) / 0.12) transparent rgb(var(--sky-c) / 0.07);
  transform: rotate(23deg);
}

.memory-sky__ribbon {
  position: absolute;
  left: -12%;
  width: 124%;
  border: 1px solid rgb(var(--sky-a) / 0.14);
  border-right-color: rgb(var(--sky-b) / 0.2);
  border-left-color: transparent;
  border-radius: 50%;
  opacity: 0.82;
  box-shadow:
    0 -18px 60px rgb(var(--sky-a) / 0.045),
    inset 0 18px 70px rgb(var(--sky-c) / 0.03);
  transition: border-color 1.5s ease, box-shadow 1.5s ease;
}

.memory-sky__ribbon--one {
  top: 18%;
  height: 48%;
  transform: rotate(-7deg);
}

.memory-sky__ribbon--two {
  top: 43%;
  left: -18%;
  width: 136%;
  height: 38%;
  border-color: rgb(var(--sky-c) / 0.1) rgb(var(--sky-b) / 0.15) transparent transparent;
  transform: rotate(5deg);
}

.memory-sky__constellation {
  position: absolute;
  inset: 14% 4% 20%;
  width: 92%;
  height: 66%;
  overflow: visible;
  opacity: 0.62;
}

.memory-sky__constellation path {
  fill: none;
  stroke: rgb(var(--sky-b) / 0.13);
  stroke-width: 0.7;
  stroke-dasharray: 1 12;
  vector-effect: non-scaling-stroke;
}

.memory-sky__node {
  fill: rgb(var(--sky-b) / 0.5);
  opacity: 0.34;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 1.2s ease, opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-chapter="01"] .memory-sky__node--01,
body[data-chapter="02"] .memory-sky__node--02,
body[data-chapter="03"] .memory-sky__node--03,
body[data-chapter="04"] .memory-sky__node--04,
body[data-chapter="05"] .memory-sky__node--05 {
  fill: rgb(var(--sky-b) / 0.98);
  opacity: 1;
  transform: scale(2.1);
}

.memory-sky__star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0.62;
  background: rgb(var(--sky-b) / 0.82);
  box-shadow: 0 0 18px 3px rgb(var(--sky-a) / 0.2);
}

.memory-sky__star::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 1px;
  content: "";
  opacity: 0.36;
  background: linear-gradient(90deg, transparent, rgb(var(--sky-b) / 0.7), transparent);
  transform: translate(-50%, -50%) rotate(-18deg);
}

.memory-sky__star--one { top: 17%; left: 18%; }
.memory-sky__star--two { top: 27%; right: 23%; width: 2px; height: 2px; }
.memory-sky__star--three { top: 58%; left: 9%; width: 2px; height: 2px; }
.memory-sky__star--four { right: 12%; bottom: 21%; }
.memory-sky__star--five { right: 44%; bottom: 13%; width: 2px; height: 2px; }

.ambient-dial {
  position: absolute;
  right: max(22px, 3.2vw);
  bottom: max(22px, 4vh);
  display: grid;
  grid-template-columns: auto 42px auto;
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgb(var(--sky-b) / 0.13);
  border-radius: 999px;
  color: rgb(var(--sky-b) / 0.66);
  background: rgb(14 13 22 / 0.13);
  backdrop-filter: blur(9px);
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  opacity: 0.72;
  transition: color 1.2s ease, border-color 1.2s ease, background 1.2s ease;
}

.ambient-dial i {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, rgb(var(--sky-a) / 0.12), rgb(var(--sky-b) / 0.72));
}

.ambient-dial i::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  content: "";
  background: rgb(var(--sky-b) / 0.92);
  box-shadow: 0 0 12px rgb(var(--sky-a) / 0.42);
  transform: translateY(-50%);
}

.ambient-dial em {
  color: inherit;
  font-style: normal;
  white-space: nowrap;
}

body[data-tone="day"] .ambient-dial {
  color: rgb(86 58 67 / 0.65);
  background: rgb(255 246 235 / 0.2);
}

/* Make the existing atmosphere readable without letting it cover the story. */
body[data-chapter="01"] .atmosphere { opacity: 0.44; }
body[data-chapter="02"] .atmosphere { opacity: 0.5; }
body[data-chapter="03"] .atmosphere { opacity: 0.4; }
body[data-chapter="04"] .atmosphere { opacity: 0.26; }
body[data-chapter="05"] .atmosphere { opacity: 0.2; }

.pointer-light {
  border-color: rgb(var(--sky-b) / 0.08);
  background:
    radial-gradient(circle at center, rgb(var(--sky-b) / 0.17) 0 3%, rgb(var(--sky-a) / 0.09) 14%, rgb(var(--sky-c) / 0.035) 42%, transparent 72%);
  box-shadow: inset 0 0 46px rgb(var(--sky-a) / 0.025);
}

.pointer-light::after {
  width: 4px;
  height: 4px;
  background: rgb(var(--sky-b) / 0.92);
  box-shadow: 0 0 20px 3px rgb(var(--sky-a) / 0.28);
}

.romance-veil::after {
  width: 230px;
  border-color: rgb(var(--sky-b) / 0.5);
  background:
    radial-gradient(circle, rgb(var(--sky-b) / 0.18), rgb(var(--sky-a) / 0.07) 35%, transparent 69%);
  box-shadow: 0 0 74px rgb(var(--sky-a) / 0.14);
}

body.is-ambient-echo .romance-veil::after {
  animation-duration: 1180ms;
}

/* Interaction rewards become visible as warm material responses, not neon. */
.film-frame {
  transform-style: preserve-3d;
}

.film-frame.has-depth {
  box-shadow:
    calc(var(--photo-shift-x, 0px) * -0.7) calc(34px + var(--photo-shift-y, 0px) * -0.7) 118px rgb(0 0 0 / 0.42),
    0 0 94px rgb(var(--sky-a) / 0.11);
}

.film-frame.is-memory-warm {
  border-color: rgb(var(--sky-b) / 0.24);
  box-shadow: 0 42px 130px rgb(0 0 0 / 0.42), 0 0 110px rgb(var(--sky-a) / 0.16);
}

.film-frame.has-photo .first-frame__touch {
  opacity: 0.9;
}

.memory__visual:hover,
.memory__visual:focus-visible,
.memory__visual.is-inspected {
  border-color: rgb(var(--sky-b) / 0.28);
  box-shadow: 0 46px 125px rgb(0 0 0 / 0.44), 0 0 105px rgb(var(--sky-a) / 0.14);
}

.memory__visual:hover .scene__photo--memory-reveal,
.memory__visual:focus-visible .scene__photo--memory-reveal {
  clip-path: circle(240px at var(--inspect-x, 50%) var(--inspect-y, 50%));
}

.chat-fragments:has(.chat-fragment.is-open) .chat-fragment:not(.is-open) {
  opacity: 0.38;
  filter: saturate(0.7);
  transform: scale(0.985);
}

.chat-fragment.is-open {
  filter: drop-shadow(0 28px 50px rgb(var(--sky-a) / 0.1));
}

.ordinary-lines li.is-current {
  text-shadow: 0 0 34px rgb(var(--sky-b) / 0.12);
}

.ordinary-lines li.is-current::after {
  box-shadow: 0 0 28px 5px rgb(var(--sky-a) / 0.24);
}

.ordinary-days__wash {
  transition: background 1.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.1s ease;
}

.ordinary-days[data-current-line="1"] .ordinary-days__wash {
  background: radial-gradient(circle at 18% 34%, rgb(230 160 128 / 0.24), transparent 32%), radial-gradient(circle at 82% 74%, rgb(174 84 107 / 0.12), transparent 29%);
}

.ordinary-days[data-current-line="2"] .ordinary-days__wash {
  background: radial-gradient(circle at 42% 42%, rgb(244 207 165 / 0.2), transparent 34%), radial-gradient(circle at 78% 66%, rgb(174 84 107 / 0.15), transparent 31%);
}

.ordinary-days[data-current-line="3"] .ordinary-days__wash {
  background: radial-gradient(circle at 68% 37%, rgb(230 160 128 / 0.22), transparent 33%), radial-gradient(circle at 24% 72%, rgb(138 95 126 / 0.13), transparent 30%);
}

.ordinary-days[data-current-line="4"] .ordinary-days__wash {
  background: radial-gradient(circle at 76% 62%, rgb(244 207 165 / 0.22), transparent 35%), radial-gradient(circle at 30% 34%, rgb(174 84 107 / 0.12), transparent 29%);
}

.puzzle-story__visual {
  --puzzle-drag-x: 0px;
  touch-action: pan-y;
  transition: transform 560ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 560ms ease;
}

.puzzle-story.is-dragging .puzzle-story__visual {
  transform: translate3d(var(--puzzle-drag-x), 0, 0) rotate(calc(var(--puzzle-drag-x) / 90));
  box-shadow: 0 40px 120px rgb(0 0 0 / 0.38), 0 0 90px rgb(var(--sky-a) / 0.12);
  transition: none;
}

.letter-progress__stitch {
  position: absolute;
  top: calc(4% + var(--stitch-position) * 92%);
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid rgb(154 92 106 / 0.44);
  border-radius: 50%;
  opacity: 0.18;
  background: rgb(247 226 205 / 0.36);
  box-shadow: 0 0 0 rgb(199 143 109 / 0);
  transform: translate(-50%, -50%) scale(0.45);
  transition: opacity 620ms ease, transform 720ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 720ms ease;
}

.letter-progress__stitch.is-read {
  opacity: 0.88;
  box-shadow: 0 0 18px 3px rgb(199 143 109 / 0.18);
  transform: translate(-50%, -50%) scale(1);
}

/* The ending is now an instrument: the light can be carried between both cities. */
.city-pair {
  height: clamp(360px, 38vw, 520px);
  margin-top: 18px;
  isolation: isolate;
}

.city-pair svg {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
}

.city-pair__route-progress {
  fill: none;
  stroke: url("#cityRouteTone");
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  opacity: 0.88;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgb(199 143 109 / 0.3));
}

.city-pair__route-light--touch {
  display: none;
  animation: none;
}

.city-pair__handle {
  cursor: grab;
  outline: none;
}

.city-pair__handle:active {
  cursor: grabbing;
}

.city-pair__handle-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.city-pair__handle-halo {
  fill: rgb(199 143 109 / 0.08);
  stroke: rgb(231 183 143 / 0.5);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: city-handle-breathe 2.8s ease-in-out infinite;
  animation-play-state: paused;
  vector-effect: non-scaling-stroke;
}

.city-pair.is-active .city-pair__handle-halo {
  animation-play-state: running;
}

.city-pair__handle-core {
  fill: #e5ae7f;
  stroke: rgb(255 239 217 / 0.75);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgb(231 183 143 / 0.72));
}

.city-pair__handle:focus-visible .city-pair__handle-halo {
  fill: rgb(231 183 143 / 0.22);
  stroke: rgb(255 239 217 / 0.95);
  stroke-width: 2;
}

@keyframes city-handle-breathe {
  0%, 100% { opacity: 0.44; transform: scale(0.78); }
  50% { opacity: 0.96; transform: scale(1.18); }
}

.city-pair__gesture-hint {
  position: absolute;
  z-index: 3;
  bottom: 4%;
  left: 50%;
  display: grid;
  gap: 5px;
  margin: 0;
  color: rgb(76 58 63 / 0.72);
  font-family: var(--serif);
  font-size: clamp(0.78rem, 1vw, 0.94rem);
  letter-spacing: 0.08em;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 800ms ease, transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.city-pair__gesture-hint small {
  font-family: var(--sans);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  opacity: 0.58;
  white-space: nowrap;
}

.city-pair.has-route-arrived .city-pair__gesture-hint {
  opacity: 0.32;
  transform: translate(-50%, 4px);
}

.city-pair.is-touch-connecting .city-pair__route-light--touch {
  display: block;
  animation: city-touch-arrival 2.6s cubic-bezier(0.22, 1, 0.36, 1) 1 both;
  animation-play-state: running;
}

@keyframes city-touch-arrival {
  0% { opacity: 0; stroke-dashoffset: 102; }
  15% { opacity: 0.98; }
  78% { opacity: 0.9; }
  100% { opacity: 0; stroke-dashoffset: -99; }
}

.city-pair .city-pair__window {
  opacity: calc(0.28 + var(--route-progress) * 0.58);
}

.city-pair .city-pair__reflections {
  opacity: calc(0.3 + var(--route-progress) * 0.7);
}

.city-pair.has-route-arrived::after {
  opacity: 0.18;
  transform: translate(-50%, -50%) scale(1.18);
}

body.archive-is-open .memory-sky__field,
body.archive-is-open .city-pair__handle-halo,
body.is-data-saver .memory-sky__field {
  animation-play-state: paused !important;
}

body.archive-is-open .ambient-dial {
  opacity: 0;
}

body.is-data-saver .memory-sky__star {
  display: none;
}

/* Cinematic refactor: large light, real-photo afterimages, and visible exploration. */
:root {
  --projection-x: 0px;
  --projection-y: 0px;
  --projection-scroll-y: 0px;
  --city-time: 0;
}

.memory-sky::before {
  position: absolute;
  z-index: 5;
  top: -18%;
  left: -26%;
  width: 152vw;
  height: 136%;
  content: "";
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(102deg, transparent 28%, rgb(var(--sky-a) / 0.04) 39%, rgb(var(--sky-b) / 0.32) 49%, rgb(var(--sky-c) / 0.12) 57%, transparent 71%);
  transform: translate3d(-92vw, 0, 0) skewX(-9deg);
}

body.is-chapter-transitioning .memory-sky::before {
  animation: chapter-light-pass 920ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes chapter-light-pass {
  0% { opacity: 0; transform: translate3d(-92vw, 0, 0) skewX(-9deg); }
  34% { opacity: 0.72; }
  100% { opacity: 0; transform: translate3d(94vw, 0, 0) skewX(-9deg); }
}

.memory-sky__field::before,
.memory-sky__field::after {
  position: absolute;
  content: "";
  pointer-events: none;
  transition: opacity 1.5s ease, transform 1.7s cubic-bezier(0.16, 1, 0.3, 1), background 1.5s ease;
}

.memory-sky__field::before {
  z-index: -1;
  top: -26%;
  right: -5%;
  width: 48vw;
  min-width: 560px;
  height: 148vh;
  opacity: 0.82;
  background: linear-gradient(112deg, transparent 8%, rgb(var(--sky-b) / 0.19) 41%, rgb(var(--sky-a) / 0.1) 56%, transparent 76%);
  transform: translate3d(var(--ambient-x), calc(var(--ambient-scroll-y) - 2vh), 0) rotate(-7deg);
}

.memory-sky__field::after {
  z-index: -2;
  right: -14%;
  bottom: -20%;
  width: 88vw;
  height: 78vh;
  border-radius: 50%;
  opacity: 0.74;
  background:
    radial-gradient(ellipse at 28% 37%, rgb(var(--sky-c) / 0.2), transparent 42%),
    radial-gradient(ellipse at 69% 58%, rgb(var(--sky-a) / 0.17), transparent 46%),
    radial-gradient(ellipse at 46% 83%, rgb(var(--sky-b) / 0.11), transparent 38%);
  filter: blur(18px);
  transform: translate3d(calc(0px - var(--ambient-x)), calc(0px - var(--ambient-scroll-y)), 0) rotate(4deg);
}

.memory-sky__aurora {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.72;
  filter: blur(22px);
  transition: opacity 1.5s ease, background 1.5s ease, transform 1.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.memory-sky__aurora--one {
  top: -10%;
  left: -9%;
  width: 78vw;
  height: 34vh;
  background: radial-gradient(ellipse at 48% 50%, rgb(var(--sky-c) / 0.22), rgb(var(--sky-a) / 0.08) 48%, transparent 74%);
  transform: translate3d(calc(0px - var(--ambient-x)), var(--ambient-y), 0) rotate(-8deg);
}

.memory-sky__aurora--two {
  right: -17%;
  bottom: 5%;
  width: 74vw;
  height: 30vh;
  background: radial-gradient(ellipse at 52% 50%, rgb(var(--sky-a) / 0.21), rgb(var(--sky-b) / 0.08) 52%, transparent 76%);
  transform: translate3d(var(--ambient-x), calc(0px - var(--ambient-y)), 0) rotate(7deg);
}

.memory-sky__moon {
  position: absolute;
  z-index: 0;
  top: 10%;
  right: 8%;
  width: clamp(150px, 18vw, 280px);
  aspect-ratio: 1;
  border: 1px solid rgb(var(--sky-b) / 0.12);
  border-radius: 50%;
  opacity: 0.78;
  background: radial-gradient(circle at 42% 40%, rgb(var(--sky-b) / 0.24) 0 4%, rgb(var(--sky-a) / 0.08) 28%, transparent 68%);
  box-shadow: 0 0 96px rgb(var(--sky-a) / 0.12), inset 24px -18px 70px rgb(var(--sky-c) / 0.06);
  transform: translate3d(var(--ambient-x), var(--ambient-y), 0);
  transition: top 1.5s ease, right 1.5s ease, width 1.5s ease, opacity 1.5s ease, background 1.5s ease;
}

body[data-tone="blue"] .memory-sky__field::before {
  width: 38vw;
  opacity: 0.62;
}

body[data-tone="warm"] .memory-sky__field::before {
  width: 58vw;
  opacity: 1;
  transform: translate3d(var(--ambient-x), calc(var(--ambient-scroll-y) + 2vh), 0) rotate(-4deg);
}

body[data-tone="ink"] .memory-sky__field::before {
  right: 16%;
  width: 34vw;
  opacity: 0.66;
  transform: translate3d(var(--ambient-x), var(--ambient-scroll-y), 0) rotate(3deg);
}

body[data-tone="day"] .memory-sky__field::before {
  top: 28%;
  right: 12%;
  width: 72vw;
  height: 90vh;
  opacity: 0.72;
  background: linear-gradient(0deg, transparent 4%, rgb(var(--sky-b) / 0.21) 47%, rgb(var(--sky-a) / 0.08) 68%, transparent 88%);
  transform: translate3d(0, calc(var(--daybreak-rise, 0px) * -1), 0) rotate(0);
}

body[data-tone="day"] .memory-sky__field::after,
body[data-tone="day"] .memory-sky__aurora {
  mix-blend-mode: multiply;
}

body[data-tone="day"] .memory-sky__moon {
  top: 38%;
  right: 36%;
  width: clamp(210px, 29vw, 440px);
  opacity: 0.42;
  background: radial-gradient(circle, rgb(var(--sky-b) / 0.22), rgb(var(--sky-a) / 0.075) 45%, transparent 72%);
  box-shadow: 0 0 120px rgb(var(--sky-a) / 0.11);
}

.memory-sky__ribbon {
  opacity: 0.54;
}

.memory-sky__constellation {
  opacity: 0.46;
}

.memory-sky__chapter-echo {
  position: absolute;
  z-index: 3;
  top: 19%;
  left: 7%;
  color: rgb(var(--sky-b) / 0.44);
  font-family: var(--serif);
  font-size: clamp(0.64rem, 0.82vw, 0.78rem);
  letter-spacing: 0.16em;
  opacity: 0;
  transform: translate3d(-18px, 0, 0);
}

body.is-chapter-transitioning .memory-sky__chapter-echo {
  animation: chapter-echo-in 920ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chapter-echo-in {
  0% { opacity: 0; transform: translate3d(-18px, 0, 0); }
  34%, 70% { opacity: 0.86; transform: translate3d(0, 0, 0); }
  100% { opacity: 0; transform: translate3d(12px, 0, 0); }
}

.memory-projection {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  pointer-events: none;
  transition: opacity 1.3s ease;
}

.memory-projection__layer {
  position: absolute;
  top: 2%;
  right: -8%;
  width: min(72vw, 1120px);
  height: 92vh;
  border-radius: 46% 54% 52% 48%;
  opacity: 0;
  background-position: center;
  background-size: cover;
  filter: grayscale(0.16) saturate(0.76) contrast(0.94) blur(11px);
  mask-image: radial-gradient(ellipse 58% 54% at 50% 50%, #000 12%, rgb(0 0 0 / 0.74) 46%, transparent 78%);
  mix-blend-mode: soft-light;
  transform: translate3d(var(--projection-x), calc(var(--projection-y) + var(--projection-scroll-y)), 0) scale(1.105);
  transition: opacity 1.25s ease, filter 1.35s ease, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.memory-projection__layer.is-current {
  opacity: 0.18;
}

body[data-chapter="01"] .memory-projection__layer {
  right: -12%;
  opacity: 0;
}

body[data-chapter="01"] .memory-projection__layer.is-current { opacity: 0.105; }
body[data-chapter="02"] .memory-projection__layer.is-current { opacity: 0.2; }
body[data-chapter="03"] .memory-projection__layer.is-current { opacity: 0.175; }
body[data-chapter="04"] .memory-projection__layer.is-current { opacity: 0.12; }

body[data-chapter="04"] .memory-projection__layer {
  right: auto;
  left: -13%;
  mix-blend-mode: screen;
}

body[data-chapter="05"] .memory-projection__layer {
  top: 10%;
  right: -3%;
  width: 94vw;
  height: 78vh;
  background-position: center 32%;
  filter: grayscale(0.08) saturate(0.68) contrast(0.88) blur(10px);
  mix-blend-mode: multiply;
}

body[data-chapter="05"] .memory-projection__layer.is-current { opacity: 0.115; }

body.is-entrance-opening .memory-projection__layer.is-current {
  animation: projection-open 1.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes projection-open {
  from { filter: grayscale(0.3) saturate(0.52) blur(20px); transform: translate3d(var(--projection-x), var(--projection-y), 0) scale(1.18); }
  to { filter: grayscale(0.16) saturate(0.76) blur(11px); transform: translate3d(var(--projection-x), var(--projection-y), 0) scale(1.105); }
}

.memory-map-toggle {
  position: fixed;
  z-index: 76;
  right: max(24px, 3.2vw);
  bottom: max(24px, 4vh);
  display: grid;
  min-width: 198px;
  min-height: 54px;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
  padding: 8px 14px 8px 10px;
  border: 1px solid rgb(var(--sky-b) / 0.24);
  border-radius: 999px;
  color: rgb(var(--sky-b) / 0.82);
  background: linear-gradient(120deg, rgb(15 14 23 / 0.68), rgb(var(--sky-a) / 0.08));
  box-shadow: 0 18px 60px rgb(0 0 0 / 0.18), inset 0 1px rgb(255 255 255 / 0.04);
  backdrop-filter: blur(14px) saturate(1.1);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.16, 1, 0.3, 1), border-color 500ms ease, background 500ms ease;
}

body.has-entered .memory-map-toggle {
  opacity: 0.82;
  transform: none;
}

.memory-map-toggle:hover,
.memory-map-toggle:focus-visible,
body.is-memory-map-open .memory-map-toggle {
  border-color: rgb(var(--sky-b) / 0.5);
  opacity: 1;
  transform: translate3d(0, -2px, 0);
}

.memory-map-toggle > i {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(var(--sky-b) / 0.34);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--sky-b) / 0.2), transparent 64%);
}

.memory-map-toggle > i::before,
.memory-map-toggle > i::after,
.memory-map-toggle > i span {
  position: absolute;
  border-radius: 50%;
  content: "";
  background: rgb(var(--sky-b) / 0.9);
  box-shadow: 0 0 12px rgb(var(--sky-a) / 0.34);
}

.memory-map-toggle > i::before { top: 8px; left: 9px; width: 3px; height: 3px; }
.memory-map-toggle > i::after { right: 7px; bottom: 9px; width: 4px; height: 4px; }
.memory-map-toggle > i span { top: 16px; left: 15px; width: 2px; height: 2px; }

.memory-map-toggle > span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.memory-map-toggle small {
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  opacity: 0.72;
}

.memory-map-toggle em {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.08em;
}

body[data-tone="day"] .memory-map-toggle {
  color: rgb(87 59 66 / 0.76);
  background: rgb(255 248 239 / 0.62);
  box-shadow: 0 18px 54px rgb(135 91 79 / 0.12), inset 0 1px rgb(255 255 255 / 0.46);
}

.memory-map-panel {
  position: fixed;
  z-index: 75;
  right: max(24px, 3.2vw);
  bottom: max(90px, calc(4vh + 66px));
  width: min(380px, calc(100vw - 40px));
  padding: 24px;
  border: 1px solid rgb(var(--sky-b) / 0.24);
  border-radius: 26px;
  color: rgb(245 232 219 / 0.88);
  background:
    radial-gradient(circle at 88% 8%, rgb(var(--sky-a) / 0.13), transparent 34%),
    rgb(15 14 23 / 0.9);
  box-shadow: 0 30px 100px rgb(0 0 0 / 0.38), inset 0 1px rgb(255 255 255 / 0.04);
  backdrop-filter: blur(22px) saturate(1.08);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 18px, 0) scale(0.97);
  transform-origin: right bottom;
  transition: opacity 360ms ease, transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-memory-map-open .memory-map-panel {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.memory-map-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 19px;
  border-bottom: 1px solid rgb(var(--sky-b) / 0.14);
}

.memory-map-panel h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.memory-map-panel__close {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgb(var(--sky-b) / 0.17);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.memory-map-panel__close::before,
.memory-map-panel__close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  content: "";
  background: currentColor;
}

.memory-map-panel__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.memory-map-panel__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.memory-map-panel__nav {
  position: relative;
  display: grid;
  margin: 14px 0 18px;
}

.memory-map-panel__nav::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 9px;
  width: 1px;
  content: "";
  background: linear-gradient(rgb(var(--sky-b) / 0.48), rgb(var(--sky-a) / 0.13));
}

.memory-map-panel__nav a {
  position: relative;
  display: grid;
  min-height: 48px;
  grid-template-columns: 20px 1fr;
  gap: 13px;
  align-items: center;
  color: inherit;
  opacity: 0.42;
  text-decoration: none;
  transition: opacity 320ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.memory-map-panel__nav a:hover,
.memory-map-panel__nav a:focus-visible,
.memory-map-panel__nav a.is-active { opacity: 1; transform: translate3d(3px, 0, 0); }
.memory-map-panel__nav a.is-visited { opacity: 0.72; }

.memory-map-panel__nav a > i {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border: 1px solid rgb(var(--sky-b) / 0.58);
  border-radius: 50%;
  background: rgb(15 14 23);
  transition: background 360ms ease, box-shadow 360ms ease, transform 360ms ease;
}

.memory-map-panel__nav a.is-visited > i { background: rgb(var(--sky-b) / 0.7); }
.memory-map-panel__nav a.is-active > i {
  background: rgb(var(--sky-b));
  box-shadow: 0 0 0 5px rgb(var(--sky-b) / 0.08), 0 0 18px rgb(var(--sky-a) / 0.34);
  transform: scale(1.26);
}

.memory-map-panel__nav a > span {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.memory-map-panel__nav small {
  font-family: var(--sans);
  font-size: 0.52rem;
  opacity: 0.55;
}

.memory-map-panel__hint,
.memory-map-panel__privacy {
  margin: 0;
  color: rgb(245 232 219 / 0.46);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.memory-map-panel__echo {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid rgb(var(--sky-b) / 0.28);
  border-radius: 999px;
  color: rgb(var(--sky-b) / 0.88);
  background: rgb(var(--sky-a) / 0.055);
  cursor: pointer;
  font-family: var(--serif);
  letter-spacing: 0.06em;
}

.memory-map-panel__echo i {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
  transform-origin: right;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.memory-map-panel__echo:hover i,
.memory-map-panel__echo:focus-visible i { transform: scaleX(1.45); }

body[data-tone="day"] .memory-map-panel {
  color: rgb(73 50 57 / 0.9);
  background: rgb(255 247 238 / 0.9);
  box-shadow: 0 30px 90px rgb(135 91 79 / 0.16), inset 0 1px rgb(255 255 255 / 0.72);
}

.chapter-bridge {
  position: relative;
  z-index: 6;
  display: grid;
  width: min(360px, calc(100% - 40px));
  min-height: 82px;
  grid-template-columns: 1fr 78px;
  align-items: center;
  margin: clamp(34px, 7vh, 84px) auto clamp(24px, 5vh, 58px);
  padding: 14px 18px 14px 21px;
  border: 1px solid rgb(var(--sky-b) / 0.2);
  border-radius: 999px;
  color: rgb(var(--sky-b) / 0.76);
  background: linear-gradient(115deg, rgb(255 255 255 / 0.018), rgb(var(--sky-a) / 0.045));
  text-decoration: none;
  transition: border-color 420ms ease, background 420ms ease, transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-bridge small,
.chapter-bridge strong {
  grid-column: 1;
}

.chapter-bridge small {
  align-self: end;
  font-family: var(--sans);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  opacity: 0.55;
}

.chapter-bridge strong {
  align-self: start;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.chapter-bridge i {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 62px;
  height: 1px;
  justify-self: end;
  background: linear-gradient(90deg, transparent, currentColor);
}

.chapter-bridge i::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-left: 0;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.chapter-bridge:hover,
.chapter-bridge:focus-visible {
  border-color: rgb(var(--sky-b) / 0.44);
  background: linear-gradient(115deg, rgb(var(--sky-a) / 0.065), rgb(var(--sky-b) / 0.075));
  transform: translate3d(0, -4px, 0);
}

body[data-tone="day"] .chapter-bridge {
  color: rgb(83 58 65 / 0.7);
  background: rgb(255 248 239 / 0.28);
}

.reveal:not(.is-visible) > .display-title,
.reveal:not(.is-visible) > h2,
.reveal:not(.is-visible) > h3,
.reveal:not(.is-visible) h2,
.reveal:not(.is-visible) h3 {
  filter: blur(7px);
  letter-spacing: 0.075em;
  transform: translate3d(0, 26px, 0);
}

.reveal.is-visible > .display-title,
.reveal.is-visible > h2,
.reveal.is-visible > h3,
.reveal.is-visible h2,
.reveal.is-visible h3 {
  filter: blur(0);
  transition: transform 980ms cubic-bezier(0.16, 1, 0.3, 1), filter 980ms ease, letter-spacing 980ms ease;
  transform: none;
}

.first-frame__copy.reveal:not(.is-visible) .display-title { transform: translate3d(-28px, 0, 0); }
.section-heading.reveal:not(.is-visible) h2 { transform: translate3d(28px, 0, 0); }
.daybreak__copy.reveal:not(.is-visible) h2 { transform: translate3d(0, 34px, 0); }

.daybreak__final-wash {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 67% 55%, rgb(255 222 190 / 0.5), transparent 23%),
    radial-gradient(ellipse at 50% 70%, rgb(213 137 128 / 0.25), transparent 49%),
    linear-gradient(180deg, transparent 32%, rgb(246 229 216 / 0.4));
  transform: scale(0.68);
  transform-origin: 67% 55%;
}

body.is-final-bloom .daybreak__final-wash {
  animation: final-wash 2.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes final-wash {
  0% { opacity: 0; transform: scale(0.68); }
  35% { opacity: 0.62; }
  100% { opacity: 0.82; transform: scale(1.26); }
}

body.is-final-bloom .city-pair {
  animation: city-final-breathe 2.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes city-final-breathe {
  0%, 100% { transform: scale(1); }
  55% { transform: scale(1.025); }
}

body.is-final-bloom .city-pair__ridge--near { fill: rgb(105 126 126 / 0.18); stroke: rgb(81 108 110 / 0.68); }
body.is-final-bloom .city-pair__ridge--far { stroke: rgb(91 120 122 / 0.64); }
body.is-final-bloom .city-pair__bund rect { fill: rgb(190 122 117 / 0.14); }
body.is-final-bloom .city-pair__reflections { opacity: 0.9 !important; }
body.is-final-bloom .city-pair__window { opacity: 0.95 !important; }
body.is-final-bloom .memory-sky__ribbon { opacity: 0.18; }

.city-pair__range {
  position: absolute;
  z-index: 4;
  bottom: 0;
  left: 50%;
  width: min(230px, 64vw);
  height: 44px;
  margin: 0;
  opacity: 0.001;
  pointer-events: none;
  transform: translateX(-50%);
}

.city-pair:has(.city-pair__range:focus-visible) .city-pair__handle-halo {
  fill: rgb(231 183 143 / 0.24);
  stroke: rgb(97 61 69 / 0.94);
  stroke-width: 2;
}

body.is-journey-echo .memory-sky__constellation {
  animation: journey-constellation 5.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.is-journey-echo .memory-sky__node {
  animation: journey-node 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.is-journey-echo .memory-sky__node--02 { animation-delay: 0.5s; }
body.is-journey-echo .memory-sky__node--03 { animation-delay: 1s; }
body.is-journey-echo .memory-sky__node--04 { animation-delay: 1.5s; }
body.is-journey-echo .memory-sky__node--05 { animation-delay: 2s; }

body.is-journey-echo .memory-sky__chapter-echo {
  animation: journey-echo-copy 5.1s ease both;
}

@keyframes journey-constellation {
  0% { opacity: 0.46; transform: scale(1); }
  42%, 76% { opacity: 1; transform: scale(1.025); }
  100% { opacity: 0.46; transform: scale(1); }
}

@keyframes journey-node {
  0%, 100% { opacity: 0.34; transform: scale(1); }
  42%, 68% { fill: rgb(var(--sky-b)); opacity: 1; transform: scale(3.1); }
}

@keyframes journey-echo-copy {
  0%, 100% { opacity: 0; transform: translate3d(-18px, 0, 0); }
  22%, 76% { opacity: 0.86; transform: none; }
}

@media (max-width: 900px) {
  .site-chrome {
    grid-template-columns: 1fr auto auto;
    column-gap: 12px;
  }

  .sound-toggle {
    min-width: 46px;
    min-height: 46px;
  }

  .memory-sky__field {
    inset: -5% -18%;
  }

  .memory-sky__halo {
    top: 9%;
    right: -30%;
    width: 94vw;
  }

  .memory-sky__constellation {
    inset: 18% -5% 24%;
    width: 110%;
  }

  .ambient-dial {
    right: 18px;
    bottom: 18px;
    grid-template-columns: 28px auto;
    padding: 8px 10px;
  }

  .ambient-dial > span {
    display: none;
  }

  .city-pair {
    height: clamp(300px, 48vw, 390px);
  }
}

@media (max-width: 520px) {
  .memory-sky__field {
    opacity: 0.82;
  }

  .memory-sky__ribbon--one {
    top: 22%;
    height: 42%;
  }

  .memory-sky__ribbon--two {
    top: 52%;
  }

  .memory-sky__star--three,
  .memory-sky__star--five {
    display: none;
  }

  .ambient-dial {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    opacity: 0.56;
    backdrop-filter: none;
  }

  .city-pair {
    width: calc(100% + 24px);
    height: 278px;
    margin-left: -12px;
  }

  .city-pair__gesture-hint {
    bottom: 1%;
    font-size: 0.72rem;
  }

  .city-pair__gesture-hint small {
    font-size: 0.49rem;
  }

  .city-pair__handle-halo {
    stroke-width: 1.4;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .ambient-dial {
    display: none;
  }

  .city-pair {
    height: 224px;
  }
}

@media (min-width: 2560px), (min-width: 1600px) and (min-resolution: 2dppx) {
  .memory-sky__field {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .memory-sky__field,
  .city-pair__handle-halo {
    animation: none !important;
  }

  .memory-sky__field {
    transform: none;
  }

  .memory-sky__star {
    opacity: 0.36;
  }

  .city-pair__route-progress {
    filter: none;
  }

  .city-pair.is-touch-connecting .city-pair__route-light--touch {
    display: none;
    animation: none;
  }

  .letter-progress__stitch {
    transition: none;
  }
}

@media (forced-colors: active) {
  .memory-sky,
  .ambient-dial,
  .city-pair__route-progress,
  .city-pair__route-light--touch {
    display: none;
  }

  .city-pair__handle-halo,
  .city-pair__handle-core {
    fill: Canvas;
    stroke: CanvasText;
    filter: none;
  }
}

/* --------------------------------------------------------------------------
   月下终场 · three discovered memories dissolve into one quiet constellation
   -------------------------------------------------------------------------- */

.moon-secret__header,
.moon-secret__experience,
.moon-secret__ending {
  transition:
    opacity 1.2s cubic-bezier(.2,.72,.22,1),
    filter 1.4s cubic-bezier(.2,.72,.22,1),
    transform 1.5s cubic-bezier(.2,.72,.22,1);
}

.moon-secret__moon {
  transition:
    top 2.2s cubic-bezier(.16,1,.3,1),
    right 2.2s cubic-bezier(.16,1,.3,1),
    width 2.2s cubic-bezier(.16,1,.3,1),
    opacity 1.8s ease,
    transform 2.2s cubic-bezier(.16,1,.3,1);
}

.moon-secret__finale[hidden] {
  display: none;
}

.moon-secret__finale {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  overflow: hidden;
  padding: clamp(86px, 11vh, 138px) clamp(28px, 8vw, 132px) 120px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  filter: blur(14px);
  pointer-events: none;
  transform: scale(0.975);
  transition:
    opacity 1.65s cubic-bezier(.2,.72,.22,1) 180ms,
    filter 1.8s cubic-bezier(.2,.72,.22,1) 180ms,
    transform 2s cubic-bezier(.16,1,.3,1) 180ms,
    visibility 0s linear 1.8s;
}

.moon-secret.is-finale .moon-secret__header,
.moon-secret.is-finale .moon-secret__experience,
.moon-secret.is-finale .moon-secret__ending {
  opacity: 0;
  filter: blur(12px);
  pointer-events: none;
  transform: translate3d(0, -18px, 0) scale(0.975);
}

.moon-secret.is-finale .moon-secret__scene {
  animation: none;
  transform: none;
}

.moon-secret.is-finale .moon-secret__moon {
  top: 50%;
  right: 50%;
  width: min(62vw, 760px);
  opacity: 0.54;
  transform: translate3d(50%, -50%, 0) scale(1);
}

.moon-secret.is-finale .moon-secret__finale {
  opacity: 1;
  visibility: visible;
  filter: none;
  pointer-events: auto;
  transform: none;
  transition-delay: 180ms, 180ms, 180ms, 0s;
}

.moon-secret.is-finale .moon-secret__return {
  position: absolute;
  z-index: 6;
  right: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(50%);
}

.moon-secret__finale:focus {
  outline: none;
}

.moon-secret__finale > .eyebrow {
  margin: 0 0 18px;
  color: rgb(231 176 149 / 0.74);
  letter-spacing: 0.28em;
}

.moon-secret__finale h3 {
  max-width: 11em;
  margin: 0;
  white-space: pre-line;
  color: rgb(250 237 220 / 0.96);
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6.8vw, 7.3rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.055em;
  text-wrap: balance;
  text-shadow: 0 26px 90px rgb(0 0 0 / 0.38);
}

.moon-secret__finale > p:not(.eyebrow) {
  width: min(42em, 82vw);
  margin: clamp(24px, 4vh, 46px) 0 0;
  color: rgb(246 226 209 / 0.76);
  font-family: var(--serif);
  font-size: clamp(0.84rem, 1.25vw, 1.08rem);
  line-height: 2.15;
  letter-spacing: 0.075em;
  text-wrap: pretty;
}

.moon-secret__finale > small {
  display: block;
  width: min(45em, 82vw);
  margin-top: clamp(18px, 2.7vh, 30px);
  color: rgb(234 216 204 / 0.43);
  font-family: var(--sans);
  font-size: clamp(0.58rem, 0.78vw, 0.68rem);
  line-height: 1.8;
  letter-spacing: 0.14em;
}

.moon-secret__finale-sky {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.moon-secret__finale-sky svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(76vw, 980px);
  height: min(35vh, 330px);
  opacity: 0.72;
  transform: translate(-50%, -50%);
}

.moon-secret__finale-sky path {
  fill: none;
  stroke: rgb(239 198 162 / 0.48);
  stroke-width: 1.1;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.moon-secret__finale-sky circle {
  fill: rgb(255 231 197 / 0.88);
  opacity: 0;
  filter: drop-shadow(0 0 12px rgb(226 169 147 / 0.42));
}

.moon-secret.is-finale .moon-secret__finale-sky path {
  animation: moon-finale-thread 3.8s cubic-bezier(.2,.72,.22,1) 420ms both;
}

.moon-secret.is-finale .moon-secret__finale-sky circle {
  animation: moon-finale-star 1.2s cubic-bezier(.16,1,.3,1) both;
}

.moon-secret.is-finale .moon-secret__finale-sky circle:nth-of-type(1) { animation-delay: 0.55s; }
.moon-secret.is-finale .moon-secret__finale-sky circle:nth-of-type(2) { animation-delay: 1s; }
.moon-secret.is-finale .moon-secret__finale-sky circle:nth-of-type(3) { animation-delay: 1.45s; }
.moon-secret.is-finale .moon-secret__finale-sky circle:nth-of-type(4) { animation-delay: 1.9s; }
.moon-secret.is-finale .moon-secret__finale-sky circle:nth-of-type(5) { animation-delay: 2.35s; }

.moon-secret__finale-sky > span {
  position: absolute;
  width: clamp(180px, 24vw, 390px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.12;
  background: radial-gradient(circle, rgb(226 169 147 / 0.55), transparent 68%);
  filter: blur(22px);
}

.moon-secret__finale-sky > span:nth-child(1) {
  top: 8%;
  left: 5%;
}

.moon-secret__finale-sky > span:nth-child(2) {
  right: 3%;
  bottom: 4%;
  background: radial-gradient(circle, rgb(133 153 177 / 0.48), transparent 70%);
}

.moon-secret__finale-sky > span:nth-child(3) {
  right: 29%;
  bottom: -16%;
  width: clamp(240px, 32vw, 520px);
  background: radial-gradient(circle, rgb(228 195 155 / 0.42), transparent 72%);
}

@keyframes moon-finale-thread {
  from { stroke-dashoffset: 900; opacity: 0.24; }
  to { stroke-dashoffset: 0; opacity: 0.72; }
}

@keyframes moon-finale-star {
  from { opacity: 0; transform: scale(0.5); transform-origin: center; }
  to { opacity: 0.88; transform: scale(1); transform-origin: center; }
}

body[data-moon-secret="complete"] .city-pair__moon-wash {
  opacity: 0.88;
  filter: drop-shadow(0 0 18px rgb(218 181 131 / 0.22));
}

body[data-moon-secret="complete"] .city-pair__moon-water {
  opacity: 0.74;
  stroke-dasharray: 4 6;
}

@media (max-width: 700px) {
  .moon-secret__finale {
    padding: 96px 24px 116px;
  }

  .moon-secret.is-finale .moon-secret__moon {
    width: min(112vw, 560px);
    opacity: 0.42;
  }

  .moon-secret__finale h3 {
    max-width: 9em;
    font-size: clamp(2.65rem, 13.5vw, 4.6rem);
    line-height: 1.16;
  }

  .moon-secret__finale > p:not(.eyebrow) {
    width: min(32em, 88vw);
    font-size: 0.82rem;
    line-height: 2;
  }

  .moon-secret__finale > small {
    width: min(34em, 88vw);
    font-size: 0.58rem;
    line-height: 1.75;
  }

  .moon-secret__finale-sky svg {
    width: 132vw;
    height: 36vh;
  }

  .moon-secret.is-finale .moon-secret__return {
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 26px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .moon-secret__header,
  .moon-secret__experience,
  .moon-secret__ending,
  .moon-secret__moon,
  .moon-secret__finale {
    transition-duration: 1ms !important;
  }

  .moon-secret.is-finale .moon-secret__finale-sky path {
    stroke-dashoffset: 0;
    animation: none !important;
  }

  .moon-secret.is-finale .moon-secret__finale-sky circle {
    opacity: 0.88;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .moon-secret__finale {
    color: CanvasText;
    background: Canvas;
  }

  .moon-secret__finale-sky {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Three tactile rituals: slow one photograph, fold one letter, share one sky.
   All motion is finite and begins only after an explicit touch or key press.
   -------------------------------------------------------------------------- */

.first-frame__touch {
  --first-hold: 0;
}

.first-frame__hold-gauge {
  position: absolute;
  inset: 4px;
  width: 44px;
  height: 44px;
  overflow: visible;
  opacity: calc(0.22 + var(--first-hold) * 0.78);
  pointer-events: none;
  transform: rotate(-90deg);
}

.first-frame__hold-gauge circle {
  fill: none;
  stroke: rgb(255 229 205 / 0.94);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-dasharray: 119.38;
  stroke-dashoffset: 119.38;
  filter: drop-shadow(0 0 5px rgb(231 183 143 / 0.62));
}

.first-frame__touch.is-holding .first-frame__touch-ring {
  border-color: rgb(255 239 219 / 0.96);
  box-shadow: 0 0 0 10px rgb(231 183 143 / 0.08), 0 0 34px rgb(202 137 148 / 0.34);
  transform: scale(calc(1 + var(--first-hold) * 0.12));
}

.film-frame.is-time-holding {
  border-color: rgb(231 183 143 / 0.28);
  box-shadow: 0 44px 135px rgb(0 0 0 / 0.45), 0 0 120px rgb(202 137 148 / 0.2);
}

.film-frame.is-time-holding .scene__photo--reveal {
  opacity: calc(0.68 + var(--first-hold, 0) * 0.3);
  filter: saturate(1.03) brightness(1.02) contrast(0.97);
}

.film-frame.is-time-held .scene {
  filter: saturate(1.08) brightness(1.03) contrast(0.96);
  transition-duration: 1.25s;
}

.film-frame.is-time-held .scene__photo--reveal {
  filter: saturate(1.08) brightness(1.05) contrast(0.96);
  transform: scale(1.022);
}

.film-frame.is-time-held .scene__curtain--left { transform: translateX(-16px); }
.film-frame.is-time-held .scene__curtain--right { transform: translateX(16px); }

body.is-time-held .memory-sky__field,
body.is-time-held .memory-sky__aurora,
body.is-time-held .memory-sky__ribbon {
  animation-play-state: paused !important;
}

body.is-time-held .memory-sky__landscape {
  opacity: 0.82;
  filter: saturate(0.86) brightness(1.06);
}

body.is-time-holding .memory-map-toggle,
body.is-time-holding #lightSeed,
body.is-time-holding .ambient-dial,
body.is-time-held .memory-map-toggle,
body.is-time-held #lightSeed,
body.is-time-held .ambient-dial,
body.is-moon-gate-unlocked #lightSeed {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.moon-secret-is-open .city-pair__handle-halo,
body.moon-secret-is-open .city-pair__mist,
body.moon-secret-is-open .city-pair__route-light {
  animation-play-state: paused !important;
}

.letter-body__footer {
  width: 100%;
  align-items: end;
  justify-content: space-between;
  flex-direction: row;
  gap: clamp(30px, 8vw, 90px);
}

.letter-body__signoff {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
  text-align: right;
}

.letter-body__signoff p { margin: 0; }

.letter-fold {
  position: relative;
  display: grid;
  width: min(360px, 52%);
  justify-items: end;
  gap: 9px;
}

.letter-fold__button {
  display: grid;
  width: 100%;
  min-height: 68px;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 15px;
  padding: 8px 17px 8px 9px;
  border: 1px solid rgb(219 184 163 / 0.18);
  border-radius: 4px 24px 24px 4px;
  color: rgb(78 56 61 / 0.78);
  background:
    linear-gradient(135deg, rgb(255 248 235 / 0.46), rgb(159 98 112 / 0.07)),
    rgb(112 79 78 / 0.035);
  box-shadow: 0 18px 50px rgb(88 56 60 / 0.09), inset 0 1px rgb(255 255 255 / 0.32);
  font-family: var(--serif);
  font-size: 0.77rem;
  letter-spacing: 0.055em;
  line-height: 1.65;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 420ms ease, background 520ms ease, transform 180ms ease;
}

.letter-fold__button:hover,
.letter-fold__button:focus-visible {
  border-color: rgb(231 183 143 / 0.42);
  color: rgb(67 43 49 / 0.96);
  background: linear-gradient(135deg, rgb(255 248 235 / 0.72), rgb(159 98 112 / 0.1));
}

.letter-fold__button:active { transform: scale(0.985); }

.letter-fold__paper {
  position: relative;
  display: grid;
  width: 54px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(128 83 87 / 0.24);
  border-radius: 2px;
  color: rgb(104 67 73 / 0.72);
  background: linear-gradient(145deg, #eee1cf, #d8c5b4);
  box-shadow: 0 8px 19px rgb(0 0 0 / 0.2);
  transform: rotate(-2deg);
  transform-origin: 50% 80%;
  transition: transform 820ms cubic-bezier(0.16, 1, 0.3, 1), border-radius 820ms ease;
}

.letter-fold__paper::before,
.letter-fold__paper::after,
.letter-fold__paper i {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  transition: clip-path 820ms cubic-bezier(0.16, 1, 0.3, 1), transform 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-fold__paper::before {
  background: linear-gradient(155deg, rgb(255 247 232 / 0.72), rgb(197 173 156 / 0.52));
  clip-path: polygon(0 0, 100% 0, 50% 44%);
}

.letter-fold__paper::after {
  background: linear-gradient(25deg, rgb(207 184 165 / 0.86), rgb(244 229 210 / 0.78));
  clip-path: polygon(0 100%, 50% 48%, 100% 100%);
}

.letter-fold__paper i {
  background: linear-gradient(148deg, rgb(218 197 177 / 0.92), rgb(245 231 212 / 0.9));
  clip-path: polygon(0 0, 50% 54%, 100% 0);
  transform: translateY(-104%);
}

.letter-fold__paper b {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 0.67rem;
  font-weight: 400;
  opacity: 0;
  transition: opacity 500ms 300ms ease;
}

.letter-fold__note {
  max-width: 31em;
  margin: 0;
  color: rgb(88 65 68 / 0.58);
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  line-height: 1.7;
  text-align: right;
}

.letter-body.has-folded-keepsake .letter-fold__paper {
  border-radius: 3px;
  transform: rotate(2deg) scale(0.92);
}

.letter-body.has-folded-keepsake .letter-fold__paper i {
  transform: translateY(0);
}

.letter-body.has-folded-keepsake .letter-fold__paper b { opacity: 0.92; }

.letter-fold__echo {
  position: absolute;
  z-index: 5;
  right: 5%;
  bottom: 44px;
  width: min(620px, 76%);
  aspect-ratio: 1.52;
  border: 1px solid rgb(128 83 87 / 0.16);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(154deg, rgb(251 240 222 / 0.94), rgb(209 189 173 / 0.9)),
    repeating-linear-gradient(0deg, transparent 0 29px, rgb(128 83 87 / 0.07) 30px);
  box-shadow: 0 34px 90px rgb(0 0 0 / 0.28);
  transform-origin: 100% 100%;
}

.letter-fold__echo::before,
.letter-fold__echo::after,
.letter-fold__echo i {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.letter-fold__echo::before {
  border-left: 1px solid rgb(128 83 87 / 0.13);
  transform: translateX(50%);
}

.letter-fold__echo::after {
  border-top: 1px solid rgb(128 83 87 / 0.13);
  transform: translateY(50%);
}

.letter-fold__echo i {
  background: radial-gradient(circle at 78% 72%, rgb(159 98 112 / 0.18), transparent 11%);
}

.letter-body.is-folding .letter-fold__echo {
  animation: letter-fold-away 1.08s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.letter-body.is-unfolding .letter-fold__echo {
  animation: letter-unfold-back 0.86s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.letter-body.is-folding .letter-body__paragraphs,
.letter-body.is-unfolding .letter-body__paragraphs {
  filter: blur(0.55px);
  opacity: 0.72;
  transition: filter 540ms ease, opacity 540ms ease;
}

@keyframes letter-fold-away {
  0% { opacity: 0; clip-path: inset(0); transform: translate3d(-8%, -18%, 0) scale(0.82); }
  18% { opacity: 0.82; }
  48% { opacity: 0.92; clip-path: inset(25% 0); transform: translate3d(-3%, -7%, 0) scale(0.66); }
  76% { opacity: 0.78; clip-path: inset(25% 24%); transform: translate3d(5%, 0, 0) rotate(1.5deg) scale(0.43); }
  100% { opacity: 0; clip-path: inset(25% 24%); transform: translate3d(18%, 8%, 0) rotate(3deg) scale(0.12); }
}

@keyframes letter-unfold-back {
  0% { opacity: 0; clip-path: inset(25% 24%); transform: translate3d(18%, 8%, 0) rotate(3deg) scale(0.12); }
  35% { opacity: 0.76; clip-path: inset(25% 24%); transform: translate3d(5%, 0, 0) scale(0.44); }
  72% { opacity: 0.7; clip-path: inset(8%); transform: translate3d(-2%, -8%, 0) scale(0.74); }
  100% { opacity: 0; clip-path: inset(0); transform: translate3d(-8%, -18%, 0) scale(0.86); }
}

.city-pair {
  --weather-hold: 0;
}

.city-pair::before {
  position: absolute;
  z-index: 0;
  inset: 2% 3% 8%;
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 25% 63%, rgb(123 152 157 / 0.2), transparent 34%),
    radial-gradient(ellipse at 76% 57%, rgb(203 145 124 / 0.22), transparent 33%),
    linear-gradient(90deg, rgb(125 151 154 / 0.05), rgb(173 132 133 / 0.12), rgb(213 161 128 / 0.06));
  filter: blur(16px);
  transform: scale(0.78);
}

.city-weather {
  position: absolute;
  z-index: 6;
  top: 5px;
  left: 50%;
  display: grid;
  width: min(390px, 76%);
  justify-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.city-weather__button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 56px;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 8px 18px 8px 11px;
  border: 1px solid rgb(92 73 78 / 0.17);
  border-radius: 999px;
  color: rgb(66 52 56 / 0.78);
  background: rgb(255 248 237 / 0.34);
  box-shadow: 0 17px 45px rgb(104 72 74 / 0.08), inset 0 1px rgb(255 255 255 / 0.42);
  font-family: var(--serif);
  font-size: clamp(0.7rem, 0.92vw, 0.82rem);
  letter-spacing: 0.045em;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(11px);
  transition: color 420ms ease, border-color 420ms ease, background 520ms ease, transform 180ms ease;
}

.city-weather__button:hover,
.city-weather__button:focus-visible,
.city-weather__button.is-holding {
  color: rgb(62 43 49 / 0.96);
  border-color: rgb(159 98 112 / 0.32);
  background: rgb(255 246 233 / 0.58);
}

.city-weather__button:active { transform: scale(0.987); }

.city-weather__moon {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid rgb(159 98 112 / 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(199 143 109 / 0.035);
  transition: box-shadow 720ms ease, transform 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

.city-weather__moon::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  content: "";
  background: rgb(199 143 109 / 0.66);
  box-shadow: 0 0 12px rgb(199 143 109 / 0.28);
}

.city-weather__moon::after {
  position: absolute;
  top: 5px;
  left: 11px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  content: "";
  background: rgb(244 232 217 / 0.92);
}

.city-weather__moon i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgb(255 248 232 / 0.96);
  box-shadow: 0 0 11px 3px rgb(199 143 109 / 0.35);
  opacity: var(--weather-hold);
  transform: translate(-50%, -50%) scale(calc(0.4 + var(--weather-hold) * 1.4));
}

.city-weather__progress {
  position: absolute;
  right: 20px;
  bottom: 7px;
  left: 58px;
  height: 1px;
  overflow: hidden;
  background: rgb(92 73 78 / 0.11);
}

.city-weather__progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #82989a, #aa817e 56%, #c7926d);
  box-shadow: 0 0 10px rgb(199 143 109 / 0.38);
  transform: scaleX(var(--weather-hold));
  transform-origin: left;
}

.city-weather__hint {
  margin: 0;
  color: rgb(76 58 63 / 0.48);
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.065em;
  line-height: 1.5;
  text-align: center;
}

.city-pair.is-weather-holding .city-weather__moon {
  box-shadow: 0 0 0 calc(5px + var(--weather-hold) * 7px) rgb(199 143 109 / 0.07), 0 0 32px rgb(159 98 112 / 0.17);
  transform: rotate(calc(var(--weather-hold) * 18deg)) scale(calc(1 + var(--weather-hold) * 0.08));
}

.city-pair.is-weather-holding .city-pair__mist {
  opacity: calc(0.46 + var(--weather-hold) * 0.36);
  transform: translate3d(calc((var(--weather-hold) - 0.5) * 14px), 0, 0);
}

.city-pair.has-same-weather::before {
  animation: shared-weather-sky 4.8s cubic-bezier(0.16, 1, 0.3, 1) 1 both;
}

.city-pair.has-same-weather .city-weather__moon {
  border-color: rgb(159 98 112 / 0.42);
  box-shadow: 0 0 0 7px rgb(199 143 109 / 0.07), 0 0 32px rgb(199 143 109 / 0.19);
  transform: rotate(12deg);
}

.city-pair.has-same-weather .city-pair__ridge,
.city-pair.has-same-weather .city-pair__river,
.city-pair.has-same-weather .city-pair__water {
  stroke: rgb(91 107 109 / 0.7);
  transition: stroke 1.4s ease;
}

.city-pair.has-same-weather .city-pair__reflections line {
  stroke: rgb(167 106 107 / 0.42);
  transition: stroke 1.4s ease;
}

@keyframes shared-weather-sky {
  0% { opacity: 0; transform: scale(0.78); }
  42% { opacity: 0.82; transform: scale(1); }
  72% { opacity: 0.62; transform: scale(1.06); }
  100% { opacity: 0.28; transform: scale(1.09); }
}

@media (max-width: 700px) {
  .first-frame__hold-gauge { inset: 4px; }

  .letter-body__footer {
    align-items: stretch;
    flex-direction: column;
    gap: 44px;
  }

  .letter-body__signoff { align-self: flex-end; }

  .letter-fold {
    width: 100%;
    justify-items: stretch;
  }

  .letter-fold__button {
    min-height: 64px;
    font-size: 0.74rem;
  }

  .letter-fold__note { text-align: left; }

  .letter-fold__echo {
    right: 2%;
    bottom: 118px;
    width: 92%;
  }

  .city-weather {
    top: 1px;
    width: min(328px, 86%);
  }

  .city-weather__button {
    min-height: 52px;
    grid-template-columns: 32px 1fr;
    padding-inline: 10px 14px;
    font-size: 0.67rem;
  }

  .city-weather__moon {
    width: 29px;
    height: 29px;
  }

  .city-weather__hint {
    max-width: 28em;
    font-size: 0.5rem;
  }

  .city-pair__gesture-hint { bottom: -1%; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .city-weather {
    top: 0;
    width: min(350px, 60%);
  }

  .city-weather__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .first-frame__touch-ring,
  .first-frame__hold-gauge,
  .film-frame .scene,
  .letter-fold__button,
  .letter-fold__paper,
  .letter-fold__paper::before,
  .letter-fold__paper::after,
  .letter-fold__paper i,
  .city-weather__button,
  .city-weather__moon,
  .city-pair.has-same-weather .city-pair__ridge,
  .city-pair.has-same-weather .city-pair__river,
  .city-pair.has-same-weather .city-pair__water,
  .city-pair.has-same-weather .city-pair__reflections line {
    transition: none !important;
  }

  .letter-body.is-folding .letter-fold__echo,
  .letter-body.is-unfolding .letter-fold__echo,
  .city-pair.has-same-weather::before {
    animation: none !important;
  }

  .city-pair.has-same-weather::before {
    opacity: 0.28;
    transform: scale(1.09);
  }
}

@media (forced-colors: active) {
  .first-frame__hold-gauge circle,
  .letter-fold__button,
  .letter-fold__paper,
  .city-weather__button,
  .city-weather__moon {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  .first-frame__hold-gauge circle { stroke: CanvasText; }
  .letter-fold__echo,
  .city-pair::before { display: none; }
}

/* --------------------------------------------------------------------------
   Five developing scenes: the background is now part of the story, not a HUD.
   Every large shape shares the existing field drift, so this adds no new idle
   animation loop. Interaction rewards below are finite and user-triggered.
   -------------------------------------------------------------------------- */

.memory-sky__landscape {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  opacity: 0.96;
  transition: opacity 1.25s ease;
}

.memory-sky__mountain,
.memory-sky__river,
.memory-sky__silk,
.memory-sky__windows {
  position: absolute;
  display: block;
  transition:
    opacity 1.35s ease,
    transform 1.65s cubic-bezier(0.16, 1, 0.3, 1),
    background 1.5s ease,
    filter 1.5s ease;
}

.memory-sky__mountain {
  left: -9%;
  bottom: -5%;
  width: 78%;
  height: 48%;
  clip-path: polygon(0 86%, 8% 66%, 15% 72%, 23% 42%, 31% 60%, 42% 27%, 51% 52%, 62% 18%, 70% 48%, 81% 31%, 91% 61%, 100% 45%, 100% 100%, 0 100%);
  background:
    linear-gradient(164deg, rgb(112 116 139 / 0.04) 10%, rgb(var(--sky-c) / 0.24) 68%, rgb(6 8 15 / 0.62));
  filter: blur(0.2px);
  opacity: 0.5;
  transform: translate3d(calc(var(--ambient-x, 0px) * -0.07), 0, 0);
}

.memory-sky__mountain--far {
  left: -3%;
  bottom: 12%;
  width: 66%;
  height: 34%;
  clip-path: polygon(0 91%, 12% 61%, 21% 77%, 34% 35%, 47% 70%, 61% 28%, 77% 71%, 90% 47%, 100% 73%, 100% 100%, 0 100%);
  background: linear-gradient(168deg, rgb(var(--sky-b) / 0.03), rgb(var(--sky-c) / 0.12));
  opacity: 0.32;
  transform: translate3d(calc(var(--ambient-x, 0px) * -0.035), 0, 0);
}

.memory-sky__river {
  right: -5%;
  bottom: -18%;
  width: 66%;
  height: 80%;
  border-radius: 50% 0 0;
  background:
    repeating-linear-gradient(176deg, transparent 0 28px, rgb(var(--sky-b) / 0.075) 29px 30px, transparent 31px 56px),
    radial-gradient(ellipse at 58% 34%, rgb(var(--sky-b) / 0.18), rgb(var(--sky-a) / 0.075) 34%, transparent 70%);
  filter: blur(0.4px);
  opacity: 0.48;
  transform: rotate(-8deg) translate3d(calc(var(--ambient-x, 0px) * 0.06), calc(var(--ambient-scroll-y, 0px) * 0.3), 0);
}

.memory-sky__silk {
  top: -22%;
  right: 8%;
  width: 58%;
  height: 142%;
  border-radius: 46% 54% 68% 32%;
  background:
    linear-gradient(104deg, transparent 3%, rgb(var(--sky-a) / 0.05) 28%, rgb(var(--sky-b) / 0.2) 48%, rgb(var(--sky-c) / 0.075) 66%, transparent 88%);
  box-shadow: inset 32px 0 80px rgb(var(--sky-a) / 0.05), -18px 0 70px rgb(var(--sky-b) / 0.04);
  filter: blur(8px);
  opacity: 0.42;
  transform: rotate(8deg);
}

.memory-sky__windows {
  right: 4%;
  bottom: 10%;
  display: grid;
  width: min(32vw, 470px);
  height: min(18vw, 250px);
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: clamp(9px, 1.5vw, 24px);
  opacity: 0.68;
}

.memory-sky__windows i {
  display: block;
  min-height: 18%;
  border: 1px solid rgb(var(--sky-b) / 0.11);
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgb(var(--sky-b) / 0.11), transparent 52%),
    repeating-linear-gradient(90deg, transparent 0 7px, rgb(var(--sky-b) / 0.08) 8px 9px);
  box-shadow: 0 -14px 42px rgb(var(--sky-a) / 0.05);
}

.memory-sky__windows i:nth-child(1) { height: 38%; }
.memory-sky__windows i:nth-child(2) { height: 62%; }
.memory-sky__windows i:nth-child(3) { height: 45%; }
.memory-sky__windows i:nth-child(4) { height: 88%; border-radius: 38% 38% 0 0; }
.memory-sky__windows i:nth-child(5) { height: 57%; }
.memory-sky__windows i:nth-child(6) { height: 34%; }

/* 01 · 夜窗：山影与江面分居两侧，真实照片成为可辨认的夜色。 */
body[data-chapter="01"] .memory-projection__layer {
  top: -3vh;
  right: -5vw;
  width: min(72vw, 1160px);
  height: 106vh;
  border-radius: 0;
  background-position: center;
  filter: saturate(0.66) contrast(0.9) brightness(0.69) blur(1.2px);
  mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 0.24) 13%, #000 38% 88%, transparent 100%);
  mix-blend-mode: normal;
  transform: translate3d(var(--projection-x), calc(var(--projection-y) + var(--projection-scroll-y)), 0) scale(1.035);
}

body[data-chapter="01"] .memory-projection__layer.is-current { opacity: 0.34; }
body[data-chapter="01"] .memory-sky__silk { opacity: 0.5; }
body[data-chapter="01"] .memory-sky__windows { opacity: 0.52; }

/* 02 · 暗房：旧影铺开，冷银与一角暗红共同显影。 */
body[data-chapter="02"] .memory-projection__layer {
  top: -6%;
  right: -5%;
  width: 110%;
  height: 112%;
  border-radius: 0;
  background-position: center;
  filter: grayscale(0.52) sepia(0.12) saturate(0.72) contrast(0.9) blur(2px);
  mask-image: radial-gradient(ellipse 52% 68% at calc(68% + var(--projection-x, 0px)) calc(48% + var(--projection-y, 0px)), #000 0 48%, rgb(0 0 0 / 0.74) 61%, transparent 82%);
  mix-blend-mode: soft-light;
  transform: scale(1.04);
}

body[data-chapter="02"] .memory-projection__layer.is-current { opacity: 0.31; }
body[data-chapter="02"] .memory-sky__mountain { opacity: 0.13; transform: translate3d(-8%, 10%, 0) scale(1.08); }
body[data-chapter="02"] .memory-sky__river { opacity: 0.22; }
body[data-chapter="02"] .memory-sky__silk {
  top: 38%;
  right: auto;
  left: -18%;
  width: 72%;
  height: 76%;
  opacity: 0.75;
  background: radial-gradient(ellipse at 8% 92%, rgb(183 60 74 / 0.4), rgb(219 120 116 / 0.12) 42%, transparent 72%);
  filter: blur(26px);
  transform: rotate(-9deg);
}

body[data-chapter="02"] .memory-sky__windows { opacity: 0.2; }

/* 03 · 晚霞入室：宽阔窗格切开暖光，丝绸取代星轨成为主形体。 */
body[data-chapter="03"] .memory-projection__layer {
  top: 0;
  right: -2%;
  width: 78vw;
  height: 100vh;
  border-radius: 20% 0 0 48%;
  background-position: center;
  filter: saturate(0.82) contrast(0.88) brightness(0.72) blur(2px);
  mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.68) 28%, #000 58%, transparent 100%);
  mix-blend-mode: soft-light;
  transform: translate3d(var(--projection-x), var(--projection-scroll-y), 0) scale(1.04);
}

body[data-chapter="03"] .memory-projection__layer.is-current { opacity: 0.32; }
body[data-chapter="03"] .memory-sky__mountain { opacity: 0.08; }
body[data-chapter="03"] .memory-sky__river { opacity: 0.28; }
body[data-chapter="03"] .memory-sky__silk {
  top: -30%;
  right: 3%;
  width: 74%;
  height: 160%;
  opacity: 0.82;
  background:
    linear-gradient(104deg, rgb(20 10 18 / 0.7) 0 8%, transparent 8% 31%, rgb(20 10 18 / 0.38) 31% 36%, transparent 36% 68%, rgb(18 9 16 / 0.35) 68% 72%, transparent 72%),
    radial-gradient(ellipse at 54% 50%, rgb(232 142 111 / 0.29), rgb(174 84 107 / 0.13) 49%, transparent 76%);
  filter: blur(3px);
  transform: rotate(2deg);
}

body[data-chapter="03"] .memory-sky__windows { opacity: 0.92; filter: drop-shadow(0 0 30px rgb(230 160 128 / 0.12)); }

/* 04 · 纸上月色：星点退后，纸张与墨影承担整屏材质。 */
body[data-chapter="04"] .memory-projection__layer {
  top: 3vh;
  right: auto;
  left: 27vw;
  width: 72vw;
  height: 94vh;
  border-radius: 3px;
  background-position: center;
  filter: saturate(0.38) contrast(0.83) brightness(1.04) blur(1.8px);
  mask-image: linear-gradient(90deg, transparent, #000 15% 88%, transparent);
  mix-blend-mode: soft-light;
  transform: rotate(2.6deg) translate3d(var(--projection-x), var(--projection-scroll-y), 0) scale(1.025);
}

body[data-chapter="04"] .memory-projection__layer.is-current { opacity: 0.28; }
body[data-chapter="04"] .memory-sky__mountain,
body[data-chapter="04"] .memory-sky__river,
body[data-chapter="04"] .memory-sky__windows { opacity: 0.08; }
body[data-chapter="04"] .memory-sky__silk {
  top: 3%;
  right: 7%;
  width: 68%;
  height: 91%;
  border: 1px solid rgb(243 214 188 / 0.12);
  border-radius: 2px;
  opacity: 0.58;
  background:
    linear-gradient(90deg, transparent 0 6%, rgb(245 221 196 / 0.09) 6% 94%, transparent 94%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgb(121 78 88 / 0.04) 32px 33px);
  filter: drop-shadow(0 40px 80px rgb(0 0 0 / 0.24));
  transform: rotate(2.6deg);
}

body[data-chapter="04"] .memory-sky__constellation,
body[data-chapter="04"] .memory-sky__ribbon { opacity: 0.12; }

/* 05 · 山水同明：苍山、江面与晨光重新占满画面。 */
body[data-chapter="05"] .memory-projection__layer {
  top: -2%;
  right: -2%;
  width: 104vw;
  height: 102vh;
  border-radius: 0;
  background-position: center 30%;
  filter: grayscale(0.05) saturate(0.7) contrast(0.85) brightness(1.02) blur(2px);
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.14), #000 34% 72%, transparent 100%);
  mix-blend-mode: multiply;
  transform: translate3d(0, var(--projection-scroll-y), 0) scale(1.03);
}

body[data-chapter="05"] .memory-projection__layer.is-current { opacity: 0.34; }
body[data-chapter="05"] .memory-sky__mountain {
  left: -5%;
  bottom: -2%;
  width: 92%;
  height: 52%;
  opacity: 0.42;
  background: linear-gradient(166deg, rgb(111 138 139 / 0.08), rgb(89 117 118 / 0.3) 62%, rgb(116 93 100 / 0.18));
  transform: translate3d(0, calc(var(--daybreak-rise, 0px) * -0.5), 0);
}

body[data-chapter="05"] .memory-sky__mountain--far { bottom: 18%; opacity: 0.25; }
body[data-chapter="05"] .memory-sky__river { opacity: 0.72; }
body[data-chapter="05"] .memory-sky__silk {
  top: auto;
  right: 20%;
  bottom: -30%;
  width: 54%;
  height: 90%;
  border-radius: 50%;
  opacity: 0.74;
  background: radial-gradient(circle, rgb(255 232 202 / 0.62) 0 18%, rgb(239 169 138 / 0.22) 46%, transparent 73%);
  filter: blur(4px);
  transform: translate3d(0, calc(var(--daybreak-rise, 0px) * -1), 0);
}

body[data-chapter="05"] .memory-sky__windows { opacity: 0.74; }

/* Scroll is the camera: each chapter moves near, middle and far planes at a
   different pace. Individual transforms preserve the chapter compositions
   above and add no new animation loop. */
@supports (translate: 1px) {
  .memory-sky__mountain,
  .memory-sky__river,
  .memory-sky__silk,
  .memory-sky__windows,
  .memory-sky__moon,
  .memory-sky__constellation,
  .memory-projection__layer {
    transition:
      opacity 1.35s ease,
      transform 1.65s cubic-bezier(0.16, 1, 0.3, 1),
      translate 640ms cubic-bezier(0.2, 0.72, 0.2, 1),
      scale 780ms cubic-bezier(0.16, 1, 0.3, 1),
      rotate 780ms cubic-bezier(0.16, 1, 0.3, 1),
      filter 1.5s ease;
  }

  .memory-sky__mountain--far { translate: var(--scene-far-x, 0px) var(--scene-far-y, 0px); }
  .memory-sky__mountain--near {
    translate: var(--scene-near-x, 0px) var(--scene-near-y, 0px);
    scale: var(--scene-near-scale, 1);
  }
  .memory-sky__river {
    translate: var(--scene-river-x, 0px) var(--scene-river-y, 0px);
    scale: var(--scene-river-scale, 1);
  }
  .memory-sky__silk {
    translate: var(--scene-silk-x, 0px) var(--scene-silk-y, 0px);
    rotate: var(--scene-silk-turn, 0deg);
  }
  .memory-sky__windows {
    translate: var(--scene-windows-x, 0px) var(--scene-windows-y, 0px);
    scale: var(--scene-windows-scale, 1);
  }
  .memory-sky__moon { translate: var(--scene-moon-x, 0px) var(--scene-moon-y, 0px); }
  .memory-projection__layer {
    translate: var(--scene-projection-x, 0px) var(--scene-projection-y, 0px);
    scale: var(--scene-projection-scale, 1);
  }

  body[data-chapter="04"] .memory-sky__constellation {
    translate: 0 calc(0px - var(--scene-moon-y, 0px));
  }
}

/* While a gesture is physically drawing the canvas, the silk rises just
   enough above the paper/daylight chapters to remain visible, then fades back. */
body.is-silk-active[data-chapter="01"] .atmosphere { opacity: 0.58; }
body.is-silk-active[data-chapter="02"] .atmosphere { opacity: 0.62; }
body.is-silk-active[data-chapter="03"] .atmosphere { opacity: 0.56; }
body.is-silk-active[data-chapter="04"] .atmosphere { opacity: 0.46; }
body.is-silk-active[data-chapter="05"] .atmosphere { opacity: 0.38; }

body.is-drawing-silk .pointer-light {
  opacity: 0.34;
  transform: translate3d(-50%, -50%, 0) scale(1.22);
}

body.is-final-bloom .daybreak {
  background:
    radial-gradient(circle at 50% 69%, rgb(255 233 201 / 0.96) 0 10%, transparent 38%),
    linear-gradient(180deg, #c9cbd2 0%, #edb8a6 43%, #f7dcc8 100%);
}

body.is-final-bloom .daybreak::before {
  position: absolute;
  z-index: 0;
  bottom: 9%;
  left: 50%;
  width: min(48vw, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgb(255 238 209 / 0.94) 0 20%, rgb(247 171 137 / 0.34) 48%, transparent 72%);
  filter: blur(5px);
  transform: translate(-50%, 60px) scale(0.72);
  animation: final-sun-rise 2.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes final-sun-rise {
  0% { opacity: 0; transform: translate(-50%, 60px) scale(0.72); }
  55% { opacity: 0.84; }
  100% { opacity: 0.72; transform: translate(-50%, 0) scale(1); }
}

body.is-final-bloom .memory-sky__constellation,
body.is-final-bloom .memory-sky__ribbon,
body.is-final-bloom .memory-map-toggle { opacity: 0; }

/* One finite, chapter-colored response for blank-space touches and gathered light. */
.interaction-bloom {
  --bloom-rgb: 231 183 143;
  --bloom-x: 50vw;
  --bloom-y: 50vh;
  position: fixed;
  z-index: 67;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

body[data-tone="blue"] .interaction-bloom { --bloom-rgb: 157 203 207; }
body[data-tone="warm"] .interaction-bloom { --bloom-rgb: 244 177 142; }
body[data-tone="ink"] .interaction-bloom { --bloom-rgb: 224 160 131; }
body[data-tone="day"] .interaction-bloom { --bloom-rgb: 169 91 99; mix-blend-mode: multiply; }

.interaction-bloom::before,
.interaction-bloom::after {
  position: absolute;
  top: var(--bloom-y);
  left: var(--bloom-x);
  width: clamp(180px, 26vw, 380px);
  aspect-ratio: 1;
  border: 1px solid rgb(var(--bloom-rgb) / 0.42);
  border-radius: 50%;
  content: "";
  opacity: 0;
  box-shadow: 0 0 90px rgb(var(--bloom-rgb) / 0.18), inset 0 0 70px rgb(var(--bloom-rgb) / 0.08);
  transform: translate(-50%, -50%) scale(0.1);
}

.interaction-bloom::after {
  width: clamp(260px, 42vw, 620px);
  border-style: dashed;
  border-color: rgb(var(--bloom-rgb) / 0.2);
}

.interaction-bloom i {
  position: absolute;
  top: var(--bloom-y);
  left: var(--bloom-x);
  width: 1px;
  height: clamp(58px, 8vw, 108px);
  border-radius: 50%;
  opacity: 0;
  background: linear-gradient(180deg, rgb(var(--bloom-rgb) / 0.82), transparent);
  transform-origin: 50% 0;
}

.interaction-bloom i:nth-child(1) { --bloom-angle: 12deg; }
.interaction-bloom i:nth-child(2) { --bloom-angle: 72deg; }
.interaction-bloom i:nth-child(3) { --bloom-angle: 132deg; }
.interaction-bloom i:nth-child(4) { --bloom-angle: 192deg; }
.interaction-bloom i:nth-child(5) { --bloom-angle: 252deg; }
.interaction-bloom i:nth-child(6) { --bloom-angle: 312deg; }

.interaction-bloom.is-visible { opacity: 1; }
.interaction-bloom.is-visible::before { animation: touch-bloom-ring 1.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.interaction-bloom.is-visible::after { animation: touch-bloom-ring 1.6s 90ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.interaction-bloom.is-visible i { animation: touch-bloom-ray 1.25s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes touch-bloom-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  25% { opacity: 0.82; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); }
}

@keyframes touch-bloom-ray {
  0% { opacity: 0; transform: rotate(var(--bloom-angle)) translateY(8px) scaleY(0.15); }
  28% { opacity: 0.72; }
  100% { opacity: 0; transform: rotate(var(--bloom-angle)) translateY(clamp(84px, 13vw, 160px)) scaleY(0.42); }
}

/* A visible piece of the background that can actually be touched. */
.light-seed {
  position: fixed;
  z-index: 72;
  top: 24%;
  right: max(24px, 4vw);
  display: grid;
  width: 54px;
  min-width: 54px;
  min-height: 54px;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  padding: 7px;
  border: 1px solid rgb(var(--sky-b) / 0.24);
  border-radius: 999px;
  color: rgb(246 224 205 / 0.9);
  background: linear-gradient(118deg, rgb(11 12 20 / 0.68), rgb(var(--sky-a) / 0.11));
  box-shadow: 0 22px 70px rgb(0 0 0 / 0.22), 0 0 54px rgb(var(--sky-a) / 0.08), inset 0 1px rgb(255 255 255 / 0.05);
  backdrop-filter: blur(13px) saturate(1.1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(16px, 0, 0) scale(0.96);
  transition:
    top 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    right 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    bottom 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    left 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 420ms ease;
}

body.has-entered .light-seed {
  opacity: 0.86;
  pointer-events: auto;
  transform: none;
}

body[data-chapter="02"] .light-seed { top: 72%; right: max(22px, 5vw); }
body[data-chapter="03"] .light-seed { top: 74%; right: auto; left: max(22px, 4vw); }
body[data-chapter="04"] .light-seed { top: 63%; right: max(22px, 4vw); }
body[data-chapter="05"] .light-seed { top: 27%; right: auto; left: max(22px, 5vw); color: rgb(91 57 65 / 0.88); background: rgb(255 245 233 / 0.62); }

.light-seed:hover,
.light-seed:focus-visible {
  border-color: rgb(var(--sky-b) / 0.62);
  opacity: 1;
  transform: translate3d(0, -3px, 0);
}

.light-seed > i {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(var(--sky-b) / 0.48);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgb(var(--sky-b) / 0.84) 0 2px, rgb(var(--sky-a) / 0.2) 3px 18%, transparent 66%);
  box-shadow: 0 0 30px rgb(var(--sky-a) / 0.18);
}

.light-seed > i::before,
.light-seed > i::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(var(--sky-b) / 0.7), transparent);
  transform: translate(-50%, -50%);
}

.light-seed > i::before { width: 23px; height: 1px; }
.light-seed > i::after { width: 1px; height: 23px; }
.light-seed > i span { position: absolute; inset: 7px; border: 1px solid rgb(var(--sky-b) / 0.22); border-radius: 50%; }

.light-seed > span {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  display: grid;
  width: max-content;
  max-width: 220px;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid rgb(var(--sky-b) / 0.2);
  border-radius: 14px;
  background: rgb(12 12 20 / 0.76);
  box-shadow: 0 18px 46px rgb(0 0 0 / 0.2);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate3d(8px, -50%, 0);
  transition: opacity 320ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-chapter="03"] .light-seed > span,
body[data-chapter="05"] .light-seed > span { right: auto; left: calc(100% + 10px); transform: translate3d(-8px, -50%, 0); }

.light-seed.is-inviting > span,
.light-seed:hover > span,
.light-seed:focus-visible > span { opacity: 1; transform: translate3d(0, -50%, 0); }
.light-seed small { font-family: var(--sans); font-size: 0.53rem; letter-spacing: 0.18em; opacity: 0.58; }
.light-seed em { font-family: var(--serif); font-size: 0.72rem; font-style: normal; letter-spacing: 0.07em; white-space: nowrap; }
.light-seed.is-collected > i { background: radial-gradient(circle, rgb(var(--sky-b) / 0.95) 0 3px, rgb(var(--sky-a) / 0.24) 4px 24%, transparent 72%); }
.light-seed.is-collected { border-color: rgb(var(--sky-b) / 0.42); }

.light-note {
  position: fixed;
  z-index: 73;
  bottom: max(104px, 11vh);
  left: 50%;
  width: min(540px, calc(100vw - 40px));
  margin: 0;
  padding: 17px 25px;
  border: 1px solid rgb(var(--sky-b) / 0.28);
  border-radius: 999px;
  color: rgb(247 229 213 / 0.92);
  background: linear-gradient(116deg, rgb(12 12 20 / 0.82), rgb(var(--sky-a) / 0.12));
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.28), 0 0 70px rgb(var(--sky-a) / 0.11);
  backdrop-filter: blur(18px) saturate(1.1);
  font-family: var(--serif);
  font-size: clamp(0.76rem, 1.1vw, 0.9rem);
  letter-spacing: 0.055em;
  line-height: 1.8;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate3d(-50%, 18px, 0) scale(0.97);
}

body.is-light-note-visible .light-note {
  animation: light-note-arrive 4.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes light-note-arrive {
  0% { opacity: 0; transform: translate3d(-50%, 18px, 0) scale(0.97); }
  12%, 78% { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(-50%, -10px, 0) scale(0.99); }
}

.moon-gate {
  position: fixed;
  z-index: 78;
  bottom: max(26px, 4vh);
  left: 50%;
  display: grid;
  min-width: 270px;
  min-height: 66px;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: center;
  padding: 9px 20px 9px 10px;
  border: 1px solid rgb(239 194 158 / 0.5);
  border-radius: 999px;
  color: rgb(251 231 210 / 0.96);
  background:
    radial-gradient(circle at 15% 50%, rgb(239 194 158 / 0.17), transparent 29%),
    rgb(14 13 22 / 0.88);
  box-shadow: 0 30px 100px rgb(0 0 0 / 0.4), 0 0 110px rgb(201 126 139 / 0.18), inset 0 1px rgb(255 255 255 / 0.07);
  backdrop-filter: blur(18px) saturate(1.16);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(-50%, 24px, 0) scale(0.92);
}

.moon-gate[hidden] { display: none; }
body.is-moon-gate-unlocked .moon-gate { animation: moon-gate-arrive 1.25s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes moon-gate-arrive {
  0% { opacity: 0; transform: translate3d(-50%, 24px, 0) scale(0.92); }
  62% { opacity: 1; transform: translate3d(-50%, -5px, 0) scale(1.02); }
  100% { opacity: 0.94; transform: translate3d(-50%, 0, 0) scale(1); }
}

.moon-gate:hover,
.moon-gate:focus-visible { border-color: rgb(246 215 184 / 0.86); }
.moon-gate > i { width: 46px; aspect-ratio: 1; border: 1px solid rgb(239 194 158 / 0.42); border-radius: 50%; background: radial-gradient(circle at 63% 42%, rgb(255 230 197 / 0.92) 0 14%, rgb(221 153 142 / 0.22) 16% 38%, transparent 64%); box-shadow: 0 0 38px rgb(221 153 142 / 0.2); }
.moon-gate > span { display: grid; gap: 3px; text-align: left; }
.moon-gate small { font-family: var(--sans); font-size: 0.54rem; letter-spacing: 0.18em; opacity: 0.6; }
.moon-gate strong { font-family: var(--serif); font-size: 0.88rem; font-weight: 400; letter-spacing: 0.08em; }

/* The unlocked full-screen surprise: three real memories under one moon. */
.moon-secret {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: rgb(247 232 218 / 0.94);
  background: transparent;
}

.moon-secret:not([open]) { display: none; }
.moon-secret::backdrop { background: rgb(5 6 12 / 0.86); backdrop-filter: blur(9px); }

.moon-secret__scene {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow: hidden auto;
  isolation: isolate;
  background:
    radial-gradient(circle at 70% 24%, rgb(226 169 147 / 0.16), transparent 24%),
    radial-gradient(ellipse at 28% 72%, rgb(105 119 143 / 0.18), transparent 39%),
    linear-gradient(145deg, #090b14, #18131f 54%, #261923);
}

.moon-secret[open] .moon-secret__scene { animation: moon-secret-open 980ms cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes moon-secret-open {
  from { opacity: 0; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}

.moon-secret__sky { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.moon-secret__moon {
  position: absolute;
  top: 9%;
  right: 9%;
  width: min(28vw, 390px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 39%, rgb(255 236 211 / 0.76), rgb(226 169 147 / 0.26) 33%, rgb(143 113 141 / 0.09) 58%, transparent 72%);
  box-shadow: 0 0 140px rgb(212 145 146 / 0.22);
  transform: translate3d(var(--moon-x, 0px), var(--moon-y, 0px), 0);
  transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.moon-secret__ridge { position: absolute; right: -8%; bottom: -2%; width: 78%; height: 47%; clip-path: polygon(0 87%, 10% 62%, 22% 76%, 37% 32%, 49% 67%, 65% 21%, 77% 68%, 91% 42%, 100% 71%, 100% 100%, 0 100%); background: linear-gradient(165deg, rgb(141 132 151 / 0.1), rgb(32 28 42 / 0.94)); }
.moon-secret__ridge--far { right: 20%; bottom: 12%; width: 92%; height: 35%; opacity: 0.46; background: rgb(99 104 128 / 0.18); transform: translate3d(calc(var(--moon-x, 0px) * -0.28), 0, 0); }
.moon-secret__water { position: absolute; right: -10%; bottom: -18%; width: 74%; height: 72%; border-radius: 50%; background: repeating-linear-gradient(177deg, transparent 0 28px, rgb(231 187 159 / 0.08) 29px 30px), radial-gradient(ellipse, rgb(201 135 143 / 0.13), transparent 63%); transform: rotate(-7deg); }
.moon-secret__thread { position: absolute; top: 50%; left: -8%; width: 116%; height: 1px; background: linear-gradient(90deg, transparent, rgb(226 169 147 / 0.45), rgb(142 157 177 / 0.25), transparent); box-shadow: 0 0 36px rgb(226 169 147 / 0.16); transform: rotate(-5deg); }

.moon-secret__close {
  position: fixed;
  z-index: 4;
  top: max(20px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  border: 1px solid rgb(239 202 175 / 0.3);
  border-radius: 50%;
  color: inherit;
  background: rgb(12 12 20 / 0.42);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.moon-secret__close span::before,
.moon-secret__close span::after { position: absolute; top: 50%; left: 50%; width: 16px; height: 1px; content: ""; background: currentColor; }
.moon-secret__close span::before { transform: translate(-50%, -50%) rotate(45deg); }
.moon-secret__close span::after { transform: translate(-50%, -50%) rotate(-45deg); }

.moon-secret__header {
  position: absolute;
  z-index: 2;
  top: 14%;
  left: clamp(28px, 7vw, 108px);
  width: min(36vw, 510px);
}

.moon-secret__header h2 { margin: 16px 0 24px; white-space: pre-line; font-family: var(--serif); font-size: clamp(2.25rem, 4.8vw, 5rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.035em; }
.moon-secret__header > p:last-child { width: min(34em, 100%); margin: 0; color: rgb(240 222 207 / 0.62); font-family: var(--serif); font-size: clamp(0.82rem, 1.15vw, 1rem); line-height: 2; }

.moon-secret__experience { position: absolute; z-index: 2; top: 13%; right: clamp(32px, 6vw, 92px); width: min(50vw, 720px); height: 72%; }
.moon-secret__frames { position: absolute; inset: 0 0 92px; }
.moon-secret__frame { position: absolute; inset: 0; overflow: hidden; border: 1px solid rgb(239 202 175 / 0.25); border-radius: 34px 34px 120px 34px; background: rgb(12 12 20 / 0.58); box-shadow: 0 42px 130px rgb(0 0 0 / 0.42), 0 0 100px rgb(201 135 143 / 0.13); }
.moon-secret__frame[hidden] { display: none; }
.moon-secret__image { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.72) contrast(0.92) brightness(0.72); }
.moon-secret__copy { position: absolute; right: 0; bottom: 0; left: 0; padding: clamp(22px, 4vw, 50px); background: linear-gradient(0deg, rgb(8 9 15 / 0.96), rgb(11 11 19 / 0.64) 70%, transparent); }
.moon-secret__copy small { display: block; margin-bottom: 12px; color: rgb(234 184 153 / 0.76); font-family: var(--sans); font-size: 0.58rem; letter-spacing: 0.24em; }
.moon-secret__copy p { width: min(34em, 92%); margin: 0; font-family: var(--serif); font-size: clamp(0.9rem, 1.4vw, 1.18rem); line-height: 2; letter-spacing: 0.045em; }

.moon-secret.is-turning-page .moon-secret__frame.is-visible { animation: moon-frame-develop 960ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes moon-frame-develop { from { opacity: 0; filter: blur(12px); transform: scale(1.045) translate3d(20px, 0, 0); } to { opacity: 1; filter: blur(0); transform: none; } }

.moon-secret__lights { position: absolute; right: 0; bottom: 0; left: 0; display: flex; min-height: 72px; align-items: center; justify-content: center; gap: clamp(12px, 2.5vw, 30px); }
.moon-secret__light { display: grid; min-width: 76px; min-height: 54px; grid-template-columns: 36px auto; gap: 8px; align-items: center; padding: 6px 12px 6px 7px; border: 1px solid rgb(239 202 175 / 0.2); border-radius: 999px; color: rgb(240 222 207 / 0.62); background: rgb(11 11 19 / 0.48); cursor: pointer; font-family: var(--serif); }
.moon-secret__light i { width: 36px; height: 36px; border: 1px solid rgb(239 202 175 / 0.28); border-radius: 50%; background: radial-gradient(circle, rgb(246 214 184 / 0.75) 0 2px, transparent 3px); box-shadow: 0 0 24px rgb(201 135 143 / 0.12); }
.moon-secret__light:hover,
.moon-secret__light:focus-visible,
.moon-secret__light.is-active { color: rgb(251 233 215 / 0.96); border-color: rgb(239 202 175 / 0.54); transform: translate3d(0, -2px, 0); }
.moon-secret__light.is-discovered i { background: radial-gradient(circle, rgb(255 233 204 / 0.98) 0 3px, rgb(211 146 145 / 0.24) 4px 42%, transparent 70%); box-shadow: 0 0 36px rgb(211 146 145 / 0.26); }

.moon-secret__progress { position: absolute; right: 0; bottom: -26px; margin: 0; color: rgb(240 222 207 / 0.42); font-family: var(--sans); font-size: 0.56rem; letter-spacing: 0.12em; }
.moon-secret__ending { position: fixed; z-index: 3; bottom: max(30px, 4vh); left: clamp(28px, 7vw, 108px); width: min(39vw, 580px); margin: 0; color: rgb(247 220 197 / 0.88); font-family: var(--serif); font-size: clamp(0.78rem, 1.1vw, 0.94rem); line-height: 1.9; letter-spacing: 0.07em; }
.moon-secret.is-complete .moon-secret__ending { animation: moon-ending-in 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes moon-ending-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.moon-secret__return { position: fixed; z-index: 3; bottom: max(28px, 4vh); right: clamp(28px, 6vw, 92px); min-height: 50px; padding: 0 24px; border: 1px solid rgb(239 202 175 / 0.3); border-radius: 999px; color: rgb(247 229 211 / 0.82); background: rgb(12 12 20 / 0.5); backdrop-filter: blur(12px); cursor: pointer; font-family: var(--serif); letter-spacing: 0.08em; }

body.archive-is-open .light-seed,
body.archive-is-open .light-note,
body.archive-is-open .moon-gate,
body.moon-secret-is-open .light-seed,
body.moon-secret-is-open .light-note,
body.moon-secret-is-open .moon-gate,
body.moon-secret-is-open .memory-map-toggle,
body.moon-secret-is-open .memory-map-panel { opacity: 0; pointer-events: none; }

body.moon-secret-is-open .memory-sky__field,
body.moon-secret-is-open .grain,
body.moon-secret-is-open .romance-veil__bloom,
body.moon-secret-is-open .romance-veil::before,
body.moon-secret-is-open .romance-veil__thread::after,
body.moon-secret-is-open .pointer-light::before { animation-play-state: paused !important; }

@media (max-width: 900px) {
  .memory-projection__layer,
  body[data-chapter="01"] .memory-projection__layer,
  body[data-chapter="02"] .memory-projection__layer,
  body[data-chapter="03"] .memory-projection__layer,
  body[data-chapter="04"] .memory-projection__layer,
  body[data-chapter="05"] .memory-projection__layer {
    top: 10%;
    right: -38%;
    left: auto;
    width: 128vw;
    height: 74vh;
    border-radius: 32% 0 0 40%;
    filter: grayscale(0.1) saturate(0.7) contrast(0.9) brightness(0.76) blur(2px);
    mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.7) 27%, #000 72%, transparent);
    mix-blend-mode: soft-light;
    transform: scale(1.03);
  }

  body[data-chapter="01"] .memory-projection__layer.is-current { opacity: 0.28; }
  body[data-chapter="02"] .memory-projection__layer.is-current { opacity: 0.26; }
  body[data-chapter="03"] .memory-projection__layer.is-current { opacity: 0.25; }
  body[data-chapter="04"] .memory-projection__layer.is-current { opacity: 0.19; }
  body[data-chapter="05"] .memory-projection__layer.is-current { opacity: 0.24; }

  .memory-sky__mountain { left: -38%; width: 132%; height: 42%; opacity: 0.36; }
  .memory-sky__mountain--far { left: -22%; bottom: 10%; width: 112%; opacity: 0.22; }
  .memory-sky__river { right: -48%; width: 122%; opacity: 0.38; }
  .memory-sky__silk { right: -34%; width: 118%; opacity: 0.54; }
  .memory-sky__windows { right: -6%; bottom: 11%; width: 54vw; height: 30vw; gap: 9px; opacity: 0.5; }

  .light-seed,
  body[data-chapter="02"] .light-seed,
  body[data-chapter="03"] .light-seed,
  body[data-chapter="04"] .light-seed,
  body[data-chapter="05"] .light-seed {
    top: auto;
    right: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    min-width: 50px;
    width: 50px;
    min-height: 50px;
    grid-template-columns: 1fr;
    padding: 5px;
    color: rgb(246 224 205 / 0.9);
    background: rgb(12 12 20 / 0.72);
  }

  .light-seed > i { width: 38px; height: 38px; margin: auto; }
  .light-seed > span { position: absolute; bottom: calc(100% + 8px); left: 0; width: max-content; max-width: 210px; padding: 8px 11px; border: 1px solid rgb(var(--sky-b) / 0.2); border-radius: 12px; background: rgb(12 12 20 / 0.76); opacity: 0; pointer-events: none; transform: translate3d(0, 6px, 0); transition: opacity 300ms ease, transform 300ms ease; }
  .light-seed.is-inviting > span,
  .light-seed:hover > span,
  .light-seed:focus-visible > span { opacity: 1; transform: none; }

  .light-note { bottom: max(78px, calc(env(safe-area-inset-bottom) + 68px)); width: calc(100vw - 24px); padding: 14px 18px; border-radius: 18px; font-size: 0.72rem; }
  .moon-gate { bottom: max(76px, calc(env(safe-area-inset-bottom) + 65px)); min-width: min(270px, calc(100vw - 44px)); }

  .moon-secret__scene { min-height: 100svh; padding: 90px 22px 130px; }
  .moon-secret__header { position: relative; top: auto; left: auto; width: 100%; }
  .moon-secret__header h2 { margin: 12px 0 18px; font-size: clamp(2.2rem, 10vw, 4rem); }
  .moon-secret__header > p:last-child { font-size: 0.78rem; line-height: 1.85; }
  .moon-secret__experience { position: relative; top: auto; right: auto; width: 100%; height: auto; margin-top: 30px; }
  .moon-secret__frames { position: relative; inset: auto; height: min(47svh, 440px); }
  .moon-secret__frame { border-radius: 24px 24px 76px 24px; }
  .moon-secret__copy { padding: 24px 20px 25px; }
  .moon-secret__copy p { width: 100%; font-size: 0.82rem; line-height: 1.85; }
  .moon-secret__lights { position: relative; inset: auto; min-height: 64px; margin-top: 14px; gap: 9px; }
  .moon-secret__light { min-width: 52px; width: 52px; min-height: 52px; grid-template-columns: 1fr; padding: 6px; }
  .moon-secret__light i { width: 38px; height: 38px; margin: auto; }
  .moon-secret__light span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .moon-secret__progress { position: relative; right: auto; bottom: auto; margin-top: 2px; text-align: center; }
  .moon-secret__ending { position: relative; bottom: auto; left: auto; width: 100%; margin-top: 30px; text-align: center; }
  .moon-secret__return { right: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(50%); white-space: nowrap; }
  .moon-secret__moon { top: 8%; right: -16%; width: 68vw; }
  .moon-secret__ridge { right: -52%; width: 140%; }
}

@media (max-width: 520px) {
  .memory-sky__constellation { opacity: 0.26; }
  .memory-sky__ribbon { opacity: 0.34; }
  .interaction-bloom::before { width: 190px; }
  .interaction-bloom::after { width: 280px; }
  .interaction-bloom i { height: 62px; }
  body.is-moon-gate-unlocked .memory-map-toggle { opacity: 0.48; }
}

@media (prefers-reduced-motion: reduce) {
  .memory-sky__mountain,
  .memory-sky__river,
  .memory-sky__silk,
  .memory-sky__windows,
  .memory-sky__moon,
  .memory-sky__constellation,
  .memory-projection__layer,
  .light-seed,
  .moon-secret__moon {
    transition: none !important;
  }

  .memory-sky__mountain,
  .memory-sky__river,
  .memory-sky__silk,
  .memory-sky__windows,
  .memory-sky__moon,
  .memory-sky__constellation,
  .memory-projection__layer {
    translate: none !important;
    scale: none !important;
    rotate: none !important;
  }

  .interaction-bloom.is-visible::before,
  .interaction-bloom.is-visible::after,
  .interaction-bloom.is-visible i,
  body.is-light-note-visible .light-note,
  body.is-moon-gate-unlocked .moon-gate,
  .moon-secret[open] .moon-secret__scene,
  .moon-secret.is-turning-page .moon-secret__frame.is-visible,
  .moon-secret.is-complete .moon-secret__ending,
  body.is-final-bloom .daybreak::before {
    animation: none !important;
  }

  .interaction-bloom.is-visible::before { opacity: 0.5; transform: translate(-50%, -50%) scale(0.72); }
  .interaction-bloom.is-visible::after,
  .interaction-bloom.is-visible i { display: none; }
  body.is-light-note-visible .light-note { opacity: 1; transform: translate3d(-50%, 0, 0); }
  body.is-moon-gate-unlocked .moon-gate { opacity: 0.94; transform: translate3d(-50%, 0, 0); }
  body.is-final-bloom .daybreak::before { opacity: 0.72; transform: translate(-50%, 0) scale(1); }
}

body.is-data-saver .memory-sky__river,
body.is-data-saver .memory-sky__silk,
body.is-data-saver .interaction-bloom,
body.is-data-saver .moon-secret__image { filter: none; }

body.is-data-saver .memory-sky__mountain,
body.is-data-saver .memory-sky__river,
body.is-data-saver .memory-sky__silk,
body.is-data-saver .memory-sky__windows,
body.is-data-saver .memory-sky__moon,
body.is-data-saver .memory-sky__constellation,
body.is-data-saver .memory-projection__layer {
  translate: none !important;
  scale: none !important;
  rotate: none !important;
}

@media (forced-colors: active) {
  .memory-sky__landscape,
  .interaction-bloom,
  .moon-secret__sky { display: none; }

  .light-seed,
  .moon-gate,
  .moon-secret__light,
  .moon-secret__close,
  .moon-secret__return { border: 1px solid ButtonText; color: ButtonText; background: ButtonFace; box-shadow: none; forced-color-adjust: auto; }
}

@media (max-width: 900px) {
  .memory-sky__field::before {
    right: -28%;
    width: 76vw;
    min-width: 0;
    opacity: 0.68;
  }

  .memory-sky__field::after {
    right: -30%;
    width: 116vw;
    filter: blur(13px);
  }

  .memory-sky__aurora {
    filter: blur(14px);
  }

  .memory-sky__aurora--one { width: 102vw; }
  .memory-sky__aurora--two { width: 98vw; }

  .memory-projection__layer {
    top: 9%;
    right: -28%;
    width: 112vw;
    height: 74vh;
    filter: grayscale(0.14) saturate(0.74) contrast(0.94) blur(8px);
  }

  body[data-chapter="04"] .memory-projection__layer {
    right: auto;
    left: -30%;
  }

  .memory-map-toggle {
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    min-width: 184px;
    backdrop-filter: blur(10px);
  }

  .memory-map-panel {
    right: 18px;
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 70px));
    max-height: calc(100svh - 118px);
    overflow-y: auto;
    backdrop-filter: blur(16px);
  }

  .chapter-bridge {
    min-height: 74px;
  }
}

@media (max-width: 520px) {
  .memory-sky::before {
    width: 180vw;
    background: linear-gradient(102deg, transparent 28%, rgb(var(--sky-b) / 0.3) 49%, rgb(var(--sky-a) / 0.1) 58%, transparent 72%);
  }

  body.is-chapter-transitioning .memory-sky::before {
    animation-duration: 640ms;
  }

  .memory-sky__field::before {
    top: -12%;
    right: -48%;
    width: 92vw;
    height: 124vh;
  }

  .memory-sky__field::after {
    right: -52%;
    bottom: -8%;
    width: 142vw;
    height: 66vh;
  }

  .memory-sky__aurora--one {
    top: 2%;
    left: -30%;
    width: 138vw;
    height: 26vh;
  }

  .memory-sky__aurora--two {
    right: -45%;
    bottom: 12%;
    width: 126vw;
    height: 24vh;
  }

  .memory-sky__moon {
    top: 13%;
    right: -8%;
    width: 156px;
  }

  .memory-sky__chapter-echo {
    top: 13%;
    left: 18px;
    font-size: 0.56rem;
  }

  .memory-projection__layer {
    top: 17%;
    right: -43%;
    width: 132vw;
    height: 62vh;
    filter: grayscale(0.12) saturate(0.72) contrast(0.93) blur(7px);
  }

  body[data-chapter="01"] .memory-projection__layer.is-current { opacity: 0.075; }
  body[data-chapter="02"] .memory-projection__layer.is-current { opacity: 0.13; }
  body[data-chapter="03"] .memory-projection__layer.is-current { opacity: 0.11; }
  body[data-chapter="04"] .memory-projection__layer.is-current { opacity: 0.08; }
  body[data-chapter="05"] .memory-projection__layer.is-current { opacity: 0.075; }

  .memory-map-toggle {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 164px;
    min-height: 50px;
    grid-template-columns: 30px 1fr;
    gap: 9px;
    padding: 7px 12px 7px 9px;
  }

  .memory-map-toggle > i {
    width: 30px;
    height: 30px;
  }

  .memory-map-toggle em { font-size: 0.64rem; }

  .memory-map-panel {
    right: 10px;
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
    width: calc(100vw - 20px);
    max-height: calc(100svh - 92px - env(safe-area-inset-bottom));
    padding: 19px;
    border-radius: 22px;
  }

  .memory-map-panel h2 { font-size: 1.2rem; }
  .memory-map-panel__nav { margin-block: 10px 13px; }
  .memory-map-panel__nav a { min-height: 46px; }

  .chapter-bridge {
    width: calc(100% - 32px);
    min-height: 68px;
    grid-template-columns: 1fr 54px;
    margin-top: 40px;
    padding: 11px 14px 11px 17px;
  }

  .chapter-bridge i { width: 44px; }
  .chapter-bridge strong { font-size: 0.78rem; }

  .reveal:not(.is-visible) > .display-title,
  .reveal:not(.is-visible) > h2,
  .reveal:not(.is-visible) > h3,
  .reveal:not(.is-visible) h2,
  .reveal:not(.is-visible) h3 {
    filter: blur(4px);
    transform: translate3d(0, 14px, 0);
  }

  .first-frame__copy.reveal:not(.is-visible) .display-title { transform: translate3d(-14px, 0, 0); }
  .section-heading.reveal:not(.is-visible) h2 { transform: translate3d(14px, 0, 0); }

  body.is-final-bloom .daybreak__final-wash { animation-duration: 1.65s; }
  body.is-final-bloom .city-pair { animation-duration: 1.55s; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .memory-map-toggle {
    min-width: 50px;
    width: 50px;
    padding: 8px;
    grid-template-columns: 1fr;
  }

  .memory-map-toggle > span { display: none; }

  .memory-map-panel {
    right: 76px;
    bottom: 10px;
    max-height: calc(100svh - 20px);
  }
}

@media (min-width: 2560px), (min-width: 1600px) and (min-resolution: 2dppx) {
  .memory-sky__field {
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-chapter-transitioning .memory-sky::before,
  body.is-chapter-transitioning .memory-sky__chapter-echo,
  body.is-journey-echo .memory-sky__constellation,
  body.is-journey-echo .memory-sky__node,
  body.is-journey-echo .memory-sky__chapter-echo,
  body.is-entrance-opening .memory-projection__layer.is-current,
  body.is-final-bloom .daybreak__final-wash,
  body.is-final-bloom .city-pair {
    animation: none !important;
  }

  .memory-projection__layer,
  .memory-map-toggle,
  .memory-map-panel,
  .chapter-bridge,
  .reveal h2,
  .reveal h3 {
    transition: none !important;
  }

  body.is-final-bloom .daybreak__final-wash {
    opacity: 0.72;
    transform: scale(1.24);
  }
}

body.is-data-saver .memory-projection,
body.is-data-saver .memory-sky__aurora--two,
body.archive-is-open .memory-projection {
  display: none;
}

body.archive-is-open .memory-map-toggle,
body.archive-is-open .memory-map-panel {
  opacity: 0;
  pointer-events: none;
}

@media (forced-colors: active) {
  .memory-projection,
  .daybreak__final-wash {
    display: none;
  }

  .memory-map-toggle,
  .memory-map-panel,
  .chapter-bridge {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  .city-pair__range {
    bottom: 4px;
    height: 24px;
    opacity: 1;
    pointer-events: auto;
  }
}

/* “潮水退去以后”：阅读中段拥有自己的水位、月路与有限涟漪。 */
.truth-beat {
  --tide-y: 66%;
  --tide-y-px: 420px;
  --tide-progress: 0;
  --tide-reveal: 0;
  --tide-lean: 0;
  --tide-wave: 0;
  --tide-pointer-x: 72%;
  --tide-ripple-x: 50%;
  --tide-ripple-y: 66%;
  position: relative;
  width: min(1120px, 100%);
  min-height: clamp(640px, 92svh, 900px);
  max-width: none;
  padding: clamp(76px, 8vw, 118px) clamp(34px, 8vw, 108px);
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
  border-block: 1px solid rgb(226 205 198 / 0.07);
  background:
    linear-gradient(180deg, rgb(10 13 24 / 0.08), transparent 35% 64%, rgb(37 32 55 / 0.12)),
    radial-gradient(circle at 78% 20%, rgb(201 182 205 / 0.07), transparent 31%);
}

.truth-beat::before {
  z-index: 0;
  top: 48%;
  left: 37%;
  width: min(72vw, 810px);
  opacity: 0.68;
  background:
    radial-gradient(circle, rgb(202 137 148 / 0.13), rgb(111 127 159 / 0.04) 48%, transparent 72%);
  transform: translate3d(
    calc(-50% + var(--tide-lean) * -9px),
    calc(-50% + (var(--tide-progress) - 0.5) * 8px),
    0
  );
  transition: opacity 700ms ease;
}

.truth-tide {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  mask-image: linear-gradient(180deg, transparent 0, #000 10% 93%, transparent 100%);
}

.truth-tide__canvas {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.94;
  mix-blend-mode: screen;
}

.truth-tide__moon {
  position: absolute;
  z-index: 1;
  top: clamp(48px, 8%, 76px);
  left: calc(76% + var(--tide-lean) * 15px);
  width: clamp(104px, 15vw, 178px);
  aspect-ratio: 1;
  border: 1px solid rgb(236 214 202 / 0.09);
  border-radius: 50%;
  opacity: calc(0.52 + var(--tide-reveal) * 0.28);
  background:
    radial-gradient(circle at 44% 40%, rgb(244 225 208 / 0.23) 0 5%, rgb(199 177 194 / 0.09) 27%, transparent 67%);
  box-shadow:
    0 0 82px rgb(194 160 179 / 0.13),
    inset 18px -13px 42px rgb(92 104 139 / 0.06);
  transform: translateX(-50%) scale(calc(0.94 + var(--tide-reveal) * 0.06));
  transition: left 160ms linear, opacity 480ms ease, transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

.truth-tide__moon::before,
.truth-tide__moon::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.truth-tide__moon::before {
  inset: 18%;
  border: 1px solid rgb(236 214 202 / 0.07);
  border-left-color: transparent;
  transform: rotate(calc(-18deg + var(--tide-lean) * 8deg));
}

.truth-tide__moon::after {
  top: 29%;
  left: 24%;
  width: 9%;
  aspect-ratio: 1;
  background: rgb(123 131 157 / 0.1);
  box-shadow: 28px 24px 0 5px rgb(123 131 157 / 0.055);
}

.truth-tide__moon-road {
  position: absolute;
  z-index: 2;
  top: clamp(130px, 19%, 170px);
  left: calc(76% + var(--tide-lean) * 13px);
  width: clamp(50px, 8vw, 94px);
  height: max(70px, calc(var(--tide-y) - 19%));
  opacity: calc(0.17 + var(--tide-reveal) * 0.26);
  background: linear-gradient(180deg, rgb(235 210 198 / 0.12), rgb(216 181 180 / 0.025) 72%, transparent);
  filter: blur(13px);
  transform: translateX(-50%) skewX(calc(var(--tide-wave) * 2deg));
  transition: left 160ms linear, opacity 480ms ease;
}

.truth-tide__shore {
  position: absolute;
  z-index: 4;
  top: var(--tide-y);
  right: 7%;
  left: 7%;
  height: 1px;
  opacity: calc(0.2 + var(--tide-reveal) * 0.25);
  background: linear-gradient(90deg, transparent, rgb(236 209 197 / 0.19) 24%, rgb(161 183 199 / 0.17) 72%, transparent);
  box-shadow: 0 0 30px rgb(181 157 182 / 0.08);
  transform: rotate(calc(var(--tide-lean) * 0.55deg)) scaleX(calc(0.82 + var(--tide-reveal) * 0.18));
  transform-origin: center;
}

.truth-tide__reflection {
  position: absolute;
  z-index: 2;
  top: calc(var(--tide-y) + 16px);
  left: var(--truth-reflection-left, 8%);
  width: var(--truth-reflection-width, min(10.5em, 58%));
  max-height: clamp(120px, 23vh, 220px);
  overflow: hidden;
  color: rgb(222 208 210 / 0.11);
  font-family: var(--serif);
  font-size: clamp(2.7rem, 4.8vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.15;
  white-space: pre-line;
  opacity: calc(0.025 + var(--tide-reveal) * 0.075);
  filter: blur(2.2px);
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.76), transparent 86%);
  transform: translate3d(calc(var(--tide-wave) * 10px), 0, 0) scaleY(-1) skewX(calc(var(--tide-wave) * -2deg));
  transform-origin: center;
}

.truth-tide__touch-ring {
  position: absolute;
  z-index: 5;
  top: var(--tide-ripple-y);
  left: var(--tide-ripple-x);
  width: 18px;
  aspect-ratio: 1;
  border: 1px solid rgb(239 210 196 / 0.52);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 28px rgb(193 169 192 / 0.16);
  transform: translate(-50%, -50%) scale(0.15, 0.08);
}

.truth-beat.is-tide-rippling .truth-tide__touch-ring {
  animation: truth-tide-touch-ring 1.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes truth-tide-touch-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.12, 0.06); }
  22% { opacity: 0.72; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(18, 5.2); }
}

#truthBeatLine,
#truthBeatAfter {
  position: relative;
  z-index: 6;
}

#truthBeatLine {
  transform: translate3d(calc(var(--tide-lean) * 5px), calc((0.5 - var(--tide-progress)) * 7px), 0);
  transition: text-shadow 480ms ease;
}

.truth-beat.is-tide-active #truthBeatLine {
  text-shadow:
    0 0 42px rgb(202 137 148 / 0.13),
    0 18px 54px rgb(104 130 156 / 0.07);
}

#truthBeatAfter {
  transform: translate3d(calc(var(--tide-lean) * -3px), calc((var(--tide-progress) - 0.5) * 5px), 0);
}

@media (max-width: 700px) {
  .truth-beat {
    min-height: 78svh;
    padding: 62px 4% 76px;
  }

  .truth-tide__canvas { opacity: 0.82; }
  .truth-tide__moon {
    top: 7%;
    left: calc(81% + var(--tide-lean) * 8px);
    width: clamp(82px, 27vw, 112px);
  }

  .truth-tide__moon-road {
    left: calc(81% + var(--tide-lean) * 7px);
    width: 48px;
    filter: blur(10px);
  }

  .truth-tide__reflection {
    font-size: clamp(2.5rem, 10.5vw, 3.8rem);
    opacity: calc(0.02 + var(--tide-reveal) * 0.055);
  }

  .truth-tide__shore {
    right: 2%;
    left: 2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .truth-beat {
    --tide-y: 62%;
    --tide-progress: 0.5;
    --tide-reveal: 0.54;
  }

  .truth-tide__moon,
  .truth-tide__moon-road,
  .truth-tide__shore,
  #truthBeatLine,
  #truthBeatAfter {
    transition: none !important;
    transform: none !important;
  }

  .truth-tide__reflection,
  .truth-tide__touch-ring {
    display: none;
  }

  .truth-tide__canvas { opacity: 0.5; }
  .truth-beat.is-tide-rippling .truth-tide__touch-ring { animation: none !important; }
}

body.is-data-saver .truth-tide__canvas { opacity: 0.48; }
body.is-data-saver .truth-tide__reflection { display: none; }

@media (forced-colors: active) {
  .truth-tide { display: none; }
  .truth-beat { border-color: CanvasText; background: Canvas; }
}

/* Two photographs become small, finite rituals: paper remembers touch; mountain remembers weather. */
.photo-ritual {
  --paper-tilt-x: 0deg;
  --paper-tilt-y: 0deg;
  --paper-shift-x: 0px;
  --paper-shift-y: 0px;
  --paper-light-x: 50%;
  --paper-light-y: 50%;
  --mountain-height: 0.67;
  --mountain-marker-y: 67%;
  --mountain-back-y: -2.2px;
  --mountain-middle-y: -4.1px;
  --mountain-front-y: -6.5px;
  --mountain-scale-y: 2.4px;
  isolation: isolate;
  outline: none;
  touch-action: pan-y;
  transform-style: preserve-3d;
}

.photo-ritual:focus-visible {
  box-shadow:
    0 0 0 1px rgb(238 213 190 / 0.64),
    0 0 0 7px rgb(202 137 148 / 0.09),
    var(--photo-shadow);
}

.photo-after__item--1 .photo-ritual--paper {
  transform:
    perspective(1150px)
    translate3d(var(--paper-shift-x), var(--paper-shift-y), 0)
    rotate(0.26deg)
    rotateX(var(--paper-tilt-x))
    rotateY(var(--paper-tilt-y));
  transform-origin: 52% 46%;
}

.photo-ritual--paper.is-ritual-moving {
  will-change: transform;
}

.photo-ritual__paper-sheen {
  position: absolute;
  z-index: 3;
  inset: 0 0 34px;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle 190px at var(--paper-light-x) var(--paper-light-y), rgb(255 244 225 / 0.2), transparent 72%),
    linear-gradient(112deg, transparent 18%, rgb(255 247 233 / 0.055) 43%, transparent 66%);
  box-shadow: inset 0 0 0 1px rgb(255 247 233 / 0.055);
  mix-blend-mode: screen;
  opacity: 0.42;
  transform: translateZ(7px);
}

.photo-ritual__paper-sheen::before,
.photo-ritual__paper-sheen::after {
  position: absolute;
  width: 23%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(75 58 49 / 0.34), transparent);
  opacity: 0.42;
}

.photo-ritual__paper-sheen::before {
  top: 16%;
  right: 7%;
  transform: rotate(-4deg);
}

.photo-ritual__paper-sheen::after {
  bottom: 13%;
  left: 9%;
  transform: rotate(2deg);
}

.photo-ritual--paper figcaption,
.photo-ritual--mountain figcaption {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.photo-ritual__ink {
  position: relative;
  display: inline-grid;
  width: 126px;
  min-width: 126px;
  height: 22px;
  align-items: center;
  color: rgb(229 198 184 / 0.8);
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  opacity: 0;
  text-align: right;
}

.photo-ritual__ink svg,
.photo-ritual__ink-words {
  position: absolute;
  inset: 0;
}

.photo-ritual__ink svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.photo-ritual__ink path {
  fill: none;
  stroke: rgb(217 158 151 / 0.78);
  stroke-dasharray: 132;
  stroke-dashoffset: 132;
  stroke-linecap: round;
  stroke-width: 0.75;
}

.photo-ritual__ink-words {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  opacity: 0;
  transform: translateY(3px);
}

.has-paper-ritual.is-ink-awake .photo-ritual__ink {
  animation: photo-paper-ink-shell 2.55s both;
}

.has-paper-ritual.is-ink-awake .photo-ritual__ink path {
  animation: photo-paper-ink-line 2.4s var(--romance-ease) both;
}

.has-paper-ritual.is-ink-awake .photo-ritual__ink-words {
  animation: photo-paper-ink-words 2.55s var(--romance-ease) both;
}

.has-paper-ritual.is-ink-awake .photo-ritual__paper-sheen {
  animation: photo-paper-soft-flash 2.45s var(--romance-ease) both;
}

@keyframes photo-paper-ink-shell {
  0%, 100% { opacity: 0; }
  11%, 76% { opacity: 1; }
}

@keyframes photo-paper-ink-line {
  0% { opacity: 0; stroke-dashoffset: 132; }
  12% { opacity: 0.9; }
  58%, 82% { opacity: 0.76; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

@keyframes photo-paper-ink-words {
  0%, 27% { opacity: 0; transform: translateY(3px); }
  46%, 78% { opacity: 0.88; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-1px); }
}

@keyframes photo-paper-soft-flash {
  0%, 100% { opacity: 0.42; }
  34% { opacity: 0.78; }
  70% { opacity: 0.53; }
}

.photo-ritual--mountain {
  overflow: visible;
  transition: transform 820ms var(--romance-ease), box-shadow 500ms ease;
}

.photo-ritual--mountain:focus-visible {
  transform: translateY(-2px) rotate(-0.24deg);
}

.mountain-ritual__depth {
  position: absolute;
  z-index: 3;
  inset: 0 0 34px;
  overflow: hidden;
  pointer-events: none;
}

.mountain-ritual__depth::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgb(217 229 232 / 0.085), transparent 28%),
    radial-gradient(circle at 30% 54%, transparent 0 38%, rgb(236 230 223 / 0.038) 73%, transparent 100%);
  mix-blend-mode: screen;
}

.mountain-ritual__mist {
  position: absolute;
  display: block;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
  transform: translate3d(0, 0, 0);
  transform-origin: center;
}

.mountain-ritual__mist--back {
  top: 4%;
  left: -17%;
  width: 126%;
  height: 27%;
  background:
    radial-gradient(ellipse at 28% 62%, rgb(226 234 234 / 0.24), transparent 42%),
    radial-gradient(ellipse at 74% 43%, rgb(216 226 230 / 0.2), transparent 47%);
  opacity: 0.36;
  transform: translate3d(-2%, var(--mountain-back-y), 0);
}

.mountain-ritual__mist--middle {
  top: 36%;
  left: -25%;
  width: 146%;
  height: 23%;
  background:
    radial-gradient(ellipse at 18% 46%, rgb(224 230 227 / 0.2), transparent 38%),
    radial-gradient(ellipse at 57% 54%, rgb(232 232 225 / 0.22), transparent 44%),
    radial-gradient(ellipse at 87% 38%, rgb(218 225 227 / 0.16), transparent 36%);
  opacity: 0.28;
  transform: translate3d(1%, var(--mountain-middle-y), 0);
}

.mountain-ritual__mist--front {
  right: -23%;
  bottom: -6%;
  width: 138%;
  height: 30%;
  background:
    radial-gradient(ellipse at 27% 42%, rgb(235 229 220 / 0.19), transparent 41%),
    radial-gradient(ellipse at 70% 56%, rgb(226 229 224 / 0.24), transparent 48%);
  opacity: 0.25;
  filter: blur(24px);
  transform: translate3d(-1%, var(--mountain-front-y), 0);
}

.mountain-ritual__scale {
  position: absolute;
  z-index: 5;
  top: 16%;
  right: clamp(12px, 2.2vw, 24px);
  width: 58px;
  height: 68%;
  color: rgb(240 231 218 / 0.76);
  opacity: 0.56;
  transform: translateY(var(--mountain-scale-y));
}

.mountain-ritual__scale-line {
  position: absolute;
  top: 0;
  right: 3px;
  bottom: 0;
  width: 8px;
  border-right: 1px solid rgb(244 236 222 / 0.46);
  background: repeating-linear-gradient(180deg, transparent 0 11px, rgb(244 236 222 / 0.36) 11px 12px, transparent 12px 19px);
  mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
}

.mountain-ritual__marker {
  position: absolute;
  top: var(--mountain-marker-y);
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
}

.mountain-ritual__marker-rule {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(245 231 211 / 0.85));
  box-shadow: 0 0 9px rgb(235 213 190 / 0.24);
}

.mountain-ritual__marker-label {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 8px rgb(18 25 32 / 0.76);
}

.mountain-ritual__hint {
  min-width: max-content;
  color: rgb(213 196 188 / 0.5);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
  text-align: right;
}

.has-mountain-ritual.is-cloud-awake .mountain-ritual__scale {
  opacity: 0.9;
}

.has-mountain-ritual.is-cloud-awake .mountain-ritual__marker-rule {
  box-shadow: 0 0 13px rgb(235 213 190 / 0.48);
}

.has-mountain-ritual.is-cloud-awake .mountain-ritual__mist--back {
  animation: mountain-cloud-back 2.9s var(--romance-ease) both;
}

.has-mountain-ritual.is-cloud-awake .mountain-ritual__mist--middle {
  animation: mountain-cloud-middle 2.75s var(--romance-ease) both;
}

.has-mountain-ritual.is-cloud-awake .mountain-ritual__mist--front {
  animation: mountain-cloud-front 3s var(--romance-ease) both;
}

@keyframes mountain-cloud-back {
  0% { opacity: 0.28; transform: translate3d(-9%, var(--mountain-back-y), 0); }
  42% { opacity: 0.5; }
  100% { opacity: 0.36; transform: translate3d(2%, var(--mountain-back-y), 0); }
}

@keyframes mountain-cloud-middle {
  0% { opacity: 0.2; transform: translate3d(8%, var(--mountain-middle-y), 0) scale(0.98); }
  48% { opacity: 0.41; }
  100% { opacity: 0.28; transform: translate3d(-4%, var(--mountain-middle-y), 0) scale(1.02); }
}

@keyframes mountain-cloud-front {
  0% { opacity: 0.17; transform: translate3d(-7%, var(--mountain-front-y), 0) scale(0.97); }
  55% { opacity: 0.36; }
  100% { opacity: 0.25; transform: translate3d(3%, var(--mountain-front-y), 0) scale(1.03); }
}

@media (max-width: 700px) {
  .photo-after__item--1 .photo-ritual--paper {
    transform:
      perspective(980px)
      translate3d(var(--paper-shift-x), var(--paper-shift-y), 0)
      rotate(0.18deg)
      rotateX(var(--paper-tilt-x))
      rotateY(var(--paper-tilt-y));
  }

  .photo-ritual__ink {
    width: 116px;
    min-width: 116px;
    font-size: 0.64rem;
  }

  .mountain-ritual__scale {
    right: 9px;
    width: 54px;
    opacity: 0.52;
  }

  .mountain-ritual__hint {
    font-size: 0.57rem;
    letter-spacing: 0.07em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-after__item--1 .photo-ritual--paper,
  .photo-ritual--mountain,
  .photo-ritual__paper-sheen,
  .photo-ritual__ink,
  .photo-ritual__ink path,
  .photo-ritual__ink-words,
  .mountain-ritual__mist,
  .mountain-ritual__scale,
  .mountain-ritual__marker-rule {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .photo-ritual__paper-sheen { opacity: 0.24; }
  .photo-ritual__ink { display: none; }
  .mountain-ritual__mist--back { opacity: 0.2; }
  .mountain-ritual__mist--middle { opacity: 0.14; }
  .mountain-ritual__mist--front { opacity: 0.11; }
  .mountain-ritual__scale { opacity: 0.42; }
}

body.is-data-saver .photo-after__item--1 .photo-ritual--paper,
body.is-data-saver .photo-ritual--mountain,
body.is-data-saver .photo-ritual__paper-sheen,
body.is-data-saver .photo-ritual__ink,
body.is-data-saver .photo-ritual__ink path,
body.is-data-saver .photo-ritual__ink-words,
body.is-data-saver .mountain-ritual__mist,
body.is-data-saver .mountain-ritual__scale,
body.is-data-saver .mountain-ritual__marker-rule {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

body.is-data-saver .photo-ritual__paper-sheen { opacity: 0.2; }
body.is-data-saver .photo-ritual__ink { display: none; }
body.is-data-saver .mountain-ritual__mist--back { opacity: 0.18; }
body.is-data-saver .mountain-ritual__mist--middle { opacity: 0.12; }
body.is-data-saver .mountain-ritual__mist--front { opacity: 0.1; }

@media (forced-colors: active) {
  .photo-ritual__paper-sheen,
  .photo-ritual__ink,
  .mountain-ritual__depth,
  .mountain-ritual__hint {
    display: none;
  }

  .photo-ritual:focus-visible { outline: 2px solid Highlight; }
}

/* The moonlit truth chapter settles like ink, one sentence at a time. */
.ordinary-lines li[data-ordinary-ink-ready="true"] {
  --ordinary-ink-origin: 50%;
  --ordinary-ink-drift: 0px;
  isolation: isolate;
  outline: 0;
}

.ordinary-lines li[data-ordinary-ink-ready="true"]::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: -9%;
  display: block;
  width: 118%;
  height: 145%;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at var(--ordinary-ink-origin) 48%, rgb(7 13 19 / 0.72) 0 11%, rgb(22 25 32 / 0.42) 31%, transparent 68%),
    radial-gradient(ellipse at calc(var(--ordinary-ink-origin) + 8%) 53%, rgb(201 143 125 / 0.13), transparent 51%);
  transform: translate3d(var(--ordinary-ink-drift), -50%, 0) scale3d(1.22, 0.5, 1);
  transform-origin: var(--ordinary-ink-origin) center;
}

.ordinary-lines li[data-ordinary-ink-ready="true"].is-current {
  cursor: pointer;
}

.ordinary-lines li[data-ordinary-ink-ready="true"].is-current::before {
  opacity: 0.09;
  transform: translate3d(0, -50%, 0) scale3d(0.82, 0.72, 1);
}

.ordinary-lines li[data-ordinary-ink-ready="true"].ordinary-ink--playing {
  animation: ordinary-ink-line-settle 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ordinary-lines li[data-ordinary-ink-ready="true"].ordinary-ink--playing::before {
  animation: ordinary-ink-gather 1.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ordinary-ink__period {
  display: inline-block;
  width: 0.14em;
  height: 0.14em;
  margin-inline-start: 0.26em;
  border-radius: 50%;
  vertical-align: 0.22em;
  pointer-events: none;
  opacity: 0.16;
  background: rgb(238 201 171 / 0.82);
  box-shadow: 0 0 0 rgb(231 183 143 / 0);
  transform: translate3d(0, 0, 0) scale(0.74);
}

.ordinary-lines li.is-current .ordinary-ink__period {
  opacity: 0.56;
}

.ordinary-lines li.ordinary-ink--playing .ordinary-ink__period {
  animation: ordinary-ink-period-fall 1.32s cubic-bezier(0.2, 0.9, 0.22, 1) 100ms both;
}

.ordinary-lines li[data-ordinary-ink-ready="true"]:focus-visible {
  outline: 1px solid rgb(231 183 143 / 0.42);
  outline-offset: 12px;
  border-radius: 3px;
}

.ordinary-days__wash::after {
  position: absolute;
  top: var(--ordinary-ink-y, 50%);
  left: var(--ordinary-ink-x, 70%);
  width: clamp(260px, 42vw, 590px);
  aspect-ratio: 1.8;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse, rgb(222 172 146 / 0.11), rgb(120 94 115 / 0.05) 38%, transparent 72%);
  transform: translate3d(-50%, -50%, 0) scale3d(1.25, 0.38, 1);
}

.ordinary-days--ink-breathing .ordinary-days__wash::after {
  animation: ordinary-ink-chapter-breath 1.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ordinary-ink-line-settle {
  0% { opacity: 0.72; transform: translate3d(-3px, 7px, 0) scale(0.994); }
  36% { opacity: 1; transform: translate3d(7px, -1px, 0) scale(1.002); }
  100% { opacity: 1; transform: translate3d(5px, 0, 0) scale(1); }
}

@keyframes ordinary-ink-gather {
  0% { opacity: 0; transform: translate3d(var(--ordinary-ink-drift), -50%, 0) scale3d(1.28, 0.38, 1); }
  28% { opacity: 0.56; }
  58% { opacity: 0.28; transform: translate3d(0, -50%, 0) scale3d(0.92, 0.64, 1); }
  100% { opacity: 0.09; transform: translate3d(0, -50%, 0) scale3d(0.82, 0.72, 1); }
}

@keyframes ordinary-ink-period-fall {
  0% { opacity: 0; box-shadow: 0 0 0 rgb(231 183 143 / 0); transform: translate3d(0, -1.25em, 0) scale(0.18); }
  42% { opacity: 0.96; box-shadow: 0 0 30px 8px rgb(231 183 143 / 0.24); transform: translate3d(0, 0.08em, 0) scale(1.08); }
  68% { transform: translate3d(0, -0.04em, 0) scale(0.92); }
  100% { opacity: 0.56; box-shadow: 0 0 18px 3px rgb(231 183 143 / 0.14); transform: translate3d(0, 0, 0) scale(0.74); }
}

@keyframes ordinary-ink-chapter-breath {
  0% { opacity: 0; transform: translate3d(-50%, -50%, 0) scale3d(1.25, 0.38, 1); }
  34% { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(-50%, -50%, 0) scale3d(0.72, 0.7, 1); }
}

@media (max-width: 700px) {
  .ordinary-lines li[data-ordinary-ink-ready="true"]::before {
    left: -7%;
    width: 112%;
    height: 132%;
  }

  .ordinary-lines li[data-ordinary-ink-ready="true"]:focus-visible {
    outline-offset: 8px;
  }

  .ordinary-days__wash::after {
    width: min(86vw, 430px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ordinary-lines li[data-ordinary-ink-ready="true"],
  .ordinary-lines li[data-ordinary-ink-ready="true"]::before,
  .ordinary-ink__period,
  .ordinary-days__wash::after {
    animation: none !important;
  }

  .ordinary-lines li[data-ordinary-ink-ready="true"]::before,
  .ordinary-days__wash::after {
    display: none;
  }

  .ordinary-ink__period {
    opacity: 0.34;
    transform: none;
  }
}

body.is-data-saver .ordinary-lines li[data-ordinary-ink-ready="true"]::before,
body.is-data-saver .ordinary-days__wash::after {
  display: none;
}

body.is-data-saver .ordinary-lines li[data-ordinary-ink-ready="true"],
body.is-data-saver .ordinary-ink__period {
  animation: none !important;
}

@media (forced-colors: active) {
  .ordinary-lines li[data-ordinary-ink-ready="true"]::before,
  .ordinary-days__wash::after,
  .ordinary-ink__period {
    display: none;
  }

  .ordinary-lines li[data-ordinary-ink-ready="true"]:focus-visible {
    outline: 2px solid Highlight;
  }
}
