:root {
  --wine: #7d142b;
  --wine-dark: #3d0b19;
  --red: #c52747;
  --rose: #e38a99;
  --blush: #f4c5c8;
  --paper: #fff8eb;
  --ink: #44272a;
  --gold: #d8b47a;
  --night: #11060a;
  --ease-silk: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

html {
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  color: #fff5f2;
  background:
    radial-gradient(circle at 50% 36%, rgba(130, 25, 53, 0.22), transparent 38%),
    linear-gradient(145deg, #1a090f 0%, #0e0508 58%, #17080e 100%);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.ambient,
.aurora,
.grain,
.stars,
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  overflow: hidden;
}

.aurora {
  width: 65vw;
  height: 65vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.11;
  animation: breathe 8s ease-in-out infinite alternate;
}

.aurora--one {
  top: -36vw;
  left: -14vw;
  background: #db3658;
}

.aurora--two {
  inset: auto -27vw -38vw auto;
  background: #922b57;
  animation-delay: -4s;
}

.grain {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.star {
  position: absolute;
  width: 3px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffd7cf;
  box-shadow: 0 0 10px 1px rgba(255, 199, 190, 0.6);
  opacity: 0;
  animation: twinkle var(--duration) ease-in-out var(--delay) infinite;
}

.petal {
  position: absolute;
  top: -8vh;
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 0.72);
  border-radius: 70% 12% 70% 20%;
  background: linear-gradient(135deg, rgba(202, 58, 79, 0.8), rgba(105, 16, 38, 0.24));
  filter: blur(0.2px);
  opacity: 0;
  transform: rotate(var(--rotate));
  animation: petal-fall var(--fall-time) linear var(--delay) infinite;
}

.experience {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 100svh;
  padding: clamp(24px, 4vh, 46px) 20px clamp(18px, 3vh, 32px);
}

.intro {
  text-align: center;
  animation: intro-arrive 0.9s 0.05s both var(--ease-silk);
  transition: opacity 0.7s ease, transform 0.9s var(--ease-silk);
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 10px;
  color: rgba(244, 197, 200, 0.7);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow span {
  width: clamp(20px, 4vw, 48px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 180, 122, 0.65));
}

.eyebrow span:last-child {
  transform: scaleX(-1);
}

h1 {
  margin: 0;
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(2.6rem, 5.3vw, 5.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 45px rgba(199, 39, 71, 0.16);
}

h1 em {
  color: #d76b7d;
  font-family: "Caveat", cursive;
  font-size: 1.13em;
  font-weight: 500;
}

.intro-copy {
  margin: 12px 0 0;
  color: rgba(255, 238, 234, 0.58);
  font-family: Georgia, serif;
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  font-style: italic;
  letter-spacing: 0.02em;
}

.letter-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(92vw, 860px);
  height: clamp(360px, 58vh, 570px);
  margin: 1vh auto 0;
  perspective: 1500px;
}

.halo {
  position: absolute;
  top: 51%;
  left: 50%;
  width: min(72vw, 680px);
  height: min(32vw, 280px);
  border-radius: 50%;
  background: rgba(192, 49, 75, 0.15);
  filter: blur(60px);
  transform: translate(-50%, -50%);
  transition: width 1.5s var(--ease-silk), height 1.5s var(--ease-silk), opacity 1s ease;
}

.envelope {
  --envelope-width: min(76vw, 580px);
  position: relative;
  z-index: 3;
  width: var(--envelope-width);
  height: calc(var(--envelope-width) * 0.58);
  margin-top: 24px;
  transform-style: preserve-3d;
  animation: envelope-arrive 1.05s 0.25s both var(--ease-silk);
  transition: transform 1s var(--ease-silk);
}

.envelope-shadow {
  position: absolute;
  z-index: -2;
  inset: auto 9% -10% 9%;
  height: 20%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  filter: blur(20px);
  transform: translateZ(-40px);
  transition: opacity 1s ease, transform 1s ease;
}

.envelope-back {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 211, 0.12);
  border-radius: 4px 4px 13px 13px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.055), transparent 32%),
    linear-gradient(135deg, #8f1d37, #5a1025);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.46), inset 0 -2px 3px rgba(36, 3, 12, 0.4);
  transition: opacity 0.25s ease, visibility 0s;
}

.envelope-front {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  border-radius: 4px 4px 13px 13px;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s;
}

.front-left,
.front-right,
.front-bottom {
  position: absolute;
  inset: 0;
}

