@import url("https://fonts.googleapis.com/css2?family=Marck+Script&family=Nunito:wght@400;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --wine: #6a2138;
  --rose-deep: #bd3155;
  --rose: #e86f88;
  --coral: #ff9aa7;
  --blush: #fff4f7;
  --cream: #fffaf3;
  --gold: #efc36f;
  --ink: #44202e;
  --muted: #8f5b6c;
  --line: rgba(189, 49, 85, 0.16);
  --panel: rgba(255, 250, 252, 0.84);
  --shadow: 0 24px 76px rgba(111, 39, 58, 0.2);
  font-family: "Nunito", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(112, 35, 58, 0.72), rgba(232, 111, 136, 0.56) 42%, rgba(255, 212, 218, 0.66) 72%, rgba(255, 250, 243, 0.92)),
    linear-gradient(24deg, rgba(239, 195, 111, 0.24), transparent 34% 74%, rgba(189, 49, 85, 0.2)),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 20px),
    #f5a7b5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.silk {
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(100deg, transparent 0 12%, rgba(255, 255, 255, 0.22) 24%, transparent 42%),
    linear-gradient(26deg, rgba(239, 195, 111, 0.22), transparent 30% 70%, rgba(106, 33, 56, 0.12)),
    linear-gradient(145deg, rgba(255, 244, 247, 0.22), rgba(232, 111, 136, 0.12));
  filter: saturate(1.1);
  animation: silkMove 18s ease-in-out infinite alternate;
}

.ribbon {
  position: absolute;
  width: 135vw;
  height: 18vh;
  left: -18vw;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(90deg, transparent, rgba(255, 244, 247, 0.24), rgba(239, 195, 111, 0.18), transparent);
  transform-origin: center;
  opacity: 0.78;
}

.ribbon-one {
  top: 9vh;
  transform: rotate(-10deg);
  animation: ribbonFloat 14s ease-in-out infinite;
}

.ribbon-two {
  bottom: 8vh;
  transform: rotate(8deg);
  animation: ribbonFloat 18s ease-in-out infinite reverse;
}

.heart-field {
  position: absolute;
  inset: 0;
}

.moment-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background:
    linear-gradient(135deg, rgba(255, 250, 252, 0.82), rgba(255, 221, 227, 0.74)),
    linear-gradient(24deg, rgba(239, 195, 111, 0.2), transparent 58%, rgba(189, 49, 85, 0.14));
  backdrop-filter: blur(18px);
  transition: opacity 520ms ease, visibility 520ms ease;
}

.moment-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.moment-symbol {
  position: relative;
  z-index: 2;
  font-size: clamp(5rem, 17vw, 11rem);
  line-height: 1;
  filter: drop-shadow(0 24px 36px rgba(189, 49, 85, 0.24));
  transform: scale(0.56) translateY(18px);
  opacity: 0;
}

.moment-overlay.is-visible .moment-symbol {
  animation: momentSymbol 1350ms cubic-bezier(0.2, 0.88, 0.2, 1) forwards;
}

.moment-text {
  position: absolute;
  top: calc(50% + clamp(68px, 11vw, 128px));
  left: 50%;
  z-index: 2;
  width: min(82vw, 560px);
  margin: 0;
  color: var(--wine);
  font-family: "Marck Script", "Segoe Script", "Bradley Hand ITC", cursive;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
}

.moment-overlay.is-visible .moment-text {
  animation: momentText 1350ms ease forwards;
}

.moment-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.moment-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  color: var(--rose-deep);
  font-size: var(--size, 1.2rem);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: momentParticle var(--duration, 1300ms) cubic-bezier(0.18, 0.82, 0.22, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.floating-heart {
  position: absolute;
  bottom: -4rem;
  color: rgba(255, 250, 252, 0.72);
  font-size: var(--size, 1rem);
  text-shadow: 0 8px 20px rgba(82, 23, 42, 0.28);
  animation: floatHeart var(--duration, 14s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
  display: grid;
  place-items: center;
}

.invite {
  position: relative;
  width: min(100%, 780px);
  min-height: 620px;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 244, 247, 0.42)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.invite::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(245, 191, 101, 0.16), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 8px);
  opacity: 0.8;
  pointer-events: none;
}

