:root {
  --bg-1: #14001f;
  --bg-2: #3a0a35;
  --bg-3: #6b1d45;
  --bg-4: #ff6b9d;
  --text-main: #fff7fb;
  --text-soft: #ffd8e8;
  --glass: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glow: rgba(255, 158, 204, 0.6);
  --accent: #ff6ea8;
  --accent-2: #ffd2e8;
  --shadow: 0 12px 50px rgba(255, 90, 160, 0.3);
  --container: min(1080px, 92vw);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  background: radial-gradient(circle at 20% 20%, #381a56 0%, #190025 45%, #100018 100%);
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, var(--bg-1), var(--bg-2), var(--bg-3), var(--bg-4), var(--bg-2), var(--bg-1));
  background-size: 300% 300%;
  animation: gradientFlow 20s ease-in-out infinite;
  z-index: -20;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  z-index: -19;
  pointer-events: none;
}

.glow-1 {
  width: 35vmax;
  height: 35vmax;
  left: -8vmax;
  top: -6vmax;
  background: #ff77c8;
  animation: floatGlow 13s ease-in-out infinite;
}

.glow-2 {
  width: 30vmax;
  height: 30vmax;
  right: -6vmax;
  top: 20vh;
  background: #ff9bc8;
  animation: floatGlow 17s ease-in-out infinite reverse;
}

.glow-3 {
  width: 40vmax;
  height: 40vmax;
  left: 22vw;
  bottom: -18vmax;
  background: #8f6bff;
  animation: floatGlow 19s ease-in-out infinite;
}

.decor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -5;
  overflow: hidden;
}

#hearts-layer-front,
#click-burst-layer,
#fireworks-layer {
  z-index: 5;
}

#trail-layer {
  z-index: 6;
}

.cursor-glow {
  position: fixed;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle, rgba(255, 186, 225, 0.22), rgba(255, 186, 225, 0.06) 45%, transparent 72%);
  transform: translate(-50%, -50%);
  filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.pointer-active .cursor-glow {
  opacity: 1;
}

.section {
  position: relative;
  width: 100%;
  min-height: 90vh;
  display: grid;
  align-items: center;
  padding: 8rem 0;
  transition: filter 0.7s ease;
}

.full-screen {
  min-height: 100vh;
}

.section-inner {
  width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0;
}

.hero-title {
  margin-top: 1rem;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: clamp(2.3rem, 7vw, 5.6rem);
  line-height: 1.2;
  text-shadow: 0 0 15px rgba(255, 201, 229, 0.6), 0 0 45px rgba(255, 110, 168, 0.45);
  max-width: 18ch;
  text-wrap: balance;
}

.hero-sub {
  margin-top: 1.6rem;
  max-width: 42rem;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: #ffe9f3;
  min-height: 2.8em;
  text-shadow: 0 0 18px rgba(255, 190, 221, 0.5);
}

.scroll-down {
  display: inline-block;
  margin-top: 2.4rem;
  text-decoration: none;
  color: #ffe7f2;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  backdrop-filter: blur(8px);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.scroll-down:hover {
  transform: translateY(-4px) scale(1.03);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 26px rgba(255, 156, 211, 0.45);
}

.music-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(24, 6, 36, 0.48);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 82, 165, 0.28);
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.music-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 113, 186, 0.48);
  background: rgba(44, 12, 66, 0.58);
}

.music-icon {
  font-size: 1rem;
  animation: spinSlow 5s linear infinite;
}

.music-toggle.paused .music-icon {
  animation-play-state: paused;
  opacity: 0.7;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: clamp(2.1rem, 6vw, 4rem);
  margin-bottom: 2rem;
  text-shadow: 0 0 18px rgba(255, 189, 224, 0.6);
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  padding: 1.2rem 1.2rem;
  backdrop-filter: blur(8px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.timeline-item:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(255, 219, 237, 0.65);
  box-shadow: 0 14px 36px rgba(255, 133, 194, 0.32), 0 0 24px rgba(255, 167, 214, 0.38);
}

.timeline-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 20px rgba(255, 161, 212, 0.46);
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

.timeline-content p {
  color: #ffe5f1;
  line-height: 1.7;
}

/* ── Timeline Container ── */
.memory-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2rem 0;
}

/* Center vertical line */
.memory-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 154, 205, 0.7) 8%, rgba(255, 154, 205, 0.85) 50%, rgba(255, 154, 205, 0.7) 92%, transparent 100%);
  box-shadow: 0 0 14px rgba(255, 164, 212, 0.4);
}