.front-left {
  z-index: 1;
  background: linear-gradient(45deg, #74172f, #9c2440);
  clip-path: polygon(0 0, 53% 53%, 0 100%);
}

.front-right {
  z-index: 1;
  background: linear-gradient(-45deg, #661228, #881c37);
  clip-path: polygon(100% 0, 47% 53%, 100% 100%);
}

.front-bottom {
  z-index: 2;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.06), transparent 40%),
    linear-gradient(10deg, #861d38, #a32945);
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
  filter: drop-shadow(0 -3px 3px rgba(55, 7, 19, 0.18));
}

.address {
  position: absolute;
  z-index: 3;
  inset: 32% 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 232, 226, 0.87);
  text-align: center;
  user-select: none;
  transform: translateY(-50%);
  transition: opacity 0.45s ease;
}

.address span,
.address small {
  font-size: clamp(0.46rem, 1vw, 0.65rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.address strong {
  margin: -3px 0 0;
  font-family: "Caveat", cursive;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 1;
}

.address small {
  color: rgba(244, 197, 200, 0.55);
  letter-spacing: 0.12em;
}

.flap {
  position: absolute;
  z-index: 7;
  top: 0;
  left: 0;
  width: 100%;
  height: 61%;
  border-radius: 4px 4px 0 0;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(175deg, #a62946, #73162f 70%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 5px 4px rgba(54, 4, 17, 0.2));
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  transition:
    transform 0.72s var(--ease-silk),
    opacity 0.22s ease,
    visibility 0s,
    z-index 0s 0.36s;
  backface-visibility: visible;
}

.flap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(49, 7, 17, 0.42), transparent 62%);
  clip-path: inherit;
  backface-visibility: hidden;
}

.wax-seal {
  position: absolute;
  z-index: 8;
  top: 59%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(60px, 9.5vw, 74px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #f5bdc3;
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 190, 195, 0.34), transparent 14%),
    radial-gradient(circle at 50% 52%, #b72a47 0 52%, #951c38 70%, #681028 100%);
  box-shadow:
    0 9px 18px rgba(40, 1, 10, 0.48),
    inset 0 -7px 10px rgba(66, 4, 20, 0.52),
    inset 0 3px 6px rgba(255, 194, 198, 0.22),
    0 0 0 3px rgba(84, 8, 27, 0.42);
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 0 10px rgba(203, 47, 76, 0.18));
  transform: translate(-50%, -50%) rotate(-2deg);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-silk), filter 0.3s ease;
}

.wax-seal::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 194, 198, 0.4);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgba(70, 5, 21, 0.22),
    0 0 0 1px rgba(87, 7, 28, 0.3);
}

.wax-seal::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(223, 83, 105, 0.35);
  border-radius: 50%;
  opacity: 0;
  animation: seal-ring 2.4s 1.4s ease-out infinite;
}

.wax-seal:hover,
.wax-seal:focus-visible {
  outline: none;
  filter: brightness(1.13) drop-shadow(0 0 13px rgba(221, 80, 104, 0.3));
  transform: translate(-50%, -50%) rotate(0) scale(1.06);
}

.wax-seal:disabled {
  cursor: default;
}

.seal-shine {
  position: absolute;
  top: 17%;
  left: 25%;
  width: 18%;
  height: 9%;
  border-radius: 50%;
  background: rgba(255, 224, 221, 0.46);
  filter: blur(2px);
  transform: rotate(-28deg);
}

.seal-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  text-shadow: 0 2px 1px rgba(65, 4, 18, 0.52);
}

.seal-mark b {
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(1.65rem, 3.7vw, 2.1rem);
  font-weight: 400;
  line-height: 1;
}

.seal-mark i {
  position: absolute;
  right: 23%;
  bottom: 21%;
  font-family: Georgia, serif;
  font-size: clamp(0.48rem, 1.2vw, 0.65rem);
  font-style: normal;
}

.letter {
  position: absolute;
  z-index: 3;
  top: 6%;
  left: 50%;
  width: 89%;
  height: 94%;
  overflow: hidden;
  border-radius: 3px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(126, 73, 52, 0.035), transparent 9%, transparent 91%, rgba(126, 73, 52, 0.035)),
    var(--paper);
  box-shadow: 0 3px 9px rgba(39, 6, 14, 0.25);
  opacity: 0;
  transform: translateX(-50%) translateY(8%) scale(0.96);
  transform-origin: bottom center;
  transition:
    height 1s var(--ease-silk),
    width 1s var(--ease-silk),
    top 1s var(--ease-silk),
    opacity 0.5s ease,
    transform 1s var(--ease-silk),
    box-shadow 1s ease;
}

