:root {
  --rose: #e96d8c;
  --rose-deep: #a73c5e;
  --rose-pale: #f6b8c7;
  --ink: #472a32;
  --ink-soft: #7e4f5e;
  --paper: #fffaf0;
  --paper-shadow: #e8cfbf;
  --cream: #fff0ca;
  --cherry: #c9423c;
  --leaf: #648666;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #d85e7f;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
}

button {
  color: inherit;
  font: inherit;
}

::selection {
  background: rgba(255, 235, 174, 0.9);
  color: var(--ink);
}

.scene {
  isolation: isolate;
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 156, 179, 0.1), rgba(121, 33, 64, 0.18)),
    url("./assets/table-background.jpg") center / cover no-repeat;
}

.scene::before,
.scene::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.scene::before {
  background:
    radial-gradient(circle at 52% 42%, rgba(255, 224, 226, 0.22), transparent 40%),
    radial-gradient(circle at 7% 95%, rgba(81, 20, 43, 0.32), transparent 26%),
    linear-gradient(90deg, rgba(93, 26, 48, 0.12), transparent 12%, transparent 88%, rgba(93, 26, 48, 0.12));
  mix-blend-mode: multiply;
}

.scene::after {
  border: clamp(8px, 1.2vw, 18px) solid rgba(88, 27, 49, 0.13);
  box-shadow: inset 0 0 90px rgba(104, 27, 52, 0.25);
}

.paper-grain {
  position: absolute;
  inset: -30%;
  z-index: 1;
  opacity: 0.2;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 17% 31%, rgba(80, 25, 45, 0.16) 0 0.55px, transparent 0.7px 5px),
    repeating-radial-gradient(circle at 73% 63%, rgba(255, 255, 255, 0.16) 0 0.45px, transparent 0.65px 6px);
  transform: rotate(7deg);
  mix-blend-mode: soft-light;
}

.table-note {
  position: absolute;
  top: clamp(18px, 3vw, 38px);
  left: clamp(18px, 3vw, 44px);
  z-index: 70;
  display: grid;
  min-width: 150px;
  padding: 12px 28px 11px 22px;
  border: 2px solid rgba(93, 42, 53, 0.72);
  border-radius: 4px 16px 7px 12px;
  background: rgba(255, 247, 219, 0.92);
  box-shadow: 5px 8px 0 rgba(97, 30, 52, 0.15);
  transform: rotate(-3deg);
  animation: note-arrival 700ms 120ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.table-note::before {
  position: absolute;
  top: -10px;
  left: 34%;
  width: 64px;
  height: 20px;
  content: "";
  background: rgba(255, 228, 187, 0.68);
  box-shadow: 0 1px 0 rgba(116, 70, 57, 0.2);
  transform: rotate(2deg);
}

.table-note__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.table-note__name {
  margin-top: -2px;
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 0.95;
  color: var(--rose-deep);
}

.envelope-stage {
  --envelope-width: min(68vw, 760px);
  position: absolute;
  top: 53%;
  left: 50%;
  z-index: 10;
  width: var(--envelope-width);
  aspect-ratio: 1.42;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-7deg);
  transform-style: preserve-3d;
  perspective: 1500px;
  animation: envelope-arrival 900ms both cubic-bezier(0.18, 0.84, 0.2, 1);
}

.envelope-art {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(14px 20px 7px rgba(92, 30, 50, 0.28));
  transform-origin: 50% 60%;
  transition: opacity 300ms ease 160ms, transform 420ms ease;
}

.open-envelope {
  position: absolute;
  inset: 10% 3% 8% 4%;
  z-index: 4;
  opacity: 0;
  transform-style: flat;
  transition: opacity 240ms ease 140ms;
}

.open-envelope__back {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: clamp(2px, 0.25vw, 4px) solid #372327;
  border-radius: 3px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.3), transparent 35%),
    #f4afc0;
  box-shadow: 14px 20px 7px rgba(92, 30, 50, 0.26);
}

.open-envelope__flap {
  position: absolute;
  right: 0;
  bottom: 92%;
  left: 0;
  z-index: 0;
  height: 66%;
  border: clamp(2px, 0.25vw, 4px) solid #372327;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.38), transparent 48%),
    #f6b7c6;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  filter: drop-shadow(0 -6px 3px rgba(121, 45, 67, 0.14));
  transform: rotateX(-12deg) translateZ(-30px);
  transform-origin: bottom center;
}