.topline,
.progress,
.step {
  position: relative;
  z-index: 1;
}

.topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.tiny-heart {
  color: var(--rose);
  font-size: 0.9rem;
}

.progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(26px, 5vw, 46px);
}

.invite.is-intro .progress {
  display: none;
}

.invite.is-letter {
  align-self: start;
  min-height: 0;
}

.progress-dot {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(168, 15, 56, 0.2);
  transition: width 280ms ease, background 280ms ease, transform 280ms ease;
}

.progress-dot.is-active {
  width: 58px;
  background: linear-gradient(90deg, var(--rose-deep), var(--coral), var(--gold));
  transform: translateY(-1px);
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  animation: stepIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.invite.is-breathing {
  animation: inviteBreath 980ms ease;
}

.intro-letter {
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(260px, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 46px);
  min-height: 490px;
}

.intro-envelope {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1.24;
  margin: 0 auto;
  filter: drop-shadow(0 28px 44px rgba(111, 39, 58, 0.22));
  transform-origin: center;
  animation: introLetterFly 1250ms cubic-bezier(0.16, 0.86, 0.2, 1) both, introLetterNudge 2.8s 1.35s ease-in-out infinite;
}

.intro-letter.is-opening .intro-envelope {
  animation: introOpenWhole 920ms ease both;
}

.intro-envelope-back,
.intro-envelope-front,
.intro-envelope-left,
.intro-envelope-right,
.intro-envelope-flap,
.intro-envelope-paper,
.intro-envelope-seal {
  position: absolute;
}

.intro-envelope-back {
  inset: 12% 0 0;
  border: 1px solid rgba(189, 49, 85, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 238, 242, 0.96));
}

.intro-envelope-paper {
  left: 10%;
  right: 10%;
  top: 18%;
  height: 62%;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 20px 18px;
  border: 1px solid rgba(232, 111, 136, 0.16);
  border-radius: 8px;
  color: var(--rose-deep);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 250, 0.98)),
    repeating-linear-gradient(0deg, rgba(189, 49, 85, 0.04) 0 1px, transparent 1px 24px);
  box-shadow: 0 12px 22px rgba(111, 39, 58, 0.1);
  transform: translateY(32%);
  transition: transform 720ms cubic-bezier(0.2, 0.86, 0.2, 1);
}

.intro-envelope-paper span {
  font-size: 0.86rem;
  font-weight: 900;
}

.intro-envelope-paper strong {
  font-size: 2.25rem;
  line-height: 1;
}

.intro-letter.is-opening .intro-envelope-paper {
  transform: translateY(-18%) rotate(-1deg);
}

.intro-envelope-front {
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  border: 1px solid rgba(189, 49, 85, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 249, 0.96), rgba(255, 226, 232, 0.96));
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
}

.intro-envelope-left {
  left: 0;
  bottom: 0;
  width: 50%;
  height: 58%;
  background: linear-gradient(35deg, rgba(255, 221, 227, 0.96), rgba(255, 248, 250, 0.82));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.intro-envelope-right {
  right: 0;
  bottom: 0;
  width: 50%;
  height: 58%;
  background: linear-gradient(325deg, rgba(255, 221, 227, 0.96), rgba(255, 248, 250, 0.82));
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.intro-envelope-flap {
  left: 0;
  right: 0;
  top: 12%;
  height: 54%;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 250, 252, 0.98), rgba(255, 221, 227, 0.96));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 760ms cubic-bezier(0.2, 0.86, 0.2, 1), opacity 760ms ease;
}

