:root {
  --bg: #120b12;
  --bg-deep: #090609;
  --surface: rgba(255, 245, 246, 0.055);
  --surface-strong: rgba(255, 245, 246, 0.09);
  --text: #fff7f7;
  --muted: #cdbfc5;
  --soft: #e9d6dc;
  --rose: #efb3c1;
  --rose-bright: #ffd1db;
  --line: rgba(255, 220, 227, 0.16);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(185, 79, 110, .16), transparent 38rem),
    var(--bg);
  font-family: var(--sans);
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

img { display: block; width: 100%; }

button { font: inherit; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #0b070b;
  transition: opacity .9s var(--ease), visibility .9s;
}

body.loaded .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-heart {
  color: var(--rose-bright);
  font: 500 4rem/1 var(--serif);
  animation: breathe 1.5s ease-in-out infinite;
}

.ambient,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient { z-index: 0; overflow: hidden; }

.glow {
  position: absolute;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .12;
}

.glow-a {
  top: 8%;
  left: -18rem;
  background: #d46c88;
  animation: driftA 16s ease-in-out infinite alternate;
}

.glow-b {
  right: -20rem;
  top: 45%;
  background: #b94e73;
  animation: driftB 19s ease-in-out infinite alternate;
}

.grain {
  opacity: .035;
  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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  z-index: 50;
  top: 50%;
  right: 1.4rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: .65rem;
  writing-mode: vertical-rl;
  opacity: .65;
  mix-blend-mode: screen;
}

.progress-label {
  font-size: .58rem;
  letter-spacing: .2em;
  color: var(--muted);
}

.progress-track {
  width: 1px;
  height: 7rem;
  background: var(--line);
  position: relative;
}

.progress-fill {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  background: var(--rose-bright);
  box-shadow: 0 0 12px rgba(255, 200, 213, .55);
  transition: height .12s linear;
}

.section,
.chapter { position: relative; z-index: 1; }

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  padding: 7rem 1.5rem 5rem;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 58rem;
}

.eyebrow,
.chapter-number {
  margin: 0 0 1.25rem;
  font-size: .68rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--rose);
}

.hero-title {
  margin: 0;
  font: 600 clamp(4rem, 10vw, 8.5rem)/.78 var(--serif);
  letter-spacing: -.045em;
}

.hero-title em,
.chapter-title em,
.final-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--rose-bright);
}

.hero-title span {
  display: inline-block;
  font-size: .36em;
  vertical-align: top;
  margin-top: .15em;
  color: var(--rose);
}

.hero-subtitle {
  margin: 2rem auto 0;
  max-width: 38rem;
  color: var(--muted);
  font: 400 clamp(1.05rem, 2vw, 1.3rem)/1.65 var(--serif);
}

.begin-btn {
  margin-top: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .8rem 1.15rem .8rem 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--text);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: transform .4s var(--ease), background .4s, border-color .4s;
}

.begin-btn i {
  font-style: normal;
  color: var(--rose-bright);
}

