/* ==========================================================================
   A Letter For Nuki — Stylesheet
   Designed with Love, Care & Visual Elegance
   ========================================================================== */

:root {
  --bg-romantic: #fae8ee;
  --bg-parchment: #f9f2e7;
  --parchment-border: #97705c;
  --parchment-line: rgba(184, 151, 126, 0.4);
  --pink-envelope: #ee9db3;
  --pink-envelope-dark: #dc849d;
  --pink-envelope-light: #f7b7c8;
  --seal-red: #8f1b3b;
  --seal-shadow: rgba(143, 27, 59, 0.35);
  --accent-gold: #c99b5b;
  --text-ink: #3a2c2b;
  --text-ink-soft: #544342;
  --text-red: #b82d46;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-cursive: 'Great Vibes', cursive;
  --font-hand: 'Caveat', cursive, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --shadow-lux: 0 20px 45px rgba(105, 50, 70, 0.16);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--bg-romantic);
  font-family: var(--font-sans);
  color: var(--text-ink);
  user-select: none;
}

/* Background image & frame */
body {
  background-image: url('assets/romantic_frame_bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
}

/* Ambient Canvas for Floating Sparkles & Hearts */
#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Main Site Container */
.site-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* ==========================================================================
   Envelope Stage (Initial Landing)
   ========================================================================== */
.envelope-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-top: 85px; /* Shifts envelope down comfortably to fit sliding note */
  box-sizing: border-box;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.envelope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  transform: translateY(35px); /* Positioned lower so note card never gets cut off */
}

/* 3D Envelope Container */
.envelope-card-container {
  position: relative;
  width: 380px;
  height: 250px;
  perspective: 1200px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: gentleFloat 4s ease-in-out infinite;
}

.envelope-card-container:hover {
  transform: translateY(-6px) scale(1.02);
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Envelope Back */
.env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f5c4d3 0%, #e8a6bb 100%);
  border-radius: 12px;
  box-shadow: 0 25px 45px rgba(120, 60, 80, 0.22);
}

/* Note Preview Card (Slides out smoothly) */
.env-preview-card {
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  height: 220px;
  background: var(--bg-parchment);
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(90, 45, 60, 0.18);
  border: 1px solid rgba(190, 150, 130, 0.4);
  padding: 16px;
  z-index: 5;
  transition: transform 0.7s cubic-bezier(0.34, 1.3, 0.64, 1), box-shadow 0.4s ease;
  transform: translateY(0);
}

.card-inner-texture {
  width: 100%;
  height: 100%;
  border: 1.5px dashed rgba(190, 150, 130, 0.45);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.card-heart-stamp {
  font-size: 26px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(210, 80, 120, 0.3));
}

.card-text {
  font-family: var(--font-hand);
  font-size: 2.2rem;
  font-weight: 700;
  color: #4b353a;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.card-subtext {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ad5270;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s ease;
}

/* When Envelope is Opened */
.envelope-card-container.is-open .env-preview-card {
  transform: translateY(-105px);
  box-shadow: 0 15px 35px rgba(90, 45, 60, 0.28);
}

.envelope-card-container.is-open .card-subtext {
  opacity: 1;
  transform: translateY(0);
  animation: pulseSubtext 1.5s ease-in-out infinite alternate;
}

@keyframes pulseSubtext {
  from { transform: scale(1); opacity: 0.75; }
  to { transform: scale(1.05); opacity: 1; color: #d6336c; }
}

/* Envelope Front Pocket (triangles folding in front of the card) */
.env-front-pocket {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  border-radius: 12px;
  overflow: hidden;
}

.env-triangle-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 125px solid transparent;
  border-bottom: 125px solid transparent;
  border-left: 190px solid #f2b5c7;
  filter: drop-shadow(4px 0 6px rgba(120, 40, 70, 0.08));
}

