:root {
  --bg-main: #ffeaf3;
  --bg-second: #ffdce9;
  --accent: #ff4f97;
  --accent-deep: #d63a7d;
  --paper: #fff7fb;
  --paper-edge: #ffd5e6;
  --shadow: rgba(210, 71, 127, 0.22);
  --shadow-strong: rgba(175, 42, 98, 0.3);
  --text-soft: #b84d7e;
  --page-side-padding: 24px;
  --page-top-padding: 24px;
  --bouquet-sink: clamp(110px, 17vh, 168px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: var(--page-top-padding) var(--page-side-padding) 0;
  font-family: "Cormorant Garamond", serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.68), transparent 24%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.58), transparent 20%),
    radial-gradient(circle at 50% 60%, rgba(255, 206, 227, 0.42), transparent 42%),
    linear-gradient(180deg, var(--bg-main) 0%, #ffd8e9 100%);
  color: var(--accent-deep);
}

body.note-open {
  overflow: hidden;
}

.gift-scene {
  position: relative;
  width: min(100%, 780px);
  min-height: calc(100vh - var(--page-top-padding));
  min-height: calc(100svh - var(--page-top-padding));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.headline {
  margin: 0;
  text-align: center;
  font-size: clamp(3.3rem, 9vw, 6.4rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-wrap: balance;
  text-shadow:
    0 8px 24px rgba(255, 99, 164, 0.16),
    0 2px 0 rgba(255, 255, 255, 0.5);
}

.bouquet-stage {
  position: relative;
  width: min(100%, 680px);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: clamp(8px, 2vw, 20px);
}

.bouquet-visual {
  position: relative;
  width: min(100%, 540px);
  margin: 0 auto calc(var(--bouquet-sink) * -1);
  padding-bottom: clamp(18px, 4vw, 30px);
  transform-origin: center bottom;
  will-change: transform, opacity;
  animation: bouquet-rise 1.35s cubic-bezier(0.18, 0.88, 0.22, 1.01) 120ms both;
}

.bouquet-glow {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 72%;
  height: 36%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 186, 214, 0.42) 0%, rgba(255, 186, 214, 0) 72%);
  filter: blur(16px);
  z-index: 0;
}

.bouquet-guest {
  position: absolute;
  left: 50%;
  bottom: 83%;
  width: min(100%, 540px);
  opacity: 0;
  transform: translate3d(-50%, 34%, 0) scale(0.94);
  transform-origin: center bottom;
  pointer-events: none;
  z-index: 1;
  will-change: transform, opacity;
  animation: guest-peek 1.05s cubic-bezier(0.22, 0.9, 0.24, 1) 1.05s both;
}

.bouquet-guest__image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(122, 44, 77, 0.16));
}

.bouquet-photo {
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(340px, 58vw, 510px);
  height: auto;
  margin: 0 auto;
  transform: translateY(-7%) scale(1.12);
  transform-origin: center center;
  filter:
    saturate(1.02)
    drop-shadow(0 26px 38px rgba(170, 67, 107, 0.18));
}

.note-button {
  position: absolute;
  left: 74%;
  top: 58%;
  width: clamp(72px, 11.5vw, 90px);
  aspect-ratio: 0.82;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(8deg);
  z-index: 4;
  transition: transform 300ms ease, opacity 220ms ease;
}

.note-button:hover,
.note-button:focus-visible {
  transform: translate(-50%, -56%) rotate(11deg) scale(1.04);
}

.note-button:focus-visible {
  outline: none;
}

.note-button[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}

.note-button__paper {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.12)),
    linear-gradient(135deg, #fffdfd 0%, #ffe9f2 100%);
  box-shadow:
    0 18px 28px rgba(191, 78, 119, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.note-button__paper::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #ffd8e7 0%, #fff9fd 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  border-top-right-radius: 14px;
}

.note-button__paper::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 119, 171, 0.25);
}

.note-button__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 8px;
  font-size: clamp(1.1rem, 2.9vw, 1.45rem);
  font-family: "Marck Script", cursive;
  color: var(--accent-deep);
}

.page-glow {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 68%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 0;
}

.page-glow--left {
  top: -8vw;
  left: -8vw;
}

.page-glow--right {
  right: -10vw;
  bottom: 4vh;
}

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.petal {
  position: absolute;
  width: 18px;
  height: 28px;
  border-radius: 60% 40% 60% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 171, 208, 0.92));
  box-shadow: 0 8px 16px rgba(212, 84, 135, 0.14);
  opacity: 0.72;
  animation: drift 14s linear infinite;
}

.petal--1 {
  top: 8%;
  left: 18%;
  animation-delay: -2s;
}

.petal--2 {
  top: 12%;
  right: 20%;
  width: 14px;
  height: 22px;
  animation-delay: -7s;
}

.petal--3 {
  top: 36%;
  left: 8%;
  width: 16px;
  height: 24px;
  animation-delay: -4s;
}

.petal--4 {
  top: 42%;
  right: 11%;
  animation-delay: -10s;
}