.begin-btn:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255, 220, 227, .35);
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  color: #a99ba1;
  font-size: .57rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.scroll-hint .line {
  height: 3rem;
  width: 1px;
  background: linear-gradient(var(--rose), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

.hero-orb {
  position: absolute;
  border: 1px solid rgba(255, 205, 216, .12);
  border-radius: 50%;
  transform: translate3d(0, var(--parallax, 0), 0);
}

.hero-orb-a {
  width: 34rem; height: 34rem;
  left: -18rem; top: 30%;
}

.hero-orb-b {
  width: 26rem; height: 26rem;
  right: -13rem; top: 10%;
}

.chapter {
  min-height: 100svh;
  padding: 11rem 1.5rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.chapter-dark {
  background: linear-gradient(180deg, rgba(5, 3, 5, .42), rgba(17, 9, 15, .8));
}

.chapter-inner {
  width: min(76rem, 100%);
  margin: auto;
}

.narrow { max-width: 50rem; }

.chapter-title {
  margin: 0;
  max-width: 48rem;
  font: 500 clamp(3rem, 7vw, 6.5rem)/.88 var(--serif);
  letter-spacing: -.035em;
}

.memory-copy,
.story-copy {
  margin-top: 3.5rem;
}

.memory-copy p,
.story-copy p {
  max-width: 42rem;
  margin: 0 0 1.8rem;
  color: var(--muted);
  font: 400 clamp(1.15rem, 2.2vw, 1.45rem)/1.7 var(--serif);
}

.story-copy strong { color: var(--soft); font-weight: 600; }

.pull-quote {
  margin: 4rem 0 0 !important;
  padding-left: 1.5rem;
  border-left: 1px solid var(--rose);
  color: var(--rose-bright) !important;
  font-size: clamp(1.7rem, 4vw, 2.5rem) !important;
  font-style: italic;
}

.signature {
  color: var(--soft) !important;
  font-style: italic;
}

.memory-placeholder {
  min-height: 19rem;
  margin-top: 5rem;
  padding: 2rem;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px dashed rgba(255, 220, 227, .2);
  border-radius: 1.5rem;
  background: rgba(255,255,255,.025);
}

.memory-placeholder span {
  font: 3rem var(--serif);
  color: var(--rose);
}

.memory-placeholder small {
  margin-top: .5rem;
  color: var(--soft);
}

.memory-placeholder p {
  margin: .6rem 0 0;
  max-width: 30rem;
  color: #8f8389;
  font-size: .78rem;
}

.memory-placeholder code {
  color: var(--rose);
}

.split-line {
  margin: 4rem 0;
  padding: 1.7rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: baseline;
  gap: 1rem;
  color: #a99ba1;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.split-line strong {
  font: 600 clamp(2rem, 5vw, 4rem) var(--serif);
  color: var(--rose-bright);
  letter-spacing: 0;
  text-transform: none;
}

.big-line {
  color: var(--rose-bright) !important;
  font-size: clamp(2rem, 5vw, 3.7rem) !important;
  line-height: 1.1 !important;
}

.quiet { color: #e2cfd5 !important; }

.phone-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 0 1.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rose-bright);
  font: 2rem var(--serif);
  box-shadow: 0 0 0 0 rgba(239,179,193,.15);
  animation: phonePulse 2.5s infinite;
}

.call-content { position: relative; z-index: 2; }

.call-rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20rem;
  height: 20rem;
  transform: translate(-50%, -50%);
  opacity: .15;
}

.call-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--rose);
  border-radius: 50%;
  animation: ring 5s ease-out infinite;
}

.call-rings span:nth-child(2) { animation-delay: 1.5s; }
.call-rings span:nth-child(3) { animation-delay: 3s; }

.turning-point {
  margin-top: 5rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  border-left: 1px solid var(--rose);
  background: linear-gradient(90deg, rgba(239,179,193,.08), transparent);
}

.turning-point span {
  color: #9e9097;
  font-size: .65rem;
  letter-spacing: .22em;
}

.turning-point strong {
  font: 600 clamp(2.3rem, 6vw, 5rem)/.85 var(--serif);
  color: var(--rose-bright);
}

.promise-card {
  margin: 4rem 0;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.018));
  box-shadow: var(--shadow);
}

.promise-card p {
  margin-bottom: .9rem;
  font-size: 1rem;
  color: #a99ba1;
}

.promise-card strong {
  font: 500 clamp(2rem, 5vw, 3.5rem)/1.02 var(--serif);
  color: var(--rose-bright);
}

.shape-one,
.shape-two {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(255, 205, 216, .08);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(var(--parallax, 0));
}

.shape-one { right: -13rem; top: 20%; }
.shape-two { left: -12rem; bottom: 12%; }

.memories-again {
  min-height: 100svh;
  padding: 10rem 1.5rem;
  display: flex;
  align-items: center;
}

.center { text-align: center; margin-inline: auto; }

.memory-gallery {
  width: min(70rem, 100%);
  margin: 5rem auto 0;
  min-height: 34rem;
  display: grid;
  grid-template-columns: 1fr .7fr 1fr;
  align-items: center;
  gap: 1.5rem;
}