.intro-letter.is-opening .intro-envelope-flap {
  transform: rotateX(174deg);
  opacity: 0.62;
}

.intro-envelope-seal {
  left: 50%;
  top: 48%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.36), transparent 30%),
    linear-gradient(135deg, var(--rose-deep), var(--coral));
  box-shadow: 0 14px 26px rgba(189, 49, 85, 0.24), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  font-size: 1.85rem;
  transform: translate(-50%, -50%) rotate(-8deg);
  transition: transform 520ms ease, opacity 520ms ease;
}

.intro-letter.is-opening .intro-envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(18deg) scale(0.45);
}

.intro-copy {
  position: relative;
  z-index: 1;
}

.intro-copy h2 {
  font-size: clamp(3.4rem, 7vw, 5.6rem);
}

.intro-open-button {
  margin-top: 28px;
}

.handwritten-stage {
  position: relative;
  width: min(100%, 680px);
  margin: 0 auto;
  perspective: 1200px;
}

.handwritten-paper {
  position: relative;
  min-height: min(62vh, 620px);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid rgba(189, 49, 85, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 244, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(189, 49, 85, 0.09) 32px 33px);
  box-shadow: 0 26px 70px rgba(111, 39, 58, 0.18);
  overflow: hidden;
  transform-origin: 50% 20%;
}

.step.is-active .handwritten-paper {
  animation: paperArrive 980ms cubic-bezier(0.16, 0.86, 0.2, 1) both;
}

.handwritten-paper::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(232, 111, 136, 0.14);
  border-radius: 8px;
  pointer-events: none;
}

.handwritten-paper::after {
  content: "";
  position: absolute;
  left: 34px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(232, 111, 136, 0.16);
  pointer-events: none;
}

.handwritten-seal {
  position: absolute;
  right: 24px;
  top: 20px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(135deg, var(--rose-deep), var(--coral));
  box-shadow: 0 12px 24px rgba(189, 49, 85, 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  font-size: 1.65rem;
  transform: rotate(8deg);
}

.handwritten-lines {
  position: relative;
  z-index: 1;
  max-height: min(48vh, 480px);
  overflow-y: auto;
  padding: 8px 8px 4px 24px;
  color: var(--wine);
  scrollbar-color: rgba(189, 49, 85, 0.22) transparent;
}

.handwritten-text {
  animation: letterTextAppear 820ms 240ms ease both;
}

.handwritten-text p {
  margin: 0 0 18px;
  font-family: "Marck Script", "Segoe Script", "Bradley Hand ITC", cursive;
  font-size: clamp(1.48rem, 3.2vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.handwritten-text p:first-child {
  font-size: clamp(2.05rem, 4.8vw, 3rem);
  margin-bottom: 14px;
}

.handwritten-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  padding-left: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rose-deep);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2 {
  max-width: 720px;
  margin: 0;
  color: var(--wine);
  font-family: "Marck Script", "Segoe Script", "Bradley Hand ITC", cursive;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.35rem, 8vw, 6.25rem);
}

h2 {
  font-size: clamp(3rem, 6.2vw, 5rem);
}

.lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.1vw, 1.22rem);
  line-height: 1.75;
  font-weight: 600;
}

.lead.compact {
  max-width: 560px;
  margin-top: 14px;
}

.question-actions,
.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button,
.chip {
  position: relative;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button {
  padding: 0 24px;
  isolation: isolate;
}

.button:hover,
.chip:hover,
.choice:hover {
  transform: translateY(-2px);
}

.button:active,
.chip:active,
.choice:active {
  transform: translateY(0);
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose) 58%, var(--coral));
  background-size: 180% 180%;
  box-shadow: 0 16px 34px rgba(189, 49, 85, 0.28);
  animation: buttonGlow 4.5s ease-in-out infinite;
}

.button.primary::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.26);
  pointer-events: none;
}