.env-triangle-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 125px solid transparent;
  border-bottom: 125px solid transparent;
  border-right: 190px solid #ecabbd;
  filter: drop-shadow(-4px 0 6px rgba(120, 40, 70, 0.08));
}

.env-triangle-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 190px solid transparent;
  border-right: 190px solid transparent;
  border-bottom: 140px solid #e599ad;
  filter: drop-shadow(0 -4px 8px rgba(120, 40, 70, 0.1));
}

/* Postage Stamp */
.env-stamp {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 44px;
  height: 52px;
  background: #fdfbf7;
  border: 1.5px dashed #c49ba9;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 12;
}

.stamp-heart {
  color: #b54a6b;
  font-size: 16px;
  line-height: 1;
}

.stamp-line {
  width: 22px;
  height: 2px;
  background: #e2c0cd;
  border-radius: 1px;
}

/* Top Foldable Flap with Wax Seal */
.env-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.3s ease;
  z-index: 15;
}

.flap-triangle {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 190px solid transparent;
  border-right: 190px solid transparent;
  border-top: 135px solid #f7bfd0;
  filter: drop-shadow(0 4px 10px rgba(120, 40, 70, 0.15));
}

/* Wax Seal */
.wax-seal {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ad244a, #78132f 80%, #520b1f);
  box-shadow: 0 8px 18px var(--seal-shadow), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wax-seal::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed rgba(160, 30, 60, 0.4);
  pointer-events: none;
}

.seal-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #8a1939, #670f27);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.seal-heart {
  color: #ffdce6;
  font-size: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* When Envelope is Opened: Flap folds upwards */
.envelope-card-container.is-open .env-top-flap {
  transform: rotateX(180deg);
  z-index: 4;
}

/* Envelope Hint Tooltip */
.envelope-hint {
  margin-top: 30px;
  font-family: var(--font-hand);
  font-size: 1.55rem;
  font-weight: 600;
  color: #6a3a4b;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(238, 157, 179, 0.3);
  border-radius: 30px;
  box-shadow: 0 6px 16px rgba(120, 60, 80, 0.08);
  animation: pulseHint 2s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.hint-sparkle {
  font-size: 14px;
}

/* Next Floating Button after Letter is closed */
.next-floating-btn {
  margin-top: 18px;
  background: linear-gradient(135deg, #d84b72, #b82d46);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(184, 45, 70, 0.35);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: buttonPulse 2.5s infinite ease-in-out;
}

.next-floating-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(184, 45, 70, 0.45);
}

@keyframes buttonPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(184, 45, 70, 0.35); }
  50% { box-shadow: 0 12px 34px rgba(184, 45, 70, 0.6); }
}

/* ==========================================================================
   Full Letter Overlay Modal
   ========================================================================== */
.letter-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 25, 35, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Close Icon (Top Right) */
.modal-close-icon {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 70;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(180, 130, 150, 0.3);
  color: #4b353a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
}

.modal-close-icon:hover {
  transform: scale(1.1) rotate(90deg);
  background: #fff;
  color: #b82d46;
}

/* Scroll Area for Letter */
.letter-scroll-area {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 16px 60px;
  display: flex;
  justify-content: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 120, 140, 0.4) transparent;
}

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

.letter-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(180, 120, 140, 0.4);
  border-radius: 4px;
}

/* Parchment Container */
.letter-parchment {
  position: relative;
  width: min(92vw, 760px);
  background: linear-gradient(180deg, #fbf5eb 0%, #f6ecdc 100%);
  border: 5px solid #a47b63;
  box-shadow: 0 25px 60px rgba(70, 35, 45, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.7);
  padding: 48px 42px 42px;
  margin: auto;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92) translateY(30px);
  transition: transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.letter-overlay.show .letter-parchment {
  transform: scale(1) translateY(0);
}

/* Vintage Inner Double-Border */
.letter-parchment::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1.5px solid rgba(164, 123, 99, 0.45);
  pointer-events: none;
  border-radius: 4px;
}

