:root {
  --ink: #293451;
  --ink-soft: #59627e;
  --sky: #d4eaff;
  --blue: #aebff4;
  --lavender: #d9c9ff;
  --blush: #ffd3e3;
  --rose: #f476a8;
  --rose-deep: #d9558c;
  --cream: #fff9fc;
  --white: rgba(255, 255, 255, 0.94);
  --glow: rgba(255, 123, 175, 0.35);
  --scene-blue: rgba(163, 196, 246, 0.5);
  --scene-pink: rgba(255, 192, 218, 0.52);
  --scene-warm: rgba(255, 235, 238, 0.2);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--sky);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #dbe8fb;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 1s ease;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(41, 52, 81, 0.42);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.background,
.aurora,
.soft-focus,
.grain,
.stars {
  position: absolute;
  inset: 0;
}

.background {
  z-index: -3;
  overflow: hidden;
  background: linear-gradient(135deg, #b8d4fb, #f9cfdf);
}

.dreamscape {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  object-position: center center;
  opacity: 0.68;
  filter: saturate(0.86) contrast(0.92) brightness(1.07);
  transform: translate3d(var(--parallax-x, 0), var(--parallax-y, 0), 0) scale(1.035);
  transition: transform 1.5s var(--ease-out), filter 1.2s ease, opacity 1.2s ease;
  will-change: transform;
}

.aurora {
  z-index: 1;
  background:
    radial-gradient(circle at 12% 14%, var(--scene-blue), transparent 40%),
    radial-gradient(circle at 88% 85%, var(--scene-pink), transparent 43%),
    linear-gradient(145deg, rgba(230, 242, 255, 0.22), var(--scene-warm));
  mix-blend-mode: soft-light;
  opacity: 0.95;
  transition: background 1s ease, opacity 1s ease;
}

.soft-focus {
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.73) 0%, rgba(255, 255, 255, 0.46) 25%, transparent 61%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.13), rgba(219, 225, 254, 0.2));
  transition: opacity 1s ease;
}

.grain {
  z-index: 3;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.stars {
  z-index: 4;
  pointer-events: none;
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.78);
  opacity: var(--opacity);
  animation: twinkle var(--duration) ease-in-out var(--delay) infinite alternate;
}

@keyframes twinkle {
  from {
    transform: scale(0.56);
    opacity: calc(var(--opacity) * 0.5);
  }
  to {
    transform: scale(1.2);
    opacity: var(--opacity);
  }
}

body[data-scene="1"] {
  --scene-blue: rgba(100, 153, 234, 0.56);
  --scene-pink: rgba(255, 197, 221, 0.24);
  --scene-warm: rgba(224, 218, 255, 0.12);
}

body[data-scene="2"] {
  --scene-blue: rgba(148, 191, 246, 0.48);
  --scene-pink: rgba(255, 169, 207, 0.38);
  --scene-warm: rgba(235, 223, 255, 0.2);
}

body[data-scene="3"] {
  --scene-blue: rgba(164, 202, 247, 0.4);
  --scene-pink: rgba(255, 190, 217, 0.42);
  --scene-warm: rgba(246, 231, 255, 0.24);
}

body[data-scene="4"] {
  --scene-blue: rgba(177, 201, 247, 0.34);
  --scene-pink: rgba(255, 175, 209, 0.5);
  --scene-warm: rgba(255, 227, 240, 0.26);
}

body[data-scene="5"] {
  --scene-blue: rgba(186, 211, 247, 0.3);
  --scene-pink: rgba(255, 162, 204, 0.58);
  --scene-warm: rgba(255, 222, 238, 0.31);
}

body[data-scene="6"] {
  --scene-blue: rgba(197, 219, 249, 0.28);
  --scene-pink: rgba(255, 148, 194, 0.62);
  --scene-warm: rgba(255, 220, 232, 0.36);
}

body[data-scene="7"] {
  --scene-blue: rgba(214, 230, 250, 0.26);
  --scene-pink: rgba(255, 133, 184, 0.68);
  --scene-warm: rgba(255, 216, 226, 0.42);
}