.open-envelope__pocket {
  position: absolute;
  inset: 41% 0 0;
  z-index: 6;
  overflow: hidden;
  border-right: clamp(2px, 0.25vw, 4px) solid #372327;
  border-bottom: clamp(2px, 0.25vw, 4px) solid #372327;
  border-left: clamp(2px, 0.25vw, 4px) solid #372327;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 42%),
    #f3aabc;
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  transform: translateZ(20px);
}

.open-envelope__pocket::before,
.open-envelope__pocket::after {
  position: absolute;
  top: 35%;
  width: 72%;
  height: 2px;
  content: "";
  background: #4d3037;
  opacity: 0.72;
  transform-origin: center;
}

.open-envelope__pocket::before {
  left: -8%;
  transform: rotate(25deg);
}

.open-envelope__pocket::after {
  right: -8%;
  transform: rotate(-25deg);
}

.letter-paper {
  position: absolute;
  right: 9%;
  bottom: 17%;
  left: 9%;
  z-index: 5;
  min-height: 88%;
  padding: clamp(22px, 4vw, 48px) clamp(22px, 5vw, 58px);
  border: 2px solid rgba(91, 55, 47, 0.72);
  border-radius: 4px 8px 5px 7px;
  opacity: 0;
  background:
    linear-gradient(to bottom, transparent 32.8%, rgba(131, 91, 76, 0.13) 33%, transparent 33.4%),
    linear-gradient(to bottom, transparent 65.8%, rgba(131, 91, 76, 0.13) 66%, transparent 66.4%),
    linear-gradient(145deg, #fffdf6, #f8eddc 80%);
  box-shadow:
    0 20px 28px rgba(82, 35, 47, 0.25),
    inset 0 0 45px rgba(190, 145, 111, 0.09);
  color: var(--ink);
  transform: translateY(34%) translateZ(10px) scaleY(0.12) rotateX(-70deg) rotate(7deg);
  transform-origin: bottom center;
  transform-style: preserve-3d;
}

.letter-paper::before {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(183, 106, 119, 0.34);
  border-radius: 2px 6px 3px 5px;
  content: "";
  pointer-events: none;
}

.letter-paper__fold {
  position: absolute;
  right: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(106, 70, 60, 0.15), transparent);
}

.letter-paper__fold--one {
  top: 33%;
}

.letter-paper__fold--two {
  top: 66%;
}

.letter-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0;
  text-align: center;
}

.letter-copy h1 {
  margin: 0 0 clamp(16px, 2.4vw, 28px);
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 700;
  line-height: 0.92;
  color: var(--rose-deep);
}

.scribble-copy {
  display: grid;
  justify-items: center;
  gap: clamp(7px, 1.1vw, 13px);
  width: 100%;
  padding: 2px 3% 8px;
}

.scribble-copy i {
  display: block;
  width: var(--scribble-width);
  height: clamp(8px, 1vw, 12px);
  opacity: 0.78;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M1 9C8 2 11 13 19 7S31 2 37 9S49 12 55 5S67 3 73 9S85 12 92 5S105 4 112 9S125 11 133 5S147 4 159 8' fill='none' stroke='%23472a32' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transform: rotate(var(--scribble-turn));
}

.cherry-mark {
  position: absolute;
  right: -8px;
  bottom: -12px;
  width: 38px;
  height: 38px;
  transform: rotate(12deg);
}

.cherry-mark i {
  position: absolute;
  bottom: 1px;
  width: 14px;
  height: 14px;
  border: 1.5px solid #772b30;
  border-radius: 50%;
  background: var(--cherry);
}

.cherry-mark i:first-child {
  left: 4px;
}

.cherry-mark i:nth-child(2) {
  right: 4px;
}

.cherry-mark i::before {
  position: absolute;
  bottom: 11px;
  left: 6px;
  width: 1.5px;
  height: 17px;
  content: "";
  background: #4f663e;
  transform: rotate(17deg);
  transform-origin: bottom;
}

.cherry-mark i:nth-child(2)::before {
  transform: rotate(-23deg);
}

.cherry-mark b {
  position: absolute;
  top: 3px;
  left: 19px;
  width: 13px;
  height: 8px;
  border-radius: 100% 0 100% 0;
  background: var(--leaf);
  transform: rotate(-12deg);
}