.photo-card { margin: 0; }

.photo-frame {
  overflow: hidden;
  border-radius: 1.1rem;
  background: #21151d;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
}

.photo-frame img {
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.photo-card:hover .photo-frame img { transform: scale(1.05); }

.photo-card figcaption {
  margin-top: .7rem;
  color: #94878e;
  font-size: .65rem;
  letter-spacing: .08em;
  text-align: center;
}

.photo-left { transform: rotate(-4deg) translateY(1rem); }
.photo-right { transform: rotate(4deg) translateY(-1rem); }

.gallery-center {
  text-align: center;
  color: var(--muted);
}

.gallery-center span {
  color: var(--rose);
  font: 3rem var(--serif);
}

.gallery-center p {
  margin: .8rem 0;
  font: 1.2rem/1.5 var(--serif);
}

.gallery-note {
  margin: 5rem auto 0;
  max-width: 36rem;
  text-align: center;
  color: var(--rose-bright);
  font: italic 1.45rem/1.5 var(--serif);
}

.finale {
  min-height: 100svh;
  padding: 9rem 1.5rem 4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(178, 67, 101, .17), transparent 34rem),
    linear-gradient(180deg, #0c070c, #090509);
  overflow: hidden;
}

.final-title {
  margin: 0 auto;
  max-width: 55rem;
  font: 500 clamp(4rem, 10vw, 8rem)/.8 var(--serif);
  letter-spacing: -.045em;
}

.final-memory {
  width: min(75rem, 100%);
  min-height: 34rem;
  margin: 5rem auto 4rem;
  display: grid;
  grid-template-columns: .8fr 1.25fr .8fr;
  align-items: center;
  gap: 1.4rem;
  perspective: 1200px;
}

.final-photo {
  margin: 0;
  border: 1px solid var(--line);
  padding: .45rem;
  background: rgba(255,255,255,.035);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.final-photo img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.final-photo-left {
  transform: rotateY(12deg) rotateZ(-4deg) translateY(1.5rem);
}

.final-photo-right {
  transform: rotateY(-12deg) rotateZ(4deg) translateY(-1.5rem);
}

.final-gif {
  position: relative;
  margin: 0;
  z-index: 2;
  border-radius: 1.5rem;
  padding: .55rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255, 220, 227, .2);
  box-shadow: 0 35px 100px rgba(0,0,0,.5);
}

.final-gif img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1.05rem;
}

.gif-glow {
  position: absolute;
  inset: -1.5rem;
  z-index: -1;
  border-radius: 2rem;
  background: rgba(224, 100, 132, .2);
  filter: blur(35px);
  animation: gifGlow 3.5s ease-in-out infinite alternate;
}

.heart-mark {
  position: absolute;
  right: -1rem;
  bottom: -1rem;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #190c14;
  border: 1px solid var(--line);
  color: var(--rose-bright);
  font: 1.5rem var(--serif);
}

.final-copy {
  max-width: 35rem;
  margin: 0 auto;
}

.final-copy p {
  margin: .45rem 0;
  color: #9f9298;
  font: 1.1rem/1.35 var(--serif);
}

.final-copy .final-emphasis {
  margin-top: 2rem;
  color: var(--rose-bright);
  font: italic 2rem/1.2 var(--serif);
}

.final-promise {
  max-width: 40rem;
  margin: 5rem auto 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.final-promise p {
  margin: 0 0 .8rem;
  color: #9f9298;
  font: 1.05rem/1.5 var(--serif);
}

.final-promise strong {
  color: var(--rose-bright);
  font: 500 clamp(2rem, 5vw, 3.2rem)/1.05 var(--serif);
}

.love-ending {
  margin-top: 6rem;
  padding-bottom: 2rem;
}

.love-ending span,
.love-ending small {
  display: block;
  color: #887b82;
  font: .9rem var(--serif);
}

.love-ending h3 {
  margin: .5rem 0 .7rem;
  font: 500 clamp(2.8rem, 7vw, 5.5rem)/.9 var(--serif);
}

.love-ending h3 b {
  color: var(--rose);
  font-weight: 400;
}

.love-ending small {
  font: .65rem var(--sans);
  letter-spacing: .08em;
}

.top-btn {
  width: 3rem;
  height: 3rem;
  margin-top: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rose-bright);
  background: transparent;
  cursor: pointer;
  transition: transform .4s var(--ease), background .4s;
}

