:root {
  --ink: #32242b;
  --muted: #6f5962;
  --white: #fffafc;
  --rose-1: #fff2f6;
  --rose-2: #f8dfea;
  --rose-3: #f1b9cd;
  --rose-4: #cf6f90;
  --gold: #d6a953;
  --shadow: 0 22px 60px rgba(92, 35, 62, 0.18);
  --soft-shadow: 0 14px 40px rgba(92, 35, 62, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--rose-1);
  overflow-x: hidden;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--rose-1);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
}

.page::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.intro-page::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 112, 161, 0.34), transparent 30%),
    radial-gradient(circle at 80% 12%, rgba(255, 209, 111, 0.2), transparent 28%),
    radial-gradient(circle at 52% 92%, rgba(192, 33, 79, 0.42), transparent 42%),
    linear-gradient(145deg, #260616, #560d31 52%, #17040f);
}

.welcome-page::before {
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.92), transparent 25%),
    radial-gradient(circle at 88% 12%, rgba(255, 94, 150, 0.62), transparent 32%),
    radial-gradient(circle at 38% 92%, rgba(255, 189, 215, 0.7), transparent 38%),
    linear-gradient(160deg, #ffeaf3 0%, #f68fb6 54%, #df3f75 100%);
}

.birthday-page::before {
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.86), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(255, 208, 104, 0.52), transparent 28%),
    radial-gradient(circle at 46% 92%, rgba(255, 112, 150, 0.68), transparent 35%),
    linear-gradient(180deg, #fff0f5 0%, #f76796 53%, #bd1e55 100%);
}

.letter-page::before {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.94), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 158, 187, 0.62), transparent 30%),
    radial-gradient(circle at 50% 94%, rgba(255, 204, 178, 0.68), transparent 35%),
    linear-gradient(180deg, #fff5f1 0%, #f29bb7 55%, #bb3d69 100%);
}

.gallery-page::before {
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.88), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(255, 139, 179, 0.6), transparent 30%),
    radial-gradient(circle at 18% 80%, rgba(255, 201, 111, 0.54), transparent 32%),
    linear-gradient(180deg, #fff1f6 0%, #df4b80 48%, #8f214a 100%);
}

.surprise-card-page::before {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 113, 164, 0.57), transparent 29%),
    radial-gradient(circle at 50% 100%, rgba(255, 182, 202, 0.6), transparent 35%),
    linear-gradient(160deg, #fff0f6 0%, #e45489 54%, #9d2551 100%);
}

.new-phase-page::before {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.88), transparent 25%),
    radial-gradient(circle at 84% 16%, rgba(255, 191, 117, 0.56), transparent 29%),
    radial-gradient(circle at 26% 78%, rgba(242, 115, 162, 0.58), transparent 32%),
    linear-gradient(180deg, #fff5ee 0%, #eb779d 54%, #a73361 100%);
}

.ending-page::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(255, 112, 160, 0.56), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(255, 196, 97, 0.48), transparent 34%),
    linear-gradient(180deg, #fff2f6 0%, #d94779 56%, #6f173b 100%);
}

.card-tone-funny::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.9), transparent 25%),
    radial-gradient(circle at 84% 16%, rgba(255, 203, 90, 0.7), transparent 29%),
    radial-gradient(circle at 50% 92%, rgba(255, 116, 169, 0.58), transparent 36%),
    linear-gradient(160deg, #fff2d7 0%, #ff96ba 55%, #e65478 100%);
}

.card-tone-sweet::before {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 142, 188, 0.62), transparent 29%),
    radial-gradient(circle at 50% 100%, rgba(249, 104, 150, 0.52), transparent 35%),
    linear-gradient(160deg, #fff0f7 0%, #ed739f 54%, #b1255b 100%);
}

.card-tone-final::before {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 204, 102, 0.62), transparent 29%),
    radial-gradient(circle at 50% 100%, rgba(222, 75, 120, 0.55), transparent 35%),
    linear-gradient(160deg, #fff4e7 0%, #e98975 54%, #9e224d 100%);
}

.welcome-page .message-panel h1 {
  color: #a2144d;
}

.birthday-page .birthday-hero h1 {
  color: #b1124c;
}

.letter-page .letter-card h1 {
  color: #921640;
}

.gallery-page .gallery-intro h1,
.gallery-page .gallery-section h2,
.new-phase-page .new-phase-intro h1 {
  color: #fff9fc;
  text-shadow: 0 3px 14px rgba(105, 19, 58, 0.32);
}

.gallery-page .gallery-intro .lead,
.gallery-page .gallery-fallback,
.gallery-page .gallery-note,
.new-phase-page .new-phase-intro .lead {
  color: rgba(255, 249, 252, 0.9);
  text-shadow: 0 2px 10px rgba(105, 19, 58, 0.24);
}