.envelope-stage.is-open .envelope-art {
  opacity: 0;
  transform: scale(0.97) translateY(2%);
  transition-delay: 0ms;
}

.envelope-stage.is-open {
  z-index: 85;
}

.envelope-stage.is-fading {
  opacity: 0;
  animation: none;
  transition: opacity 900ms ease;
}

.expanded-letter {
  position: absolute;
  inset: 10px;
  z-index: 220;
  overflow: hidden;
  border: 2px solid rgba(88, 54, 48, 0.76);
  border-radius: 5px 11px 6px 9px;
  visibility: hidden;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(198, 98, 113, 0.16) 9% calc(9% + 2px), transparent calc(9% + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 37px, rgba(116, 91, 77, 0.11) 38px 39px),
    linear-gradient(145deg, #fffdf5, #f8eddb 82%);
  box-shadow:
    0 16px 50px rgba(72, 28, 43, 0.36),
    inset 0 0 80px rgba(169, 116, 83, 0.1);
  pointer-events: none;
  transform: scale(0.985);
  transition:
    opacity 1100ms ease,
    transform 1100ms cubic-bezier(0.2, 0.75, 0.2, 1),
    visibility 0s linear 1100ms;
}

.expanded-letter::before {
  position: absolute;
  inset: 9px;
  z-index: 2;
  border: 1px solid rgba(185, 105, 119, 0.28);
  border-radius: 3px 8px 4px 7px;
  content: "";
  pointer-events: none;
}

.expanded-letter.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  transition-delay: 0s;
}

.expanded-letter__scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(42px, 7vw, 88px) clamp(32px, 10vw, 150px) clamp(70px, 10vw, 130px);
  scrollbar-color: rgba(167, 60, 94, 0.62) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.expanded-letter__scroll::-webkit-scrollbar {
  width: 9px;
}

.expanded-letter__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.expanded-letter__scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgba(167, 60, 94, 0.62);
  background-clip: padding-box;
}

.expanded-letter__content {
  width: min(100%, 760px);
  min-height: 100%;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.58;
}

.expanded-letter__salutation {
  margin: 0 0 0.5em;
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1;
  color: var(--rose-deep);
}

.expanded-letter h2 {
  margin: 0 0 clamp(24px, 4vw, 44px);
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(44px, 8vw, 92px);
  font-weight: 700;
  line-height: 0.88;
  color: var(--rose-deep);
  text-wrap: balance;
}

.expanded-letter p {
  margin: 0 0 1.35em;
}

.expanded-letter__signoff {
  padding-top: clamp(12px, 2vw, 24px);
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.02;
  color: var(--ink-soft);
}

.expanded-letter__signature-name {
  display: inline-block;
  margin-left: 2.4em;
}

.envelope-stage.is-open .open-envelope {
  opacity: 1;
}

.envelope-stage.is-open .open-envelope__flap {
  animation: flap-settle 650ms 120ms both cubic-bezier(0.2, 0.78, 0.2, 1);
}

.envelope-stage.is-open .letter-paper {
  animation: letter-unfold 1700ms 420ms both cubic-bezier(0.2, 0.72, 0.12, 1);
}

.envelope-stage.is-open .letter-copy {
  animation: ink-appear 520ms 1600ms both ease-out;
}

.sticker-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.sticker {
  --tx: 0px;
  --ty: 0px;
  --tilt: 0deg;
  --lift: 1;
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 30;
  width: var(--size);
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  translate: -50% -50%;
  transform: translate3d(var(--tx), var(--ty), 0) rotate(calc(var(--rotation) + var(--tilt))) scale(var(--lift));
  transform-origin: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.sticker img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(5px 8px 4px rgba(74, 24, 42, 0.23));
  animation: sticker-arrival 620ms var(--delay) both cubic-bezier(0.2, 0.86, 0.25, 1.14);
  transition: filter 170ms ease, scale 170ms ease;
  -webkit-user-drag: none;
}

