:root {
  color-scheme: dark;
  --ink: #fff9f4;
  --muted: rgba(255, 249, 244, 0.72);
  --space: #020208;
  --notif: #ffd2df;
  --notif-deep: #b75072;
  --scroll-shift: 0px;
  --timeline-x: 0px;
  --timeline-scale: 1;
  --final-bg-fade: 0;
  --space-scene:
    radial-gradient(circle at 50% 46%, rgba(255, 208, 229, 0.1), transparent 24rem),
    radial-gradient(circle at 72% 18%, rgba(139, 197, 255, 0.1), transparent 22rem),
    linear-gradient(180deg, #03030a 0%, #010104 100%);
  --romance-scene:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.64), transparent 17rem),
    radial-gradient(circle at 84% 26%, rgba(255, 175, 204, 0.5), transparent 18rem),
    radial-gradient(circle at 50% 112%, rgba(183, 80, 114, 0.2), transparent 26rem),
    linear-gradient(135deg, #ffeaf1 0%, #ffd2df 45%, #fac0d4 100%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--space);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--space);
  color: var(--ink);
}

body.is-locked {
  overflow: hidden;
  touch-action: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 187, 205, 0.2), transparent 28vw),
    radial-gradient(circle at 80% 72%, rgba(147, 202, 255, 0.14), transparent 34vw),
    #020208;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 237, 229, 0.12), transparent 32rem),
    linear-gradient(135deg, #15131d, #07060a 70%);
  isolation: isolate;
  transition: opacity 1200ms cubic-bezier(0.22, 1, 0.36, 1), visibility 1200ms;
}

body:not(.is-intro) .intro {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.intro-vignette,
.word-stage::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 44%, rgba(0, 0, 0, 0.22) 67%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 28%, transparent 70%, rgba(0, 0, 0, 0.48));
  z-index: 2;
}

.clock-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: min(96vw, 64rem);
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  transform: translate(-50%, -50%) translateZ(0);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.22, 1, 0.36, 1), filter 650ms ease;
}

.clock-panel.is-done {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.98);
  filter: blur(8px);
}

.clock-label {
  margin: 0 0 0.85rem;
  color: rgba(255, 249, 244, 0.68);
  font-size: clamp(0.82rem, 2.3vw, 1rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.clock-time {
  justify-self: center;
  width: max-content;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.5rem, 12vw, 8.6rem);
  font-weight: 800;
  line-height: 0.92;
  white-space: nowrap;
  text-shadow: 0 1rem 4rem rgba(255, 171, 198, 0.22);
}

.clock-date {
  margin-top: 1.15rem;
  color: rgba(255, 249, 244, 0.8);
  font-size: clamp(1.15rem, 4.2vw, 2.25rem);
  font-weight: 650;
}

.word-stage {
  --word-bg-a: #111827;
  --word-bg-b: #331827;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.16), transparent 27rem),
    linear-gradient(135deg, var(--word-bg-a), var(--word-bg-b));
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), visibility 700ms;
}

.word-stage.is-active {
  visibility: visible;
  opacity: 1;
}

.word-stage span {
  position: relative;
  z-index: 3;
  display: block;
  max-width: 94vw;
  color: var(--word-color, #fff9f4);
  font-size: clamp(4rem, 16vw, 13rem);
  font-weight: 900;
  line-height: 0.92;
  text-align: center;
  text-shadow: 0 1.2rem 4rem rgba(0, 0, 0, 0.34);
  transform: translateY(2.8rem) scale(0.92);
  opacity: 0;
  filter: blur(18px);
}

.word-stage span.is-in {
  animation: wordIn 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.word-stage span.is-out {
  animation: wordOut 520ms cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes wordIn {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes wordOut {
  from {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    filter: blur(16px);
    transform: translateY(-2.5rem) scale(1.04);
  }
}

.space-scroll {
  min-height: 560vh;
  background: var(--space);
}

.space-stage,
.timeline-sticky,
.final-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.space-stage {
  display: grid;
  place-items: center;
  background: var(--space-scene);
}

.stars,
.stars::before,
.stars::after {
  position: absolute;
  inset: -18%;
  content: "";
  pointer-events: none;
  background-repeat: repeat;
  will-change: transform;
}

.stars-a {
  opacity: 0.72;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 206, 232, 0.75) 0 1px, transparent 1.4px);
  background-size: 9.5rem 9.5rem, 14rem 14rem;
  background-position: 1rem 1.4rem, 6rem 7rem;
  transform: translate3d(0, calc(var(--scroll-shift) * -0.16), 0);
}

.stars-b {
  opacity: 0.58;
  background-image:
    radial-gradient(circle, rgba(142, 209, 255, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.64) 0 1px, transparent 1.3px);
  background-size: 13rem 13rem, 18rem 18rem;
  background-position: 3rem 9rem, 10rem 2rem;
  transform: translate3d(0, calc(var(--scroll-shift) * -0.28), 0);
}

.stars-c {
  opacity: 0.36;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.7px);
  background-size: 22rem 22rem;
  background-position: 8rem 8rem;
  transform: translate3d(0, calc(var(--scroll-shift) * -0.44), 0) scale(1.05);
}

.stars-a::before,
.stars-b::before,
.stars-c::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 229, 163, 0.7) 0 1px, transparent 1.5px);
  background-size: 16rem 16rem, 24rem 24rem;
  background-position: 5rem 4rem, 2rem 12rem;
  animation: twinkle 4.8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.24;
  }

  100% {
    opacity: 0.8;
  }
}