.petal--5 {
  top: 58%;
  left: 26%;
  width: 13px;
  height: 20px;
  animation-delay: -12s;
}

.petal--6 {
  top: 70%;
  right: 28%;
  width: 16px;
  height: 26px;
  animation-delay: -5s;
}

.letter-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 10;
}

.letter-overlay[hidden] {
  display: none;
}

.letter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 223, 237, 0.48);
  backdrop-filter: blur(7px);
}

.letter-card {
  position: relative;
  width: min(92vw, 620px);
  perspective: 1600px;
  isolation: isolate;
  opacity: 0;
  transform: translateY(36px) scale(0.78) rotate(-10deg);
  transform-origin: center;
  transition:
    opacity 320ms ease,
    transform 700ms cubic-bezier(0.2, 0.92, 0.2, 1);
}

.letter-overlay.is-open .letter-card {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(-2deg);
}

.letter-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 4;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-soft);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(186, 79, 123, 0.12);
}

.letter-surprise {
  --surprise-open-transform: translate3d(93px, -78px, 0) rotate(5deg) scale(1);
  position: absolute;
  right: -92px;
  bottom: -22px;
  width: min(44vw, 250px);
  opacity: 0;
  transform: translate3d(63px, 228px, 0) rotate(9deg) scale(0.82);
  transform-origin: center bottom;
  transition:
    opacity 280ms ease,
    transform 520ms cubic-bezier(0.22, 0.9, 0.24, 1),
    filter 280ms ease;
  filter: drop-shadow(0 14px 24px rgba(133, 47, 83, 0.16));
  pointer-events: none;
  z-index: 1;
}

.letter-surprise__image {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(90deg);
  transform-origin: center;
}

.letter-fold {
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #ffd5e7 0%, #ffc3dc 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform-origin: top center;
  transition: transform 820ms cubic-bezier(0.21, 0.9, 0.27, 1);
  z-index: 2;
}

.letter-overlay.is-open .letter-fold {
  transform: rotateX(-180deg);
}

.letter-paper {
  position: relative;
  overflow: hidden;
  padding: 86px clamp(24px, 6vw, 46px) clamp(34px, 7vw, 54px);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 32%),
    linear-gradient(180deg, var(--paper) 0%, #ffeef6 100%);
  box-shadow:
    0 28px 48px rgba(186, 67, 112, 0.22),
    inset 0 0 0 1px rgba(255, 210, 229, 0.8);
  transform-origin: top center;
  transform: rotateX(-88deg) translateY(-34px);
  opacity: 0;
  z-index: 3;
  transition:
    transform 780ms cubic-bezier(0.2, 0.94, 0.24, 0.98),
    opacity 320ms ease;
}

.letter-overlay.is-open .letter-paper {
  transform: rotateX(0deg) translateY(0);
  opacity: 1;
  transition-delay: 160ms;
}

.letter-paper::before,
.letter-paper::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 143, 188, 0.18);
  filter: blur(1px);
}

.letter-paper::before {
  width: 76px;
  height: 76px;
  top: 22px;
  left: 18px;
}

.letter-paper::after {
  width: 54px;
  height: 54px;
  right: 24px;
  bottom: 22px;
}

.letter-message {
  margin: 0;
  text-align: center;
  min-height: clamp(132px, 24vw, 172px);
  display: grid;
  place-items: center;
}

.writing-line {
  display: inline-block;
  max-width: 15ch;
  white-space: pre-wrap;
  font-family: "Marck Script", cursive;
  font-size: clamp(2.3rem, 5.8vw, 3.9rem);
  line-height: 1.12;
  color: var(--accent-deep);
  text-shadow: 0 3px 14px rgba(255, 130, 183, 0.15);
}

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

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(12px, 22px, 0) rotate(20deg);
  }
  100% {
    transform: translate3d(-8px, 48px, 0) rotate(46deg);
  }
}

@keyframes bouquet-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, calc(100% + var(--bouquet-sink)), 0);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes guest-peek {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 38%, 0) scale(0.92);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@media (max-width: 640px) {
  :root {
    --page-side-padding: 18px;
    --page-top-padding: 18px;
    --bouquet-sink: clamp(86px, 14vh, 124px);
  }

  body {
    padding: var(--page-top-padding) var(--page-side-padding) 0;
  }

  .bouquet-stage {
    width: min(100%, 560px);
  }

  .note-button {
    left: 73%;
    top: 60%;
    width: clamp(68px, 18vw, 84px);
  }

  .bouquet-photo {
    width: clamp(320px, 84vw, 430px);
  }

  .bouquet-guest {
    bottom: 80%;
    width: min(112%, 390px);
  }

  .letter-close {
    top: 12px;
    right: 12px;
    font-size: 0.95rem;
  }

  .letter-surprise {
    --surprise-open-transform: translate3d(85px, -8px, 0) rotate(5deg) scale(1);
    right: -58px;
    bottom: -16px;
    width: min(46vw, 176px);
  }

  .letter-paper {
    padding-top: 76px;
  }

  .writing-line {
    max-width: 12ch;
  }
}

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