@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Italiana&display=swap");

:root {
  --teal-950: #092b2d;
  --teal-900: #10393b;
  --teal-700: #336c6e;
  --teal-300: #8fbfc0;
  --ivory: #fffaf0;
  --paper: #f8efdf;
  --paper-deep: #ecdfc9;
  --rose: #dca3a0;
  --rose-deep: #a85f62;
  --gold: #c7a267;
  --gold-light: #edd7a4;
  --ink: #283737;
  --shadow: rgba(3, 25, 27, 0.32);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--teal-950);
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 185, 184, 0.28), transparent 42%),
    linear-gradient(145deg, var(--teal-900), var(--teal-950));
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 5px;
}

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

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

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

.aurora {
  position: absolute;
  width: min(85vw, 650px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.17;
  animation: aurora-drift 14s var(--ease-soft) infinite alternate;
}

.aurora-one {
  top: -36%;
  left: -25%;
  background: #b9e2df;
}

.aurora-two {
  right: -35%;
  bottom: -38%;
  background: #dba39d;
  animation-delay: -7s;
}

.glow {
  z-index: 3;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(241, 217, 167, 0.1), transparent 68%);
  transition: opacity 600ms ease;
  will-change: transform;
}

body.has-pointer .glow {
  opacity: 1;
}

.mote {
  position: absolute;
  bottom: -24px;
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(239, 222, 188, 0.5);
  border-radius: 50%;
  box-shadow: inset -2px -2px 4px rgba(118, 74, 67, 0.16);
  opacity: 0;
  animation: rise var(--duration) linear var(--delay) infinite;
}

.experience {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  visibility: hidden;
  opacity: 0;
  transform: scale(1.018);
  transition:
    opacity 700ms ease,
    transform 900ms var(--ease-soft),
    visibility 0s linear 900ms;
}