.gallery-page .gallery-intro .eyebrow,
.new-phase-page .new-phase-intro .eyebrow {
  color: #ffe4a1;
}

.stage {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.stage-center {
  display: grid;
  place-items: center;
}

.stage > :not(.animation-layer) {
  position: relative;
  z-index: 2;
}

.animation-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.intro-panel,
.message-panel,
.birthday-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
}

.intro-panel {
  padding: 34px 18px;
  border: 1px solid rgba(255, 235, 244, 0.2);
  border-radius: 28px;
  color: #fff8fb;
  background: rgba(255, 243, 249, 0.05);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.message-panel,
.birthday-hero {
  padding: 28px 16px;
  border: 1px solid rgba(207, 111, 144, 0.16);
  border-radius: 26px;
  background: rgba(255, 250, 252, 0.54);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.birthday-hero {
  padding-top: 36px;
}

.letter-wrap {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0 10px;
  text-align: center;
}

.letter-card {
  position: relative;
  width: 100%;
  padding: 24px 18px 22px;
  border: 1px solid rgba(207, 111, 144, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 250, 252, 0.88), rgba(255, 246, 241, 0.8)),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.9), transparent 38%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.letter-card::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 169, 83, 0.2);
  border-radius: 22px;
  content: "";
  pointer-events: none;
}

.letter-card h1 {
  position: relative;
  color: #6f3148;
  font-size: clamp(2.05rem, 11vw, 3.1rem);
}

.letter-body {
  position: relative;
  margin-top: 20px;
  text-align: left;
}

.letter-line {
  margin: 0;
  color: rgba(50, 36, 43, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 4.55vw, 1.18rem);
  line-height: 1.62;
  animation: paragraphReveal 780ms ease both;
}

.letter-line + .letter-line {
  margin-top: 15px;
}

.letter-line:nth-child(1) {
  animation-delay: 160ms;
}

.letter-line:nth-child(2) {
  animation-delay: 320ms;
}

.letter-line:nth-child(3) {
  animation-delay: 480ms;
}

.letter-line:nth-child(4) {
  animation-delay: 640ms;
}

.letter-wrap .primary-button {
  align-self: center;
  margin-top: 22px;
}

.surprise-card {
  width: 100%;
  padding: 24px 18px 22px;
  border: 1px solid rgba(207, 111, 144, 0.2);
  border-radius: 26px;
  background: rgba(255, 250, 252, 0.8);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.surprise-card h1 {
  color: #6f3148;
  font-size: clamp(1.95rem, 10vw, 2.8rem);
  line-height: 1.02;
}

.card-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 18px;
  color: #fffafc;
  background: linear-gradient(135deg, #cf6f90, #e6a5ba);
  box-shadow: 0 12px 24px rgba(207, 111, 144, 0.22);
  font-size: 1.45rem;
  animation: iconFloat 3s ease-in-out infinite;
}

.card-tone-funny .card-icon {
  color: #714456;
  background: linear-gradient(135deg, #ffd984, #f3adc6);
}

.card-media {
  display: grid;
  width: min(100%, 244px);
  aspect-ratio: 5 / 3;
  margin: 0 auto 18px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(207, 111, 144, 0.46);
  border-radius: 19px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.88), transparent 20%),
    linear-gradient(135deg, #fff1f5, #f5c9da);
}

.card-tone-funny .card-media {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.88), transparent 20%),
    linear-gradient(135deg, #fff2d9, #f5bfd4);
}

.card-media span {
  max-width: 76%;
  color: rgba(113, 67, 83, 0.76);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

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

.card-message {
  margin: 17px auto 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 4.9vw, 1.32rem);
  line-height: 1.42;
}

.card-detail {
  margin: 12px auto 0;
  color: rgba(50, 36, 43, 0.7);
  font-size: 0.96rem;
  line-height: 1.5;
}

.surprise-card .primary-button {
  margin-top: 24px;
}

.new-phase-intro {
  width: 100%;
  padding: 32px 8px 18px;
  text-align: center;
}

.new-phase-intro h1,
.wishes-card h2 {
  color: #6f3148;
}

.new-phase-intro h1 {
  font-size: clamp(2rem, 10.5vw, 3.05rem);
}

.new-phase-story,
.wishes-card {
  width: 100%;
  padding: 22px 18px;
  border: 1px solid rgba(207, 111, 144, 0.18);
  border-radius: 24px;
  background: rgba(255, 250, 252, 0.76);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.new-phase-story p {
  margin: 0;
  color: rgba(50, 36, 43, 0.78);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 4.55vw, 1.16rem);
  line-height: 1.58;
}

.new-phase-story p + p {
  margin-top: 16px;
}

.new-phase-media {
  width: 100%;
  padding: 16px 0 8px;
}

.new-phase-photo-row,
.new-phase-video-row {
  display: grid;
  gap: 12px;
  width: 100%;
}

