/* —— Romantic story: mobile-first, fancy motion —— */
:root {
  --bg-deep: #12060f;
  --bg-mid: #1a0a14;
  --rose: #e8a0b8;
  --rose-soft: rgba(232, 160, 184, 0.35);
  --gold: #d4af6a;
  --cream: #f5ebe0;
  --ink: #2a1822;
  --font-hand: "Caveat", cursive;
  --font-soft: "Quicksand", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  min-height: 100vh;
  background: #0a0408;
  color: var(--cream);
  font-family: var(--font-soft);
  font-weight: 400;
  overflow: hidden;
  overscroll-behavior: none;
}

/* —— Mood layers —— */
.mood-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: opacity 1.4s var(--ease-soft);
}

#moodA { opacity: 1; }
#moodB { opacity: 0; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

.floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.floating-hearts::before,
.floating-hearts::after {
  content: "";
  position: absolute;
  width: clamp(14px, 3vw, 22px);
  height: clamp(14px, 3vw, 22px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z' fill='%23e8a0b8'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: floatHeart 18s var(--ease-soft) infinite;
  opacity: 0.45;
}

.floating-hearts::before {
  left: 8%;
  bottom: -5%;
  animation-delay: 0s;
}

.floating-hearts::after {
  right: 12%;
  bottom: -8%;
  animation-delay: -7s;
  width: clamp(10px, 2.5vw, 16px);
  height: clamp(10px, 2.5vw, 16px);
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) translateX(0) rotate(-5deg);
    opacity: 0;
  }
  8% {
    opacity: 0.45;
  }
  100% {
    transform: translateY(-110vh) translateX(25px) rotate(8deg);
    opacity: 0;
  }
}

.story:focus-visible {
  outline: 2px solid rgba(232, 160, 184, 0.45);
  outline-offset: 4px;
}

.story {
  position: relative;
  z-index: 3;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 1.5rem) 1.5rem calc(var(--safe-bottom) + 6rem);
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 28rem);
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.65s var(--ease-out),
    transform 0.65s var(--ease-out),
    filter 0.65s var(--ease-out);
  filter: blur(8px);
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  filter: blur(0);
}

.panel.is-exit-left,
.panel.is-exit-right {
  visibility: visible;
  pointer-events: none;
}

.panel.is-exit-left {
  opacity: 0;
  transform: translate(-150%, -50%);
  filter: blur(12px);
}

.panel.is-exit-right {
  opacity: 0;
  transform: translate(50%, -50%);
  filter: blur(12px);
}

.panel.is-enter,
.panel.is-enter-from-left {
  visibility: visible;
  pointer-events: none;
}

.panel.is-enter {
  opacity: 0;
  transform: translate(10%, -50%);
  filter: blur(10px);
}

.panel.is-enter-from-left {
  opacity: 0;
  transform: translate(-110%, -50%);
  filter: blur(10px);
}

.panel.is-active:not(.is-enter):not(.is-enter-from-left) {
  transform: translate(-50%, -50%);
}

.panel__eyebrow {
  font-family: var(--font-hand);
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  color: var(--gold);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fadeRise 0.9s var(--ease-out) 0.15s forwards;
}

.panel.is-active .panel__eyebrow {
  animation: fadeRise 0.9s var(--ease-out) 0.15s forwards;
}

.panel__title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3.25rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(232, 160, 184, 0.25);
  opacity: 0;
  animation: fadeRise 0.95s var(--ease-out) 0.35s forwards;
}

.panel.is-active .panel__title {
  animation: fadeRise 0.95s var(--ease-out) 0.35s forwards;
}

.panel__text {
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(245, 235, 224, 0.82);
  margin: 0;
  opacity: 0;
  animation: fadeRise 0.9s var(--ease-out) 0.55s forwards;
}

.panel.is-active .panel__text {
  animation: fadeRise 0.9s var(--ease-out) 0.55s forwards;
}

