/* ==========================================================================
   For Mariem — Luxury Editorial Mobile Stylesheet
   Palette: Silk Ivory, Blush Satin, Velvet Burgundy & Champagne Gold.
   Modern Web Standards: dvh, safe-area-insets, @starting-style,
   allow-discrete (+ JS fallback), linear() spring easing, :user-invalid,
   compositor-only motion, logical properties, WCAG 44-48px touch targets.
   ========================================================================== */

:root {
  --font-ar: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;

  /* Luxury silk & champagne palette */
  --bg-1: #fbf6f4;
  --bg-2: #f6e7ec;
  --bg-3: #efe5f0;
  --blob-a: rgba(196, 114, 146, 0.22);
  --blob-b: rgba(206, 166, 128, 0.22);
  --blob-c: rgba(167, 134, 186, 0.18);

  --ink: #24141d;
  --ink-soft: #5b4350;
  --ink-muted: #846a78;

  --accent: #9b3158;
  --accent-strong: #7c2244;
  --accent-soft: #f9eaf0;
  --gold: #c69f74;
  --gold-border: rgba(198, 159, 116, 0.34);
  --error: #b3263d;
  --error-bg: #fff3f5;
  --success: #1d6f49;

  --card-bg: rgba(255, 253, 251, 0.84);
  --card-border: rgba(255, 255, 255, 0.94);
  --card-shadow:
    0 24px 56px -22px rgba(96, 30, 58, 0.20),
    0 4px 16px -6px rgba(96, 30, 58, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);

  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --target-size: 44px;

  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-easing: linear(
    0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%,
    1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%,
    1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%,
    0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1
  );
}

@media (pointer: coarse) {
  :root {
    --target-size: 48px;
  }
}

/* Subtle stage mood transitions */
body[data-stage="letter"] {
  --bg-1: #fcf8f3;
  --bg-2: #f7eae5;
  --bg-3: #f2e5ec;
}

body[data-stage="q1"] {
  --bg-1: #faf5f8;
  --bg-2: #efe6f2;
  --bg-3: #f7e8ee;
}

body[data-stage="q2"] {
  --bg-1: #fcf6f2;
  --bg-2: #f7e4ea;
  --bg-3: #f5ebe4;
}

body[data-stage="q3"] {
  --bg-1: #f6f4fb;
  --bg-2: #f5e9f1;
  --bg-3: #efeef7;
}

body[data-stage="q4"] {
  --bg-1: #fbf4f6;
  --bg-2: #f5e2ea;
  --bg-3: #f2e7f2;
}

body[data-stage="faq"] {
  --bg-1: #faf4f7;
  --bg-2: #f0e6f3;
  --bg-3: #f7eae9;
}

body[data-stage="closing"] {
  --bg-1: #fcf7f4;
  --bg-2: #f6e7ec;
  --bg-3: #f2e8f2;
  --blob-a: rgba(198, 159, 116, 0.25);
  --blob-b: rgba(155, 49, 88, 0.20);
}

body[data-stage="exit"] {
  --bg-1: #f7f8f6;
  --bg-2: #eef1ed;
  --bg-3: #f3f2f4;
  --blob-a: rgba(162, 186, 170, 0.18);
  --blob-b: rgba(188, 184, 198, 0.16);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-padding-block-end: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-block-size: 100dvh;
  font-family: var(--font-ar);
  color: var(--ink);
  line-height: 1.65;
  overflow-wrap: break-word;
  background: linear-gradient(155deg, var(--bg-1) 0%, var(--bg-2) 54%, var(--bg-3) 100%);
  transition: background-color 0.6s ease;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.en-text {
  font-family: var(--font-en);
}

.en-serif {
  font-family: var(--font-serif);
}

/* ==========================================================================
   Ambient Background, Grain Texture & Luminous Dust
   ========================================================================== */

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: clip;
  pointer-events: none;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.95;
  will-change: transform;
  transition: background-color 0.9s ease;
}