.new-phase-photo-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.new-phase-video-row {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 12px;
}

.new-phase-media-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(207, 111, 144, 0.45);
  border-radius: 20px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(145deg, #fff1ef, #ecc9d8);
}

.new-phase-media-frame.is-photo {
  aspect-ratio: 4 / 5;
}

.new-phase-media-frame.is-video {
  width: min(100%, 190px);
  aspect-ratio: 9 / 14;
  justify-self: center;
}

.new-phase-media-frame span {
  max-width: 74%;
  color: rgba(113, 67, 83, 0.75);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.36;
  text-align: center;
  text-transform: uppercase;
}

.new-phase-media-frame img,
.new-phase-media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wishes-card {
  margin-top: 12px;
}

.wishes-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 8vw, 2.35rem);
  line-height: 1.08;
  text-align: center;
}

.wish-list {
  display: grid;
  gap: 11px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.wish-list li {
  position: relative;
  padding-left: 24px;
  color: rgba(50, 36, 43, 0.78);
  font-size: 0.98rem;
  line-height: 1.45;
}

.wish-list li::before {
  position: absolute;
  top: 0.05em;
  left: 0;
  color: var(--rose-4);
  content: "\1F497";
  font-size: 0.88rem;
  line-height: 1;
}

.ending-card {
  width: 100%;
  padding: 28px 18px 24px;
  border: 1px solid rgba(207, 111, 144, 0.2);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 251, 252, 0.86), rgba(255, 246, 242, 0.8)),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.9), transparent 40%);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.ending-card h1 {
  color: #6f3148;
  font-size: clamp(2rem, 10.5vw, 3rem);
}

.ending-message {
  margin-top: 22px;
}

.ending-line {
  margin: 0;
  color: rgba(50, 36, 43, 0.79);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 4.45vw, 1.14rem);
  line-height: 1.56;
  animation: paragraphReveal 780ms ease both;
}

.ending-line + .ending-line {
  margin-top: 15px;
}

.ending-line:nth-child(1) {
  animation-delay: 140ms;
}

.ending-line:nth-child(2) {
  animation-delay: 280ms;
}

.ending-line:nth-child(3) {
  animation-delay: 420ms;
}

.ending-line:nth-child(4) {
  animation-delay: 560ms;
}

.ending-line:nth-child(5) {
  animation-delay: 700ms;
}

.replay-button {
  min-height: 44px;
  margin-top: 24px;
  padding: 10px 14px;
  border: 0;
  color: rgba(113, 49, 72, 0.86);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gallery-intro {
  width: 100%;
  padding: 30px 8px 16px;
  text-align: center;
}

.gallery-intro h1 {
  color: #6f3148;
  font-size: clamp(2rem, 10.5vw, 3.05rem);
}

.gallery-fallback,
.gallery-note {
  margin: 14px auto 0;
  color: rgba(50, 36, 43, 0.68);
  font-size: 0.95rem;
  line-height: 1.55;
}

.gallery-section {
  width: 100%;
  padding: 14px 0 8px;
}

.gallery-section h2 {
  margin: 0 0 12px;
  color: #71334a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 6vw, 1.8rem);
  line-height: 1.12;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.gallery-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(207, 111, 144, 0.16);
  border-radius: 22px;
  background: rgba(255, 250, 252, 0.72);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
  transform: perspective(700px) translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-card:active {
  transform: perspective(700px) rotateX(1.4deg) rotateY(-1.8deg) scale(0.985);
  box-shadow: 0 10px 26px rgba(92, 35, 62, 0.14);
}

.gallery-media-frame {
  width: 100%;
  overflow: hidden;
  border-radius: 17px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(145deg, #fff3f7, #edb8ce);
}

.gallery-media-frame.is-photo {
  aspect-ratio: 4 / 5;
}

.gallery-media-frame.is-video {
  aspect-ratio: 9 / 14;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.86), transparent 22%),
    linear-gradient(145deg, #fff3ee, #dec0dc);
}

.gallery-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 120px;
  place-items: center;
}

.gallery-placeholder span {
  color: rgba(113, 67, 83, 0.76);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-media-frame img,
.gallery-media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-caption {
  margin: 8px 2px 2px;
  color: rgba(50, 36, 43, 0.74);
  font-size: 0.78rem;
  line-height: 1.36;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--rose-4);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-panel .eyebrow {
  color: rgba(255, 232, 241, 0.72);
}

h1 {
  max-width: 100%;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 12vw, 3.7rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-panel h1 {
  font-size: clamp(2rem, 11vw, 3.15rem);
}

.lead {
  margin: 18px auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.14rem, 5vw, 1.42rem);
  line-height: 1.45;
}

.soft-copy {
  margin: 16px auto 0;
  color: rgba(50, 36, 43, 0.72);
  font-size: 1rem;
  line-height: 1.55;
}

.intro-panel .soft-copy {
  color: rgba(255, 248, 251, 0.72);
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 320px);
  min-height: 54px;
  margin-top: 30px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  color: #fffafc;
  background: linear-gradient(135deg, #cf6f90, #e39caf);
  box-shadow: 0 16px 34px rgba(207, 111, 144, 0.34);
  cursor: pointer;
  overflow: hidden;
  font-weight: 800;
  letter-spacing: 0.02em;
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button::after {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.48) 50%, transparent 72%);
  content: "";
  opacity: 0;
  transform: translateX(-48%);
  transition: opacity 180ms ease, transform 420ms ease;
}

.primary-button:active::after {
  opacity: 1;
  transform: translateX(48%);
}

.intro-panel .primary-button {
  background: linear-gradient(135deg, #f3b5cc, #d6a953);
  box-shadow: 0 16px 34px rgba(243, 181, 204, 0.18);
}

.primary-button:active {
  transform: perspective(500px) translateY(2px) rotateX(-6deg) scale(0.99);
  filter: brightness(0.98);
  box-shadow: 0 10px 22px rgba(207, 111, 144, 0.28);
}

.button-row {
  width: 100%;
  padding: 16px 0 4px;
  text-align: center;
}

.media-reel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  padding: 4px 0 8px;
}

.memory-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(207, 111, 144, 0.16);
  border-radius: 20px;
  background: rgba(255, 250, 252, 0.72);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.memory-card p {
  margin: 8px 2px 2px;
  color: rgba(50, 36, 43, 0.74);
  font-size: 0.78rem;
  line-height: 1.35;
}

.media-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(145deg, #fff4f7, #f1bfd2);
}

.video-placeholder {
  aspect-ratio: 9 / 14;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.85), transparent 24%),
    linear-gradient(145deg, #fff2ec, #e6bdd8);
}