.heart-wrap {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 4vw, 2rem);
  transition: opacity 450ms ease, transform 450ms ease;
  will-change: transform, opacity;
}

.photo-heart {
  --tile: clamp(2.35rem, 4.7vw, 4.15rem);
  --heart-offset-x: 0px;
  --heart-offset-y: clamp(-4rem, -5.8svh, -2.1rem);
  position: relative;
  width: min(94vw, 51rem);
  aspect-ratio: 1.12 / 1;
  transform: translate3d(var(--heart-offset-x), var(--heart-offset-y), 0) scale(var(--heart-scale, 1));
  transform-origin: center;
}

.heart-tile {
  position: absolute;
  width: var(--tile);
  height: var(--tile);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: clamp(0.45rem, 1vw, 0.7rem);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translate(-50%, -50%) translateY(1.2rem) scale(0.72) rotate(var(--r));
  transition:
    opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 720ms ease;
  filter: saturate(1.08) brightness(0.96);
  will-change: opacity, transform;
}

.heart-tile.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0) scale(1) rotate(var(--r));
}

.heart-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scroll-hint {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  color: rgba(255, 249, 244, 0.72);
  font-size: clamp(0.78rem, 2.4vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

.scroll-hint.is-visible {
  opacity: 1;
}

.scroll-hint-space {
  position: absolute;
  left: 50%;
  bottom: calc(max(1.1rem, env(safe-area-inset-bottom)) + 0.8rem);
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translateX(-50%);
}

.arrow-down {
  width: 0.9rem;
  height: 0.9rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: arrowFloat 1100ms ease-in-out infinite;
}

@keyframes arrowFloat {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 0.45rem;
  }
}

.scroll-gallery {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.scroll-photo {
  position: absolute;
  width: min(76vw, 31rem);
  max-height: min(76svh, 45rem);
  object-fit: contain;
  border-radius: 0.9rem;
  box-shadow:
    0 1.4rem 5rem rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.14);
  opacity: 0;
  transform: translate3d(0, 2rem, 0) scale(0.96);
  filter: saturate(1.04);
  will-change: transform, opacity;
}

.notification-gate {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-top: -1px;
  background: var(--space-scene);
}

.notification-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 201, 221, 0.16), transparent 28rem),
    linear-gradient(180deg, rgba(3, 3, 10, 0), rgba(2, 2, 8, 0.34));
}

.notification-backdrop::before,
.notification-backdrop::after {
  position: absolute;
  inset: -18%;
  content: "";
  pointer-events: none;
  background-repeat: repeat;
}

.notification-backdrop::before {
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.88) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 206, 232, 0.6) 0 1px, transparent 1.4px);
  background-size: 10rem 10rem, 15rem 15rem;
  background-position: 1rem 1.4rem, 6rem 7rem;
}

.notification-backdrop::after {
  opacity: 0.26;
  background-image:
    radial-gradient(circle, rgba(142, 209, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.64) 0 1px, transparent 1.3px);
  background-size: 13rem 13rem, 18rem 18rem;
  background-position: 3rem 9rem, 10rem 2rem;
}