.button.secondary,
.button.ghost {
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.no-button {
  min-width: 104px;
  overflow: hidden;
}

.kiss-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4) rotate(-14deg);
  filter: drop-shadow(0 8px 12px rgba(168, 15, 56, 0.32));
  transition: opacity 180ms ease, transform 220ms ease;
}

.no-button.is-kissed .kiss-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.7) rotate(8deg);
}

.no-button.is-kissed {
  color: transparent;
}

.no-hint {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--rose-deep);
  font-weight: 700;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

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

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.chip {
  min-height: 42px;
  padding: 0 16px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(168, 15, 56, 0.18);
}

.chip.is-selected {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  animation: selectedPulse 520ms ease;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  border: 1px solid rgba(168, 15, 56, 0.2);
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(82, 23, 42, 0.08);
  transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input {
  min-height: 56px;
  padding: 0 16px;
}

.field input[type="date"],
.field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

.field input[type="date"]::-webkit-date-and-time-value,
.field input[type="time"]::-webkit-date-and-time-value {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.field textarea {
  min-height: 92px;
  padding: 14px 16px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(223, 35, 86, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(223, 35, 86, 0.12), 0 14px 28px rgba(82, 23, 42, 0.1);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.choice {
  min-height: 146px;
  padding: 16px 12px;
  border: 1px solid rgba(168, 15, 56, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  box-shadow: 0 12px 30px rgba(82, 23, 42, 0.08);
  transition: transform 180ms ease, border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.choice.is-selected {
  border-color: rgba(232, 111, 136, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 244, 247, 0.9));
  box-shadow: 0 16px 38px rgba(189, 49, 85, 0.14), inset 0 0 0 2px rgba(232, 111, 136, 0.18);
  animation: selectedPulse 560ms ease;
}

.choice.is-selected .choice-icon {
  animation: iconKiss 620ms ease;
}

.choice-icon {
  display: block;
  height: 34px;
  font-size: 1.75rem;
  line-height: 1;
}

.choice-title {
  display: block;
  margin-top: 10px;
  color: var(--rose-deep);
  font-size: 1rem;
  font-weight: 950;
}

.choice-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.note-field {
  margin-top: 18px;
}

.form-error {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--rose-deep);
  font-weight: 850;
}

.letter-stage {
  position: relative;
  width: min(100%, 640px);
  perspective: 1200px;
}

.letter-stage::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 38px;
  border-radius: 50%;
  background: rgba(111, 39, 58, 0.18);
  filter: blur(18px);
  opacity: 0;
  transform: scale(0.72);
}

.step.is-active .letter-stage::before {
  animation: letterShadow 1500ms cubic-bezier(0.16, 0.86, 0.2, 1) forwards;
}

.letter-card {
  position: relative;
  width: 100%;
  padding: clamp(94px, 10vw, 108px) clamp(22px, 4.6vw, 44px) clamp(24px, 4vw, 34px);
  overflow: hidden;
  border: 1px solid rgba(189, 49, 85, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 249, 0.92)),
    repeating-linear-gradient(0deg, rgba(189, 49, 85, 0.035) 0 1px, transparent 1px 34px);
  box-shadow: 0 28px 70px rgba(111, 39, 58, 0.2);
  transform-origin: 50% 35%;
}

.letter-card > :not(.letter-flap) {
  position: relative;
  z-index: 1;
}

.step.is-active .letter-card {
  animation: letterFlyIn 1550ms cubic-bezier(0.16, 0.86, 0.2, 1) both;
}

.letter-card::before,
.letter-card::after,
.letter-flap {
  content: "";
  position: absolute;
  pointer-events: none;
}

.letter-card::before {
  inset: 10px;
  border: 1px solid rgba(232, 111, 136, 0.16);
  border-radius: 8px;
}

.letter-card::after {
  right: 0;
  bottom: -70px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 195, 111, 0.24), transparent 66%);
  transform: translateX(48%);
}