.panel__title--sm {
  font-size: clamp(1.55rem, 6.5vw, 2.4rem);
  line-height: 1.25;
}

.panel__text--accent {
  font-family: var(--font-hand);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  color: var(--rose);
  margin-top: 0.5rem;
}

.accent-vida {
  color: var(--rose);
  font-size: 1.15em;
  text-shadow: 0 0 30px rgba(232, 160, 184, 0.5);
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .panel__title {
    transition: transform 0.4s var(--ease-soft), text-shadow 0.4s var(--ease-soft);
  }

  .panel:hover .panel__title {
    transform: scale(1.02);
    text-shadow: 0 0 50px rgba(232, 160, 184, 0.4);
  }
}

.hud {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

.progress {
  display: flex;
  gap: 0.3rem;
  pointer-events: auto;
}

.progress__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(245, 235, 224, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), background 0.35s var(--ease-out), box-shadow 0.35s;
}

.progress__dot.is-on {
  background: var(--rose);
  box-shadow: 0 0 12px var(--rose-soft);
  transform: scale(1.35);
}

@media (hover: hover) {
  .progress__dot:hover:not(.is-on) {
    background: rgba(245, 235, 224, 0.5);
    transform: scale(1.1);
  }
}

.swipe-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(26, 10, 20, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 160, 184, 0.25);
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 0.65rem;
  color: var(--cream);
  font-family: var(--font-hand);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  pointer-events: none;
  opacity: 0.95;
  animation: hintPulse 2.2s var(--ease-soft) infinite;
}

.swipe-hint.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  animation: none;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.swipe-hint__hand {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transform: rotate(180deg);
  animation: swipeLeft 1.8s var(--ease-soft) infinite;
}

.swipe-hint__label {
  padding-right: 0.25rem;
}

@keyframes swipeLeft {
  0%,
  100% {
    transform: rotate(180deg) translateX(0);
  }
  50% {
    transform: rotate(180deg) translateX(-6px);
  }
}

@keyframes hintPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(232, 160, 184, 0.2);
  }
  50% {
    box-shadow: 0 0 20px 2px rgba(232, 160, 184, 0.15);
  }
}

.tap-zone-hint {
  position: fixed;
  z-index: 4;
  bottom: calc(var(--safe-bottom) + 5.5rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  color: rgba(245, 235, 224, 0.4);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out);
}

.tap-zone-hint.is-gone {
  opacity: 0;
}

/* —— Decorations —— */
.deco {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  fill: currentColor;
  color: var(--gold);
  opacity: 0;
}

.deco--rose { color: var(--rose); }
.deco--lg { width: 26px; height: 26px; }
.deco--sm { width: 12px; height: 12px; }

.panel.is-active .deco {
  animation:
    decoAppear 0.55s var(--ease-out) var(--d, 0.3s) both,
    decoJingle var(--jingle-dur, 3.2s) var(--ease-soft) calc(var(--d, 0.3s) + 0.55s) infinite both;
}

@keyframes decoAppear {
  from { opacity: 0; scale: 0.2; }
  to   { opacity: 0.5; scale: 1; }
}

@keyframes decoJingle {
  0%, 100% { translate: 0 0;    rotate: 0deg;  }
  20%      { translate: 0 -7px; rotate: 5deg;  }
  40%      { translate: 1px 0;  rotate: -2deg; }
  60%      { translate: 0 -5px; rotate: 3deg;  }
  80%      { translate: -1px -1px; rotate: -1deg; }
}

.deco--sm  { --jingle-dur: 3.8s; }
.deco--lg  { --jingle-dur: 2.8s; }

/* —— Scene illustrations —— */
.scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 85%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1;
  pointer-events: none;
  fill: currentColor;
  color: var(--cream);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.scene--sm {
  max-width: 180px;
}

.scene--bottom {
  top: auto;
  bottom: -2rem;
  transform: translateX(-50%);
}

.scene--bg {
  max-width: 360px;
  opacity: 0;
}