.scene.is-active {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.scene.is-leaving {
  opacity: 0;
  transform: scale(0.975);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Italiana", Georgia, serif;
  font-weight: 400;
}

.scene-envelope {
  grid-template-rows: 1fr auto 1fr;
  text-align: center;
}

.opening-copy {
  align-self: end;
  margin-bottom: clamp(24px, 5vh, 50px);
}

.opening-copy h1 {
  font-size: clamp(3.35rem, 12vw, 6.7rem);
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-shadow: 0 9px 35px rgba(0, 0, 0, 0.2);
}

.whisper {
  margin: 16px 0 0;
  color: rgba(255, 250, 240, 0.63);
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.04em;
}

.envelope {
  position: relative;
  width: min(78vw, 360px);
  aspect-ratio: 1.52;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1100px;
  animation: envelope-float 4s ease-in-out infinite;
}

.envelope-shadow {
  position: absolute;
  right: 10%;
  bottom: -14%;
  left: 10%;
  height: 18%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  filter: blur(18px);
  transition: transform 800ms var(--ease-soft), opacity 800ms ease;
}

.envelope-back,
.envelope-front,
.envelope-flap {
  position: absolute;
  inset: 0;
  border-radius: 5px;
}

.envelope-back {
  background: linear-gradient(135deg, #f5e9d3, #dfccb0);
  box-shadow: 0 28px 70px var(--shadow);
}

.envelope-front {
  z-index: 4;
  overflow: hidden;
  background:
    linear-gradient(33deg, transparent 49.5%, rgba(171, 137, 91, 0.2) 50%, transparent 50.8%),
    linear-gradient(147deg, transparent 49.5%, rgba(171, 137, 91, 0.2) 50%, transparent 50.8%),
    linear-gradient(35deg, #f8ecd7 49.7%, transparent 50%),
    linear-gradient(145deg, #efe0c6 49.7%, transparent 50%),
    linear-gradient(to top, #ead9bc 51%, transparent 51%);
  filter: drop-shadow(0 8px 8px rgba(56, 39, 22, 0.12));
}

.envelope-flap {
  z-index: 5;
  height: 56%;
  border-radius: 5px 5px 16px 16px;
  background: linear-gradient(160deg, #f9eedb, #e8d5b7);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transform-style: preserve-3d;
  transition: transform 1.05s var(--ease-soft), z-index 0s linear 520ms;
}

.envelope-letter {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: 7%;
  left: 8%;
  height: 86%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid rgba(165, 129, 76, 0.28);
  border-radius: 3px;
  color: var(--rose-deep);
  background: var(--ivory);
  box-shadow: 0 5px 20px rgba(81, 57, 33, 0.12);
  transition: transform 1s 500ms var(--ease-soft);
}

.letter-flourish {
  font-family: "Italiana", Georgia, serif;
  font-size: 3rem;
}

.letter-line {
  width: 45%;
  height: 1px;
  background: rgba(65, 71, 65, 0.2);
}

.letter-line.short {
  width: 28%;
}

.wax-seal {
  position: absolute;
  z-index: 6;
  top: 43%;
  left: 50%;
  display: grid;
  width: 55px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 45% 52% 46% 55%;
  color: #f2c9bd;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.25), transparent 20%),
    linear-gradient(145deg, #b65d61, #7f343b);
  box-shadow:
    0 5px 10px rgba(76, 28, 32, 0.35),
    inset 0 0 0 3px rgba(111, 43, 50, 0.3);
  font-family: "Italiana", Georgia, serif;
  font-size: 1.5rem;
  transform: translate(-50%, -50%) rotate(-8deg);
  transition: transform 600ms var(--ease-soft), opacity 400ms ease;
}

.wax-seal::before {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(244, 203, 191, 0.45);
  border-radius: 50%;
  content: "";
}

.envelope.is-open {
  animation: none;
}

.envelope.is-open .envelope-flap {
  z-index: 1;
  transform: rotateX(178deg);
}

.envelope.is-open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -80%) rotate(18deg) scale(0.55);
}

.envelope.is-open .envelope-letter {
  transform: translateY(-63%);
}

.envelope.is-open .envelope-shadow {
  opacity: 0.65;
  transform: scale(0.8);
}

.text-button {
  align-self: start;
  margin-top: 34px;
  padding: 10px 16px;
  border: 0;
  color: rgba(255, 250, 240, 0.7);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.tap-heart {
  display: inline-block;
  margin-left: 7px;
  color: var(--rose);
  font-size: 1rem;
  animation: tiny-pulse 1.8s ease-in-out infinite;
}

.scene-memory {
  overflow-y: auto;
}

.memory-layout {
  display: grid;
  width: min(100%, 860px);
  align-items: center;
  gap: clamp(32px, 7vw, 80px);
}

.polaroid-wrap {
  position: relative;
  justify-self: center;
  width: min(69vw, 315px);
}

.polaroid {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 12px 12px 22px;
  color: var(--ink);
  background: var(--ivory);
  box-shadow: 0 35px 80px rgba(0, 14, 15, 0.38);
  transform: rotate(-3deg);
  animation: photo-arrive 1.2s var(--ease-soft) both;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.7;
  background: #a6cecc;
}

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

.photo-shine {
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.33) 48%,
    transparent 60%
  );
  transform: translateX(-70%);
  animation: photo-shine 5s 1.4s ease-in-out infinite;
}

.polaroid figcaption {
  padding-top: 15px;
  text-align: center;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
}

.orbit {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(237, 215, 164, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-spin 14s linear infinite;
}

.orbit-one {
  width: 125%;
  aspect-ratio: 1;
}

.orbit-two {
  width: 148%;
  aspect-ratio: 1;
  animation-duration: 21s;
  animation-direction: reverse;
}

.orbit i {
  position: absolute;
  top: 8%;
  left: 14%;
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ddc6a0);
  box-shadow: 0 0 20px rgba(245, 221, 176, 0.5);
}

.memory-copy {
  max-width: 460px;
  text-align: center;
}

.memory-copy h2 {
  font-size: clamp(2.1rem, 7vw, 4rem);
  line-height: 1.06;
}

.memory-copy > p:not(.eyebrow) {
  margin: 22px auto 30px;
  max-width: 38ch;
  color: rgba(255, 250, 240, 0.72);
  font-family: Georgia, serif;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.75;
}

.primary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 26px;
  border: 1px solid rgba(240, 217, 167, 0.65);
  border-radius: 100px;
  color: var(--teal-950);
  background: linear-gradient(135deg, #f6e9cd, #d8b97e);
  box-shadow:
    0 15px 35px rgba(0, 20, 21, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 250ms var(--ease-soft), box-shadow 250ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 42px rgba(0, 20, 21, 0.32),
    inset 0 1px rgba(255, 255, 255, 0.7);
}

.primary-button:active {
  transform: translateY(1px) scale(0.98);
}

.scene-cards {
  grid-template-rows: auto 1fr auto;
  gap: clamp(18px, 4vh, 38px);
}

.story-header,
.card-controls {
  display: flex;
  width: min(100%, 660px);
  align-items: center;
  justify-content: space-between;
}

.story-header .eyebrow {
  margin: 0;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 250, 240, 0.55);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.progress-line {
  position: relative;
  width: 75px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.progress-line i {
  position: absolute;
  inset: 0;
  background: var(--gold-light);
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 800ms var(--ease-soft);
}

.card-stage {
  position: relative;
  width: min(88vw, 610px);
  height: min(57vh, 520px);
  min-height: 370px;
  perspective: 1500px;
}

.story-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(44px, 8vw, 80px);
  border: 1px solid rgba(196, 160, 101, 0.45);
  border-radius: 4px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 250, 240, 0.86), rgba(248, 239, 223, 0.94)),
    radial-gradient(circle at 30% 20%, #fff, transparent 35%);
  box-shadow:
    0 35px 90px rgba(0, 12, 13, 0.35),
    inset 0 0 0 8px rgba(255, 255, 255, 0.3);
  text-align: center;
  opacity: 0;
  transform: translateX(45px) rotateY(-9deg) scale(0.94);
  transform-origin: left center;
  transition:
    opacity 600ms ease,
    transform 850ms var(--ease-soft);
  pointer-events: none;
}

.story-card::before {
  position: absolute;
  top: -12%;
  left: -6%;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(141, 193, 190, 0.22), transparent 66%);
  content: "";
}

.story-card.is-current {
  z-index: 3;
  opacity: 1;
  transform: translateX(0) rotateY(0) scale(1);
  pointer-events: auto;
}

.story-card.is-previous {
  z-index: 2;
  opacity: 0;
  transform: translateX(-55%) rotateY(18deg) scale(0.92);
}

.story-card p {
  position: relative;
  z-index: 1;
  margin: 7px 0;
  font-family: Georgia, serif;
  font-size: clamp(1.2rem, 4.7vw, 2.05rem);
  line-height: 1.48;
}

.story-card em {
  color: var(--rose-deep);
  font-weight: 400;
}

.story-card .card-reveal {
  color: #5b7775;
  font-size: clamp(1rem, 3.8vw, 1.55rem);
  font-style: italic;
}

.story-card .card-signature {
  margin-top: 22px;
  color: #87585a;
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(1.45rem, 5.2vw, 2.45rem);
  line-height: 1.25;
}

.card-number {
  position: absolute;
  top: 25px;
  color: rgba(91, 119, 117, 0.5);
  font-family: Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
}

.corner {
  position: absolute;
  width: 55px;
  height: 55px;
  opacity: 0.65;
}

.corner::before,
.corner::after {
  position: absolute;
  background: var(--gold);
  content: "";
}

.corner::before {
  width: 100%;
  height: 1px;
}

.corner::after {
  width: 1px;
  height: 100%;
}

.corner-tl {
  top: 20px;
  left: 20px;
}

.corner-br {
  right: 20px;
  bottom: 20px;
  transform: rotate(180deg);
}

.pearl-mark {
  position: relative;
  width: 32px;
  aspect-ratio: 1;
  margin-top: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fff, #eee1c9 46%, #c4a77c);
  box-shadow:
    0 7px 20px rgba(91, 65, 37, 0.22),
    0 0 35px rgba(211, 170, 112, 0.28);
}

.back-button {
  width: 50px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 50%;
  color: rgba(255, 250, 240, 0.8);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.15rem;
  cursor: pointer;
  transition: opacity 250ms ease, transform 250ms var(--ease-soft);
}

.back-button:disabled {
  opacity: 0.22;
  cursor: default;
}

.back-button:not(:disabled):hover {
  transform: translateX(-2px);
}

.next-button {
  min-width: 195px;
}

.scene-reveal {
  align-content: center;
  text-align: center;
}

.reveal-symbol {
  position: relative;
  width: 120px;
  aspect-ratio: 1;
  margin-bottom: clamp(35px, 7vh, 70px);
}

.ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(236, 214, 164, 0.35);
  border-radius: 50%;
  animation: ring-breathe 3.2s ease-in-out infinite;
}

.ring-two {
  inset: 18px;
  animation-delay: -1.6s;
}

.center-pearl {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff, #e8d7ba 55%, #a9814c);
  box-shadow: 0 0 50px rgba(237, 215, 164, 0.65);
  transform: translate(-50%, -50%);
}

.scene-reveal h2 {
  max-width: 750px;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1.03;
}

.scene-reveal > p:not(.eyebrow, .box-prompt) {
  margin: 20px 0 0;
  color: rgba(255, 250, 240, 0.66);
  font-family: Georgia, serif;
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-style: italic;
}

.golden-thread {
  position: relative;
  width: 1px;
  height: clamp(45px, 8vh, 75px);
  margin: 25px auto 15px;
  overflow: hidden;
  background: rgba(237, 215, 164, 0.2);
}

.golden-thread i {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, var(--gold-light), transparent);
  animation: thread-flow 2.3s ease-in-out infinite;
}

.box-prompt {
  margin: 0 0 30px;
  color: var(--gold-light);
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
}

.found-button {
  animation: button-glow 2.4s ease-in-out infinite;
}

.scene-finale {
  overflow-y: auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.92), transparent 40%),
    linear-gradient(160deg, #fffaf1, #eddcc4);
}