.letter-flap {
  top: 0;
  left: 0;
  width: 100%;
  height: 88px;
  background:
    linear-gradient(145deg, rgba(255, 221, 227, 0.74), transparent 58%),
    linear-gradient(215deg, rgba(255, 221, 227, 0.7), transparent 58%);
  clip-path: polygon(0 0, 100% 0, 50% 92%);
  opacity: 0.78;
}

.letter-seal.final-mark {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.32), transparent 30%),
    linear-gradient(135deg, var(--rose-deep), var(--coral));
  box-shadow: 0 14px 28px rgba(189, 49, 85, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  font-size: 1.82rem;
  transform: translateX(-50%) rotate(-7deg);
  animation: sealHeartbeat 1.6s ease-in-out infinite;
}

.letter-card .eyebrow {
  margin-bottom: 6px;
}

.letter-card h2 {
  font-size: clamp(2.55rem, 5.4vw, 4.25rem);
}

.letter-card .lead {
  margin-top: 12px;
  font-size: clamp(0.98rem, 1.9vw, 1.12rem);
  line-height: 1.58;
}

.letter-card .summary {
  margin-top: 18px;
}

.summary {
  display: grid;
  gap: 10px;
  max-width: 620px;
  margin-top: 26px;
}

.love-note {
  display: grid;
  gap: 8px;
  max-width: 560px;
  padding: 14px 16px;
  border: 1px solid rgba(232, 111, 136, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 12px 30px rgba(111, 39, 58, 0.08);
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.55;
}

.love-note strong {
  color: var(--wine);
  font-family: "Marck Script", "Segoe Script", "Bradley Hand ITC", cursive;
  font-size: clamp(1.65rem, 3.7vw, 2.35rem);
  font-weight: 400;
  line-height: 1;
}

.love-note em {
  color: var(--rose-deep);
  font-style: normal;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 13px 14px;
  border: 1px solid rgba(168, 15, 56, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-weight: 650;
}

.summary-row strong {
  color: var(--wine);
}

.restart-button {
  margin-top: 26px;
}

.step[data-step="final"] .restart-button {
  margin-top: 34px;
}

.burst-heart {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  color: var(--rose);
  font-weight: 900;
  text-shadow: 0 10px 20px rgba(82, 23, 42, 0.22);
  animation: burst 820ms cubic-bezier(0.17, 0.8, 0.32, 1) forwards;
}

.trail-heart {
  position: fixed;
  z-index: 35;
  pointer-events: none;
  color: rgba(189, 49, 85, 0.72);
  font-size: var(--size, 1rem);
  transform: translate(-50%, -50%);
  text-shadow: 0 8px 18px rgba(111, 39, 58, 0.18);
  animation: trailHeart 900ms ease-out forwards;
}

@keyframes silkMove {
  from {
    transform: translate3d(-2%, -1%, 0) rotate(-1deg);
  }
  to {
    transform: translate3d(2%, 1.5%, 0) rotate(1deg);
  }
}

@keyframes ribbonFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 18px;
  }
}