.letter-parchment::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(164, 123, 99, 0.25);
  pointer-events: none;
  border-radius: 2px;
}

/* Corner Ribbon Bows */
.parchment-bow {
  position: absolute;
  top: 4px;
  width: 72px;
  height: auto;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(90, 50, 60, 0.15));
}

.bow-left {
  left: 6px;
}

.bow-right {
  right: 6px;
  transform: scaleX(-1);
}

/* Floating Rose Petals around Parchment */
.floating-petal {
  position: absolute;
  pointer-events: none;
  z-index: 12;
  filter: drop-shadow(0 6px 12px rgba(120, 20, 50, 0.25));
  animation: swayPetal 6s ease-in-out infinite alternate;
}

.petal-1 {
  right: 18px;
  top: 360px;
  width: 48px;
  transform: rotate(-15deg);
}

.petal-2 {
  right: 12px;
  top: 620px;
  width: 38px;
  transform: rotate(25deg);
  animation-delay: -2s;
}

.petal-3 {
  left: 14px;
  top: 750px;
  width: 42px;
  transform: rotate(-40deg);
  animation-delay: -4s;
}

@keyframes swayPetal {
  0% { transform: translateY(0) rotate(-15deg); }
  100% { transform: translateY(8px) rotate(-8deg); }
}

/* Header */
.parchment-header {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.letter-title {
  font-family: var(--font-cursive);
  font-size: clamp(3.2rem, 5vw, 4.8rem);
  font-weight: 400;
  color: var(--text-red);
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(184, 45, 70, 0.15);
}

.letter-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.ornament-line {
  width: 120px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #b88a6d, transparent);
}

.ornament-dot {
  color: #b88a6d;
  font-size: 11px;
}

/* Vintage Photo Frames Section */
.vintage-frames-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.vintage-frames-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vintage-frames-img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(90, 50, 60, 0.15));
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.vintage-frames-img:hover {
  transform: scale(1.02);
}

/* Letter Content */
.parchment-content {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
}

.salutation {
  font-family: var(--font-hand);
  font-size: clamp(2.2rem, 3.2vw, 2.9rem);
  font-weight: 700;
  color: #382528;
  font-style: italic;
  margin-bottom: 18px;
  border-bottom: 2px solid rgba(160, 110, 80, 0.35);
  display: inline-block;
  width: fit-content;
}

/* Ruled Lined Stationery Paragraphs */
.letter-paragraph-lines {
  margin-bottom: 24px;
}

.letter-paragraph-lines p {
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 1.85vw, 1.85rem);
  font-weight: 600;
  line-height: 2.1;
  color: #3e2e30;
  text-align: justify;
  text-justify: inter-word;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 2.05em,
    var(--parchment-line) 2.05em,
    var(--parchment-line) 2.1em
  );
  padding-bottom: 4px;
}

.heart-inline {
  color: #e0245e;
  font-size: 1.1em;
  display: inline-block;
  vertical-align: middle;
}

/* Love Declarations */
.letter-love-declaration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 10px;
}

.declaration-text {
  font-family: var(--font-hand);
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  font-weight: 700;
  color: #a31d38;
}

.big-heart {
  color: #e0245e;
  font-size: 1.5rem;
  animation: heartbeat 1.5s infinite;
}

.letter-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
}

.initials-text {
  font-family: var(--font-hand);
  font-size: clamp(1.8rem, 2.4vw, 2.3rem);
  font-weight: 700;
  color: #a31d38;
  letter-spacing: 2px;
}

.initials-heart {
  color: #e0245e;
  font-size: 1.3rem;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Signature */
.parchment-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 10px;
  padding-right: 20px;
}

.signature-prefix {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  font-weight: 600;
  color: #554044;
}

.signature-name {
  font-family: var(--font-cursive);
  font-size: clamp(2.8rem, 4vw, 3.8rem);
  color: #2b1f22;
  line-height: 1;
  margin-top: 2px;
}