body[data-scene="7"] .dreamscape {
  filter: saturate(0.98) contrast(0.92) brightness(1.1);
  opacity: 0.76;
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: max(24px, env(safe-area-inset-top)) clamp(24px, 4vw, 64px) 0;
}

.signature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.signature i {
  color: var(--rose-deep);
  font-size: 20px;
  font-style: normal;
  transform-origin: center;
  animation: signatureBeat 3s ease-in-out infinite;
}

@keyframes signatureBeat {
  0%,
  20%,
  100% {
    transform: scale(1);
  }
  9% {
    transform: scale(1.18);
  }
}

.counter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(41, 52, 81, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

#currentNumber {
  color: var(--rose-deep);
}

.counter-line {
  width: 30px;
  height: 1px;
  background: rgba(41, 52, 81, 0.28);
}

.story {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.scene {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 112px clamp(28px, 8vw, 140px) 150px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene.is-active,
.scene.is-entering,
.scene.is-leaving {
  visibility: visible;
}

.scene.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scene-copy {
  position: relative;
  z-index: 3;
  width: min(850px, 74vw);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.44);
  transform: translateZ(0);
}

.scene-copy--intro {
  width: min(760px, 74vw);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  margin: 0 0 23px;
  color: rgba(41, 52, 81, 0.68);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.21em;
}

.eyebrow::before,
.eyebrow::after {
  width: 22px;
  height: 1px;
  content: "";
  background: rgba(41, 52, 81, 0.27);
}

.eyebrow span {
  color: var(--rose-deep);
}

.scene-title {
  max-width: 14ch;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(2.85rem, 6.3vw, 6.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.047em;
  text-wrap: balance;
}

.scene-title--hero {
  font-size: clamp(5.6rem, 12vw, 10.8rem);
  line-height: 0.8;
  letter-spacing: -0.065em;
}

.scene-title em {
  position: relative;
  color: var(--rose-deep);
  font-weight: 400;
}

.scene-title em::after {
  position: absolute;
  right: 0.06em;
  bottom: -0.08em;
  left: 0.03em;
  height: 0.08em;
  border-radius: 99px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(225, 88, 144, 0.43), transparent);
  transform: scaleX(0);
  transform-origin: left;
}

.scene.is-active .scene-title em::after,
.scene.is-entering .scene-title em::after {
  animation: underline 1.15s 0.55s var(--ease-out) forwards;
}

@keyframes underline {
  to {
    transform: scaleX(1);
  }
}

.rose-dot {
  color: var(--rose-deep);
}

.scene-text {
  max-width: 47ch;
  margin: 32px auto 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.45vw, 1.22rem);
  font-weight: 450;
  line-height: 1.68;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.scene-copy--final .scene-title {
  max-width: 12ch;
  font-size: clamp(3.5rem, 7.1vw, 7.2rem);
}

.scene.is-entering .scene-copy {
  animation: sceneIn 0.88s var(--ease-out) both;
}

.scene.is-entering.from-right .scene-copy {
  --entry-x: 42px;
}

.scene.is-entering.from-left .scene-copy {
  --entry-x: -42px;
}

.scene.is-leaving .scene-copy {
  animation: sceneOut 0.48s ease both;
}

.scene.is-leaving.to-left .scene-copy {
  --exit-x: -32px;
}

.scene.is-leaving.to-right .scene-copy {
  --exit-x: 32px;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translate3d(var(--entry-x, 0), 22px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes sceneOut {
  to {
    opacity: 0;
    filter: blur(7px);
    transform: translate3d(var(--exit-x, 0), -18px, 0) scale(0.985);
  }
}

.motif,
.moment-cloud,
.heart-outline,
.photo-sticker {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.photo-sticker {
  z-index: 2;
  width: clamp(108px, 10.4vw, 156px);
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 6px 6px 24px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px 38px 30px 42px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 220, 237, 0.79));
  box-shadow:
    0 20px 48px rgba(66, 76, 128, 0.17),
    0 0 32px rgba(244, 118, 168, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.96);
  opacity: 0;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
}

.photo-sticker img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px 31px 24px 34px;
  object-fit: cover;
  filter: saturate(0.9) contrast(0.97) brightness(1.04);
}

.photo-sticker::before {
  position: absolute;
  z-index: 2;
  top: -9px;
  left: 50%;
  width: 48%;
  height: 18px;
  content: "";
  background: linear-gradient(135deg, rgba(191, 219, 255, 0.87), rgba(255, 195, 222, 0.83));
  box-shadow: 0 2px 7px rgba(77, 89, 140, 0.08);
  clip-path: polygon(5% 8%, 100% 0, 94% 100%, 0 86%);
  opacity: 0.88;
  transform: translateX(-50%) rotate(-3deg);
}

.photo-sticker::after {
  position: absolute;
  right: -8px;
  bottom: -10px;
  content: "♡";
  color: var(--rose-deep);
  font-family: var(--serif);
  font-size: 25px;
  filter: drop-shadow(0 0 7px white);
}

.scene.is-active .photo-sticker,
.scene.is-entering .photo-sticker {
  animation: stickerReveal 0.94s 0.23s var(--ease-out) both;
}

@keyframes stickerReveal {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translate3d(var(--enter-x, 0), 16px, 0) rotate(calc(var(--tilt, 0deg) * 0.45)) scale(0.82);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) rotate(var(--tilt, 0deg)) scale(1);
  }
}