.paper-texture {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(91, 54, 34, 0.025) 4px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.letter-scroll {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(38px, 7vw, 64px) clamp(30px, 7vw, 68px) 90px;
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 37, 55, 0.35) transparent;
}

.letter-scroll::-webkit-scrollbar {
  width: 6px;
}

.letter-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.letter-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(132, 37, 55, 0.3);
}

.letter-heading {
  margin-bottom: 28px;
  text-align: center;
}

.letter-heading h2 {
  margin: 0 0 4px;
  color: #7e1c34;
  font-family: "Caveat", cursive;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1;
}

.letter-date {
  margin: 0 0 10px !important;
  color: #9e5c5d;
  font-family: "DM Sans", sans-serif !important;
  font-size: 0.65rem !important;
  font-style: normal !important;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.flourish {
  width: 150px;
  overflow: visible;
  fill: #a23d4f;
  stroke: #a23d4f;
  stroke-width: 0.8;
}

.letter-scroll p,
.letter-scroll blockquote {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.98rem, 2.1vw, 1.13rem);
  line-height: 1.87;
}

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

.letter-scroll p:not(.salutation, .letter-date, .closing-thought) {
  text-align: left;
}

.letter-scroll p:not(.salutation, .letter-date, .closing-thought)::first-letter {
  margin-left: 0.4em;
}

.letter-scroll .salutation {
  margin-bottom: 1em;
  color: #7a2034;
  font-family: "Caveat", cursive;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 600;
  line-height: 1;
}

.letter-scroll em {
  color: #8d273a;
}

.letter-scroll blockquote {
  position: relative;
  margin: 34px 2% 36px;
  padding: 24px 22px;
  color: #7c2838;
  text-align: center;
  font-style: italic;
  line-height: 1.65;
}

.letter-scroll blockquote::before,
.letter-scroll blockquote::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #bd8a7f, transparent);
  transform: translateX(-50%);
}

.letter-scroll blockquote::before {
  top: 0;
}

.letter-scroll blockquote::after {
  bottom: 0;
}

.letter-scroll .closing-thought {
  margin: 42px 0;
  color: #7e1c34;
  font-family: "Caveat", cursive;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.38;
  text-align: center;
}

.signature {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 38px;
  padding: 0 36px 12px 0;
  color: #6e1d30;
}

.signature span:first-child {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
}

.signature strong {
  margin-top: 4px;
  font-family: "Caveat", cursive;
  font-size: clamp(2.7rem, 6vw, 3.6rem);
  font-weight: 600;
  line-height: 0.9;
  transform: rotate(-4deg);
}

.signature small {
  margin-top: 6px;
  color: #966473;
  font-family: "DM Sans", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signature .signature-heart {
  position: absolute;
  right: 0;
  bottom: 19px;
  color: #ae2944;
  font-size: 1.8rem;
  transform: rotate(10deg);
}

.scroll-fade {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  height: 85px;
  pointer-events: none;
  background: linear-gradient(transparent, var(--paper) 78%);
  transition: opacity 0.4s ease;
}

.scroll-cue {
  position: absolute;
  z-index: 4;
  bottom: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94505a;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 0.35s ease;
}

.scroll-cue svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  animation: cue-bounce 1.6s ease-in-out infinite;
}

.scroll-cue.is-hidden,
.scroll-fade.is-hidden {
  opacity: 0;
}

.open-prompt {
  position: absolute;
  z-index: 9;
  right: -7px;
  bottom: 2%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  color: rgba(245, 211, 208, 0.64);
  background: transparent;
  font-family: "Caveat", cursive;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  animation: prompt-in 0.9s 1.6s forwards;
  transition: opacity 0.4s ease, color 0.3s ease;
}

.open-prompt:hover {
  color: rgba(255, 231, 227, 0.9);
}

.open-prompt svg {
  width: 44px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
}

.close-letter {
  position: fixed;
  z-index: 20;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(240, 196, 195, 0.16);
  border-radius: 999px;
  color: rgba(255, 234, 230, 0.65);
  background: rgba(42, 9, 17, 0.48);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.25s ease;
}

.close-letter:hover {
  background: rgba(88, 20, 37, 0.62);
}