/* ── Each row ── */
.memory-row {
  display: grid;
  grid-template-columns: 1fr 3.2rem 1fr;
  align-items: center;
  gap: 0;
  position: relative;
}

.memory-row.reveal-item {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.memory-row.reveal-item:nth-child(odd) {
  transform: translateX(-34px) translateY(18px);
}

.memory-row.reveal-item:nth-child(even) {
  transform: translateX(34px) translateY(18px);
}

.memory-row.reveal-item.visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* ── Gallery wrap (replaces single image) ── */
.memory-gallery-wrap {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0.6rem;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.gallery-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Collage grid layouts (Messenger-style) ── */
.gallery-collage {
  position: relative;
  display: grid;
  padding-right: 34px;
  padding-bottom: 24px;
  border-radius: 16px;
  overflow: visible;
  cursor: pointer;
  filter: drop-shadow(0 10px 26px rgba(255, 100, 170, 0.2));
}

.gallery-collage.gallery-empty {
  min-height: 180px;
  background: linear-gradient(145deg, #6b6578, #504a5d);
  border-color: rgba(200, 180, 210, 0.35);
}

.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Gallery cell ── */
.gallery-cell {
  grid-area: 1 / 1;
  transform: translate(var(--stack-x, 0), var(--stack-y, 0)) rotate(var(--stack-r, 0deg));
  transform-origin: center center;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.gallery-thumb {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.3);
  filter: saturate(1.05);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.gallery-collage:hover .gallery-cell {
  transform: translate(calc(var(--stack-x, 0) + 4px), calc(var(--stack-y, 0) - 2px)) rotate(var(--stack-r, 0deg));
}

.gallery-collage:hover .gallery-cell:first-child .gallery-thumb {
  transform: scale(1.06);
  filter: saturate(1.15) brightness(1.05);
}

.gallery-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.gallery-more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

/* ── Marker ── */
.memory-marker {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(145deg, #ff73b3, #ff97c7);
  border: 2.5px solid rgba(255, 230, 242, 0.9);
  box-shadow: 0 0 20px rgba(255, 132, 194, 0.55), 0 0 40px rgba(255, 132, 194, 0.2);
  z-index: 3;
  flex-shrink: 0;
  animation: markerBeat 2.8s ease-in-out infinite;
}

.memory-row:nth-child(3n) .memory-marker {
  animation-delay: 0.45s;
}

.memory-row:nth-child(4n) .memory-marker {
  animation-delay: 0.95s;
}

/* ── Content card ── */
.memory-content {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  margin: 0 0.8rem;
  padding: 1.2rem 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff1f8;
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: left;
  min-height: 80px;
  display: flex;
  align-items: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

/* ── Even rows: swap sides ── */
.memory-row:nth-child(even) .memory-gallery-wrap {
  grid-column: 3;
  grid-row: 1;
}

.memory-row:nth-child(even) .memory-content {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  justify-content: flex-end;
}

.memory-content:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 225, 240, 0.6);
  font-style: italic;
}

.memory-row-future {
  grid-template-columns: 1fr;
}

.memory-future-note {
  grid-column: 1;
  justify-self: center;
  width: min(760px, 92%);
  padding: 1.05rem 1.3rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 210, 232, 0.6);
  background: rgba(255, 255, 255, 0.08);
  color: #ffeaf4;
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ── Hover effects ── */
.memory-row:hover .memory-gallery-wrap {
  box-shadow: 0 14px 40px rgba(255, 100, 170, 0.3);
}

.memory-row:hover .memory-content {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(255, 100, 170, 0.15);
}

/* ═══════════ Lightbox ═══════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  position: relative;
  width: min(92vw, 1100px);
  height: min(88vh, 800px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-media {
  max-width: min(90vw, 1060px);
  max-height: min(82vh, 760px);
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

video.lightbox-media {
  background: #000;
  outline: none;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: -0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 100, 170, 0.4);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.lightbox-arrow:hover {
  background: rgba(255, 100, 170, 0.35);
}

.lightbox-arrow.prev {
  left: -3.5rem;
}

.lightbox-arrow.next {
  right: -3.5rem;
}

.lightbox-counter {
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.letter-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  box-shadow: var(--shadow);
  will-change: transform;
}

.letter-card.typing-active {
  animation: none !important;
  transform: none !important;
}

.letter-line {
  opacity: 0;
  transform: translateY(18px);
  margin: 0.55rem 0;
  line-height: 1.85;
  color: #fff0f7;
  white-space: pre-wrap;
}

.letter-line.typing-cursor-line::after {
  content: "|";
  margin-left: 2px;
  opacity: 0.85;
  animation: blink 0.7s steps(1) infinite;
}

.letter-line.signature {
  margin-top: 1.2rem;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 2rem;
  color: #ffdff0;
}

.future-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.future-item {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.future-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(255, 137, 200, 0.26);
  border-color: rgba(255, 226, 241, 0.75);
}

.future-item label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem;
  cursor: pointer;
}

.future-check {
  display: none;
}

.custom-check {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.custom-check::after {
  content: "❤";
  color: #fff;
  transform: scale(0);
  transition: transform 0.25s ease;
  font-size: 0.8rem;
}

.future-text {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.future-check:checked + .custom-check {
  border-color: #ffd9ec;
  background: linear-gradient(120deg, #ff6ea8, #ff97c0);
  box-shadow: 0 0 18px rgba(255, 158, 210, 0.6);
}

.future-check:checked + .custom-check::after {
  transform: scale(1);
}

.future-item.done .future-text {
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 214, 236, 0.75);
}

.promise .section-inner {
  text-align: center;
}

.love-btn {
  margin-top: 0.6rem;
  border: none;
  border-radius: 999px;
  padding: 1.05rem 2rem;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff4f9c, #ff76b4, #ff9bc8);
  box-shadow: 0 14px 40px rgba(255, 92, 165, 0.42);
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
  animation: heartBeat 1.8s ease-in-out infinite;
}

.love-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 20px 48px rgba(255, 125, 188, 0.6), 0 0 28px rgba(255, 192, 224, 0.72);
  filter: brightness(1.08);
}

.final-message {
  margin-top: 1.3rem;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: clamp(2rem, 6vw, 4.8rem);
  opacity: 0;
  transform: scale(0.86) translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  text-shadow: 0 0 16px rgba(255, 202, 228, 0.72), 0 0 36px rgba(255, 123, 187, 0.6);
}

.final-message.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: floatText 2.4s ease-in-out infinite;
}

.footer {
  padding: 1.2rem 1rem 2rem;
  text-align: center;
  color: #ffe4f1;
  opacity: 0;
  transform: translateY(16px);
}

.footer p {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 1s ease, transform 1s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: sectionBloom 1.2s ease;
}

.reveal-item {
  opacity: 0;
  transform: translateY(25px) translateX(-10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-item.visible {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

.fade-up {
  animation: fadeUp 1.3s 0.2s forwards;
}

.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  animation: charIn 0.8s forwards;
}

.typing-cursor::after {
  content: "|";
  margin-left: 3px;
  animation: blink 0.95s steps(1) infinite;
}

.floating-heart,
.floating-sparkle {
  position: absolute;
  will-change: transform, opacity;
}

.floating-heart {
  color: rgba(255, 190, 220, 0.85);
  text-shadow: 0 0 14px rgba(255, 166, 210, 0.7);
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.floating-sparkle {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 210, 236, 0.5), transparent 70%);
  animation-name: sparkleDrift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.click-heart {
  position: absolute;
  font-size: 0.9rem;
  color: #ffd5ec;
  text-shadow: 0 0 16px rgba(255, 158, 211, 0.75);
  animation: burstHeart 1s ease-out forwards;
}

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: fireworkFly 1100ms ease-out forwards;
  box-shadow: 0 0 14px currentColor;
}

.meteor {
  position: absolute;
  width: var(--size, 2px);
  height: var(--size, 2px);
  border-radius: 999px;
  background: #ffeaf5;
  box-shadow: 0 0 10px rgba(255, 209, 234, 0.9), 0 0 18px rgba(255, 145, 202, 0.6);
  animation: meteorFall var(--duration, 10s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.meteor::after {
  content: "";
  position: absolute;
  left: -120px;
  top: 50%;
  width: 120px;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 213, 236, 0.65));
}

.trail-heart {
  position: absolute;
  color: rgba(255, 208, 232, 0.95);
  text-shadow: 0 0 12px rgba(255, 168, 212, 0.8);
  animation: trailFloat 820ms ease-out forwards;
}

.memory-gallery-wrap {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.screen-shake {
  animation: shake 400ms linear 2;
}

.intro {
  transform: translateY(calc(var(--parallax, 0px) * -0.15));
}

.memory {
  transform: translateY(calc(var(--parallax, 0px) * -0.08));
}

.letter {
  transform: translateY(calc(var(--parallax, 0px) * -0.06));
}

.future {
  transform: translateY(calc(var(--parallax, 0px) * -0.04));
}

.promise {
  transform: translateY(calc(var(--parallax, 0px) * -0.02));
}

.breathing {
  animation: breathing 4.2s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(2vmax, -2vmax) scale(1.08);
  }
}

@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes charIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes floatUp {
  0% {
    transform: translateY(12vh) translateX(0) scale(0.8) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  60% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(-120vh) translateX(var(--drift, 30px)) scale(1.2) rotate(360deg);
    opacity: 0;
  }
}

@keyframes sparkleDrift {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(0.7);
    opacity: 0.25;
  }
  50% {
    transform: translateY(-30px) translateX(15px) scale(1);
    opacity: 0.7;
  }
}

@keyframes burstHeart {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, -120px))) scale(1.5);
    opacity: 0;
  }
}

@keyframes breathing {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 50px rgba(255, 90, 160, 0.28);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 14px 56px rgba(255, 152, 204, 0.44);
  }
}

@keyframes heartBeat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.05);
  }
  35% {
    transform: scale(0.97);
  }
  55% {
    transform: scale(1.06);
  }
}

@keyframes floatText {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.03) translateY(-4px);
  }
}

@keyframes fireworkFly {
  to {
    transform: translate(var(--tx), var(--ty)) scale(0.25);
    opacity: 0;
  }
}

@keyframes meteorFall {
  0% {
    transform: translate3d(25vw, -20vh, 0) rotate(-22deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-45vw, 130vh, 0) rotate(-22deg);
    opacity: 0;
  }
}

@keyframes trailFloat {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -145%) scale(1.45);
    opacity: 0;
  }
}

@keyframes sectionBloom {
  0% {
    filter: brightness(1) saturate(1);
  }
  45% {
    filter: brightness(1.08) saturate(1.08);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes shake {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3px, 2px);
  }
  40% {
    transform: translate(4px, -2px);
  }
  60% {
    transform: translate(-3px, 1px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@media (max-width: 1024px) {
  :root {
    --container: min(980px, 94vw);
  }

  .section {
    padding: 6.5rem 0;
    min-height: auto;
  }

  .hero-title {
    max-width: 14ch;
    line-height: 1.16;
  }

  .hero-sub {
    max-width: 34rem;
    font-size: clamp(1rem, 2vw, 1.2rem);
  }

  .memory-row {
    grid-template-columns: 1fr 2.8rem 1fr;
  }

  .memory-content {
    font-size: 0.98rem;
    line-height: 1.65;
    padding: 1rem 1.2rem;
  }

  .lightbox-inner {
    width: min(95vw, 980px);
    height: min(86vh, 760px);
  }

  .lightbox-arrow.prev {
    left: -1.5rem;
  }

  .lightbox-arrow.next {
    right: -1.5rem;
  }
}

@media (max-width: 900px) {
  :root {
    --container: min(760px, 94vw);
  }

  .section {
    padding: 5.8rem 0;
  }

  .music-toggle {
    top: 0.9rem;
    right: 0.9rem;
    padding: 0.5rem 0.8rem;
    gap: 0.3rem;
  }

  .music-text {
    font-size: 0.82rem;
  }

  .memory-timeline::before {
    left: 50%;
  }

  .memory-row {
    grid-template-columns: minmax(130px, 0.9fr) 2.35rem minmax(130px, 0.9fr);
    gap: 0.4rem;
    padding-left: 0;
  }

  .memory-marker {
    position: static;
    transform: none;
    width: 1.95rem;
    height: 1.95rem;
    font-size: 0.72rem;
  }

  .memory-gallery-wrap,
  .memory-row:nth-child(even) .memory-gallery-wrap {
    margin: 0 0.2rem;
  }

  .memory-content,
  .memory-row:nth-child(even) .memory-content {
    margin: 0 0.2rem;
    min-height: auto;
    padding: 0.62rem 0.72rem;
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .memory-row.reveal-item:nth-child(odd),
  .memory-row.reveal-item:nth-child(even) {
    transform: translateX(0) translateY(18px);
  }

  .future-item label {
    align-items: flex-start;
  }

  .lightbox-arrow {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.15rem;
  }

  .lightbox-arrow.prev {
    left: 0.4rem;
  }

  .lightbox-arrow.next {
    right: 0.4rem;
  }

  .lightbox-close {
    top: 0.4rem;
    right: 0.4rem;
  }

  .lightbox-counter {
    bottom: 0.6rem;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
  }
}

@media (max-width: 720px) {
  .section {
    min-height: auto;
    padding: 5.2rem 0;
  }

  .cursor-glow {
    display: none;
  }

  .section-title {
    margin-bottom: 1.35rem;
  }

  .hero-sub {
    min-height: 2.4em;
    margin-top: 1.1rem;
  }

  .scroll-down {
    margin-top: 1.4rem;
    padding: 0.62rem 1rem;
    font-size: 0.88rem;
  }

  .music-toggle {
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .music-text {
    display: none;
  }

  .timeline-item {
    padding: 1rem;
  }

  .memory-timeline::before {
    left: 50%;
  }

  .memory-row {
    grid-template-columns: minmax(104px, 0.9fr) 1.95rem minmax(104px, 0.9fr);
    gap: 0.22rem;
    padding-left: 0;
    position: relative;
  }

  .memory-marker {
    position: static;
    transform: none;
    width: 1.62rem;
    height: 1.62rem;
    font-size: 0.63rem;
    border-width: 2px;
  }

  .memory-gallery-wrap,
  .memory-row:nth-child(even) .memory-gallery-wrap {
    margin: 0 0.08rem;
  }

  .memory-content,
  .memory-row:nth-child(even) .memory-content {
    margin: 0 0.08rem;
    min-height: auto;
    padding: 0.48rem 0.54rem;
    font-size: 0.79rem;
    line-height: 1.42;
    border-radius: 10px;
  }

  .gallery-collage {
    padding-right: 22px;
    padding-bottom: 16px;
  }

  .memory-future-note {
    width: min(560px, 96%);
    font-size: 0.84rem;
    padding: 0.7rem 0.8rem;
  }

  .letter-card {
    border-radius: 18px;
    padding: 1rem;
  }

  .letter-line {
    margin: 0.45rem 0;
    line-height: 1.72;
    font-size: 0.96rem;
  }

  .letter-line.signature {
    font-size: 1.55rem;
    margin-top: 0.95rem;
  }

  .future-item label {
    padding: 0.8rem 0.85rem;
    gap: 0.72rem;
  }

  .custom-check {
    width: 1.25rem;
    height: 1.25rem;
  }

  .future-text {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .love-btn {
    width: 100%;
    max-width: 25rem;
    padding: 0.95rem 1.15rem;
  }

  .final-message {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
    margin-top: 1rem;
  }

  .lightbox-inner {
    width: 96vw;
    height: 88vh;
  }

  .lightbox-media {
    max-width: 93vw;
    max-height: 80vh;
  }

  .lightbox-arrow.prev {
    left: 0.3rem;
  }

  .lightbox-arrow.next {
    right: 0.3rem;
  }

  .lightbox-close {
    top: 0.3rem;
    right: 0.3rem;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.15rem;
  }
}

@media (max-width: 520px) {
  :root {
    --container: min(100%, 94vw);
  }

  .section {
    padding: 4.8rem 0;
  }

  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }

  .hero-title {
    margin-top: 0.6rem;
    font-size: clamp(1.9rem, 10.2vw, 2.55rem);
    max-width: 12ch;
  }

  .hero-sub {
    font-size: 0.96rem;
    min-height: 2.2em;
  }

  .memory-row {
    grid-template-columns: minmax(84px, 0.9fr) 1.7rem minmax(84px, 0.9fr);
    gap: 0.12rem;
    padding-left: 0;
  }

  .memory-marker {
    width: 1.45rem;
    height: 1.45rem;
    font-size: 0.55rem;
  }

  .memory-content,
  .memory-row:nth-child(even) .memory-content {
    padding: 0.42rem 0.45rem;
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .memory-future-note {
    font-size: 0.76rem;
    padding: 0.64rem 0.65rem;
  }

  .gallery-collage {
    padding-right: 16px;
    padding-bottom: 12px;
  }

  .music-toggle {
    top: 0.65rem;
    right: 0.65rem;
  }

  .love-btn {
    font-size: 0.97rem;
  }

  .footer p {
    letter-spacing: 0.04em;
    font-size: 0.66rem;
  }
}

@keyframes markerBeat {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(255, 132, 194, 0.45), 0 0 28px rgba(255, 132, 194, 0.2);
  }
  45% {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(255, 148, 203, 0.7), 0 0 46px rgba(255, 148, 203, 0.28);
  }
}