.parchment-footnote {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: #8c7278;
  margin-top: 36px;
}

.footnote-heart {
  color: #e88aa5;
}

/* Bottom Action Buttons */
.parchment-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 32px;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
}

.btn-close-letter {
  background: rgba(255, 255, 255, 0.85);
  color: #4a343b;
  border: 1.5px solid rgba(160, 110, 130, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.btn-close-letter:hover {
  background: #ffffff;
  transform: translateY(-2px);
  border-color: #a47b63;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-next-proposal {
  background: linear-gradient(135deg, #d84b72, #b82d46);
  color: #fff;
  box-shadow: 0 6px 20px rgba(184, 45, 70, 0.35);
}

.btn-next-proposal:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(184, 45, 70, 0.45);
}

/* ==========================================================================
   Proposal Question Overlay Modal
   ========================================================================== */
.question-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(35, 20, 28, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: clamp(8px, 2.2vmin, 20px);
  overflow: hidden;
}

.question-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.question-card {
  width: min(94vw, 520px);
  max-height: 100%;
  background: radial-gradient(130% 100% at 50% 0%, #ffffff 0%, #fff8fa 45%, #ffeef4 100%);
  border: 1.5px solid rgba(214, 145, 168, 0.45);
  border-radius: clamp(20px, 5vmin, 34px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95),
              0 26px 60px rgba(94, 27, 51, 0.26),
              0 4px 14px rgba(94, 27, 51, 0.1);
  padding: clamp(16px, 4vmin, 34px) clamp(15px, 3.6vmin, 30px) clamp(15px, 3.4vmin, 30px);
  text-align: center;
  position: relative;
  overflow: visible; /* the box never scrolls inside itself */
}

/* Scaled as one piece by script.js so the whole card always fits the screen */
.question-card-inner {
  zoom: var(--card-scale, 1);
  width: 100%;
}

/* Delicate rose accent across the top edge */
.question-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 4px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, transparent, #f0a8bd 20%, #d6336c 50%, #f0a8bd 80%, transparent);
  opacity: 0.9;
}

/* The entrance ends on `transform: none` on purpose: a lingering transform would
   make the card a containing block for the runaway button and trap it inside. */
.question-overlay.show .question-card {
  animation: cardIn 0.55s cubic-bezier(0.22, 1.08, 0.36, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* Ring badge as a real designed chip instead of a floating emoji */
.question-rings-badge {
  width: clamp(44px, 11vmin, 78px);
  height: clamp(44px, 11vmin, 78px);
  margin: 0 auto clamp(8px, 1.8vmin, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 4.4vmin, 2.35rem);
  line-height: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #ffe6ee 46%, #f6c6d7 100%);
  box-shadow: 0 12px 26px rgba(216, 51, 108, 0.22),
              inset 0 0 0 1px rgba(255, 255, 255, 0.85),
              inset 0 -8px 14px rgba(214, 51, 108, 0.12);
  animation: floatRing 3.4s ease-in-out infinite;
}

@keyframes floatRing {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}

.question-main-text {
  font-family: var(--font-hand);
  font-size: clamp(1.6rem, 7vmin, 2.95rem);
  font-weight: 700;
  color: #a31d38;
  line-height: 1.16;
  margin-bottom: 6px;
  text-shadow: 0 2px 6px rgba(216, 51, 108, 0.14);
}

.question-sub-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.72rem, 2.3vmin, 0.98rem);
  color: #a1727f;
  margin-bottom: clamp(10px, 2.4vmin, 18px);
}

/* Ornamental divider between the question and the answers */
.question-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #e08aa5;
}

.question-divider::before,
.question-divider::after {
  content: "";
  height: 1px;
  width: 52px;
  background: linear-gradient(90deg, transparent, rgba(224, 138, 165, 0.7));
}

.question-divider::after {
  background: linear-gradient(90deg, rgba(224, 138, 165, 0.7), transparent);
}

.question-divider span {
  font-size: 0.8rem;
  line-height: 1;
}

/* Proposal 3 Buttons */
.proposal-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The empty slot the runaway button leaves behind closes itself smoothly */
.proposal-gap {
  height: var(--gap-height, 0px);
  width: 100%;
  overflow: hidden;
  opacity: 1;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.proposal-gap.is-collapsed {
  height: 0;
  opacity: 0;
}

.proposal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.proposal-btn .btn-emoji {
  font-size: 1.45rem;
  margin-bottom: 4px;
}

.proposal-btn .btn-txt {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.proposal-btn .btn-sub {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 3px;
}

/* Button 1: YES */
.btn-yes {
  background: linear-gradient(140deg, #ff6f97 0%, #e8306a 48%, #c2185b 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(214, 45, 95, 0.34),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-yes:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 36px rgba(214, 45, 95, 0.46),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* Button 2: NO */
.btn-no {
  background: linear-gradient(180deg, #fcfdfe 0%, #eef1f4 100%);
  color: #5b6670;
  border: 1px solid #dfe4e9;
  box-shadow: 0 4px 14px rgba(40, 50, 60, 0.06);
}

.btn-no:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e7ebef 100%);
  transform: translateY(-2px);
  color: #343a40;
}

/* Button 3: LATER */
.btn-later {
  background: linear-gradient(180deg, #fffaf6 0%, #f5ebe1 100%);
  color: #7a5c48;
  border: 1.5px dashed rgba(180, 140, 115, 0.55);
  box-shadow: 0 6px 18px rgba(125, 90, 68, 0.08);
}

.btn-later:hover {
  background: linear-gradient(180deg, #fff6ee 0%, #efdfd0 100%);
  transform: translateY(-2px);
}

/* ==========================================================================
   Question stages
   stage 1 -> Yes / No / "not now" (the last one runs away)
   stage 2 -> Yes / No only (No runs away)
   stage 3 -> three identical "YES" buttons, the honest answers stay in
              the form but are never shown
   ========================================================================== */
.proposal-yes-trio {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

#proposalForm.stage-three > .btn-yes,
#proposalForm.stage-three > .btn-no,
#proposalForm.stage-three > .btn-later {
  display: none;
}

#proposalForm.stage-three .proposal-yes-trio {
  display: flex;
}

/* The honest answers wait almost invisibly, and only really show up when you
   hover or focus them. They send a real answer like any other button.
   The stage-two one is even fainter than the pair on the last page. */
.proposal-real-options {
  display: none;
}

#proposalForm.stage-two .proposal-real-options-stage-two,
#proposalForm.stage-three .proposal-real-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  opacity: 0.13;
  transition: opacity 0.4s ease;
}

#proposalForm.stage-two .proposal-real-options-stage-two {
  opacity: 0.07;
}

#proposalForm.stage-two .proposal-real-options-stage-two:hover,
#proposalForm.stage-two .proposal-real-options-stage-two:focus-within,
#proposalForm.stage-three .proposal-real-options:hover,
#proposalForm.stage-three .proposal-real-options:focus-within {
  opacity: 1;
}

#proposalForm .proposal-real-options .proposal-btn {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(150, 120, 130, 0.4);
  box-shadow: none;
  color: #8d7480;
  overflow: visible; /* nothing inside is ever cut in half */
}

#proposalForm .proposal-real-options .proposal-btn:hover,
#proposalForm .proposal-real-options .proposal-btn:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(150, 120, 130, 0.7);
  color: #6f5764;
  transform: none;
}