.top-btn:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.06);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(4px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease),
    filter 1s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }
.reveal:nth-child(5) { transition-delay: .32s; }

@keyframes breathe {
  0%, 100% { transform: scale(.9); opacity: .65; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes driftA {
  to { transform: translate(13rem, 9rem) scale(1.15); }
}

@keyframes driftB {
  to { transform: translate(-9rem, -8rem) scale(.85); }
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(.55); transform-origin: top; opacity: .4; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

@keyframes phonePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,179,193,.16); }
  50% { box-shadow: 0 0 0 1.4rem rgba(239,179,193,0); }
}

@keyframes ring {
  0% { transform: scale(.2); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes gifGlow {
  from { opacity: .5; transform: scale(.92); }
  to { opacity: 1; transform: scale(1.06); }
}

@media (max-width: 760px) {
  .progress {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    transform: none;
    writing-mode: horizontal-tb;
    flex-direction: row;
  }

  .progress-track {
    width: 5rem;
    height: 1px;
  }

  .progress-fill {
    width: 0;
    height: 100%;
    inset: 0 auto 0 0;
  }

  .hero { padding-inline: 1.2rem; }

  .hero-title { font-size: clamp(3.7rem, 17vw, 6rem); }
  .hero-subtitle { font-size: 1.1rem; }

  .chapter {
    min-height: auto;
    padding: 8rem 1.25rem;
  }

  .chapter-title { font-size: clamp(3rem, 15vw, 5rem); }

  .memory-copy,
  .story-copy { margin-top: 2.7rem; }

  .memory-copy p,
  .story-copy p { font-size: 1.22rem; }

  .split-line {
    grid-template-columns: 1fr auto;
    gap: .4rem .8rem;
  }

  .split-line span:nth-of-type(2) {
    grid-column: 1;
  }

  .split-line strong:nth-of-type(2) {
    grid-column: 2;
    grid-row: 2;
  }

  .memory-gallery {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 3.5rem;
  }

  .photo-left,
  .photo-right {
    width: 78%;
    margin-inline: auto;
  }

  .photo-left { transform: rotate(-3deg); }
  .photo-right { transform: rotate(3deg); }

  .gallery-center { order: -1; }

  .finale { padding: 8rem 1.15rem 3rem; }

  .final-memory {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: min(24rem, 100%);
    margin-top: 3.5rem;
  }

  .final-gif { order: 0; width: 82%; margin-inline: auto; }
  .final-photo-left { order: -1; width: 68%; justify-self: start; transform: rotate(-5deg); }
  .final-photo-right { order: 1; width: 68%; justify-self: end; transform: rotate(5deg); }

  .final-copy .final-emphasis { font-size: 1.8rem; }

  .promise-card { padding: 1.8rem; }

  .love-ending { margin-top: 4.5rem; }

  .shape-one,
  .shape-two,
  .hero-orb { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}


/* =========================================================
   V2 CINEMATIC MOTION LAYER
   ========================================================= */

::selection {
  background: rgba(239, 179, 193, .22);
  color: var(--text);
}

body {
  cursor: none;
}

button, a, .photo-card, .final-photo, .final-gif {
  cursor: none;
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(202, 87, 119, .2), transparent 25rem),
    #090509;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .8s var(--ease), visibility .8s;
}

.page-transition.active {
  opacity: 1;
  visibility: visible;
}

.transition-heart {
  color: var(--rose-bright);
  font: 5rem var(--serif);
  animation: transitionHeart 1.2s var(--ease) both;
}

.cursor {
  position: fixed;
  z-index: 10001;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 214, 224, .8);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .35s var(--ease), height .35s var(--ease), background .35s, border-color .35s;
  mix-blend-mode: screen;
}

.cursor::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(255, 214, 224, .13);
  border-radius: 50%;
  transition: transform .5s var(--ease);
}