.aurora-1 {
  width: 76vw;
  height: 76vw;
  max-width: 440px;
  max-height: 440px;
  inset-block-start: -16%;
  inset-inline-start: -18%;
  background: var(--blob-a);
}

.aurora-2 {
  width: 72vw;
  height: 72vw;
  max-width: 410px;
  max-height: 410px;
  inset-block-end: -16%;
  inset-inline-end: -16%;
  background: var(--blob-b);
}

.aurora-3 {
  width: 56vw;
  height: 56vw;
  max-width: 310px;
  max-height: 310px;
  inset-block-start: 40%;
  inset-inline-start: 54%;
  background: var(--blob-c);
}

.grain-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.032;
  background-image: radial-gradient(rgba(36, 20, 29, 0.9) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-paused) .aurora-1 {
    animation: driftA 18s ease-in-out infinite alternate;
  }
  body:not(.motion-paused) .aurora-2 {
    animation: driftB 21s ease-in-out infinite alternate;
  }
  body:not(.motion-paused) .aurora-3 {
    animation: driftC 16s ease-in-out infinite alternate;
  }
}

@keyframes driftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(24px, 30px, 0) scale(1.08); }
}

@keyframes driftB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-26px, -22px, 0) scale(1.1); }
}

@keyframes driftC {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to   { transform: translate3d(-18px, 20px, 0) scale(1.06); }
}

.petals-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: clip;
  pointer-events: none;
}

.luminous-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sz, 6px);
  height: var(--sz, 6px);
  border-radius: 50%;
  background: var(--clr, #c69f74);
  box-shadow: 0 0 10px var(--clr, #c69f74);
  will-change: transform, opacity;
  animation: dustBurst var(--dur, 720ms) var(--ease-smooth) forwards;
}

@keyframes dustBurst {
  0% {
    opacity: 0.95;
    transform: translate3d(var(--x0), var(--y0), 0) scale(0.4);
  }
  65% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x1), var(--y1), 0) scale(1.2);
  }
}

/* ==========================================================================
   Top Bar (Back Button + Progress Dots + Motion Toggle)
   ========================================================================== */

.top-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 20;
  padding-block-start: max(0.8rem, env(safe-area-inset-top, 0px));
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.top-bar-inner {
  max-inline-size: 430px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.top-pill-btn {
  pointer-events: auto;
  justify-self: start;
  min-block-size: var(--target-size);
  padding: 0 0.95rem 0 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 251, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(96, 30, 58, 0.08);
  transition: transform 0.25s var(--ease-smooth), background-color 0.2s ease, color 0.2s ease;
}

.top-pill-btn[hidden] {
  display: none;
}

.top-pill-btn:hover {
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-strong);
}

.top-pill-btn:active {
  transform: scale(0.94);
}

.progress-dots {
  pointer-events: auto;
  grid-column: 2;
  background: rgba(255, 253, 251, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.8rem;
  box-shadow: 0 6px 18px rgba(96, 30, 58, 0.08);
}

.progress-dots[hidden] {
  display: none;
}

.dots-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(155, 49, 88, 0.20);
  transition: width 0.35s var(--ease-smooth), background-color 0.35s ease;
}

.dot.is-done {
  background: rgba(198, 159, 116, 0.75);
}