@keyframes floatHeart {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.72;
  }
  100% {
    transform: translate3d(var(--drift, 30px), -112vh, 0) rotate(var(--spin, 180deg));
    opacity: 0;
  }
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes introLetterFly {
  0% {
    opacity: 0;
    transform: translate3d(-34vw, -22vh, 0) rotate(-17deg) scale(0.58);
    filter: blur(8px);
  }
  56% {
    opacity: 1;
    transform: translate3d(14px, 8px, 0) rotate(4deg) scale(1.04);
    filter: blur(0);
  }
  78% {
    transform: translate3d(-6px, -4px, 0) rotate(-2deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes introLetterNudge {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  8% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
  16% {
    transform: translateY(2px) rotate(1deg);
  }
  24% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
  32% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes introOpenWhole {
  0% {
    transform: scale(1) rotate(0deg);
  }
  44% {
    transform: scale(1.03) rotate(-1.2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes paperArrive {
  0% {
    opacity: 0;
    transform: translate3d(0, 34px, 0) rotateX(12deg) scale(0.96);
    filter: blur(8px);
  }
  64% {
    opacity: 1;
    transform: translate3d(0, -8px, 0) rotateX(0deg) scale(1.01);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
    filter: blur(0);
  }
}

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

@keyframes momentSymbol {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(26px) rotate(-8deg);
  }
  34% {
    opacity: 1;
    transform: scale(1.08) translateY(0) rotate(4deg);
  }
  58% {
    opacity: 1;
    transform: scale(0.96) translateY(0) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

@keyframes momentText {
  0%,
  24% {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
  55%,
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes momentParticle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  18% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.08) rotate(var(--r));
  }
}

@keyframes inviteBreath {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.992);
  }
}

@keyframes buttonGlow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes selectedPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  42% {
    transform: translateY(-2px) scale(1.025);
  }
}

@keyframes iconKiss {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  48% {
    transform: scale(1.22) rotate(-6deg);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  55% {
    transform: scale(0.98);
  }
}

@keyframes sealHeartbeat {
  0%,
  100% {
    transform: translateX(-50%) rotate(-7deg) scale(1);
  }
  36% {
    transform: translateX(-50%) rotate(-5deg) scale(1.08);
  }
  58% {
    transform: translateX(-50%) rotate(-8deg) scale(0.98);
  }
}

@keyframes letterFlyIn {
  0% {
    opacity: 0;
    transform: translate3d(-44vw, -34vh, 0) rotate(-16deg) scale(0.58);
    filter: blur(10px);
  }
  46% {
    opacity: 1;
    transform: translate3d(24px, 18px, 0) rotate(5deg) scale(1.04);
    filter: blur(0);
  }
  72% {
    transform: translate3d(-8px, -6px, 0) rotate(-2deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes letterShadow {
  0% {
    opacity: 0;
    transform: scale(0.48) translateX(-18px);
  }
  48% {
    opacity: 0.95;
    transform: scale(1.05) translateX(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

@keyframes burst {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.3) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) scale(1.25) rotate(var(--r));
  }
}

@keyframes trailHeart {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.35) rotate(0deg);
  }
  20% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.12) rotate(var(--r));
  }
}

@media (max-width: 760px) {
  .shell {
    align-items: stretch;
    padding: 12px;
  }

  .invite {
    min-height: calc(100vh - 24px);
    padding: 22px;
  }

  .topline {
    justify-content: flex-start;
    margin-bottom: 22px;
    font-size: 0.7rem;
  }

  .progress {
    justify-content: flex-start;
    margin-bottom: 28px;
  }

  .progress-dot {
    width: 30px;
  }

  .progress-dot.is-active {
    width: 44px;
  }

  .question-actions,
  .step-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .intro-letter {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: auto;
  }

  .intro-envelope {
    width: min(88%, 300px);
  }

  .intro-copy h2 {
    font-size: clamp(3rem, 16vw, 4.45rem);
  }

  .handwritten-paper {
    min-height: 0;
    max-height: calc(100dvh - 170px);
    padding: 24px 14px 20px;
  }

  .handwritten-paper::after {
    left: 22px;
  }

  .handwritten-seal {
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    font-size: 1.42rem;
  }

  .handwritten-lines {
    max-height: calc(100dvh - 250px);
    padding-left: 18px;
    padding-right: 2px;
  }

  .handwritten-text p {
    font-size: clamp(1.34rem, 7vw, 1.74rem);
    line-height: 1.2;
  }

  .handwritten-text p:first-child {
    padding-right: 52px;
    font-size: clamp(1.86rem, 10vw, 2.42rem);
  }

  .handwritten-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding-left: 18px;
  }

  .form-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 112px;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .floating-heart {
    display: none;
  }
}