.cursor span {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--rose-bright);
  opacity: .75;
}

.cursor.hover {
  width: 42px;
  height: 42px;
  background: rgba(239, 179, 193, .08);
  border-color: rgba(255, 214, 224, .5);
}

.cursor.hover::before {
  transform: scale(.72);
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rose-bright);
  opacity: 0;
  filter: blur(.2px);
  animation: particleFloat linear infinite;
}

.hero-content {
  animation: heroBreath 8s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 10% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 222, .2), transparent);
  opacity: .7;
}

.chapter-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
}

.chapter-label::before {
  content: "♡";
  color: rgba(239, 179, 193, .65);
  font-size: .85rem;
  transform: translateY(-1px);
}

.chapter-label::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(239,179,193,.6), transparent);
}

.chapter-title {
  text-wrap: balance;
}

.story-copy p,
.memory-copy p {
  text-wrap: pretty;
}

.chapter-number {
  transition: letter-spacing .8s var(--ease), opacity .8s var(--ease);
}

.chapter:has(.reveal.visible) .chapter-number {
  letter-spacing: .34em;
}

.big-line,
.pull-quote,
.final-emphasis {
  text-wrap: balance;
}

.photo-frame,
.final-photo,
.final-gif {
  will-change: transform;
}

.photo-frame::after,
.final-photo::after,
.final-gif::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.13), transparent 28%, transparent 70%, rgba(255,185,204,.08));
  opacity: .35;
}

.photo-frame,
.final-photo,
.final-gif {
  position: relative;
}

.final-gif {
  animation: finalFloat 5.5s ease-in-out infinite;
}

.final-memory .final-photo-left {
  animation: memoryFloatLeft 6.5s ease-in-out infinite alternate;
}

.final-memory .final-photo-right {
  animation: memoryFloatRight 7s ease-in-out infinite alternate;
}

.final-memory {
  transform-style: preserve-3d;
}

.finale .final-title {
  text-shadow: 0 0 50px rgba(239, 179, 193, .07);
}

.love-ending h3 {
  text-shadow: 0 0 40px rgba(239, 179, 193, .12);
}

.top-btn {
  position: relative;
  overflow: hidden;
}

.top-btn::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(239,179,193,.12);
  transform: translate(-50%, -50%);
  transition: width .6s var(--ease), height .6s var(--ease);
}

.top-btn:hover::after {
  width: 180%;
  height: 180%;
}

@supports (animation-timeline: view()) {
  .chapter .chapter-inner {
    animation: cinematicLift linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 38%;
  }

  .final-memory {
    animation: finalScrollDepth linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 55%;
  }
}

@keyframes cinematicLift {
  from {
    opacity: .62;
    transform: translateY(30px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes finalScrollDepth {
  from {
    transform: scale(.91) translateY(55px);
  }
  to {
    transform: scale(1) translateY(0);
  }
}

@keyframes heroBreath {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

@keyframes transitionHeart {
  0% { opacity: 0; transform: scale(.55); filter: blur(8px); }
  45% { opacity: 1; transform: scale(1.1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(.6);
  }
  12% { opacity: .42; }
  80% { opacity: .16; }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x), -110vh, 0) scale(1.15);
  }
}

@keyframes finalFloat {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-10px) rotateX(1deg); }
}

@keyframes memoryFloatLeft {
  from { transform: rotateY(12deg) rotateZ(-4deg) translate3d(0, 1.5rem, 0); }
  to { transform: rotateY(12deg) rotateZ(-4deg) translate3d(-8px, -.2rem, 0); }
}

@keyframes memoryFloatRight {
  from { transform: rotateY(-12deg) rotateZ(4deg) translate3d(0, -1.5rem, 0); }
  to { transform: rotateY(-12deg) rotateZ(4deg) translate3d(8px, .2rem, 0); }
}