.photo-sticker--smile {
  top: 21%;
  left: clamp(24px, 5vw, 76px);
  --enter-x: -20px;
  --tilt: -5deg;
}

.photo-sticker--sky {
  top: 18%;
  right: clamp(24px, 5vw, 76px);
  --enter-x: 20px;
  --tilt: 5deg;
}

.photo-sticker--sun {
  bottom: 20%;
  left: clamp(24px, 4.5vw, 68px);
  --enter-x: -20px;
  --tilt: 4deg;
}

.photo-sticker--evening {
  top: 18%;
  left: clamp(24px, 5vw, 76px);
  --enter-x: -20px;
  --tilt: -4deg;
}

.photo-sticker--close {
  top: 17%;
  right: clamp(24px, 5vw, 76px);
  width: clamp(104px, 9.8vw, 148px);
  --enter-x: 20px;
  --tilt: 5deg;
}

.motif--star {
  top: 20%;
  left: 15%;
  width: 140px;
  height: 150px;
  color: rgba(236, 111, 163, 0.72);
}

.big-star {
  position: absolute;
  top: 48px;
  left: 52px;
  font-size: 48px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.95));
  animation: floatStar 5.5s ease-in-out infinite;
}

.small-star {
  position: absolute;
  color: rgba(41, 52, 81, 0.5);
  font-size: 20px;
}

.small-star--one {
  top: 18px;
  right: 8px;
  animation: floatStar 4s 0.8s ease-in-out infinite reverse;
}

.small-star--two {
  bottom: 16px;
  left: 12px;
  font-size: 30px;
}

@keyframes floatStar {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(8deg);
  }
}

.motif--orbit {
  right: 8vw;
  bottom: 21%;
  width: clamp(170px, 20vw, 280px);
  aspect-ratio: 1;
}

.orbit {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(76, 91, 143, 0.23);
  border-radius: 50%;
}

.orbit--one {
  transform: rotate(27deg) scaleY(0.43);
}

.orbit--two {
  transform: rotate(-28deg) scaleY(0.43);
}

.orbit-heart {
  position: absolute;
  top: 38%;
  left: 46%;
  color: var(--rose-deep);
  font-size: 20px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1));
  animation: orbitBeat 2.6s ease-in-out infinite;
}

@keyframes orbitBeat {
  0%,
  100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.15);
  }
}

.motif--halo {
  top: 50%;
  left: 7vw;
  width: clamp(155px, 19vw, 250px);
  aspect-ratio: 1;
  transform: translateY(-40%);
}

