:root {
  --pink-50: #fff0f5;
  --pink-100: #ffe5ec;
  --pink-200: #ffd6e7;
  --pink-300: #ffc2d1;
  --pink-400: #ffb3d1;
  --pink-500: #ff8fb1;
  --cream: #fffaf3;
  --ink: #5b3f49;
  --muted: #8a6874;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(255, 143, 177, 0.24);
  --paper-shadow: 0 14px 35px rgba(129, 73, 91, 0.14);
  --radius-lg: 34px;
  --radius-md: 24px;
  --font-title: "Pacifico", "Brush Script MT", cursive;
  --font-body: "Poppins", "Nunito", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.95) 0 9%, transparent 10%),
    radial-gradient(circle at 82% 6%, rgba(255, 214, 231, 0.7) 0 12%, transparent 13%),
    linear-gradient(135deg, var(--pink-50), #fff9fb 40%, var(--pink-200));
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 143, 177, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 143, 177, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 86%);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

body.entry-locked {
  overflow: hidden;
}

.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.82), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(255, 179, 209, 0.38), transparent 26%),
    linear-gradient(145deg, var(--pink-200), var(--pink-50) 58%, var(--pink-300));
  transition: opacity 420ms ease, visibility 420ms ease;
}

.entry-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-card {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
  padding: clamp(34px, 7vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(16px);
}

.entry-logo {
  display: block;
  width: clamp(96px, 22vw, 150px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(255, 143, 177, 0.28);
}

.entry-card h1 {
  color: #f66f9d;
  font-family: var(--font-title);
  width: min(520px, 100%);
  margin: 12px auto 0;
  font-size: clamp(3.1rem, 8vw, 5.1rem);
  font-weight: 400;
  line-height: 1.06;
  text-shadow: 0 6px 0 rgba(255, 255, 255, 0.78);
}

.entry-card p:not(.eyebrow) {
  margin: 20px auto 28px;
  max-width: 420px;
  text-align: center;
}

.entry-copy {
  padding-top: 10px;
}

.js-enter-site {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
}

.js-enter-site:disabled {
  cursor: wait;
  opacity: 0.72;
}

.section {
  position: relative;
  min-height: 100vh;
  padding: 96px 20px;
}

.section-heading {
  width: min(760px, 100%);
  margin: 0 auto 48px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--pink-500);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1,
h2 {
  font-family: var(--font-title);
  font-weight: 400;
}

h2 {
  font-size: clamp(2.4rem, 7vw, 4.7rem);
}

h3 {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

p {
  color: var(--muted);
  line-height: 1.8;
}

.hero {
  display: grid;
  place-items: center;
  padding-top: 72px;
  background:
    radial-gradient(circle at 20% 78%, rgba(255, 255, 255, 0.76), transparent 26%),
    radial-gradient(circle at 76% 26%, rgba(255, 179, 209, 0.46), transparent 28%),
    linear-gradient(145deg, var(--pink-200), var(--pink-50) 54%, var(--pink-300));
}

.hero-card,
.ending-card {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(34px, 7vw, 68px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(16px);
}

.hero-card::before,
.ending-card::before {
  position: absolute;
  inset: 16px;
  z-index: -1;
  border: 2px dashed rgba(255, 143, 177, 0.32);
  border-radius: calc(var(--radius-lg) - 12px);
  content: "";
}

.title-logo {
  display: block;
  width: clamp(78px, 16vw, 128px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border: 6px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 16px 34px rgba(255, 143, 177, 0.28);
}

.hero-title {
  min-height: 1.35em;
  font-size: clamp(3.25rem, 13vw, 7.8rem);
  line-height: 1.22;
  color: #f66f9d;
  text-shadow: 0 8px 0 rgba(255, 255, 255, 0.8);
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  margin-left: 6px;
  border-radius: 99px;
  background: var(--pink-500);
  animation: blink 0.85s steps(2, start) infinite;
  vertical-align: -0.08em;
}

.hero-copy {
  width: min(520px, 100%);
  margin: 22px auto 32px;
  font-size: 1.03rem;
}

.primary-button,
.soft-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-500), #ff73a4);
  box-shadow: 0 16px 28px rgba(255, 143, 177, 0.38);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.primary-button:hover,
.soft-link:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 38px rgba(255, 143, 177, 0.46);
}

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

.float-piece {
  position: absolute;
  width: var(--size);
  height: var(--size);
  opacity: 0.32;
  transform: rotate(var(--rotate));
  animation: floatUp var(--duration) linear infinite;
}

.float-piece::before,
.float-piece::after {
  position: absolute;
  content: "";
}

.float-piece.heart::before {
  inset: 18% 18% 0;
  border-radius: 38% 38% 12% 12%;
  background: var(--pink-500);
  transform: rotate(45deg);
}

.float-piece.heart::after {
  top: 10%;
  left: 18%;
  width: 64%;
  height: 64%;
  border-radius: 999px 999px 0 999px;
  background:
    radial-gradient(circle at 25% 30%, var(--pink-500) 0 28%, transparent 29%),
    radial-gradient(circle at 68% 30%, var(--pink-500) 0 28%, transparent 29%);
}

.float-piece.star {
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 18px rgba(255, 143, 177, 0.8);
}

.float-piece.sparkle::before {
  inset: 0;
  background: var(--pink-400);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
}

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--paper-shadow);
  font-size: 0.96rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.music-toggle.is-playing .music-icon {
  color: var(--pink-500);
}

.music-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.music-icon::before {
  position: absolute;
  inset: 1px 0 1px 3px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

.music-toggle.is-playing .music-icon::before {
  inset: 1px 8px 1px 1px;
  clip-path: none;
}

.music-toggle.is-playing .music-icon::after {
  position: absolute;
  inset: 1px 1px 1px 8px;
  background: currentColor;
  content: "";
}

.envelope-section {
  display: grid;
  align-content: center;
}

.envelope-hint {
  margin-top: 28px;
}

.envelope-scene {
  display: block;
  width: min(480px, 92vw);
  height: 470px;
  margin: 42px auto 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
}

.envelope {
  position: relative;
  display: block;
  width: 100%;
  height: 430px;
  margin-top: 28px;
}

.envelope-back,
.envelope-front,
.envelope-flap,
.letter {
  position: absolute;
  inset: auto 0 0;
  margin: auto;
}

.envelope-back {
  z-index: 1;
  width: 100%;
  height: 210px;
  border-radius: 18px;
  background: #ffc0d7;
  box-shadow: var(--shadow);
}

.envelope-front {
  z-index: 4;
  width: 100%;
  height: 210px;
  border-radius: 18px;
  background:
    linear-gradient(146deg, transparent 49.4%, #ff9fc1 50%),
    linear-gradient(214deg, transparent 49.4%, #ffb6cf 50%),
    linear-gradient(to top, #ffcfe0, #ffc0d7);
}

.envelope-flap {
  z-index: 5;
  bottom: 102px;
  width: 100%;
  height: 150px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(150deg, #ff9ec0, #ffc6da);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter {
  z-index: 2;
  bottom: 6px;
  width: 78%;
  min-height: 170px;
  max-height: 170px;
  padding: 22px 22px 18px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(255, 143, 177, 0.1) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--cream);
  box-shadow: var(--paper-shadow);
  overflow: hidden;
  transform: translateY(0) scale(0.9);
  transform-origin: bottom center;
  transition:
    max-height 650ms 380ms cubic-bezier(0.2, 0.8, 0.2, 1),
    min-height 650ms 380ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 650ms 380ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 900ms 200ms cubic-bezier(0.16, 0.85, 0.2, 1);
}

.letter-preview {
  display: block;
  transition: opacity 250ms ease;
}

.letter-line {
  display: block;
  width: 62%;
  height: 8px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 143, 177, 0.42);
}

.letter-line.wide {
  width: 86%;
}

.letter-heart {
  position: absolute;
  right: 22px;
  bottom: 16px;
  color: var(--pink-500);
  font-size: 1.9rem;
}

.letter-copy {
  display: grid;
  align-content: start;
  gap: 10px;
  color: var(--muted);
  font-size: clamp(0.92rem, 2.2vw, 1.08rem);
  font-weight: 500;
  line-height: 1.62;
  opacity: 0;
  text-align: center;
  transform: translateY(12px);
  transition: opacity 420ms 760ms ease, transform 420ms 760ms ease;
}

.letter-salutation {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(1.95rem, 4.2vw, 2.7rem);
  line-height: 1.1;
  white-space: nowrap;
}

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

.envelope-section.is-open .letter {
  z-index: 6;
  inset: auto -4% 0 -4%;
  width: auto;
  min-height: 300px;
  max-height: 300px;
  padding: 32px 34px 28px;
  transform: translateY(-180px) scale(1);
  animation: letterPopOut 1000ms 140ms cubic-bezier(0.16, 0.85, 0.2, 1) both;
}

.envelope-section.is-open .letter-preview {
  display: none;
}

.envelope-section.is-open .letter-copy {
  opacity: 1;
  transform: translateY(0);
}

.scrapbook-section {
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(180deg, transparent, rgba(255, 240, 245, 0.74));
}

.memory-grid,
.open-when-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.memory-card {
  position: relative;
  min-height: 260px;
  padding: 48px 28px 30px;
  border-radius: 12px 28px 18px 24px;
  box-shadow: var(--paper-shadow);
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.memory-card:hover {
  box-shadow: 0 22px 44px rgba(129, 73, 91, 0.18);
  transform: translateY(-8px) rotate(0.4deg);
}

.memory-card:nth-child(2) {
  --tilt: 1.7deg;
}

.memory-card:nth-child(3) {
  --tilt: -2.2deg;
}

.memory-card:nth-child(4) {
  --tilt: 2.3deg;
}

.memory-card:nth-child(5) {
  --tilt: -1deg;
}

.memory-card:nth-child(6) {
  --tilt: 1.2deg;
}

.note-yellow {
  background: #fff4bd;
}

.note-pink {
  background: #ffd4e5;
}

.note-purple {
  background: #eadfff;
}

.note-blue {
  background: #dff4ff;
}

.note-cream {
  background: #fffaf0;
}

.note-green {
  background: #e4f8df;
}

.polaroid {
  padding-top: 24px;
  background: #ffffff;
}

.photo-placeholder {
  display: block;
  height: 150px;
  margin-bottom: 18px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.88) 0 8%, transparent 9%),
    linear-gradient(145deg, #ffd2e2, #fff7c8 48%, #c9f1ff);
}

.tape {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 82px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 4px 12px rgba(129, 73, 91, 0.08);
  transform: translateX(-50%) rotate(-3deg);
}

.memory-meta {
  margin: 0 0 12px;
  color: rgba(91, 63, 73, 0.58);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-note {
  position: relative;
  min-height: 220px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  perspective: 900px;
}

.open-note:hover {
  transform: translateY(-4px);
}

.note-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 28px 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--paper-shadow);
  line-height: 1.55;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.2, 0.75, 0.2, 1), box-shadow 220ms ease;
}

.note-back {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  background:
    linear-gradient(90deg, rgba(255, 143, 177, 0.08) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--cream);
  transform: rotateY(180deg);
}

.note-title {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.open-note.is-flipped .note-front {
  transform: rotateY(180deg);
}

.open-note.is-flipped .note-back {
  transform: rotateY(360deg);
}

.open-note:hover .note-face {
  box-shadow: 0 22px 42px rgba(129, 73, 91, 0.18);
}

.mini-envelope {
  position: relative;
  display: block;
  width: 86px;
  height: 58px;
  margin: 0 auto 20px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, transparent 49%, #ffa9c7 50%),
    linear-gradient(215deg, transparent 49%, #ffc5d8 50%),
    #ffd6e7;
  box-shadow: 0 10px 20px rgba(255, 143, 177, 0.22);
}

.mini-envelope::before {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #ffb3d1;
  clip-path: polygon(0 0, 100% 0, 50% 54%);
  content: "";
}

.cake-section {
  display: grid;
  align-content: center;
  background:
    radial-gradient(circle at 88% 28%, rgba(255, 255, 255, 0.78), transparent 22%),
    linear-gradient(180deg, rgba(255, 240, 245, 0.72), rgba(255, 229, 236, 0.42));
}

.cake-hint {
  margin-top: 24px;
}

.cake-wrap {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 34px 22px 30px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 214, 166, 0.72), transparent 32%),
    radial-gradient(circle at 50% 70%, rgba(255, 151, 120, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  text-align: center;
}

.cake {
  position: relative;
  width: min(430px, 88vw);
  height: 360px;
  margin: 0 auto 18px;
}

.candle {
  position: absolute;
  top: 56px;
  z-index: 8;
  width: 24px;
  height: 92px;
  border: 0;
  border-radius: 16px 16px 10px 10px;
  background:
    repeating-linear-gradient(45deg, #fff8ed 0 10px, #fff8ed 10px 18px, #ff9a80 18px 30px);
  box-shadow: 0 10px 18px rgba(224, 117, 82, 0.18);
  cursor: pointer;
}

.candle::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 44%, rgba(214, 92, 64, 0.1));
  content: "";
}

.candle:nth-child(1) {
  left: 20%;
}

.candle:nth-child(2) {
  left: 32%;
  top: 56px;
}

.candle:nth-child(3) {
  left: 44%;
  transform: translateX(-50%);
}

.candle:nth-child(4) {
  right: 44%;
  top: 56px;
}

.candle:nth-child(5) {
  right: 32%;
}

.candle:nth-child(6) {
  right: 20%;
}

.flame {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: 34px;
  height: 46px;
  border-radius: 48% 52% 48% 52%;
  background:
    radial-gradient(circle at 50% 64%, #fff9b6 0 20%, transparent 21%),
    radial-gradient(circle at 50% 62%, #ffd25a 0 38%, transparent 39%),
    linear-gradient(135deg, #ff7fa6 12%, #ff9a6f 72%);
  box-shadow: 0 0 34px rgba(255, 194, 96, 0.86), 0 0 70px rgba(255, 143, 177, 0.42);
  transform: translateX(-50%) rotate(45deg);
  transform-origin: bottom;
  animation: flicker 820ms ease-in-out infinite alternate;
}

.candle.is-out .flame {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px) rotate(45deg) scale(0.3);
  transition: opacity 240ms ease, transform 240ms ease;
}

.candle.is-out::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(150, 122, 132, 0.22);
  content: "";
  animation: smoke 900ms ease-out forwards;
}

.cake-top {
  position: absolute;
  top: 124px;
  left: 48px;
  z-index: 5;
  width: calc(100% - 96px);
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(180deg, #fff2d7, #ffd09a);
  box-shadow: inset 0 -16px 0 rgba(255, 166, 101, 0.2), 0 16px 28px rgba(255, 153, 112, 0.14);
}

.cake-layer {
  position: absolute;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 24px 46px rgba(223, 113, 88, 0.18);
}

.cake-layer-one {
  top: 154px;
  left: 52px;
  z-index: 4;
  width: calc(100% - 104px);
  height: 102px;
  background:
    radial-gradient(circle at 8% 0, #fff0cf 0 24px, transparent 25px),
    radial-gradient(circle at 22% 0, #fff0cf 0 42px, transparent 43px),
    radial-gradient(circle at 40% 0, #fff0cf 0 32px, transparent 33px),
    radial-gradient(circle at 58% 0, #fff0cf 0 38px, transparent 39px),
    radial-gradient(circle at 76% 0, #fff0cf 0 30px, transparent 31px),
    radial-gradient(circle at 92% 0, #fff0cf 0 28px, transparent 29px),
    linear-gradient(180deg, #ffc18e 0 18%, #ff9f7b 68%, #ff8f72 100%);
}

.cake-layer-one::before,
.cake-layer-two::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 28%, rgba(209, 82, 56, 0.08));
  content: "";
}

.cake-layer-one::after,
.cake-layer-two::after {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60px;
  background:
    radial-gradient(circle at 6% 0, #fff0cf 0 24px, transparent 25px),
    radial-gradient(circle at 20% 0, #fff0cf 0 42px, transparent 43px),
    radial-gradient(circle at 38% 0, #fff0cf 0 32px, transparent 33px),
    radial-gradient(circle at 56% 0, #fff0cf 0 38px, transparent 39px),
    radial-gradient(circle at 74% 0, #fff0cf 0 30px, transparent 31px),
    radial-gradient(circle at 92% 0, #fff0cf 0 32px, transparent 33px);
  content: "";
}

.cake-layer-two {
  top: 248px;
  left: 18px;
  z-index: 2;
  width: calc(100% - 36px);
  height: 92px;
  background:
    radial-gradient(circle at 10% 0, #fff0cf 0 26px, transparent 27px),
    radial-gradient(circle at 25% 0, #fff0cf 0 42px, transparent 43px),
    radial-gradient(circle at 43% 0, #fff0cf 0 34px, transparent 35px),
    radial-gradient(circle at 60% 0, #fff0cf 0 44px, transparent 45px),
    radial-gradient(circle at 78% 0, #fff0cf 0 34px, transparent 35px),
    radial-gradient(circle at 94% 0, #fff0cf 0 28px, transparent 29px),
    linear-gradient(180deg, #ffab83 0 18%, #ff9270 76%, #f97d62 100%);
}

.cake-plate {
  position: absolute;
  left: 0;
  bottom: 6px;
  z-index: 1;
  width: 100%;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(255, 158, 128, 0.22);
}

.cake-decor {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}

.cake-decor-top {
  top: 180px;
  left: 52px;
  width: calc(100% - 104px);
  height: 68px;
}

.cake-decor-bottom {
  top: 288px;
  left: 18px;
  width: calc(100% - 36px);
  height: 42px;
}

.peach-emblem {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 44px;
  height: 48px;
  border-radius: 48% 52% 56% 44%;
  background:
    radial-gradient(circle at 38% 34%, #ffcf8f 0 15%, transparent 16%),
    radial-gradient(circle at 58% 68%, rgba(255, 111, 126, 0.65) 0 10%, transparent 11%),
    linear-gradient(140deg, #ffcf9d 0 18%, #ff9d7d 54%, #ff7f82 100%);
  box-shadow: inset -12px -8px 0 rgba(255, 118, 118, 0.12);
  transform: translateX(-50%) rotate(-10deg);
}

.peach-emblem::before,
.peach-emblem::after {
  position: absolute;
  top: -20px;
  width: 34px;
  height: 18px;
  border-radius: 100% 0;
  background: #78bd69;
  content: "";
}

.peach-emblem::before {
  left: 23px;
  transform: rotate(32deg);
}

.peach-emblem::after {
  right: 8px;
  transform: rotate(-28deg) scaleX(-1);
}

.cake-heart,
.cake-heart::before,
.cake-heart::after {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ff8373;
}

.cake-heart {
  border-radius: 3px;
  transform: rotate(45deg);
}

.cake-heart::before,
.cake-heart::after {
  border-radius: 50%;
  content: "";
}

.cake-heart::before {
  left: -8px;
}

.cake-heart::after {
  top: -8px;
}

.heart-left {
  left: 52px;
  top: 28px;
}

.heart-right {
  right: 52px;
  top: 26px;
}

.heart-one {
  left: 64px;
  top: 22px;
}

.heart-two {
  left: 50%;
  top: 28px;
}

.heart-three {
  right: 64px;
  top: 20px;
}

.cake-sparkle {
  position: absolute;
  width: 26px;
  height: 26px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

.sparkle-left {
  left: 126px;
  top: 42px;
}

.sparkle-right {
  right: 126px;
  top: 38px;
}

.sparkle-one {
  left: 28px;
  top: 18px;
}

.sparkle-two {
  left: 39%;
  top: 54px;
  width: 16px;
  height: 16px;
}

.sparkle-three {
  right: 28px;
  top: 18px;
}

.wish-message {
  min-height: 34px;
  margin: 0;
  font-weight: 700;
}

.wish-message.is-complete {
  color: #e75f91;
  animation: softPop 450ms ease both;
}

.ending-section {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.86), transparent 22%),
    radial-gradient(circle at 78% 72%, rgba(255, 179, 209, 0.35), transparent 26%),
    linear-gradient(145deg, #fff8fb, #ffe5ec);
}

.ending-orb {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.55;
  animation: orbDrift 22s ease-in-out infinite alternate;
}

.ending-orb-1 {
  top: -8%;
  left: -4%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #ff9ec0, transparent 68%);
}

.ending-orb-2 {
  bottom: -12%;
  right: -6%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #ffd6e7, transparent 70%);
  animation-delay: -8s;
}

.ending-orb-3 {
  top: 30%;
  right: 14%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, #fff4bd, transparent 70%);
  animation-delay: -14s;
  animation-duration: 28s;
}

.ending-section .ending-card {
  position: relative;
  z-index: 1;
}

.ending-ornament {
  position: absolute;
  top: 22px;
  left: 50%;
  color: var(--pink-400);
  font-size: 1rem;
  letter-spacing: 0.6em;
  opacity: 0.55;
  transform: translateX(-50%);
}

.ending-ornament::before,
.ending-ornament::after {
  content: "✦";
  margin: 0 0.6em;
  opacity: 0.5;
}

.ending-card > .eyebrow {
  margin: 22px auto 10px;
}

.ending-notes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  width: min(720px, 100%);
  margin: 36px auto 24px;
}

@media (min-width: 760px) {
  .ending-notes {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: min(820px, 100%);
  }
}

.ending-note {
  position: relative;
  padding: 36px 22px 26px;
  border-radius: 14px 26px 16px 22px;
  background: var(--note-bg, #fff4bd);
  box-shadow: 0 14px 32px rgba(129, 73, 91, 0.14);
  text-align: left;
  transform: rotate(var(--tilt, -2deg));
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.ending-note:hover {
  box-shadow: 0 22px 44px rgba(129, 73, 91, 0.2);
  transform: rotate(0deg) translateY(-6px);
}

.ending-note p {
  width: auto;
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.65;
}

.note-sticker {
  position: absolute;
  top: -14px;
  right: -10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 6px 14px rgba(129, 73, 91, 0.18);
  color: var(--pink-500);
  font-size: 1.05rem;
  transform: rotate(calc(var(--tilt, -2deg) * -1.5));
}

.note-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.note-wish {
  --note-bg: #fff4bd;
  --tilt: -3deg;
}

.note-promise {
  --note-bg: #ffd4e5;
  --tilt: 2.5deg;
}

.note-thanks {
  --note-bg: #dff4ff;
  --tilt: -1.5deg;
}

.ending-postscript {
  width: min(560px, 100%);
  margin: 8px auto 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

.postscript-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 143, 177, 0.18);
  color: var(--pink-500);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.ending-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(460px, 100%);
  margin: 6px auto 28px;
}

.signature-flourish {
  flex: 1 1 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 143, 177, 0.55), transparent);
}

.signature-name {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.02em;
}

@keyframes orbDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(28px, -18px) scale(1.08);
  }

  100% {
    transform: translate(-22px, 26px) scale(0.96);
  }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.click-spark {
  position: fixed;
  z-index: 31;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink-500);
  pointer-events: none;
  animation: clickSpark 650ms ease-out forwards;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 620ms ease, transform 620ms ease;
}

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

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

@keyframes floatUp {
  from {
    transform: translate3d(0, 110vh, 0) rotate(var(--rotate));
  }

  to {
    transform: translate3d(var(--drift), -18vh, 0) rotate(calc(var(--rotate) + 110deg));
  }
}

@keyframes noteBounce {
  50% {
    transform: translateY(-3px) rotate(-8deg);
  }
}

@keyframes flicker {
  from {
    transform: translateX(-50%) rotate(39deg) scale(0.92);
  }

  to {
    transform: translateX(-50%) rotate(50deg) scale(1.05);
  }
}

@keyframes smoke {
  to {
    opacity: 0;
    transform: translate(-50%, -34px) scale(1.8);
  }
}

@keyframes softPop {
  0% {
    transform: scale(0.9);
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes letterPopOut {
  0% {
    transform: translateY(0) scale(0.9);
  }

  35% {
    transform: translateY(-60px) scale(0.92);
  }

  62% {
    transform: translateY(-200px) scale(0.96);
  }

  85% {
    transform: translateY(-175px) scale(1.04);
  }

  100% {
    transform: translateY(-180px) scale(1);
  }
}

@keyframes letterPopOutTablet {
  0% {
    transform: translateY(0) scale(0.9);
  }

  35% {
    transform: translateY(-50px) scale(0.92);
  }

  62% {
    transform: translateY(-170px) scale(0.96);
  }

  85% {
    transform: translateY(-145px) scale(1.04);
  }

  100% {
    transform: translateY(-150px) scale(1);
  }
}

@keyframes letterPopOutPhone {
  0% {
    transform: translateY(0) scale(0.9);
  }

  35% {
    transform: translateY(-46px) scale(0.92);
  }

  62% {
    transform: translateY(-150px) scale(0.96);
  }

  85% {
    transform: translateY(-130px) scale(1.04);
  }

  100% {
    transform: translateY(-134px) scale(1);
  }
}

@keyframes clickSpark {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.25);
  }
}

@media (max-width: 920px) {
  .memory-grid,
  .open-when-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .section {
    min-height: auto;
    padding: 78px 16px;
  }

  .entry-card h1 {
    font-size: clamp(2.6rem, 15vw, 4.2rem);
    line-height: 1.02;
  }

  .hero {
    min-height: 100vh;
  }

  .hero-card,
  .ending-card {
    padding: 34px 22px;
    border-radius: 28px;
  }

  .hero-title {
    font-size: clamp(2.9rem, 17vw, 5.4rem);
    line-height: 1.18;
  }

  .envelope-scene {
    margin-top: 34px;
  }

  .primary-button,
  .soft-link {
    width: 100%;
    padding: 0 18px;
  }

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

  .memory-card {
    min-height: auto;
    transform: none;
  }

  .memory-card:hover {
    transform: translateY(-6px);
  }

  .open-note {
    min-height: 190px;
  }

  .note-face {
    padding: 22px 14px;
    font-size: 0.9rem;
  }

  .note-back {
    font-size: 0.78rem;
  }

  .letter {
    width: 86%;
    min-height: 160px;
    max-height: 160px;
    padding: 22px 18px 18px;
  }

  .envelope-section.is-open .letter {
    inset: auto -2% 0 -2%;
    width: auto;
    min-height: 270px;
    max-height: 270px;
    padding: 26px 22px 24px;
    transform: translateY(-150px) scale(1);
    animation-name: letterPopOutTablet;
  }

  .letter-copy {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .letter-salutation {
    font-size: 2rem;
  }
}

@media (max-width: 430px) {
  .open-when-grid {
    gap: 16px;
  }

  .open-note {
    min-height: 176px;
  }

  .note-face {
    padding: 20px 10px;
    font-size: 0.78rem;
  }

  .note-back {
    font-size: 0.7rem;
  }

  .envelope-scene {
    height: 430px;
    margin-top: 30px;
  }

  .letter {
    min-height: 150px;
    max-height: 150px;
    padding: 20px 16px 16px;
  }

  .envelope-section.is-open .letter {
    inset: auto -1% 0 -1%;
    width: auto;
    min-height: 250px;
    max-height: 250px;
    padding: 22px 18px 20px;
    transform: translateY(-134px) scale(1);
    animation-name: letterPopOutPhone;
  }

  .letter-copy {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .music-toggle {
    min-width: 122px;
    justify-content: center;
    padding: 0 18px;
  }

  .candle:nth-child(1) {
    left: 20%;
  }

  .candle:nth-child(2) {
    left: 32%;
  }

  .candle:nth-child(3) {
    left: 44%;
    transform: translateX(-50%);
  }

  .candle:nth-child(4) {
    right: 44%;
  }

  .candle:nth-child(5) {
    right: 32%;
  }

  .candle:nth-child(6) {
    right: 20%;
  }
}

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