.sticker::after {
  position: absolute;
  inset: -8px;
  border: 3px dashed rgba(255, 249, 216, 0.95);
  border-radius: 18px;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.sticker:hover img {
  filter: drop-shadow(7px 11px 5px rgba(74, 24, 42, 0.3));
  scale: 1.035;
}

.sticker:focus-visible::after {
  opacity: 1;
}

.sticker.is-dragging {
  --lift: 1.08;
  z-index: 140 !important;
  cursor: grabbing;
}

.sticker.is-dragging img {
  filter: drop-shadow(13px 19px 8px rgba(74, 24, 42, 0.34));
}

.sticker.is-gliding {
  transition: transform 520ms cubic-bezier(0.16, 0.82, 0.2, 1);
}

.sticker--seal {
  z-index: 75;
}

.sticker--seal::before {
  position: absolute;
  inset: 8%;
  z-index: -1;
  border-radius: 50%;
  content: "";
  opacity: 0.45;
  background: rgba(255, 235, 181, 0.72);
  filter: blur(14px);
  animation: seal-glow 2.2s 1.2s infinite ease-in-out;
}

.sticker--seal__hint {
  position: absolute;
  top: 83%;
  left: 50%;
  min-width: max-content;
  padding: 4px 10px 3px;
  border: 1.5px solid rgba(74, 42, 46, 0.65);
  border-radius: 4px 8px 4px 9px;
  opacity: 0;
  background: rgba(255, 246, 208, 0.95);
  box-shadow: 2px 3px 0 rgba(84, 27, 46, 0.14);
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-size: clamp(15px, 1.7vw, 21px);
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, 8px) rotate(-4deg);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sticker--seal:hover .sticker--seal__hint,
.sticker--seal:focus-visible .sticker--seal__hint {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-4deg);
}

.scene.message-revealed .sticker--seal::before,
.scene.message-revealed .sticker--seal__hint {
  display: none;
}

.interaction-help {
  position: absolute;
  right: auto;
  bottom: clamp(18px, 2.5vw, 32px);
  left: clamp(18px, 2.5vw, 36px);
  z-index: 90;
  max-width: min(380px, calc(100vw - 36px));
  margin: 0;
  padding: 10px 16px 9px;
  border: 1.5px solid rgba(83, 39, 48, 0.68);
  border-radius: 7px 13px 7px 12px;
  background: rgba(255, 244, 213, 0.9);
  box-shadow: 4px 5px 0 rgba(94, 29, 51, 0.14);
  font-size: clamp(13px, 1.3vw, 16px);
  line-height: 1.15;
  transform: rotate(1deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease;
}

.interaction-help.is-visible {
  opacity: 1;
  font-family: "Gaegu", "Bradley Hand", cursive;
  font-weight: 700;
  color: var(--rose-deep);
}

.scene.message-revealed .interaction-help {
  opacity: 0;
  transform: translateY(16px) rotate(1deg);
  transition-duration: 250ms;
  pointer-events: none;
}

.audio-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 310;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 8px;
  place-items: center;
  border: 2px solid rgba(71, 42, 50, 0.86);
  border-radius: 46% 54% 49% 51% / 52% 45% 55% 48%;
  visibility: hidden;
  opacity: 0;
  background: rgba(255, 246, 218, 0.96);
  box-shadow:
    3px 4px 0 rgba(91, 32, 51, 0.2),
    inset 0 0 0 2px rgba(235, 134, 157, 0.18);
  cursor: pointer;
  pointer-events: none;
  transform: translateY(10px) rotate(4deg) scale(0.9);
  transition:
    opacity 260ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 260ms;
}

.audio-toggle.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) rotate(4deg) scale(1);
  transition-delay: 0s;
}

.audio-toggle:hover {
  transform: translateY(-2px) rotate(1deg) scale(1.04);
}

.audio-toggle:active {
  box-shadow: 1px 2px 0 rgba(91, 32, 51, 0.2);
  transform: translateY(2px) rotate(2deg) scale(0.97);
}

.audio-toggle:focus-visible {
  outline: 3px solid #fff0a8;
  outline-offset: 3px;
}