.halo-ring {
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 238, 246, 0.7), transparent 66%);
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.38), inset 0 0 24px rgba(236, 150, 192, 0.18);
  animation: breathe 5s ease-in-out infinite;
}

.halo-heart {
  position: absolute;
  top: 42%;
  left: 44%;
  color: rgba(205, 77, 130, 0.68);
  font-family: var(--serif);
  font-size: 28px;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.moment-cloud {
  inset: 0;
}

.moment {
  position: absolute;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: rgba(41, 52, 81, 0.62);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(75, 80, 135, 0.06);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  backdrop-filter: blur(8px);
  animation: drift 6s ease-in-out infinite;
}

.moment--one {
  top: 25%;
  left: 8%;
}

.moment--two {
  top: 62%;
  left: 13%;
  animation-delay: -2.2s;
}

.moment--three {
  top: 25%;
  right: 9%;
  animation-delay: -3.4s;
}

.moment--four {
  right: 13%;
  bottom: 23%;
  animation-delay: -1.1s;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-9px) rotate(1deg);
  }
}

.motif--petals {
  top: 22%;
  right: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(208, 81, 136, 0.46);
  font-size: 24px;
  transform: rotate(16deg);
}

.motif--petals span:nth-child(2n) {
  color: rgba(58, 75, 121, 0.36);
  font-size: 30px;
}

.motif--petals span {
  animation: petalFloat 4s ease-in-out infinite;
}

.motif--petals span:nth-child(2) { animation-delay: -0.8s; }
.motif--petals span:nth-child(3) { animation-delay: -1.6s; }
.motif--petals span:nth-child(4) { animation-delay: -2.4s; }
.motif--petals span:nth-child(5) { animation-delay: -3.2s; }

@keyframes petalFloat {
  50% {
    transform: translate3d(-8px, 8px, 0) rotate(12deg);
  }
}

.motif--path {
  right: 7vw;
  bottom: 24%;
  width: clamp(180px, 24vw, 330px);
  height: 120px;
  transform: rotate(-8deg);
}

.path-line {
  position: absolute;
  top: 54px;
  left: 18px;
  width: calc(100% - 36px);
  height: 42px;
  border-top: 1px dashed rgba(41, 52, 81, 0.31);
  border-radius: 50%;
}

.path-dot {
  position: absolute;
  top: 41px;
  filter: drop-shadow(0 0 8px white);
}

.path-dot--one {
  left: 8px;
  color: rgba(66, 84, 135, 0.6);
}

.path-dot--two {
  right: 5px;
  color: var(--rose-deep);
  animation: orbitBeat 2.6s ease-in-out infinite;
}

.heart-outline {
  top: 50%;
  left: 50%;
  width: min(500px, 46vw);
  height: min(458px, 42vw);
  fill: rgba(255, 255, 255, 0.07);
  stroke: rgba(220, 76, 137, 0.34);
  stroke-width: 1.4;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.66));
  transform: translate(-50%, -50%);
}

.scene--final.is-active .heart-outline,
.scene--final.is-entering .heart-outline {
  animation: drawHeart 1.9s 0.25s var(--ease-out) forwards;
}

@keyframes drawHeart {
  to {
    stroke-dashoffset: 0;
  }
}

.story-nav {
  position: absolute;
  z-index: 35;
  right: clamp(24px, 4vw, 64px);
  bottom: max(27px, env(safe-area-inset-bottom));
  left: clamp(24px, 4vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.nav-back,
.nav-next {
  border: 0;
  cursor: pointer;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  padding: 12px 4px;
  color: rgba(41, 52, 81, 0.65);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-back:disabled {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.nav-back svg,
.nav-next svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-next {
  position: relative;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  gap: 13px;
  min-width: 220px;
  padding: 15px 24px 15px 27px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.73), rgba(255, 239, 246, 0.58));
  box-shadow:
    0 16px 40px rgba(90, 88, 145, 0.12),
    0 0 30px var(--glow),
    inset 0 1px rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
  backdrop-filter: blur(12px);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, background 0.3s ease;
}

.nav-next::before {
  position: absolute;
  top: -80%;
  left: -50%;
  width: 35%;
  height: 260%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: rotate(18deg);
  transition: left 0.7s var(--ease-out);
}

.nav-next:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 226, 239, 0.74));
  box-shadow:
    0 18px 46px rgba(90, 88, 145, 0.15),
    0 0 42px rgba(255, 123, 175, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
}