#celebration {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.finale-content {
  position: relative;
  z-index: 1;
  width: min(100%, 700px);
  padding: 30px 0;
  text-align: center;
}

.final-photo {
  width: 92px;
  aspect-ratio: 1;
  margin: 0 auto 30px;
  overflow: hidden;
  border: 4px solid var(--ivory);
  border-radius: 50%;
  box-shadow:
    0 12px 30px rgba(77, 56, 35, 0.18),
    0 0 0 1px rgba(165, 126, 69, 0.22);
}

.final-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 27%;
  transform: scale(1.55);
}

.scene-finale .eyebrow {
  color: #99753f;
}

.scene-finale h2 {
  color: #274747;
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  line-height: 1;
}

.final-message {
  width: min(100%, 520px);
  margin: 27px auto 0;
}

.final-message p {
  margin: 10px 0;
  font-family: Georgia, serif;
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  line-height: 1.7;
}

.love-line {
  margin: 25px 0 18px;
  color: var(--rose-deep);
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

.heart-button {
  position: relative;
  width: 64px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  color: #fff7ee;
  background: linear-gradient(145deg, #ca7b7c, #93494d);
  box-shadow:
    0 12px 25px rgba(137, 66, 70, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.heart-button span {
  display: block;
  font-size: 1.7rem;
  animation: heart-beat 1.6s ease-in-out infinite;
}

.heart-button::before,
.heart-button::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(168, 95, 98, 0.35);
  border-radius: 50%;
  content: "";
  animation: love-ripple 2.2s ease-out infinite;
}

.heart-button::after {
  animation-delay: 1.1s;
}

.forever {
  margin: 20px 0 0;
  color: rgba(40, 55, 55, 0.54);
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
}

.sound-toggle {
  position: fixed;
  z-index: 10;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: rgba(255, 250, 240, 0.7);
  background: rgba(9, 43, 45, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: color 250ms ease, background 250ms ease;
}

.sound-toggle svg {
  width: 17px;
  fill: currentColor;
}

.sound-toggle .sound-on {
  display: none;
}

.sound-toggle.is-on .sound-on {
  display: block;
}

.sound-toggle.is-on .sound-off {
  display: none;
}

.scene-finale ~ .sound-toggle {
  color: var(--teal-900);
}

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

@keyframes aurora-drift {
  to {
    transform: translate(18%, 14%) scale(1.16);
  }
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.8);
  }
  12% {
    opacity: 0.55;
  }
  85% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -112vh, 0) scale(1.15);
  }
}