@media (max-width: 760px) {
  body, button, a, .photo-card, .final-photo, .final-gif {
    cursor: auto;
  }

  .cursor { display: none; }

  .particle-field { opacity: .6; }

  .hero-content {
    animation: none;
  }

  .final-gif {
    animation-duration: 6.5s;
  }

  .final-memory .final-photo-left,
  .final-memory .final-photo-right {
    animation: none;
  }

  @supports (animation-timeline: view()) {
    .chapter .chapter-inner {
      animation-range: entry 2% cover 22%;
    }

    .final-memory {
      animation-range: entry 2% cover 35%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .particle-field {
    display: none;
  }

  .page-transition {
    transition: none;
  }

  .hero-content,
  .final-gif,
  .final-memory .final-photo-left,
  .final-memory .final-photo-right {
    animation: none !important;
  }

  @supports (animation-timeline: view()) {
    .chapter .chapter-inner,
    .final-memory {
      animation: none;
    }
  }
}


/* =========================================================
   V3 — EMOTIONAL ATMOSPHERE + CINEMATIC FINALE
   ========================================================= */

:root {
  --atmo-rgb: 174, 69, 99;
  --atmo-strength: .12;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transition: background .9s ease, opacity .9s ease;
  opacity: 1;
}

.atmo-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, transparent 18%, rgba(0,0,0,.18) 72%, rgba(0,0,0,.48) 100%);
}

.atmo-light {
  position: absolute;
  width: 55vw;
  height: 55vw;
  max-width: 48rem;
  max-height: 48rem;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--atmo-rgb), var(--atmo-strength)), transparent 68%);
  filter: blur(18px);
  transition: background .9s ease, transform 1.2s var(--ease);
}

body.atmo-memory {
  --atmo-rgb: 195, 86, 116;
  --atmo-strength: .14;
}

body.atmo-tension {
  --atmo-rgb: 128, 49, 74;
  --atmo-strength: .08;
}

body.atmo-insecurity {
  --atmo-rgb: 100, 55, 78;
  --atmo-strength: .075;
}

body.atmo-hurt {
  --atmo-rgb: 70, 38, 54;
  --atmo-strength: .055;
}

body.atmo-call {
  --atmo-rgb: 224, 132, 151;
  --atmo-strength: .17;
}

body.atmo-understanding {
  --atmo-rgb: 191, 100, 127;
  --atmo-strength: .13;
}

body.atmo-finale {
  --atmo-rgb: 223, 110, 137;
  --atmo-strength: .2;
}

.chapter {
  transition: background-color 1.2s ease;
}

.chapter[data-chapter="hurt"] .chapter-title {
  max-width: 42rem;
}

.final-memory {
  position: relative;
  isolation: isolate;
}

.final-memory::before {
  content: "";
  position: absolute;
  inset: 7% 20%;
  z-index: -2;
  border-radius: 50%;
  background: rgba(214, 91, 123, .11);
  filter: blur(65px);
  transform: scale(.72);
  opacity: 0;
  transition: opacity 1.5s var(--ease), transform 2s var(--ease);
}

.final-memory.visible::before {
  opacity: 1;
  transform: scale(1);
}

.final-memory .final-photo,
.final-memory .final-gif {
  opacity: 0;
  filter: blur(12px);
}

.final-memory.visible .final-photo-left {
  animation:
    finalPhotoInLeft 1.35s .15s var(--ease) forwards,
    memoryFloatLeft 6.5s 1.5s ease-in-out infinite alternate;
}

.final-memory.visible .final-gif {
  animation:
    finalGifIn 1.55s .45s var(--ease) forwards,
    finalFloat 5.5s 2s ease-in-out infinite;
}

.final-memory.visible .final-photo-right {
  animation:
    finalPhotoInRight 1.35s .3s var(--ease) forwards,
    memoryFloatRight 7s 1.7s ease-in-out infinite alternate;
}

