:root {
  --green-900: #29462b;
  --green-700: #426f42;
  --green-500: #709a62;
  --green-300: #c7d9bd;
  --brown-900: #4f3625;
  --brown-700: #75513a;
  --brown-500: #a77853;
  --brown-200: #ead8c8;
  --content-width: min(1120px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Patrick Hand", cursive;
  color: var(--brown-900);
  min-height: 100vh;
  background-color: #d9cfbf;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(112, 154, 98, 0.18);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(248, 242, 233, 0.26), rgba(44, 54, 33, 0.2)),
    url("./recursos/img/fondo.jpg");
  background-position: center top;
  background-repeat: repeat-y;
  background-size: 100% auto;
  z-index: -3;
  transform: scale(1.02);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 250, 223, 0.34), transparent 30%),
    radial-gradient(circle at bottom right, rgba(83, 121, 74, 0.22), transparent 28%),
    linear-gradient(to bottom, rgba(248, 244, 236, 0.06), rgba(63, 76, 46, 0.18));
  z-index: -2;
  pointer-events: none;
}

.petals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 420ms ease;
}

.petals--active {
  opacity: 1;
}

.petal {
  position: absolute;
  top: -12%;
  left: var(--left, 50%);
  width: var(--size, 14px);
  height: calc(var(--size, 14px) * 2.15);
  opacity: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 191, 0.98) 0%,
      rgba(248, 214, 62, 0.96) 42%,
      rgba(225, 160, 20, 0.92) 100%
    );
  border-radius: 48% 52% 64% 36% / 8% 8% 92% 92%;
  clip-path: polygon(50% 0%, 64% 7%, 79% 24%, 86% 54%, 74% 86%, 50% 100%, 26% 86%, 14% 54%, 21% 24%, 36% 7%);
  box-shadow:
    inset -2px -4px 5px rgba(173, 112, 10, 0.16),
    inset 1px 1px 3px rgba(255, 252, 221, 0.48),
    0 7px 12px rgba(79, 54, 37, 0.06);
  filter: drop-shadow(0 4px 10px rgba(255, 196, 36, 0.18));
  transform: translate3d(0, 0, 0) rotate(0deg);
  transform-origin: 50% 78%;
}

.petal::before {
  content: "";
  position: absolute;
  inset: 10% 46% 12% 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 242, 150, 0.72), rgba(207, 140, 13, 0.52));
  opacity: 0.55;
}

.petal--lily-a {
  border-radius: 44% 56% 66% 34% / 8% 10% 90% 92%;
  clip-path: polygon(50% 0%, 62% 8%, 77% 25%, 84% 56%, 72% 87%, 50% 100%, 28% 87%, 16% 56%, 23% 25%, 38% 8%);
}

.petal--lily-b {
  border-radius: 56% 44% 34% 66% / 10% 8% 92% 90%;
  clip-path: polygon(50% 0%, 68% 7%, 82% 22%, 88% 50%, 76% 84%, 50% 100%, 24% 84%, 12% 50%, 18% 22%, 32% 7%);
  background:
    linear-gradient(
      180deg,
      rgba(255, 245, 176, 0.98) 0%,
      rgba(244, 207, 48, 0.96) 44%,
      rgba(219, 150, 18, 0.92) 100%
    );
}

.petal--lily-c {
  border-radius: 50% 50% 70% 30% / 8% 8% 92% 88%;
  clip-path: polygon(50% 0%, 61% 6%, 74% 20%, 82% 46%, 78% 77%, 50% 100%, 22% 77%, 18% 46%, 26% 20%, 39% 6%);
  background:
    linear-gradient(
      180deg,
      rgba(255, 250, 198, 0.98) 0%,
      rgba(250, 216, 72, 0.96) 40%,
      rgba(231, 166, 28, 0.92) 100%
    );
}

.petals--active .petal {
  animation-name: petalFall;
  animation-duration: var(--duration, 12s);
  animation-delay: var(--delay, 0s);
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

a,
button {
  font: inherit;
}

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

.page {
  width: 100%;
  overflow-x: clip;
}

.hero__copy,
.hero__visual,
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 38px, 0) scale(0.985);
  transition:
    opacity 720ms ease,
    transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.hero__card > *,