.nav-next:hover::before {
  left: 120%;
}

.nav-next:active {
  transform: translateY(0) scale(0.98);
}

.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}

.progress-dot {
  display: grid;
  width: 24px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  color: rgba(41, 52, 81, 0.31);
  background: transparent;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
  transition: color 0.45s ease, transform 0.45s var(--ease-out), filter 0.45s ease;
}

.progress-dot.is-seen {
  color: rgba(217, 85, 140, 0.7);
}

.progress-dot.is-current {
  color: var(--rose-deep);
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.95));
  transform: scale(1.38);
}

.progress-dot:focus-visible {
  border-radius: 999px;
  outline-width: 2px;
  outline-offset: 1px;
}

.gesture-hint {
  position: absolute;
  z-index: 25;
  bottom: max(94px, calc(env(safe-area-inset-bottom) + 84px));
  left: 50%;
  margin: 0;
  color: rgba(41, 52, 81, 0.43);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  transform: translateX(-50%);
  animation: hintAway 1s 5.5s ease forwards;
}

@keyframes hintAway {
  to {
    opacity: 0;
    transform: translate(-50%, 5px);
  }
}

.moon-secret {
  position: absolute;
  z-index: 22;
  top: 47%;
  right: 7%;
  width: clamp(82px, 9vw, 140px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.moon-secret:focus-visible {
  outline-color: rgba(218, 87, 142, 0.35);
}

.toast {
  position: absolute;
  z-index: 60;
  top: max(78px, calc(env(safe-area-inset-top) + 54px));
  left: 50%;
  max-width: min(90vw, 430px);
  padding: 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.67);
  box-shadow: 0 14px 42px rgba(78, 72, 126, 0.12);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(16px);
  transform: translate(-50%, -10px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.heart-layer {
  position: absolute;
  z-index: 55;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.flying-heart {
  position: absolute;
  bottom: -50px;
  left: var(--left);
  color: var(--color);
  font-size: var(--size);
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  animation: flyHeart var(--duration) var(--delay) var(--ease-out) forwards;
}

@keyframes flyHeart {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--rotation)) scale(0.55);
  }
  12% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -112vh, 0) rotate(calc(var(--rotation) + 45deg)) scale(1.15);
  }
}

.micro-heart {
  position: fixed;
  z-index: 70;
  color: var(--rose-deep);
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 1));
  animation: microPop 0.85s var(--ease-out) forwards;
}

@keyframes microPop {
  to {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rotate)) scale(0.4);
  }
}

.cursor-spark {
  position: fixed;
  z-index: 80;
  color: rgba(224, 76, 138, 0.55);
  pointer-events: none;
  font-family: var(--serif);
  font-size: 12px;
  animation: cursorFade 0.95s ease-out forwards;
}

@keyframes cursorFade {
  to {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(24deg) scale(0.35);
  }
}