/* keyboard users get a clear ring on the almost invisible answers */
#proposalForm .proposal-real-options .proposal-btn:focus-visible {
  outline: 2px solid rgba(150, 120, 130, 0.65);
  outline-offset: 2px;
}

#proposalForm .proposal-real-options .proposal-btn .btn-emoji {
  font-size: 0.8rem;
  margin-bottom: 0;
  opacity: 0.9;
}

#proposalForm .proposal-real-options .proposal-btn .btn-txt {
  font-size: 0.74rem;
  font-weight: 600;
  color: inherit;
}

#proposalForm .proposal-real-options .proposal-btn .btn-sub {
  display: none;
}

.proposal-btn.btn-quiet {
  background: linear-gradient(180deg, #fffaf6 0%, #f5ebe1 100%);
  color: #7a5c48;
  border: 1.5px dashed rgba(180, 140, 115, 0.55);
}

/* ==========================================================================
   Runaway answer buttons — "not now" first, then "No".
   Each stays in its normal slot until its first click, then breaks loose
   and jumps somewhere random on every press.
   ========================================================================== */
.proposal-btn[data-runaway] {
  transition: transform 0.42s cubic-bezier(0.32, 1.12, 0.42, 1),
              opacity 0.35s ease,
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Broken loose from the layout: free to fly anywhere on the page */
.proposal-btn[data-runaway].is-loose {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  will-change: transform;
}

/* Skip the animation for the single frame where it changes position mode */
.proposal-btn[data-runaway].no-anim {
  transition: none;
}

/* Only one answer gets its turn at running away. The other one sits still,
   dimmed and unclickable, until the runner is gone. */
.proposal-btn[data-runaway].is-waiting {
  opacity: 0.35;
  filter: grayscale(0.6);
  pointer-events: none;
}

/* Final disappearance after the last escape */
.proposal-btn[data-runaway].is-gone {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Growing "Yes" Button (scaled up by --yes-boost)
   ========================================================================== */
.proposal-btn.btn-yes {
  --yes-boost: 1;
  width: 100%;
  padding: calc(14px + (var(--yes-boost) - 1) * 26px) 22px;
  border-radius: calc(22px + (var(--yes-boost) - 1) * 34px);
  transition: padding 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
              border-radius 0.45s ease,
              box-shadow 0.3s ease,
              background 0.3s ease;
}

.btn-yes .btn-emoji {
  font-size: calc(1.45rem * min(var(--yes-boost), 1.55));
}

.btn-yes .btn-txt {
  font-size: calc(1.15rem * min(var(--yes-boost), 1.7));
  line-height: 1.25;
}

.btn-yes .btn-sub {
  font-size: calc(0.8rem * min(var(--yes-boost), 1.3));
}

/* Warm heartbeat glow while it keeps growing */
.proposal-btn.btn-yes.is-eager {
  animation: yesGlow 1.5s ease-in-out infinite;
}

@keyframes yesGlow {
  0%, 100% { box-shadow: 0 12px 28px rgba(214, 45, 95, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
  50% { box-shadow: 0 20px 52px rgba(214, 45, 95, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
}

/* ==========================================================================
   Shrinking "No" Button
   It starts exactly like the other buttons and only narrows down
   once the runaway button has been dodged at least once.
   ========================================================================== */
.proposal-btn.btn-no {
  --no-shrink: 1;
}

.proposal-btn.btn-no.is-shrinking {
  align-self: center;
  width: calc(100% * var(--no-shrink));
  min-width: 0;
  min-height: 46px;
  padding: calc(14px * var(--no-shrink)) calc(24px * var(--no-shrink));
  border-radius: 999px;
  border-color: #e5eaee;
  color: #7b8790;
}

.btn-no .btn-emoji {
  font-size: calc(1.45rem * var(--no-shrink));
  margin-bottom: calc(4px * var(--no-shrink));
}

.btn-no .btn-txt {
  font-size: calc(1.15rem * var(--no-shrink));
}

.btn-no .btn-sub {
  font-size: calc(0.8rem * var(--no-shrink));
}

/* Smooth the size change of the label inside both growing/shrinking buttons */
.btn-yes .btn-emoji,
.btn-yes .btn-txt,
.btn-yes .btn-sub,
.btn-no .btn-emoji,
.btn-no .btn-txt,
.btn-no .btn-sub {
  transition: font-size 0.3s ease;
}

/* Submission Spinner */
.submitting-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #7b4556;
}

.romantic-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(216, 75, 114, 0.25);
  border-top-color: #d84b72;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Preparation Steps: read check -> rating or reason -> warm message
   ========================================================================== */
.prep-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 6, 16, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.32s ease;
  overflow-y: auto;
}

.prep-overlay.show {
  opacity: 1;
}

.prep-card {
  position: relative;
  width: min(480px, 100%);
  padding: 34px 26px 28px;
  border-radius: 22px;
  text-align: center;
  color: #4a2c3a;
  background: linear-gradient(160deg, #fff8f2 0%, #ffeede 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.prep-overlay.show .prep-card {
  transform: translateY(0) scale(1);
}

.prep-rings {
  font-size: 30px;
  margin-bottom: 6px;
}

.prep-step {
  display: none;
  flex-direction: column;
  align-items: center;
}

.prep-step.is-active {
  display: flex;
  animation: prepStepIn 0.4s ease both;
}

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

.prep-title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  line-height: 1.35;
  color: #6b2b45;
}

.prep-sub {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #8a6272;
}

.prep-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.prep-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(196, 120, 150, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  font-weight: 600;
  color: #6b2b45;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.prep-btn:hover,
.prep-btn:focus-visible {
  transform: translateY(-2px);
  border-color: #d4748f;
  box-shadow: 0 8px 20px rgba(212, 116, 143, 0.28);
}

.prep-emoji {
  font-size: 1.3rem;
}

.star-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.star {
  width: 46px;
  height: 46px;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: #d9c2c9;
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.18s ease, color 0.18s ease;
}

.star:hover,
.star:focus-visible {
  transform: scale(1.18);
  color: #e9a0b6;
}

.star.is-lit {
  color: #e8557f;
}

.star-word {
  min-height: 1.4em;
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: #8a6272;
}

.prep-textarea {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid rgba(196, 120, 150, 0.4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #5c3444;
  resize: vertical;
  box-sizing: border-box;
}

.prep-textarea:focus {
  outline: none;
  border-color: #d4748f;
  box-shadow: 0 0 0 3px rgba(212, 116, 143, 0.18);
}

.prep-skip-btn {
  margin: 12px 0 4px;
  padding: 7px 14px;
  border: 1px dashed rgba(160, 110, 132, 0.65);
  border-radius: 999px;
  background: transparent;
  font-size: 0.84rem;
  font-style: italic;
  color: #9b7386;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.prep-skip-btn:hover,
.prep-skip-btn:focus-visible {
  background: rgba(255, 255, 255, 0.6);
  color: #6b2b45;
}

.prep-next {
  margin-top: 18px;
  padding: 13px 30px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8557f 0%, #c4407a 100%);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(196, 64, 122, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.prep-next:hover:not(:disabled),
.prep-next:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(196, 64, 122, 0.45);
}

.prep-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.prep-next-icon {
  margin-left: 4px;
}

@media (max-width: 420px) {
  .prep-card { padding: 26px 18px 22px; }
  .prep-title { font-size: 1.15rem; }
  .star { width: 40px; height: 40px; font-size: 1.7rem; }
}

/* ==========================================================================
   Floating music switch
   Bottom corner, small and nearly transparent so it never hides the letter,
   the questions or any button. It also sits below every overlay on purpose,
   so it disappears while a question is open instead of covering it.
   ========================================================================== */
.music-toggle {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(74, 34, 52, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 255, 255, 0.28);
  animation: musicGlow 3.2s ease-in-out infinite;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

@keyframes musicGlow {
  0%, 100% { box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 0 9px rgba(255, 255, 255, 0); }
}

.music-toggle:hover,
.music-toggle:focus-visible {
  opacity: 1;
  transform: scale(1.12);
  background: rgba(96, 42, 68, 0.92);
}

.music-toggle:active {
  transform: scale(0.94);
}

.music-icon {
  width: 21px;
  height: 21px;
  fill: currentColor;
  pointer-events: none;
}

/* only one of the two icons is ever shown */
.music-icon-play { display: none; }
.music-toggle.is-paused .music-icon-pause { display: none; }
.music-toggle.is-paused .music-icon-play { display: block; }

/* on a phone it stays small enough to stay out of the way, but just as clear */
@media (max-width: 480px) {
  .music-toggle {
    left: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
    opacity: 1;
  }
  .music-icon { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .music-toggle { transition: opacity 0.25s ease; }
  .music-toggle:hover, .music-toggle:active { transform: none; }
}

/* ==========================================================================
   Appreciation Final Modal
   ========================================================================== */
.appreciation-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 15, 22, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 20px;
}

.appreciation-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.appreciation-card {
  width: min(90vw, 520px);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(238, 157, 179, 0.6);
  border-radius: 32px;
  box-shadow: 0 35px 80px rgba(80, 20, 45, 0.3);
  padding: 44px 34px 38px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.appreciation-overlay.show .appreciation-card {
  transform: scale(1) translateY(0);
}

.appreciation-heart-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  animation: heartPulse 2s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.appreciation-title {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 700;
  color: #3b202a;
  line-height: 1.45;
  margin-bottom: 8px;
}

.appreciation-sub {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: #8c5b6c;
  line-height: 1.4;
  margin-bottom: 22px;
}

.appreciation-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e88aa5, transparent);
  margin: 0 auto 22px;
}

.appreciation-close-hint {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: #55343e;
  line-height: 1.6;
}

.appreciation-signature {
  margin: 26px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-hand);
}

.appreciation-signature span {
  font-size: 1.4rem;
  color: #7b5962;
}

.appreciation-signature .sig-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: #b82d46;
}

.appreciation-close-btn {
  background: linear-gradient(135deg, #d84b72, #b82d46);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 38px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(184, 45, 70, 0.35);
  transition: all 0.3s ease;
}

.appreciation-close-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(184, 45, 70, 0.45);
}

/* ==========================================================================
   Utility Classes & Responsiveness
   ========================================================================== */
.hidden {
  display: none !important;
}

/* Mobile & Tablet Optimizations */
@media (max-width: 600px) {
  .envelope-stage {
    padding-top: 60px;
  }

  .envelope-wrapper {
    transform: translateY(20px);
  }

  .envelope-card-container {
    width: 300px;
    height: 200px;
  }

  .env-triangle-left {
    border-top-width: 100px;
    border-bottom-width: 100px;
    border-left-width: 150px;
  }

  .env-triangle-right {
    border-top-width: 100px;
    border-bottom-width: 100px;
    border-right-width: 150px;
  }

  .env-triangle-bottom {
    border-left-width: 150px;
    border-right-width: 150px;
    border-bottom-width: 115px;
  }

  .flap-triangle {
    border-left-width: 150px;
    border-right-width: 150px;
    border-top-width: 110px;
  }

  .wax-seal {
    top: 80px;
    width: 52px;
    height: 52px;
  }

  .seal-inner {
    width: 36px;
    height: 36px;
  }

  .env-preview-card {
    height: 180px;
  }

  .card-text {
    font-size: 1.7rem;
  }

  .envelope-card-container.is-open .env-preview-card {
    transform: translateY(-85px);
  }

  .letter-parchment {
    padding: 36px 20px 28px;
    border-width: 4px;
  }

  .letter-title {
    font-size: 2.8rem;
  }

  .salutation {
    font-size: 2rem;
  }

  .letter-paragraph-lines p {
    font-size: 1.25rem;
    line-height: 2.0;
    text-align: left;
  }

  .parchment-bow {
    width: 52px;
  }

  .question-card, .appreciation-card {
    padding: 30px 20px 24px;
  }
}