@keyframes envelope-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg);
  }
  50% {
    transform: translateY(-9px) rotate(0.5deg);
  }
}

@keyframes tiny-pulse {
  50% {
    color: #f3c5bf;
    transform: scale(1.2);
  }
}

@keyframes photo-arrive {
  from {
    opacity: 0;
    transform: translateY(45px) rotate(-9deg) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-3deg) scale(1);
  }
}

@keyframes photo-shine {
  0%,
  45% {
    transform: translateX(-70%);
  }
  70%,
  100% {
    transform: translateX(75%);
  }
}

@keyframes orbit-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes ring-breathe {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.82);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.08);
  }
}

@keyframes thread-flow {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes button-glow {
  50% {
    box-shadow:
      0 15px 42px rgba(222, 185, 119, 0.3),
      0 0 0 8px rgba(237, 215, 164, 0.06);
  }
}

@keyframes heart-beat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.18);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.12);
  }
}

@keyframes love-ripple {
  from {
    opacity: 0.65;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(1.8);
  }
}

@media (min-width: 760px) {
  .memory-layout {
    grid-template-columns: minmax(280px, 0.8fr) minmax(350px, 1fr);
  }

  .memory-copy {
    text-align: left;
  }

  .memory-copy > p:not(.eyebrow) {
    margin-left: 0;
  }
}