.memory > *,
.memory__media > *,
.letter-panel > *,
.final-letter__sheet > * {
  min-width: 0;
}

.page--ready .hero__copy,
.page--ready .hero__visual,
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.page--ready .hero__visual {
  transition-delay: 120ms;
}

.section {
  width: var(--content-width);
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 32px;
  padding-bottom: 56px;
}

.hero__card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(112, 154, 98, 0.17);
  color: var(--green-900);
  border: 1px solid rgba(66, 111, 66, 0.18);
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.03em;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.94;
  color: var(--brown-900);
  text-wrap: balance;
}

.hero h1 .accent {
  color: var(--green-700);
  text-shadow: 2px 2px 0 rgba(255, 248, 235, 0.5);
}

.hero__lead {
  margin: 0 0 24px;
  max-width: 52ch;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255, 249, 240, 0.32);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff8ec;
  box-shadow: 0 16px 30px rgba(66, 111, 66, 0.26);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 34px rgba(66, 111, 66, 0.33);
  filter: saturate(1.08);
}

.button:focus-visible,
.letter-trigger:focus-visible {
  outline: 3px solid rgba(112, 154, 98, 0.48);
  outline-offset: 4px;
}

.hero__note {
  color: var(--brown-700);
  font-size: 1.15rem;
}

.hero__visual {
  position: relative;
  min-height: 520px;
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  inset: 10% 8% 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 212, 0.72) 0%, rgba(255, 246, 212, 0.08) 56%, transparent 72%);
  filter: blur(10px);
}

.float-card {
  position: absolute;
  --tx: 0px;
  --ty: 0px;
  --rotate: 0deg;
  --hover-lift: 0px;
  --scale: 1;
  transform: translate3d(var(--tx), calc(var(--ty) + var(--hover-lift)), 0)
    rotate(var(--rotate)) scale(var(--scale));
  transition: transform 220ms ease, filter 220ms ease;
  will-change: transform;
}

.float-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(52, 46, 25, 0.26));
}

.page--ready .float-card--flower img {
  animation:
    driftFlower 8.2s ease-in-out infinite,
    heroFlowerSpin 24s linear infinite;
}

.page--ready .float-card--photo img {
  animation: driftPhoto 7.2s ease-in-out infinite;
}

.float-card--flower {
  width: clamp(200px, 38vw, 340px);
  left: -4%;
  top: 6%;
}

.float-card--photo {
  width: clamp(190px, 34vw, 310px);
  right: 2%;
  bottom: 5%;
}

.hero__stamp {
  position: absolute;
  right: 6%;
  top: 10%;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(79, 54, 37, 0.12);
  border: 2px dashed rgba(79, 54, 37, 0.4);
  color: var(--brown-700);
  font-size: 1.2rem;
  transform: rotate(7deg);
}

.hero__scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: var(--green-900);
  font-size: 1.16rem;
}

.hero__scroll-cue::before,
.hero__scroll-cue::after {
  content: "✦";
  color: rgba(112, 154, 98, 0.82);
  animation: blink 1.6s ease-in-out infinite;
}

.memories {
  display: grid;
  gap: 42px;
}

.memory {
  padding: 12px 0;
  display: grid;
  gap: 18px;
}

.memory--split {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.92fr);
  align-items: center;
}

.memory--split.reverse {
  grid-template-columns: minmax(240px, 0.92fr) minmax(0, 1fr);
}

.memory--split.reverse .memory__media {
  order: -1;
}

.memory h2 {
  margin: 0 0 10px;
  color: var(--green-900);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.96;
}

.memory p {
  margin: 0;
  max-width: 37ch;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255, 249, 240, 0.3);
  overflow-wrap: anywhere;
}

.memory__intro {
  max-width: 52rem;
}

.memory__label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brown-700);
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  position: relative;
}