.close-letter svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.close-letter span {
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.from-line {
  margin: 0;
  color: rgba(255, 235, 231, 0.33);
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 0.5s ease;
}

.from-line strong {
  color: rgba(229, 157, 164, 0.7);
  font-weight: 400;
}

.heart-burst {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.burst-heart {
  position: absolute;
  left: 50%;
  top: 53%;
  color: var(--color);
  font-size: var(--size);
  opacity: 0;
  text-shadow: 0 0 12px rgba(228, 74, 99, 0.4);
  animation: burst 1.8s var(--delay) var(--ease-silk) forwards;
}

.experience.is-settled .intro,
.experience.is-settled .envelope {
  animation: none;
}

.experience.is-settled .open-prompt {
  opacity: 1;
  animation: none;
}

.experience:not(.is-settled) .open-prompt {
  pointer-events: none;
}

/* Open state */
.experience.is-open .intro {
  opacity: 0;
  transform: translateY(-28px);
  pointer-events: none;
}

.experience.is-open .letter-stage {
  position: fixed;
  z-index: 12;
  inset: 0;
  width: 100vw;
  height: 100svh;
  margin: 0;
}

.experience.is-open .halo {
  width: min(94vw, 840px);
  height: min(75vh, 650px);
  opacity: 0.85;
}

.experience.is-open .envelope {
  animation: none;
  transform: translateY(27vh) scale(1.03);
}

.experience.is-opening .flap,
.experience.is-open .flap {
  z-index: 2;
  transform: rotateX(180deg);
}

.experience.is-open .envelope-back,
.experience.is-open .envelope-front {
  display: none;
}

.experience.is-open .flap {
  display: none;
}

.experience.is-opening .wax-seal,
.experience.is-open .wax-seal {
  opacity: 0;
  pointer-events: none;
  animation: none;
  transform: translate(-50%, -50%) scale(0.4) rotate(24deg);
}

.experience.is-opening .address,
.experience.is-open .address {
  opacity: 0;
}

.experience.is-opening .letter {
  opacity: 1;
}

.experience.is-open .letter {
  z-index: 10;
  top: -130%;
  width: min(92vw, 650px);
  height: min(82svh, 760px);
  opacity: 1;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.55), 0 0 90px rgba(192, 53, 79, 0.08);
  transform: translateX(-50%) translateY(-1%) scale(1);
}

.experience.is-open .envelope-shadow {
  opacity: 0.5;
  transform: translateZ(-40px) scale(0.85);
}

.experience.is-opening .open-prompt,
.experience.is-open .open-prompt,
.experience.is-open .from-line {
  opacity: 0;
  pointer-events: none;
}

.experience.is-opening .open-prompt {
  visibility: hidden;
}

.experience.is-open .close-letter {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@keyframes envelope-arrive {
  from {
    opacity: 0;
    transform: translateY(54px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-arrive {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes prompt-in {
  to {
    opacity: 1;
  }
}

@keyframes seal-ring {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  28% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes cue-bounce {
  0%,
  100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
  50% {
    opacity: 0.65;
    transform: scale(1);
  }
}

@keyframes petal-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(var(--rotate));
  }
  12% {
    opacity: 0.4;
  }
  88% {
    opacity: 0.25;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 115vh, 0) rotate(calc(var(--rotate) + 420deg));
  }
}

@keyframes breathe {
  to {
    opacity: 0.19;
    transform: scale(1.08) translate3d(2vw, 1vw, 0);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0);
  }
  18% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.15) rotate(var(--spin));
  }
}

@media (max-width: 680px) {
  .experience {
    padding-inline: 12px;
  }

  .intro {
    align-self: end;
    margin-bottom: 8px;
  }

  .letter-stage {
    width: 100%;
    height: 52vh;
    min-height: 360px;
  }

  .envelope {
    --envelope-width: min(91vw, 480px);
  }

  .open-prompt {
    right: 2%;
    bottom: 0;
  }

  .experience.is-open .letter-stage {
    height: 100svh;
  }

  .experience.is-open .envelope {
    transform: translateY(29vh);
  }

  .experience.is-open .letter {
    top: -130%;
    width: 95vw;
    height: 78svh;
  }

  .letter-scroll {
    padding: 36px 28px 82px;
  }

  .close-letter {
    top: 12px;
    right: 12px;
  }
}

@media (max-height: 680px) and (min-width: 681px) {
  .experience {
    padding-block: 16px;
  }

  .intro-copy {
    display: none;
  }

  .letter-stage {
    height: 58vh;
  }

  .experience.is-open .envelope {
    transform: translateY(30vh) scale(0.92);
  }

  .experience.is-open .letter {
    top: -130%;
    height: 88svh;
  }
}

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

  .petals {
    display: none;
  }
}