@media (max-width: 759px) {
  .story-header {
    padding-right: 48px;
  }

  .story-header .progress {
    flex-shrink: 0;
  }

  .scene-memory {
    display: block;
    padding-top: max(64px, env(safe-area-inset-top));
    padding-bottom: max(34px, env(safe-area-inset-bottom));
  }

  .memory-layout {
    min-height: calc(100svh - 98px);
    align-content: center;
  }

  .card-stage {
    width: min(88vw, 440px);
  }

  .story-card {
    padding: 42px 32px;
  }
}

@media (max-height: 690px) and (max-width: 759px) {
  .opening-copy {
    margin-bottom: 13px;
  }

  .opening-copy h1 {
    font-size: 2.9rem;
  }

  .envelope {
    width: min(66vw, 300px);
  }

  .text-button {
    margin-top: 12px;
  }

  .scene-cards {
    gap: 12px;
    padding-top: 58px;
    padding-bottom: 15px;
  }

  .card-stage {
    height: 54vh;
    min-height: 310px;
  }

  .story-card {
    padding: 36px 28px;
  }

  .story-card p {
    font-size: 1.06rem;
  }

  .story-card .card-signature {
    margin-top: 12px;
    font-size: 1.4rem;
  }

  .card-controls .primary-button {
    min-height: 46px;
  }

  .reveal-symbol {
    width: 90px;
    margin-bottom: 25px;
  }

  .scene-reveal h2 {
    font-size: 2.4rem;
  }

  .golden-thread {
    height: 35px;
    margin: 14px auto 8px;
  }

  .box-prompt {
    margin-bottom: 15px;
  }
}

@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;
  }
}