.memory__label::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 140px;
  height: 2px;
  margin-top: 4px;
  background: linear-gradient(90deg, rgba(112, 154, 98, 0.88), transparent);
}

.memory__media {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 12px 6px 6px;
}

.memory__media::before {
  content: "";
  position: absolute;
  inset: 6% 6%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 212, 0.62) 0%, rgba(255, 246, 212, 0.08) 60%, transparent 76%);
  filter: blur(10px);
}

.memory__media--single {
  grid-template-columns: minmax(0, 1fr);
}

.memory__media--trio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory__media--trio::before {
  display: none;
}

.memory__media--photo-wall {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding-top: 18px;
}

.memory__media--photo-wall::before {
  inset: 10% 12%;
  background:
    radial-gradient(circle, rgba(255, 242, 190, 0.54) 0%, rgba(255, 242, 190, 0.12) 48%, transparent 70%),
    radial-gradient(circle at bottom right, rgba(112, 154, 98, 0.14), transparent 34%);
  filter: blur(14px);
}

.frame {
  position: relative;
  min-height: 220px;
  margin: 0;
}

.frame > img,
.letter-keepsake__frame > img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 18px 36px rgba(52, 46, 25, 0.24));
  transition: transform 220ms ease, filter 220ms ease;
}

.frame--contain > img {
  object-fit: contain;
  padding: 0;
}