.final-memory.visible .final-gif::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -3;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 178, 198, .13), transparent 65%);
  filter: blur(25px);
  animation: finalHalo 4s ease-in-out infinite alternate;
}

.final-copy p {
  opacity: .18;
  transform: translateY(7px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), color .7s;
}

.final-copy p.visible {
  opacity: 1;
  transform: none;
}

.final-copy .final-emphasis.visible {
  text-shadow: 0 0 35px rgba(239,179,193,.12);
}

.final-promise {
  position: relative;
}

.final-promise::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--rose);
  transform: translateX(-50%);
  transition: width 1.4s var(--ease);
}

.final-promise.visible::before {
  width: min(16rem, 70%);
}

.final-beat {
  margin: 3rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  color: var(--rose);
  opacity: 0;
  transform: scale(.75);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.final-beat.visible {
  opacity: .9;
  transform: scale(1);
}

.final-beat > span:not(.final-beat-line) {
  font: 1.5rem var(--serif);
}

.final-beat-line {
  display: block;
  width: 4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239,179,193,.6));
}

.final-beat-line:last-child {
  transform: scaleX(-1);
}

.love-ending {
  position: relative;
}

.love-ending h3 b {
  display: inline-block;
  animation: endingHeart 2.4s ease-in-out infinite;
}

@keyframes finalPhotoInLeft {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: rotateY(12deg) rotateZ(-4deg) translate3d(-70px, 3rem, 0) scale(.92);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: rotateY(12deg) rotateZ(-4deg) translate3d(0, 1.5rem, 0) scale(1);
  }
}

@keyframes finalPhotoInRight {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: rotateY(-12deg) rotateZ(4deg) translate3d(70px, -3rem, 0) scale(.92);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: rotateY(-12deg) rotateZ(4deg) translate3d(0, -1.5rem, 0) scale(1);
  }
}

@keyframes finalGifIn {
  0% {
    opacity: 0;
    filter: blur(18px);
    transform: scale(.72) translateY(35px);
  }
  65% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1.045) translateY(-5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }
}

@keyframes finalHalo {
  from { opacity: .4; transform: scale(.86); }
  to { opacity: 1; transform: scale(1.15); }
}

@keyframes endingHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@media (max-width: 760px) {
  .atmosphere { opacity: .8; }

  .atmo-light {
    width: 110vw;
    height: 110vw;
  }

  .final-memory.visible .final-photo-left {
    animation:
      finalPhotoMobileLeft 1.1s .12s var(--ease) forwards;
  }

  .final-memory.visible .final-gif {
    animation:
      finalGifIn 1.3s .3s var(--ease) forwards,
      finalFloat 6.5s 1.7s ease-in-out infinite;
  }

  .final-memory.visible .final-photo-right {
    animation:
      finalPhotoMobileRight 1.1s .22s var(--ease) forwards;
  }

  .final-memory::before {
    inset: 18% 5%;
  }

  .final-beat {
    margin-top: 2rem;
  }

  .final-beat-line { width: 2.2rem; }

  @keyframes finalPhotoMobileLeft {
    from {
      opacity: 0;
      filter: blur(10px);
      transform: rotate(-5deg) translate3d(-35px, 20px, 0) scale(.92);
    }
    to {
      opacity: 1;
      filter: blur(0);
      transform: rotate(-5deg) translate3d(0, 0, 0) scale(1);
    }
  }

  @keyframes finalPhotoMobileRight {
    from {
      opacity: 0;
      filter: blur(10px);
      transform: rotate(5deg) translate3d(35px, 20px, 0) scale(.92);
    }
    to {
      opacity: 1;
      filter: blur(0);
      transform: rotate(5deg) translate3d(0, 0, 0) scale(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere { display: none; }

  .final-memory .final-photo,
  .final-memory .final-gif {
    opacity: 1;
    filter: none;
  }

  .final-memory.visible .final-photo-left,
  .final-memory.visible .final-gif,
  .final-memory.visible .final-photo-right,
  .love-ending h3 b {
    animation: none !important;
  }
}