.media-placeholder span {
  color: rgba(113, 67, 83, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-placeholder img,
.media-placeholder video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-placeholder.has-media {
  background: #f7d9e5;
}

.float-shape {
  position: absolute;
  top: 105%;
  display: block;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(var(--scale));
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

.emoji-shape {
  font-size: var(--emoji-size);
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(129, 53, 83, 0.2));
}

.emoji-shape.soft {
  filter: drop-shadow(0 0 12px rgba(255, 245, 188, 0.72));
}

.page-emoji {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
  font-size: 2.15rem;
  filter: drop-shadow(0 8px 10px rgba(125, 54, 80, 0.2));
  animation: emojiBob 2.8s ease-in-out infinite;
}

.stage > .page-emoji {
  z-index: 4;
}

.page-emoji-1 {
  top: max(18px, env(safe-area-inset-top));
  left: 16px;
}

.page-emoji-2 {
  right: 16px;
  bottom: max(24px, env(safe-area-inset-bottom));
  animation-delay: -2.1s;
}

.confetti-piece {
  top: -8%;
  width: 8px;
  height: 13px;
  border-radius: 3px;
  background: var(--confetti-color);
  box-shadow: 0 3px 7px rgba(92, 35, 62, 0.16);
  animation-name: confettiFall;
}

.depth-surface {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gentle-motion {
  animation: gentleFloat 4.6s ease-in-out infinite;
}

.reveal.gentle-motion {
  animation: gentleFloat 4.6s ease-in-out infinite;
}

.depth-surface.gentle-motion {
  animation: none;
}

.intro-panel:active,
.message-panel:active,
.birthday-hero:active,
.letter-card:active,
.memory-card:active,
.gallery-card:active,
.surprise-card:active,
.new-phase-story:active,
.wishes-card:active,
.ending-card:active {
  transform: perspective(900px) rotateX(-1.2deg) rotateY(2deg) translateY(-2px) scale(0.992);
  box-shadow: 0 12px 28px rgba(92, 35, 62, 0.17);
}

.reveal {
  animation: riseIn 760ms ease both;
}

.delay-1 {
  animation-delay: 160ms;
}

.delay-2 {
  animation-delay: 300ms;
}

.leaving {
  animation: pageLeave 420ms ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageLeave {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes paragraphReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--scale));
  }

  12% {
    opacity: 0.78;
  }

  88% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -112vh, 0) rotate(260deg) scale(var(--scale));
  }
}

@keyframes emojiBob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-9deg) scale(1);
  }

  50% {
    transform: translate3d(0, -18px, 0) rotate(9deg) scale(1.12);
  }
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-5px) rotate(4deg);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--scale));
  }

  10% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 122vh, 0) rotate(560deg) scale(var(--scale));
  }
}

@keyframes gentleFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -5px, 0);
  }
}

@media (min-width: 480px) {
  .stage {
    padding-inline: 24px;
  }

  .media-reel {
    gap: 14px;
  }
}

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