.frame__caption {
  position: static;
  margin-top: 8px;
  padding: 0;
  color: var(--brown-700);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.memory__media .frame:nth-child(odd) {
  transform: rotate(-2deg);
}

.memory__media .frame:nth-child(even) {
  transform: rotate(2deg);
}

.frame--drift-0 > img,
.frame--drift-0 .photo-frame__media > img:first-child,
.frame--drift-0 .letter-keepsake__frame > img {
  animation: mediaFloatA 6.6s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.frame--drift-1 > img,
.frame--drift-1 .photo-frame__media > img:first-child,
.frame--drift-1 .letter-keepsake__frame > img {
  animation: mediaFloatB 7.4s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.frame--drift-2 > img,
.frame--drift-2 .photo-frame__media > img:first-child,
.frame--drift-2 .letter-keepsake__frame > img {
  animation: mediaFloatC 6.9s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.frame--drift-5 > img,
.frame--drift-5 .photo-frame__media > img:first-child,
.frame--drift-5 .letter-keepsake__frame > img {
  animation: mediaFloatD 5.6s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.frame--flower-bloom {
  isolation: isolate;
}

.frame--flower-bloom::after,
.frame--flower-twirl::after {
  content: "";
  position: absolute;
  inset: 12% 10%;
  z-index: -1;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.memory.is-visible .frame--flower-bloom::after {
  background: radial-gradient(circle, rgba(255, 240, 172, 0.58) 0%, rgba(255, 240, 172, 0.08) 58%, transparent 76%);
  animation: flowerGlowBloom 1.9s ease-out 0.12s both;
}

.memory.is-visible .frame--flower-bloom > img {
  animation:
    flowerBloomEntrance 1.35s cubic-bezier(0.18, 0.88, 0.22, 1) both,
    flowerBloomFloat 7.8s ease-in-out 1.35s infinite;
}

.frame--flower-twirl {
  isolation: isolate;
}

.memory.is-visible .frame--flower-twirl::after {
  background: radial-gradient(circle, rgba(193, 223, 169, 0.46) 0%, rgba(193, 223, 169, 0.08) 58%, transparent 76%);
  animation: flowerGlowTwirl 2.2s ease-out 0.16s both;
}

.memory.is-visible .frame--flower-twirl > img {
  animation:
    flowerTwirlEntrance 1.55s cubic-bezier(0.18, 0.88, 0.22, 1) both,
    flowerTwirlFloat 8.4s ease-in-out 1.55s infinite;
}

.frame--flower-sway {
  isolation: isolate;
}

.memory.is-visible .frame--flower-sway::after {
  background: radial-gradient(circle, rgba(255, 235, 156, 0.42) 0%, rgba(255, 235, 156, 0.06) 58%, transparent 76%);
  animation: flowerGlowSway 2.4s ease-out 0.18s both;
}

.memory.is-visible .frame--flower-sway > img {
  animation:
    flowerSwayEntrance 1.1s cubic-bezier(0.18, 0.88, 0.22, 1) both,
    flowerSwayFloat 5.2s ease-in-out 1.1s infinite;
}

.photo-frame {
  min-height: 0;
  padding: 12px 12px 16px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(243, 233, 220, 0.94));
  border: 1px solid rgba(117, 81, 58, 0.12);
  box-shadow:
    0 18px 34px rgba(79, 54, 37, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
  transform: rotate(var(--frame-tilt, 0deg));
}

.photo-frame::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 68px;
  height: 18px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(227, 210, 178, 0.74);
  border: 1px solid rgba(151, 121, 91, 0.14);
  box-shadow: 0 4px 10px rgba(79, 54, 37, 0.08);
}

.photo-frame__media {
  aspect-ratio: var(--photo-ratio, 4 / 5);
  overflow: hidden;
  background: rgba(229, 217, 202, 0.52);
  position: relative;
}

.photo-frame__media > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.08) saturate(0.97) contrast(0.98);
  transition: transform 220ms ease, filter 220ms ease;
}

.photo-frame__sticker {
  position: absolute;
  width: clamp(58px, 18%, 82px);
  height: auto;
  z-index: 2;
  filter: drop-shadow(0 8px 18px rgba(79, 54, 37, 0.18));
  pointer-events: none;
}

.photo-frame__sticker--flower {
  width: clamp(52px, 16%, 74px);
}

.photo-frame__sticker--top-left {
  top: 6px;
  left: 4px;
  transform: rotate(-8deg);
}

.photo-frame__sticker--top-right {
  top: 4px;
  right: 4px;
  transform: rotate(8deg);
}

.photo-frame__sticker--bottom-left {
  left: 4px;
  bottom: 2px;
  transform: rotate(-10deg);
}

.photo-frame__sticker--bottom-right {
  right: 4px;
  bottom: 2px;
  transform: rotate(9deg);
}

.photo-frame--tall {
  grid-column: span 3;
}

.photo-frame--small {
  grid-column: span 2;
}

.photo-frame--wide {
  grid-column: span 4;
}

.photo-frame--square {
  grid-column: span 3;
}

.quote-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quote-chip {
  padding: 16px 18px;
  border-radius: 999px;
  background: rgba(252, 248, 239, 0.2);
  border: 1px solid rgba(117, 81, 58, 0.08);
  color: var(--brown-900);
  font-size: 1.15rem;
  backdrop-filter: blur(3px);
  overflow-wrap: anywhere;
}

.letter-panel {
  padding: 12px 0 8px;
  text-align: center;
}

.letter-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(2.3rem, 4.6vw, 3.3rem);
  color: var(--green-900);
}

.letter-panel p {
  margin: 0 auto 22px;
  max-width: 32ch;
  font-size: clamp(1.18rem, 2.2vw, 1.5rem);
}

.letter-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: min(360px, 100%);
  margin: 0 auto;
  animation: heartbeat 1.8s ease-in-out infinite;
  transition: transform 200ms ease, filter 200ms ease;
}

.letter-trigger:hover {
  transform: translateY(-6px) scale(1.03);
  filter: saturate(1.05);
}

.letter-trigger img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(67, 50, 36, 0.26));
  animation: letterDrift 6.8s ease-in-out infinite;
}

.letter-trigger__hint {
  margin-top: 10px;
  color: var(--brown-700);
  font-size: 1.14rem;
}

.final-letter {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 0;
  min-height: 350px;
  background: transparent;
  box-shadow: none;
}

.final-letter__sheet {
  position: relative;
  padding: 60px 52px 46px 78px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(241, 231, 212, 0.96)),
    radial-gradient(circle at top left, rgba(255, 248, 231, 0.56), transparent 34%),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 35px,
      rgba(117, 81, 58, 0.055) 36px,
      transparent 37px
    );
  border-radius: 6px;
  border: 1px solid rgba(117, 81, 58, 0.1);
  box-shadow:
    0 26px 60px rgba(79, 54, 37, 0.16),
    inset 0 1px 0 rgba(255, 252, 245, 0.72);
  overflow: hidden;
  transform: rotate(-0.35deg);
}

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