@media (max-width: 820px) {
  .dreamscape {
    object-position: 66% center;
    opacity: 0.56;
  }

  .soft-focus {
    background:
      radial-gradient(ellipse at 50% 44%, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.58) 33%, transparent 72%),
      linear-gradient(to bottom, rgba(255, 255, 255, 0.12), rgba(219, 225, 254, 0.22));
  }

  .scene {
    padding: 102px 22px 170px;
  }

  .scene-copy,
  .scene-copy--intro {
    width: min(92vw, 650px);
  }

  .scene-title {
    max-width: 15ch;
    font-size: clamp(2.65rem, 11.7vw, 5.5rem);
  }

  .scene-title--hero {
    font-size: clamp(5.5rem, 24vw, 8.2rem);
  }

  .scene-copy--final .scene-title {
    font-size: clamp(3.2rem, 13.5vw, 5.8rem);
  }

  .scene-text {
    max-width: 36ch;
    margin-top: 25px;
    font-size: clamp(0.98rem, 3.8vw, 1.1rem);
    line-height: 1.58;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 9px;
  }

  .motif--star {
    top: 17%;
    left: -10px;
    transform: scale(0.75);
  }

  .motif--orbit {
    right: -35px;
    bottom: 23%;
    opacity: 0.55;
  }

  .motif--halo {
    left: -50px;
    opacity: 0.53;
  }

  .moment {
    opacity: 0.48;
    font-size: 12px;
  }

  .moment--one,
  .moment--three {
    top: 19%;
  }

  .moment--one,
  .moment--two {
    left: -26px;
  }

  .moment--three,
  .moment--four {
    right: -32px;
  }

  .motif--petals {
    top: 17%;
    right: -8px;
    opacity: 0.55;
    transform: rotate(16deg) scale(0.75);
  }

  .motif--path {
    right: -80px;
    bottom: 26%;
    opacity: 0.5;
  }

  .heart-outline {
    width: min(88vw, 430px);
    height: min(80vw, 393px);
    opacity: 0.8;
  }

  .photo-sticker {
    top: max(78px, calc(env(safe-area-inset-top) + 54px));
    bottom: auto;
    width: clamp(78px, 22vw, 102px);
    padding: 4px 4px 16px;
    border-radius: 19px 26px 21px 28px;
  }

  .photo-sticker img {
    border-radius: 15px 22px 17px 24px;
  }

  .photo-sticker::before {
    top: -7px;
    height: 13px;
  }

  .photo-sticker::after {
    right: -6px;
    bottom: -8px;
    font-size: 20px;
  }

  .photo-sticker--smile,
  .photo-sticker--sun,
  .photo-sticker--close {
    right: auto;
    left: 10px;
  }

  .photo-sticker--sky,
  .photo-sticker--evening {
    right: 10px;
    left: auto;
  }

  .story-nav {
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 18px;
    grid-template-columns: 44px 1fr 44px;
    gap: 10px;
  }

  .progress {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin-bottom: 66px;
    gap: 7px;
  }

  .progress-dot {
    width: 22px;
  }

  .nav-back {
    grid-column: 1;
    grid-row: 1;
    width: 44px;
    height: 54px;
    padding: 0;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(10px);
  }

  .nav-back span {
    display: none;
  }

  .nav-next {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    justify-self: stretch;
    padding-inline: 20px;
  }

  .nav-next svg {
    position: absolute;
    right: 19px;
  }

  .gesture-hint {
    display: none;
  }

  .moon-secret {
    top: 49%;
    right: -2%;
    width: 110px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: max(20px, env(safe-area-inset-top)) 20px 0;
  }

  .signature {
    font-size: 15px;
  }

  .counter-line {
    width: 20px;
  }

  .scene {
    padding-inline: 17px;
  }

  .scene-title {
    letter-spacing: -0.052em;
  }

  .scene-text {
    max-width: 32ch;
  }

  .eyebrow::before,
  .eyebrow::after {
    width: 12px;
  }

  .moment--two,
  .moment--four {
    display: none;
  }
}

@media (max-height: 690px) and (orientation: landscape) {
  body {
    overflow: auto;
  }

  .site-shell,
  .story {
    min-height: 640px;
  }

  .scene {
    min-height: 640px;
    padding-top: 82px;
    padding-bottom: 120px;
  }

  .scene-title {
    font-size: clamp(2.7rem, 8.5vh, 5.2rem);
  }

  .scene-title--hero {
    font-size: clamp(5rem, 17vh, 8.5rem);
  }

  .scene-text {
    margin-top: 18px;
  }
}

@media (max-height: 620px) and (orientation: portrait) {
  .photo-sticker {
    top: max(58px, calc(env(safe-area-inset-top) + 42px));
    width: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor-spark,
  .flying-heart,
  .micro-heart {
    display: none !important;
  }
}