.audio-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.audio-toggle__speaker {
  fill: var(--rose-deep);
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.audio-toggle__wave {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 2;
  transition: opacity 180ms ease;
}

.audio-toggle.is-muted .audio-toggle__wave {
  opacity: 0;
}

.audio-toggle.is-muted::after {
  position: absolute;
  width: 27px;
  height: 2px;
  border: 1px solid rgba(255, 246, 218, 0.9);
  border-radius: 999px;
  content: "";
  background: var(--cherry);
  transform: rotate(-46deg);
}

.celebration {
  position: absolute;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  pointer-events: none;
}

.celebration i {
  --confetti-color: #fff0a8;
  position: absolute;
  top: 48%;
  left: 50%;
  width: 9px;
  height: 17px;
  border: 1px solid rgba(88, 43, 46, 0.28);
  border-radius: 5px 2px 5px 2px;
  opacity: 0;
  background: var(--confetti-color);
}

.celebration.is-active i {
  animation: confetti-burst 1100ms var(--confetti-delay) both cubic-bezier(0.12, 0.7, 0.25, 1);
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 300;
  margin: 0;
  padding: 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  text-align: center;
}

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

@keyframes envelope-arrival {
  from {
    opacity: 0;
    transform: translate(-50%, -43%) rotate(-11deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-7deg) scale(1);
  }
}

@keyframes note-arrival {
  from {
    opacity: 0;
    transform: translateY(-18px) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-3deg);
  }
}

@keyframes sticker-arrival {
  from {
    opacity: 0;
    scale: 0.7;
    translate: 0 -24px;
  }
  to {
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
}

@keyframes seal-glow {
  0%,
  100% {
    opacity: 0.28;
    scale: 0.9;
  }
  50% {
    opacity: 0.65;
    scale: 1.08;
  }
}

@keyframes flap-settle {
  from {
    opacity: 0;
    transform: rotateX(55deg) translateY(15%) translateZ(-30px);
  }
  to {
    opacity: 1;
    transform: rotateX(-12deg) translateY(0) translateZ(-30px);
  }
}

@keyframes letter-unfold {
  0% {
    opacity: 0;
    transform: translateY(34%) translateZ(10px) scaleY(0.1) rotateX(-74deg) rotate(7deg);
  }
  24% {
    opacity: 1;
    transform: translateY(-5%) translateZ(10px) scaleY(0.12) rotateX(-68deg) rotate(7deg);
  }
  58% {
    opacity: 1;
    transform: translateY(-10%) translateZ(10px) scaleY(0.18) rotateX(-26deg) rotate(7deg);
  }
  78% {
    opacity: 1;
    transform: translateY(-12%) translateZ(10px) scaleY(1.04) rotateX(3deg) rotate(7deg);
  }
  100% {
    opacity: 1;
    transform: translateY(-8%) translateZ(10px) scaleY(1) rotateX(0) rotate(7deg);
  }
}

@keyframes ink-appear {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--confetti-x)), calc(-50% + var(--confetti-y))) rotate(var(--confetti-spin)) scale(1);
  }
}

@media (max-width: 720px) {
  .scene {
    min-height: 520px;
  }

  .table-note {
    min-width: 116px;
    padding: 9px 18px 7px 14px;
  }

  .table-note__eyebrow {
    font-size: 8px;
  }

  .table-note__name {
    font-size: 30px;
  }

  .envelope-stage {
    --envelope-width: min(88vw, 620px);
    top: 52%;
  }

  .letter-paper {
    right: 5%;
    left: 5%;
    min-height: 108%;
    padding: 22px 20px;
  }

  .interaction-help {
    right: 14px;
    bottom: 13px;
    left: 14px;
    max-width: none;
    padding: 7px 11px 6px;
    text-align: center;
  }

  .audio-toggle {
    right: 14px;
    bottom: 14px;
  }

}

@media (max-width: 480px) {
  .sticker[data-sticker="woman-fruit"] {
    --x: 8% !important;
    --y: 59% !important;
  }

  .sticker[data-sticker="pray-infinity"] {
    --x: 84% !important;
    --y: 80% !important;
  }

  .sticker[data-sticker="plate-888"] {
    --y: 87% !important;
  }

  .cherry-mark {
    display: none;
  }

  .expanded-letter__scroll {
    padding: 42px 28px 80px;
  }

  .expanded-letter__content {
    font-size: 18px;
    line-height: 1.5;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .scene {
    min-height: 420px;
  }

  .envelope-stage {
    --envelope-width: min(58vw, 610px);
    top: 55%;
  }

  .table-note {
    top: 16px;
  }

  .letter-paper {
    min-height: 82%;
    padding: 18px 28px;
  }

}

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

  .envelope-stage.is-open .letter-paper {
    opacity: 1;
    transform: translateY(-8%) translateZ(10px) scaleY(1) rotateX(0) rotate(7deg);
  }

  .envelope-stage.is-open .letter-copy {
    opacity: 1;
  }

  .celebration {
    display: none;
  }
}