.final-letter__sheet::before {
  top: 0;
  left: 54px;
  bottom: 0;
  width: 2px;
  background: rgba(164, 88, 78, 0.26);
}

.final-letter__sheet::after {
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  background:
    linear-gradient(135deg, rgba(212, 194, 166, 0.9) 0%, rgba(212, 194, 166, 0.9) 49%, transparent 50%);
  box-shadow: -1px 1px 0 rgba(117, 81, 58, 0.08);
}

.final-letter h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--green-900);
  font-size: clamp(2.1rem, 4vw, 3rem);
  letter-spacing: 0.02em;
}

.final-letter__header {
  text-align: left;
  margin-bottom: 22px;
}

.final-letter__kicker {
  margin: 0 0 10px;
  color: rgba(79, 54, 37, 0.74);
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.final-letter__divider {
  width: min(180px, 40%);
  height: 1px;
  margin: 14px 0 0;
  background: linear-gradient(90deg, rgba(117, 81, 58, 0.42), transparent);
}

.final-letter__content {
  white-space: pre-line;
  font-size: clamp(1.22rem, 2.4vw, 1.65rem);
  line-height: 1.62;
  color: rgba(73, 48, 33, 0.94);
  max-width: 34ch;
  overflow-wrap: anywhere;
}

.final-letter__postscript {
  margin-top: 26px;
  color: rgba(117, 81, 58, 0.88);
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  text-align: left;
  max-width: 36ch;
}

.final-letter__signature {
  margin-top: 22px;
  text-align: right;
  color: rgba(96, 66, 46, 0.82);
  font-size: clamp(1.1rem, 2vw, 1.28rem);
}

.final-letter__signature span {
  display: inline-block;
  padding-top: 10px;
  border-top: 1px solid rgba(117, 81, 58, 0.2);
  min-width: 180px;
  text-align: center;
}

.letter-keepsake {
  position: relative;
  width: min(280px, 72%);
  margin: 34px 0 0 auto;
  padding: 12px 12px 18px;
  background: linear-gradient(180deg, #fffdf8, #f5eee4);
  border: 1px solid rgba(151, 121, 91, 0.16);
  box-shadow:
    0 16px 28px rgba(79, 54, 37, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.72) inset;
  transform: rotate(3.5deg);
}

.letter-keepsake::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(227, 210, 178, 0.7);
  border: 1px solid rgba(151, 121, 91, 0.12);
  box-shadow: 0 4px 10px rgba(79, 54, 37, 0.08);
}

.letter-keepsake__frame {
  aspect-ratio: 4 / 4.8;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(236, 223, 204, 0.34), rgba(206, 188, 160, 0.12));
}

.letter-keepsake__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.12) saturate(0.92) contrast(0.98);
}

.letter-keepsake--full-photo {
  width: min(360px, 82%);
  margin: 34px auto 0;
  transform: rotate(1.8deg);
}

.letter-keepsake--full-photo .letter-keepsake__frame {
  aspect-ratio: 9 / 16;
  background: linear-gradient(180deg, rgba(248, 241, 231, 0.92), rgba(233, 221, 204, 0.82));
}

.letter-keepsake--full-photo .letter-keepsake__frame img {
  object-fit: contain;
  padding: 6px;
}

.letter-keepsake__caption {
  margin-top: 12px;
  text-align: center;
  color: rgba(79, 54, 37, 0.86);
  font-size: clamp(1rem, 1.8vw, 1.14rem);
  letter-spacing: 0.02em;
}

.letter-keepsake__collection {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
  align-items: start;
}

.letter-keepsake--mini {
  width: auto;
  margin: 0;
  padding: 12px 12px 16px;
  transform: rotate(var(--keepsake-tilt, 0deg));
}

.letter-keepsake--mini .letter-keepsake__frame {
  aspect-ratio: 4 / 5;
}