.panel.is-active .scene {
  animation: sceneIn 1.4s var(--ease-out) 0.25s both;
}

.panel.is-active .scene--bg {
  animation: sceneIn 1.6s var(--ease-out) 0.15s both;
}

@keyframes sceneIn {
  from { opacity: 0; scale: 0.92; }
  to   { opacity: 0.07; scale: 1; }
}

/* —— Heart scene —— */
.heart-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.25rem;
}

.heart-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  animation: heartPulse 1.6s var(--ease-soft) infinite;
  filter: drop-shadow(0 0 24px rgba(240, 100, 140, 0.35));
  transition: filter 0.4s var(--ease-out);
}

.heart-btn:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 12px;
  border-radius: 50%;
}

.heart-svg {
  width: clamp(100px, 32vw, 150px);
  height: auto;
  display: block;
}

.heart-label {
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  color: var(--cream);
  letter-spacing: 0.02em;
  opacity: 0.85;
  transition: opacity 0.3s;
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.1);
  }
  30% {
    transform: scale(0.97);
  }
  45% {
    transform: scale(1.06);
  }
  60% {
    transform: scale(1);
  }
}

.heart-btn.is-thumped {
  animation: heartThump 0.7s var(--ease-out) forwards;
}

@keyframes heartThump {
  0% { transform: scale(1); }
  20% { transform: scale(1.3); filter: drop-shadow(0 0 40px rgba(240, 100, 140, 0.6)); }
  40% { transform: scale(0.9); }
  60% { transform: scale(1.1); }
  80% { transform: scale(0.95); }
  100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(240, 100, 140, 0.2)); }
}

.heart-btn.is-thumped .heart-label {
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

/* —— Post-burst reveal —— */
.heart-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease-out) 0.15s, transform 0.8s var(--ease-out) 0.15s;
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 5vw, 1.65rem) !important;
  color: var(--rose) !important;
}

.heart-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Tulip particles —— */
.tulip-particle {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
  will-change: transform, opacity;
}

/* —— Inline SVG heart icon (final panel) —— */
.icon-heart {
  width: clamp(2rem, 7vw, 3rem);
  height: auto;
  color: var(--rose);
  display: block;
  margin: 0.75rem auto 0;
  animation: iconPulse 2.4s var(--ease-soft) infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* —— Proposal panel —— */
.proposal-btns {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  opacity: 0;
  animation: fadeRise 0.9s var(--ease-out) 0.55s forwards;
}

.panel.is-active .proposal-btns {
  animation: fadeRise 0.9s var(--ease-out) 0.55s forwards;
}

.proposal-btn {
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 2.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.proposal-btn--si {
  background: linear-gradient(135deg, #e84060, #f06888);
  color: #fff;
  box-shadow: 0 4px 24px rgba(232, 64, 96, 0.35);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.proposal-btn--si:hover {
  box-shadow: 0 6px 32px rgba(232, 64, 96, 0.5);
}

.proposal-btn--si.is-mega {
  position: fixed;
  z-index: 200;
  left: 50%;
  top: 50%;
  transform-origin: center center;
}

.proposal-btn--no {
  background: rgba(245, 235, 224, 0.12);
  color: var(--cream);
  border: 1px solid rgba(245, 235, 224, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.proposal-btn--no.is-escaping {
  position: fixed;
  z-index: 100;
  transform-origin: 0 0;
}

.proposal-result {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.proposal-result.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.proposal-msg {
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 5.5vw, 2rem);
  color: var(--rose);
  margin: 1.5rem 0;
  line-height: 1.4;
}

.proposal-wp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #25D366;
  color: #fff;
  font-family: var(--font-soft);
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.proposal-wp-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.45);
}

.wp-icon {
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .story {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .panel {
    width: min(100%, 32rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .panel {
    filter: none !important;
  }

  .floating-hearts::before,
  .floating-hearts::after {
    display: none;
  }
}