.dot.is-active {
  width: 20px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.top-icon-btn {
  pointer-events: auto;
  grid-column: 3;
  justify-self: end;
  min-inline-size: var(--target-size);
  min-block-size: var(--target-size);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(255, 253, 251, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(96, 30, 58, 0.08);
  transition: transform 0.25s ease-out, opacity 0.2s ease;
}

.top-icon-btn:active {
  transform: scale(0.92);
}

body.motion-paused .motion-toggle {
  color: var(--ink-muted);
  opacity: 0.65;
}

/* ==========================================================================
   Main Mobile Stage & Screen Entry/Exit Transitions
   ========================================================================== */

.stage {
  position: relative;
  z-index: 10;
  min-block-size: 100dvh;
  display: grid;
  place-items: center;
  padding-block: calc(4.75rem + env(safe-area-inset-top, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px));
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
}

.phone-shell {
  width: 100%;
  max-inline-size: 416px;
  position: relative;
}

@media (min-width: 540px) {
  .phone-shell {
    padding: 1.25rem;
    border-radius: 38px;
    background: rgba(255, 252, 250, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 36px 84px -26px rgba(96, 30, 58, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
}

.screen {
  display: block;
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition:
    display 0.36s,
    opacity 0.36s var(--ease-smooth),
    translate 0.4s var(--ease-smooth),
    scale 0.4s var(--ease-smooth);
  transition-behavior: allow-discrete;
}

@starting-style {
  .screen {
    opacity: 0;
    translate: 0 20px;
    scale: 0.98;
  }
}

.screen:where([hidden], [data-closing]) {
  opacity: 0;
  translate: 0 -14px;
  scale: 0.985;
}

.screen[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    translate: none;
    scale: 1;
    transition-duration: 0.14s;
  }
  @starting-style {
    .screen {
      translate: none;
      scale: 1;
    }
  }
  .screen:where([hidden], [data-closing]) {
    translate: none;
    scale: 1;
  }
}

/* ==========================================================================
   Luxury Card & Editorial Typography
   ========================================================================== */

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  outline: 1px solid rgba(198, 159, 116, 0.18);
  outline-offset: -7px;
  border-radius: var(--radius-xl);
  padding: 1.85rem 1.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.luxury-kicker {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.heading-serif {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 2.75rem);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.question-title {
  font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.58rem);
  font-weight: 800;
  color: var(--ink);
  margin-block-start: 0.4rem;
}

.question-sub {
  margin-block-start: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.body-text {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.hairline {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

/* ==========================================================================
   Buttons (Velvet Luxury + Spring Touch)
   ========================================================================== */

.btn {
  width: 100%;
  min-block-size: 52px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.45s ease-out, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  transition-timing-function: var(--spring-easing), ease, ease, ease;
}

.btn:active {
  transform: scale(0.965);
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.btn-primary {
  color: #fffdfb;
  background: linear-gradient(135deg, #a63760 0%, #832448 58%, #631b39 100%);
  box-shadow:
    0 14px 28px -12px rgba(124, 34, 68, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover {
  box-shadow:
    0 18px 34px -12px rgba(124, 34, 68, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.btn-secondary {
  color: var(--accent-strong);
  background: rgba(255, 253, 251, 0.92);
  border: 1.25px solid rgba(155, 49, 88, 0.28);
  box-shadow: 0 6px 18px -10px rgba(96, 30, 58, 0.16);
}

.btn-secondary:hover {
  background: #fff;
  border-color: rgba(155, 49, 88, 0.50);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }
  .btn:active {
    transform: none;
  }
}

/* ==========================================================================
   STEP 1: LUXURY OPENING ENVELOPE
   ========================================================================== */

.screen-envelope {
  text-align: center;
  padding-block: 1rem;
}

.envelope-intro {
  margin-block-end: 2.25rem;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-block-end: 0.5rem;
}

.envelope-title {
  font-size: clamp(2.6rem, 1.9rem + 3.2vw, 3.35rem);
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.envelope-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1.65rem;
  width: 100%;
  max-inline-size: 312px;
}

.envelope-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1.44 / 1;
  perspective: 950px;
}

.envelope-glow {
  position: absolute;
  inset: -16px;
  border-radius: 30px;
  background: radial-gradient(circle, rgba(198, 159, 116, 0.26) 0%, rgba(155, 49, 88, 0.14) 48%, transparent 74%);
  filter: blur(14px);
}

.envelope-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(160deg, #fffdfb 0%, #f7e9ed 100%);
  border: 1px solid rgba(198, 159, 116, 0.34);
  box-shadow:
    0 26px 52px -20px rgba(96, 30, 58, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: visible;
}

.envelope-letter-peek {
  position: absolute;
  inset-inline: 12%;
  inset-block-start: 14%;
  block-size: 72%;
  border-radius: 10px;
  background: #fffdfb;
  border: 1px solid rgba(198, 159, 116, 0.36);
  padding: 12% 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 18px rgba(96, 30, 58, 0.10);
  transition: transform 0.65s var(--ease-smooth);
}

.peek-monogram {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  line-height: 1;
}

.peek-line {
  display: block;
  height: 5px;
  width: 82%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(198, 159, 116, 0.22), rgba(155, 49, 88, 0.18));
}

.peek-line-short { width: 42%; }
.peek-line-mid { width: 64%; }

.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background:
    linear-gradient(146deg, transparent 49.5%, rgba(255, 251, 249, 0.97) 50%),
    linear-gradient(214deg, transparent 49.5%, rgba(248, 236, 240, 0.97) 50%),
    linear-gradient(0deg, #f1dce4 0%, #f9edf1 52%, transparent 52%);
  pointer-events: none;
}

.envelope-flap {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 56%;
  background: linear-gradient(180deg, #fffdfb 0%, #f3dde5 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 20px 20px 0 0;
  transform-origin: top center;
  transition: transform 0.68s var(--ease-smooth);
  box-shadow: 0 8px 18px rgba(96, 30, 58, 0.12);
}

.wax-seal {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #be4b74, #8d254c 62%, #631634 100%);
  color: #fff6f2;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 234, 214, 0.38);
  box-shadow:
    0 12px 24px rgba(105, 24, 56, 0.40),
    inset 0 2px 5px rgba(255, 255, 255, 0.36);
  transition: transform 0.4s var(--ease-smooth), opacity 0.35s ease;
}

.seal-heart {
  width: 21px;
  height: 21px;
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-paused) .wax-seal {
    animation: sealPulse 2.8s ease-in-out infinite;
  }
}

@keyframes sealPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}

.envelope-btn.is-opening .envelope-flap {
  transform: rotateX(-165deg);
}

.envelope-btn.is-opening .envelope-letter-peek {
  transform: translateY(-42%);
}

.envelope-btn.is-opening .wax-seal {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.32);
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 1.3rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 251, 0.82);
  border: 1px solid var(--gold-border);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  box-shadow: 0 8px 20px -10px rgba(96, 30, 58, 0.22);
}

/* ==========================================================================
   STEP 2: WELCOME (ALL ENGLISH EDITORIAL)
   ========================================================================== */

.welcome-card {
  padding: 2.15rem 1.65rem;
  gap: 1.15rem;
}

.welcome-copy {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--ink-soft);
}

/* ==========================================================================
   STEP 3: PERSONAL CONFESSION LETTER (CLEAN STATIONERY, NO BADGE)
   ========================================================================== */

.letter-card {
  background: linear-gradient(180deg, rgba(255, 253, 250, 0.94), rgba(252, 246, 248, 0.90));
  padding-block-start: 1.65rem;
}

.letter-ornament {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-block-end: 0.15rem;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

.ornament-diamond {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold);
  opacity: 0.8;
}

.letter-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  padding-inline-start: 0.95rem;
  border-inline-start: 2px solid rgba(198, 159, 116, 0.45);
}

.letter-line {
  font-size: 1.04rem;
  line-height: 1.88;
  color: var(--ink);
}

.muted-paren {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.letter-hook {
  font-weight: 700;
  color: var(--accent-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .screen.is-entered .letter-line {
    animation: lineReveal 0.65s var(--ease-smooth) both;
    animation-delay: calc(var(--stagger, 0) * 240ms + 100ms);
  }
}

@keyframes lineReveal {
  from { opacity: 0; translate: 0 12px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ==========================================================================
   STEP 4: QUESTION 1 & EDITORIAL RADIO CARDS
   ========================================================================== */

.question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.question-meta {
  flex: 1;
  min-inline-size: 0;
}

.choice-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.choice-card {
  position: relative;
  min-block-size: 54px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  border: 1.25px solid rgba(155, 49, 88, 0.14);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: transform 0.4s ease-out, border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  transition-timing-function: var(--spring-easing), ease, ease, ease;
}

.choice-card:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(198, 159, 116, 0.55);
}

.choice-card:has(input:focus-visible) {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

.choice-card:has(input:checked) {
  background: linear-gradient(135deg, rgba(253, 243, 247, 0.98), rgba(252, 246, 240, 0.98));
  border-color: var(--accent);
  box-shadow: 0 12px 26px -14px rgba(124, 34, 68, 0.42);
  transform: scale(1.012);
}

.choice-index {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(198, 159, 116, 0.12);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.choice-card:has(input:checked) .choice-index {
  background: var(--accent);
  color: #fff;
}

.choice-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.choice-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.75px solid rgba(155, 49, 88, 0.28);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.choice-card:has(input:checked) .choice-check {
  border-color: var(--accent);
  background: var(--accent);
}

.choice-card:has(input:checked) .choice-check::after {
  content: "";
  position: absolute;
  inset-block-start: 3.5px;
  inset-inline-start: 5.5px;
  width: 4.5px;
  height: 8.5px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.reveal-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 1;
  translate: 0 0;
  transition: display 0.3s, opacity 0.3s var(--ease-smooth), translate 0.3s var(--ease-smooth);
  transition-behavior: allow-discrete;
}

@starting-style {
  .reveal-box {
    opacity: 0;
    translate: 0 -8px;
  }
}

.reveal-box:where([hidden], [data-closing]) {
  opacity: 0;
  translate: 0 -8px;
}

.reveal-box[hidden] {
  display: none;
}

/* ==========================================================================
   EARLY EXIT SCREEN
   ========================================================================== */

.exit-card {
  text-align: center;
  align-items: center;
  padding-block: 2.4rem;
}

.exit-mark {
  color: var(--accent);
  margin-block-end: 0.25rem;
}

.exit-closing {
  margin-block-start: 0.25rem;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   STEP 5: BENCH PRESS INTERACTIVE WEIGHTS
   ========================================================================== */

.gym-visual {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(249, 238, 242, 0.74));
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 0.75rem 0.75rem;
  text-align: center;
}

.gym-svg {
  width: 100%;
  max-inline-size: 306px;
  height: auto;
  display: block;
  margin-inline: auto;
}

.gym-live-caption {
  margin-block-start: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}

.weight-control {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(155, 49, 88, 0.13);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.weight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.weight-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mini-gym-icon {
  width: 34px;
  height: 22px;
  flex-shrink: 0;
}

.weight-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.en-sub {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-inline-start: 0.2rem;
}

.weight-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.weight-readout .unit {
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.8;
}

.stepper-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  direction: ltr;
}

.step-btn {
  flex-shrink: 0;
  min-inline-size: var(--target-size);
  min-block-size: var(--target-size);
  border-radius: 12px;
  border: 1.25px solid rgba(155, 49, 88, 0.22);
  background: #fff;
  color: var(--accent-strong);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease-smooth), background-color 0.2s ease;
}

.step-btn:active {
  transform: scale(0.91);
  background: var(--accent-soft);
}

.fancy-range {
  flex: 1;
  min-inline-size: 0;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}

/* ==========================================================================
   REACTION CARDS (STEP R2 & STEP R3)
   ========================================================================== */

.reaction-card {
  text-align: center;
  align-items: center;
  padding-block: 2.1rem 1.75rem;
}

.reaction-card .luxury-kicker {
  align-self: center;
}

.reaction-title {
  font-size: clamp(1.4rem, 1.15rem + 1.3vw, 1.75rem);
  font-weight: 800;
  color: var(--ink);
}

.picked-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.picked-pill {
  padding: 0.38rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid rgba(155, 49, 88, 0.16);
  color: var(--accent-strong);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.reaction-quote {
  font-size: 1.04rem;
  line-height: 1.82;
  color: var(--ink);
}

.highlight-line {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(249, 234, 240, 0.95), rgba(248, 241, 234, 0.95));
  border: 1px solid var(--gold-border);
  font-weight: 800;
  color: var(--accent-strong);
}

.teaser-box {
  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(198, 159, 116, 0.55);
  font-size: 0.93rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   STEP 6: HEIGHT INTERACTIVE RULER
   ========================================================================== */

.height-stage {
  display: grid;
  grid-template-columns: 1fr 94px;
  gap: 0.85rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.height-display-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-inline-size: 0;
}

.height-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.height-big-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(2.4rem, 1.8rem + 2.5vw, 3rem);
  line-height: 1;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.height-unit {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.stepper-compact {
  gap: 0.45rem;
}

.ruler-wrap {
  display: flex;
  justify-content: center;
}

.ruler-window {
  position: relative;
  width: 90px;
  height: 184px;
  border-radius: 16px;
  background: linear-gradient(180deg, #faf3f5 0%, #ffffff 50%, #f6eff7 100%);
  border: 1.25px solid var(--gold-border);
  overflow: hidden;
  box-shadow: inset 0 12px 20px rgba(255, 255, 255, 0.92),
              inset 0 -12px 20px rgba(255, 255, 255, 0.92);
}

.ruler-track {
  position: absolute;
  inset-inline: 0;
  top: 0;
  will-change: transform;
  transition: transform 0.22s var(--ease-smooth);
}

.ruler-tick {
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-inline-end: 8px;
  direction: ltr;
}

.ruler-tick-bar {
  height: 1.5px;
  width: 12px;
  background: rgba(132, 106, 120, 0.32);
  border-radius: 99px;
}

.ruler-tick.is-major .ruler-tick-bar {
  width: 24px;
  height: 2px;
  background: rgba(155, 49, 88, 0.65);
}

.ruler-tick-num {
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.ruler-pointer {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  pointer-events: none;
  direction: ltr;
}

.pointer-dot {
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(155, 49, 88, 0.18);
}

.pointer-line {
  width: 26px;
  height: 2px;
  background: linear-gradient(270deg, var(--accent), rgba(155, 49, 88, 0.15));
}

/* ==========================================================================
   STEP 7: PHONE INPUT & VALIDATION
   ========================================================================== */

.playful-warn {
  padding: 0.72rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(249, 234, 240, 0.75);
  border: 1px solid rgba(155, 49, 88, 0.22);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.field-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.text-input {
  width: 100%;
  min-block-size: 52px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1.25px solid rgba(91, 67, 80, 0.28);
  background: rgba(255, 255, 255, 0.94);
  font-size: max(1rem, 1em);
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(155, 49, 88, 0.12);
}

.phone-input {
  font-family: var(--font-en);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
}

.text-input:is(:user-invalid, .is-invalid-field) {
  border-color: var(--error);
  background-color: var(--error-bg);
}

.text-input:is(:user-valid):not(.is-invalid-field) {
  border-color: var(--success);
}

.inline-error {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: var(--error-bg);
  border: 1px solid rgba(179, 38, 61, 0.28);
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 700;
}

.inline-error[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .is-shaking {
    animation: gentleShake 0.42s ease-in-out;
  }
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(132, 106, 120, 0.22);
}

/* ==========================================================================
   STEP 8: FINAL SCREEN + LUXURY 3D FLIP FAQ CARDS
   ========================================================================== */

.final-card {
  gap: 1.4rem;
}

.final-banner {
  text-align: center;
  padding-block-end: 1rem;
  border-block-end: 1px solid rgba(198, 159, 116, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.final-banner .luxury-kicker {
  align-self: center;
}

.final-title {
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 1.85rem);
  font-weight: 800;
  color: var(--ink);
}

.faq-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-header {
  text-align: center;
}

.faq-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--ink);
}

.faq-hint {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-block-start: 0.2rem;
}

.flip-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.flip-card {
  appearance: none;
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  min-block-size: 112px;
  perspective: 1000px;
  cursor: pointer;
  text-align: center;
}

.flip-inner {
  position: relative;
  display: grid;
  width: 100%;
  min-block-size: 112px;
  transform-style: preserve-3d;
  transition: transform 0.68s ease-out;
  transition-timing-function: var(--spring-easing);
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
}

.flip-front {
  background: rgba(255, 253, 251, 0.90);
  border: 1px solid var(--gold-border);
  box-shadow: 0 10px 24px -14px rgba(96, 30, 58, 0.20);
}

.flip-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(198, 159, 116, 0.14);
  padding: 0.14rem 0.6rem;
  border-radius: var(--radius-pill);
}

.flip-q {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.flip-tap {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.flip-back {
  transform: rotateY(180deg);
  color: #fffdfb;
  box-shadow: 0 16px 30px -14px rgba(36, 20, 29, 0.38);
}

.flip-card[data-theme="rose"] .flip-back {
  background: linear-gradient(135deg, #9e335b 0%, #6d1d3d 100%);
  border: 1px solid rgba(255, 224, 210, 0.28);
}

.flip-card[data-theme="obsidian"] .flip-back {
  background: linear-gradient(135deg, #17151b 0%, #0b0a0e 100%);
  border: 1px solid rgba(198, 159, 116, 0.55);
}

.flip-card[data-theme="barca"] .flip-back {
  background: linear-gradient(135deg, #004284 0%, #5a163c 52%, #92003b 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.flip-a {
  font-size: 1.26rem;
  font-weight: 800;
}

.flip-sub {
  font-size: 0.88rem;
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .flip-inner {
    transition: none;
    transform-style: flat;
  }
  .flip-card.is-flipped .flip-inner {
    transform: none;
  }
  .flip-back {
    transform: none;
    display: none;
  }
  .flip-card.is-flipped .flip-front {
    display: none;
  }
  .flip-card.is-flipped .flip-back {
    display: flex;
  }
}

.footer-sign {
  text-align: center;
  font-size: 0.92rem;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* ==========================================================================
   COLLAPSIBLE "I WANT TO SAY SOMETHING" NOTE & FINAL CLOSING CARD
   ========================================================================== */

.note-toggle-wrap {
  width: 100%;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.btn-subtle-note {
  color: var(--ink-soft);
  background: rgba(255, 253, 251, 0.65);
  border: 1px dashed var(--gold-border);
  min-block-size: 46px;
  font-size: 0.94rem;
}

.btn-subtle-note:hover {
  background: rgba(255, 253, 251, 0.96);
  border-color: var(--gold);
  color: var(--accent-strong);
}

.note-reveal {
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 251, 0.78);
  border: 1px solid var(--gold-border);
}

.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-compact {
  min-block-size: 44px;
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  width: auto;
  min-inline-size: 132px;
}

.note-status {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--success);
}

.note-status[hidden] {
  display: none;
}

.closing-card {
  text-align: center;
  align-items: center;
  padding: 2.35rem 1.65rem;
  gap: 1.1rem;
}

.closing-card .luxury-kicker {
  align-self: center;
}

.closing-card .letter-ornament {
  width: 72%;
}

.closing-title {
  font-size: clamp(1.55rem, 1.2rem + 1.4vw, 1.9rem);
  font-weight: 800;
  color: var(--ink);
}

.closing-body {
  font-size: 1.05rem;
  line-height: 1.88;
  color: var(--ink-soft);
  max-inline-size: 32ch;
}