.cursor {
  display: inline-block;
  width: 0.8ch;
  color: var(--green-700);
  animation: blink 1s step-end infinite;
}

.footer-note {
  text-align: center;
  color: #f8ecdc;
  text-shadow: 0 2px 8px rgba(59, 41, 24, 0.66);
  font-size: 1.18rem;
  padding-bottom: 50px;
}

.scroll-guide {
  position: fixed;
  right: 14px;
  bottom: 20px;
  z-index: 20;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.scroll-guide__sparkles {
  color: rgba(255, 244, 209, 0.95);
  text-shadow: 0 0 10px rgba(255, 243, 196, 0.72);
  font-size: 1rem;
  animation: blink 1.8s ease-in-out infinite;
}

.scroll-guide__button {
  appearance: none;
  border: 1px solid rgba(117, 81, 58, 0.08);
  background: rgba(252, 248, 239, 0.38);
  color: var(--green-900);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(79, 54, 37, 0.08);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
  touch-action: manipulation;
}

.scroll-guide__button:hover,
.scroll-guide__button:focus-visible {
  transform: translateY(-3px);
  background: rgba(112, 154, 98, 0.88);
  color: #fff8ec;
}

@keyframes petalFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }
  10% {
    opacity: 0.82;
  }
  50% {
    transform: translate3d(var(--drift-a, 30px), 48vh, 0) rotate(140deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-b, -40px), 112vh, 0) rotate(320deg);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  18% {
    transform: scale(1.06);
  }
  34% {
    transform: scale(0.98);
  }
  52% {
    transform: scale(1.08);
  }
  68% {
    transform: scale(1);
  }
}

@keyframes driftFlower {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -10px, 0) rotate(-1.2deg) scale(1.02);
  }
}

@keyframes driftPhoto {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -8px, 0) rotate(1deg) scale(1.018);
  }
}

@keyframes heroFlowerSpin {
  0% {
    rotate: 0deg;
  }
  100% {
    rotate: 360deg;
  }
}

@keyframes mediaFloatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -12px, 0) rotate(-1.5deg) scale(1.02);
  }
}

@keyframes mediaFloatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -10px, 0) rotate(1.4deg) scale(1.024);
  }
}

@keyframes mediaFloatC {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) rotate(-1deg) scale(1.022);
  }
}

@keyframes mediaFloatD {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  30% {
    transform: translate3d(0, -12px, 0) rotate(2.8deg) scale(1.024);
  }
  68% {
    transform: translate3d(0, -20px, 0) rotate(-3.6deg) scale(1.03);
  }
}

@keyframes flowerBloomEntrance {
  0% {
    transform: translate3d(-12px, 24px, 0) rotate(-12deg) scale(0.78);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(255, 232, 150, 0));
  }
  55% {
    transform: translate3d(4px, -10px, 0) rotate(4deg) scale(1.08);
    opacity: 1;
    filter: drop-shadow(0 22px 44px rgba(255, 226, 131, 0.3));
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
    filter: drop-shadow(0 18px 36px rgba(52, 46, 25, 0.24));
  }
}

@keyframes flowerBloomFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -16px, 0) rotate(-2.2deg) scale(1.03);
  }
}

@keyframes flowerGlowBloom {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  45% {
    opacity: 0.95;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.3;
    transform: scale(1.16);
  }
}

@keyframes flowerTwirlEntrance {
  0% {
    transform: translate3d(16px, 30px, 0) rotate(16deg) scale(0.74);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(193, 223, 169, 0));
  }
  52% {
    transform: translate3d(-3px, -8px, 0) rotate(-7deg) scale(1.06);
    opacity: 1;
    filter: drop-shadow(0 24px 48px rgba(137, 177, 120, 0.28));
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
    filter: drop-shadow(0 18px 36px rgba(52, 46, 25, 0.24));
  }
}

@keyframes flowerTwirlFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  35% {
    transform: translate3d(0, -10px, 0) rotate(2.8deg) scale(1.02);
  }
  68% {
    transform: translate3d(0, -15px, 0) rotate(-2.4deg) scale(1.03);
  }
}