.love-notification {
  position: fixed;
  left: 50%;
  top: calc(max(1.25rem, env(safe-area-inset-top)) + 0.3rem);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: min(calc(100vw - 2rem), 27rem);
  min-height: 4.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 1.25rem;
  color: #3e1723;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
    linear-gradient(135deg, #ffe4ee, #ffc3d8 52%, #fedbe7);
  box-shadow:
    0 1.6rem 4.5rem rgba(8, 4, 7, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(-50%, -130%, 0) scale(0.98);
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1), transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  isolation: isolate;
}

.love-notification.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0) scale(1);
  pointer-events: auto;
  animation: notificationGlow 1800ms ease-in-out infinite;
}

.love-notification::before,
.love-notification::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.love-notification::before {
  inset: -0.45rem;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 1.55rem;
  opacity: 0;
  transform: scale(0.96);
}

.love-notification::after {
  right: 1.05rem;
  bottom: -0.72rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 1.6rem rgba(255, 210, 223, 0.48);
  opacity: 0;
  transform: scale(0.72);
}

.love-notification.is-visible::before {
  animation: notificationHalo 1800ms ease-out infinite;
}

.love-notification.is-visible::after {
  animation: notificationTap 1800ms ease-in-out infinite;
}

@keyframes notificationGlow {
  0%,
  100% {
    box-shadow:
      0 1.6rem 4.5rem rgba(8, 4, 7, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  46% {
    box-shadow:
      0 1.8rem 5.1rem rgba(8, 4, 7, 0.5),
      0 0 0 0.28rem rgba(255, 255, 255, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }
}

@keyframes notificationHalo {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  24% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes notificationTap {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.72);
  }

  38% {
    opacity: 0.9;
    transform: scale(1);
  }

  64% {
    opacity: 0;
    transform: scale(1.36);
  }
}

.love-notification:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.notif-icon {
  display: grid;
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border-radius: 0.85rem;
  color: white;
  font-weight: 900;
  background: linear-gradient(145deg, #d54f7c, #793f95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.love-notification strong,
.love-notification small {
  display: block;
}

.love-notification strong {
  font-size: 1rem;
  line-height: 1.2;
}

.love-notification small {
  margin-top: 0.12rem;
  color: rgba(62, 23, 35, 0.72);
  font-size: 0.86rem;
  font-weight: 700;
}

.message-section {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(2rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem) max(5.25rem, env(safe-area-inset-bottom));
  overflow: hidden;
  color: #431825;
  background: var(--romance-scene);
  isolation: isolate;
}

.message-section::before,
.message-section::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.message-section::before {
  inset: -12%;
  z-index: 0;
  opacity: 0.34;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(190, 57, 98, 0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(104, 70, 158, 0.18) 0 1px, transparent 1.7px),
    repeating-linear-gradient(115deg, transparent 0 2.6rem, rgba(255, 255, 255, 0.2) 2.65rem 2.72rem, transparent 2.78rem 5.4rem);
  background-size: 8rem 8rem, 11rem 11rem, 15rem 15rem, auto;
  will-change: transform;
  animation: romanceDustDrift 28s linear infinite;
}

.message-section::after {
  inset: -8%;
  z-index: 1;
  opacity: 0.74;
  background:
    radial-gradient(circle at 18% 72%, rgba(255, 255, 255, 0.28), transparent 18rem),
    radial-gradient(circle at 86% 38%, rgba(255, 153, 188, 0.18), transparent 19rem),
    linear-gradient(180deg, rgba(255, 210, 223, 0) 74%, rgba(255, 210, 223, 0.95) 100%);
  will-change: transform, opacity;
  animation: romanceGlowFloat 16s ease-in-out infinite alternate;
}

@keyframes romanceDustDrift {
  to {
    transform: translate3d(-4rem, 3rem, 0);
  }
}

@keyframes romanceGlowFloat {
  0% {
    opacity: 0.58;
    transform: translate3d(-1.2rem, 0.6rem, 0);
  }

  100% {
    opacity: 0.78;
    transform: translate3d(1.6rem, -0.9rem, 0);
  }
}

.message-decor {
  position: absolute;
  z-index: 1;
  width: clamp(8rem, 22vw, 16rem);
  aspect-ratio: 1;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.36;
  filter: blur(1px);
  background:
    radial-gradient(circle at 38% 36%, rgba(255, 255, 255, 0.96) 0 4%, transparent 4.5%),
    radial-gradient(circle at 63% 34%, rgba(255, 255, 255, 0.86) 0 3%, transparent 3.5%),
    radial-gradient(circle at 50% 66%, rgba(190, 57, 98, 0.42) 0 24%, transparent 25%);
}

.message-decor-one {
  left: -4rem;
  top: 12%;
  transform: rotate(-12deg);
}

.message-decor-two {
  right: -4rem;
  bottom: 16%;
  transform: rotate(10deg) scale(0.85);
}

.message-card {
  position: relative;
  z-index: 2;
  width: min(92vw, 52rem);
  min-height: clamp(20rem, 46svh, 29rem);
  max-height: calc(100svh - 8.25rem);
  padding: clamp(1.35rem, 4vw, 3rem);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.22);
  box-shadow:
    0 2rem 6rem rgba(149, 54, 85, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.message-kicker {
  margin: 0 0 1.35rem;
  color: rgba(117, 42, 65, 0.7);
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  font-weight: 850;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.typed-message {
  margin: 0;
  color: #451827;
  font-size: clamp(1rem, 2.35vw, 1.28rem);
  font-weight: 650;
  line-height: 1.72;
  white-space: pre-wrap;
}

.typing-caret {
  display: inline-block;
  width: 0.7rem;
  height: 1.4rem;
  margin-left: 0.2rem;
  vertical-align: text-bottom;
  border-radius: 999px;
  background: #b75072;
  animation: caretBlink 740ms steps(1) infinite;
}

.typing-caret.is-hidden {
  opacity: 0;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

.scroll-hint-message {
  position: absolute;
  left: 50%;
  bottom: max(1.45rem, env(safe-area-inset-bottom));
  z-index: 3;
  color: rgba(93, 31, 50, 0.68);
  transform: translateX(-50%);
}

.timeline-section {
  height: 560vh;
  margin-top: -1px;
  color: #431825;
  background: var(--romance-scene);
}

.timeline-sticky {
  display: grid;
  align-content: center;
  gap: clamp(1.4rem, 4vw, 2.6rem);
  padding: clamp(2rem, 5vw, 4rem) 0;
  background: var(--romance-scene);
  isolation: isolate;
}

.timeline-sticky::before,
.timeline-sticky::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.timeline-sticky::before {
  inset: -14%;
  z-index: 0;
  opacity: 0.28;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(190, 57, 98, 0.22) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(81, 116, 168, 0.18) 0 1px, transparent 1.7px);
  background-size: 8rem 8rem, 12rem 12rem, 17rem 17rem;
  will-change: transform;
  animation: romanceDustDrift 32s linear infinite reverse;
}

.timeline-sticky::after {
  inset: -18%;
  z-index: 0;
  opacity: 0.2;
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 255, 255, 0.38), transparent 17rem),
    radial-gradient(circle at 78% 74%, rgba(255, 128, 174, 0.28), transparent 21rem);
  will-change: transform, opacity;
  animation: romanceGlowFloat 18s ease-in-out infinite alternate;
}

.timeline-header {
  position: relative;
  z-index: 1;
  width: min(88vw, 72rem);
  margin: 0 auto;
  color: rgba(84, 28, 47, 0.66);
  font-size: clamp(0.8rem, 2.2vw, 0.96rem);
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.timeline-camera {
  position: relative;
  z-index: 1;
  height: min(66svh, 38rem, calc(100svh - 10rem));
  min-height: min(26rem, calc(100svh - 10rem));
  overflow: visible;
  perspective: 1200px;
}

.timeline-track {
  --event-width: clamp(17rem, 30vw, 22rem);
  --event-half: clamp(8.5rem, 15vw, 11rem);
  --timeline-anchor-x: var(--event-half);
  --timeline-line-left: var(--event-half);
  --timeline-line-width: calc(100% - var(--event-half) - var(--event-half));
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: clamp(2.4rem, 7vw, 5.8rem);
  width: max-content;
  transform:
    translate3d(calc(var(--timeline-x) - var(--timeline-anchor-x)), -50%, 0)
    scale(var(--timeline-scale));
  transform-origin: 0 center;
  will-change: transform;
}

.timeline-track::before {
  position: absolute;
  left: var(--timeline-line-left);
  width: var(--timeline-line-width);
  z-index: 0;
  top: 50%;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: rgba(114, 35, 62, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
  transform: translateY(-50%);
}

.timeline-event {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--event-width);
  height: clamp(20rem, 58svh, 29rem);
  opacity: var(--event-opacity, 0.42);
  transform: translate3d(0, var(--event-y, 1.2rem), 0) scale(var(--event-scale, 0.94));
  transition: opacity 120ms linear, transform 120ms linear;
}

.timeline-event::after {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 0.65rem);
  width: 2px;
  height: 1.7rem;
  content: "";
  background: rgba(114, 35, 62, 0.42);
  transform: translateX(-50%);
}

.timeline-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid #fff5f8;
  border-radius: 999px;
  background: #ba4c75;
  box-shadow: 0 0 0 0.55rem rgba(186, 76, 117, 0.12), 0 0.85rem 1.8rem rgba(111, 35, 61, 0.22);
  transform: translate(-50%, -50%);
}

.timeline-content {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 2.35rem);
  width: 100%;
  max-width: 22rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 1.2rem 3rem rgba(139, 48, 78, 0.14);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.timeline-date {
  display: block;
  margin-bottom: 0.45rem;
  color: rgba(95, 33, 54, 0.68);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-text {
  margin: 0;
  color: #4b182a;
  font-size: clamp(1.1rem, 3.2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.38;
}

.timeline-event:nth-child(even) {
  padding: 0;
}

.timeline-event:nth-child(even)::after {
  top: calc(50% + 0.65rem);
  bottom: auto;
}

.timeline-event:nth-child(even) .timeline-content {
  top: calc(50% + 2.35rem);
  bottom: auto;
}

.final-section {
  height: 500vh;
  margin-top: -1px;
  background: #000;
}

.final-sticky {
  position: sticky;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #000;
}

.final-sticky::before,
.final-sticky::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.final-sticky::before {
  z-index: 0;
  background: var(--romance-scene);
  opacity: calc(1 - var(--final-bg-fade));
  will-change: opacity;
}

.final-sticky::after {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 84, 142, 0.1), transparent 27rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0), #000 100%);
  opacity: var(--final-bg-fade);
  will-change: opacity;
}

.final-words {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}

.final-words span {
  position: absolute;
  max-width: 94vw;
  color: #fff8fb;
  font-size: clamp(4.5rem, 17vw, 13rem);
  font-weight: 950;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 1.4rem 5rem rgba(255, 62, 133, 0.28);
  opacity: 0;
  transform: translate3d(0, 2rem, 0) scale(0.94);
  filter: blur(14px);
  will-change: transform, opacity, filter;
}

.final-heart {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  color: #ff4f88;
  font-size: clamp(9rem, 34vw, 22rem);
  line-height: 1;
  opacity: 0;
  transform: translate3d(0, 2rem, 0) scale(0.72);
  filter: drop-shadow(0 0 4rem rgba(255, 64, 128, 0.5));
  will-change: transform, opacity;
}

@media (max-width: 740px) {
  .space-scroll {
    min-height: 540vh;
  }

  .space-stage,
  .timeline-sticky,
  .final-sticky {
    min-height: 100svh;
  }

  .photo-heart {
    --tile: clamp(1.55rem, 7.1vw, 3rem);
    --heart-offset-x: 0px;
    --heart-offset-y: 0px;
    width: min(92vw, 26rem);
    aspect-ratio: 1.12 / 1;
  }

  .scroll-photo {
    width: min(86vw, 27rem);
    max-height: 70svh;
    border-radius: 0.75rem;
  }

  .message-section {
    min-height: 100svh;
    padding-top: max(1.4rem, env(safe-area-inset-top));
    padding-bottom: max(4.7rem, env(safe-area-inset-bottom));
  }

  .message-card {
    min-height: clamp(24rem, 72svh, 34rem);
    max-height: calc(100svh - 7.25rem);
    border-radius: 1rem;
  }

  .typed-message {
    line-height: 1.64;
  }

  .timeline-camera {
    height: min(70svh, calc(100svh - 8.5rem));
    min-height: min(30rem, calc(100svh - 8.5rem));
  }

  .timeline-track {
    --event-width: min(76vw, 19rem);
    --event-half: min(38vw, 9.5rem);
    gap: 3.1rem;
  }

  .timeline-event {
    height: 31rem;
  }

  .timeline-content {
    padding: 1rem;
  }

  .timeline-text {
    font-size: clamp(1rem, 5.5vw, 1.28rem);
  }
}

@media (max-width: 420px) {
  .clock-time {
    font-size: clamp(2.6rem, 14.6vw, 3.75rem);
  }

  .word-stage span,
  .final-words span {
    font-size: clamp(3.4rem, 18vw, 5.6rem);
  }

  .photo-heart {
    --tile: clamp(1.35rem, 7vw, 2.45rem);
  }

  .message-card {
    padding: 1.1rem;
  }

  .typed-message {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .love-notification {
    border-radius: 1rem;
  }
}

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