@keyframes flowerGlowTwirl {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  40% {
    opacity: 0.9;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.24;
    transform: scale(1.18);
  }
}

@keyframes flowerSwayEntrance {
  0% {
    transform: translate3d(-14px, 30px, 0) rotate(-18deg) scale(0.72);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(255, 229, 127, 0));
  }
  58% {
    transform: translate3d(8px, -14px, 0) rotate(11deg) scale(1.1);
    opacity: 1;
    filter: drop-shadow(0 28px 52px rgba(255, 220, 120, 0.32));
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
    filter: drop-shadow(0 18px 36px rgba(52, 46, 25, 0.24));
  }
}

@keyframes flowerSwayFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  28% {
    transform: translate3d(0, -14px, 0) rotate(4.2deg) scale(1.03);
  }
  62% {
    transform: translate3d(0, -22px, 0) rotate(-4.8deg) scale(1.04);
  }
}

@keyframes flowerGlowSway {
  0% {
    opacity: 0;
    transform: scale(0.58);
  }
  42% {
    opacity: 0.9;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.22;
    transform: scale(1.2);
  }
}

@keyframes letterDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(0, -10px, 0) rotate(1.2deg) scale(1.02);
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .hero__card,
  .memory--split,
  .memory--split.reverse {
    grid-template-columns: 1fr;
  }

  .memory--split.reverse .memory__media {
    order: 0;
  }

  .hero__visual {
    width: min(100%, 420px);
    min-height: 430px;
    margin: 0 auto;
  }

  .float-card--flower {
    left: 2%;
    top: 0;
  }

  .float-card--photo {
    right: 2%;
    bottom: 0;
  }

  .quote-strip {
    grid-template-columns: 1fr;
  }

  .memory__media--trio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory__media--photo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-frame--tall,
  .photo-frame--small,
  .photo-frame--wide,
  .photo-frame--square {
    grid-column: span 1;
  }

  .letter-keepsake__collection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body::before {
    background-size: cover;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 38px 0;
  }

  .hero__card {
    min-height: 0;
    gap: 16px;
  }

  .hero__visual {
    min-height: 360px;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 13vw, 3.7rem);
  }

  .hero__lead {
    font-size: clamp(1.08rem, 5vw, 1.35rem);
  }

  .hero__stamp {
    position: static;
    display: inline-flex;
    margin-top: 12px;
    top: 4%;
    right: 2%;
    font-size: 1rem;
    transform: rotate(3deg);
  }

  .float-card--flower,
  .float-card--photo {
    width: min(48vw, 220px);
  }

  .float-card--flower {
    left: 0;
    top: 0;
  }

  .float-card--photo {
    right: 0;
    bottom: 8px;
  }

  .cta-row {
    align-items: stretch;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .memory__media {
    grid-template-columns: 1fr;
  }

  .memory__media--trio {
    grid-template-columns: 1fr;
  }

  .memory__media--photo-wall,
  .letter-keepsake__collection {
    grid-template-columns: 1fr;
  }

  .final-letter {
    padding: 0;
  }

  .final-letter__sheet {
    padding: 42px 20px 30px 28px;
  }

  .final-letter__sheet::before {
    left: 20px;
  }

  .final-letter__content,
  .final-letter__postscript {
    max-width: none;
  }

  .letter-keepsake {
    width: min(290px, 100%);
    margin: 28px auto 0;
    transform: rotate(2deg);
  }

  .letter-keepsake--full-photo {
    width: min(320px, 100%);
    transform: rotate(1.2deg);
  }

  .letter-keepsake--mini {
    width: 100%;
    margin: 0;
    transform: rotate(var(--keepsake-tilt, 0deg));
  }

  .frame {
    min-height: 200px;
  }

  .quote-chip {
    border-radius: 28px;
  }

  .scroll-guide {
    right: 10px;
    bottom: 14px;
  }

  .scroll-guide__button {
    width: 44px;
    height: 44px;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .hero__copy,
  .hero__visual,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
