/* =====================================================
   RESET
===================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* =====================================================
   VARIABLES
===================================================== */

:root {
  --pink-light: #ffdce8;
  --pink: #f8c8d8;
  --pink-soft: #ffe9f0;

  /* Fucsia */
  --fuchsia: #d63384;
  --fuchsia-dark: #b51f69;
  --fuchsia-light: #ec6da5;
  --fuchsia-soft: #fce0ec;

  --pink-button: #e85b96;
  --pink-button-hover: #d94380;

  --pink-border: #d995ac;
  --fuchsia-border: #d65a91;

  --text: #633f4d;
  --text-soft: #765766;

  --title: #743f55;
  --accent: #b52f70;

  --white: #ffffff;
  --paper: #fffaf7;
}


/* =====================================================
   HTML
===================================================== */

html {
  scroll-behavior: smooth;
}


/* =====================================================
   BODY
===================================================== */

body {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255,255,255,.85),
      transparent 25%
    ),

    radial-gradient(
      circle at 80% 80%,
      rgba(255,255,255,.75),
      transparent 25%
    ),

    radial-gradient(
      circle at 50% 50%,
      rgba(238,70,145,.08),
      transparent 40%
    ),

    linear-gradient(
      135deg,
      var(--pink-light),
      var(--pink),
      var(--pink-soft)
    );

  color: var(--text);

  font-family:
    "Poppins",
    sans-serif;

  overflow-x: hidden;
}


/* =====================================================
   BOTONES
===================================================== */

button {
  border: none;

  font-family: inherit;
}


button:focus-visible {
  outline:
    3px solid rgba(214,51,132,.45);

  outline-offset: 4px;
}


button,
.envelope {
  -webkit-tap-highlight-color: transparent;
}


/* =====================================================
   UTILIDADES
===================================================== */

.is-hidden {
  display: none !important;
}


/* =====================================================
   PÉTALOS
===================================================== */

.petals {
  position: fixed;

  inset: 0;

  z-index: 0;

  pointer-events: none;

  overflow: hidden;
}


.petal {
  position: absolute;

  top: -30px;

  width: 12px;
  height: 18px;

  background:
    rgba(255,255,255,.75);

  border-radius:
    70% 30% 70% 30%;

  animation:
    caer linear infinite;
}


.petal:nth-child(1) {
  left: 10%;
  animation-duration: 8s;
}


.petal:nth-child(2) {
  left: 25%;
  animation-duration: 11s;
  animation-delay: 2s;
}


.petal:nth-child(3) {
  left: 40%;
  animation-duration: 9s;
  animation-delay: 1s;
}


.petal:nth-child(4) {
  left: 55%;
  animation-duration: 12s;
  animation-delay: 4s;
}


.petal:nth-child(5) {
  left: 70%;
  animation-duration: 8s;
  animation-delay: 3s;
}


.petal:nth-child(6) {
  left: 85%;
  animation-duration: 10s;
  animation-delay: 1s;
}


@keyframes caer {

  from {
    transform:
      translateY(-30px)
      rotate(0deg);
  }

  to {
    transform:
      translateY(110vh)
      rotate(360deg);
  }

}


/* =====================================================
   CONTENEDOR
===================================================== */

.container {
  position: relative;

  z-index: 2;

  width: min(92%, 700px);

  margin: auto;

  padding: 50px 0;

  text-align: center;
}


/* =====================================================
   SECCIONES
===================================================== */

.intro,
.envelope-section,
.letter-section,
.hug-section,
.final {
  display: flex;

  min-height: 100vh;
  min-height: 100svh;
}


/* =====================================================
   INTRO
===================================================== */

.intro {
  flex-direction: column;

  justify-content: center;

  align-items: center;

  padding:
    30px 0;
}


.small {
  margin-bottom: 15px;

  color: var(--fuchsia);

  font-size: 14px;

  letter-spacing: 3px;

  text-transform: uppercase;
}


h1 {
  color: var(--title);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(48px, 10vw, 82px);

  font-weight: 500;

  line-height: .95;
}


.intro p {
  width: min(100%, 500px);

  margin: 25px auto;

  color: var(--text-soft);

  font-size: clamp(15px, 3.5vw, 16px);

  line-height: 1.8;
}


/* =====================================================
   BOTÓN PRINCIPAL
===================================================== */

.main-btn {
  margin-top: 15px;

  padding: 14px 28px;

  border-radius: 50px;

  background:
    linear-gradient(
      135deg,
      var(--fuchsia-light),
      var(--fuchsia)
    );

  color: white;

  box-shadow:
    0 10px 30px rgba(181,31,105,.22);

  cursor: pointer;

  font-size: 15px;

  transition:
    transform .3s ease,
    box-shadow .3s ease,
    background .3s ease;
}


.main-btn:hover {
  transform:
    translateY(-3px)
    scale(1.02);

  background:
    linear-gradient(
      135deg,
      var(--fuchsia),
      var(--fuchsia-dark)
    );

  box-shadow:
    0 15px 35px rgba(181,31,105,.30);
}


.main-btn:active {
  transform:
    scale(.97);
}


/* =====================================================
   SOBRE
===================================================== */

.envelope-section {
  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding:
    40px 0;
}


.envelope {
  position: relative;

  width: min(280px, 80vw);

  height: auto;

  aspect-ratio: 280 / 190;

  border-radius: 8px;

  background: #fff8fb;

  box-shadow:
    0 20px 50px rgba(100,50,70,.2);

  cursor: pointer;

  transition:
    transform .4s ease,
    box-shadow .4s ease;
}


.envelope:hover {
  transform:
    translateY(-8px)
    rotate(-1deg);

  box-shadow:
    0 25px 60px rgba(181,31,105,.22);
}


.envelope::before {
  content: "";

  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      135deg,
      #f8bfd3,
      #f5a8c4
    );

  clip-path:
    polygon(
      0 0,
      50% 55%,
      100% 0
    );
}


.heart {
  position: absolute;

  left: 50%;
  top: 50%;

  z-index: 2;

  transform:
    translate(-50%,-30%);

  font-size: clamp(40px, 12vw, 48px);

  filter:
    drop-shadow(
      0 4px 4px rgba(0,0,0,.1)
    );

  animation:
    heartbeat 2s infinite;
}


@keyframes heartbeat {

  0%,100% {
    transform:
      translate(-50%,-30%)
      scale(1);
  }

  50% {
    transform:
      translate(-50%,-30%)
      scale(1.15);
  }

}


.envelope-text {
  margin-top: 30px;

  color: var(--fuchsia-dark);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: clamp(22px, 6vw, 25px);
}


/* =====================================================
   CARTA
===================================================== */

.letter-section {
  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding:
    40px 0;
}


.letter {
  width: min(100%, 580px);

  padding:
    clamp(28px, 6vw, 45px)
    clamp(20px, 6vw, 35px);

  border-radius: 18px;

  background:
    rgba(255,251,252,.94);

  box-shadow:
    0 25px 70px rgba(100,50,70,.18);

  text-align: left;

  animation:
    aparecer .8s ease;
}


@keyframes aparecer {

  from {
    opacity: 0;

    transform:
      translateY(25px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }

}


.letter h2 {
  margin-bottom: 25px;

  color: var(--fuchsia-dark);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(34px, 8vw, 42px);

  text-align: center;
}


.letter p {
  margin-bottom: 18px;

  color: #604653;

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(18px, 4.5vw, 22px);

  line-height: 1.7;
}


.signature {
  margin-top: 35px;

  color: var(--fuchsia);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: clamp(22px, 6vw, 24px);

  text-align: right;
}


.center-button {
  margin-top: 30px;

  text-align: center;
}


/* =====================================================
   ABRAZO
===================================================== */

.hug-section {
  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding:
    40px 0;

  text-align: center;
}


.hug {
  border: none;

  background: transparent;

  font-size:
    clamp(70px, 22vw, 110px);

  cursor: pointer;

  user-select: none;

  animation:
    abrazo 2s infinite ease-in-out;
}


@keyframes abrazo {

  0%,100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

}


.hug-section h2 {
  margin: 15px 0;

  color: var(--title);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(36px, 9vw, 52px);
}


.hug-section > p {
  width: min(100%, 480px);

  font-size:
    clamp(14px, 4vw, 16px);

  line-height: 1.8;
}


/* =====================================================
   CUPÓN
===================================================== */

.coupon {
  position: relative;

  width: min(100%, 430px);

  margin-top: 35px;

  padding: 30px 25px;

  overflow: hidden;

  border:
    2px dashed var(--fuchsia-border);

  border-radius: 18px;

  background: white;

  box-shadow:
    0 15px 35px rgba(100,50,70,.12);
}


.coupon::before,
.coupon::after {
  content: "";

  position: absolute;

  top: 50%;

  width: 25px;
  height: 25px;

  border-radius: 50%;

  background: var(--pink);

  transform:
    translateY(-50%);
}


.coupon::before {
  left: -14px;
}


.coupon::after {
  right: -14px;
}


.coupon-title {
  color: var(--fuchsia);

  font-size: 13px;

  letter-spacing: 3px;

  text-transform: uppercase;
}


.coupon h3 {
  margin: 10px 0;

  color: var(--fuchsia-dark);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(31px, 8vw, 36px);
}


.coupon p {
  font-size: 14px;

  line-height: 1.7;
}


.coupon-code {
  min-height: 18px;

  margin-top: 18px;

  color: var(--fuchsia);

  font-family: monospace;

  font-size: 12px;

  letter-spacing: 2px;

  word-break: break-all;
}


/* =====================================================
   BOTÓN RECLAMAR
===================================================== */

.claim-button {
  margin-top: 22px;

  padding: 13px 24px;

  border-radius: 40px;

  background:
    linear-gradient(
      135deg,
      var(--pink-button),
      var(--fuchsia)
    );

  color: white;

  box-shadow:
    0 8px 20px rgba(180,80,110,.25);

  cursor: pointer;

  transition:
    transform .3s ease,
    background .3s ease,
    box-shadow .3s ease;
}


.claim-button:hover:not(:disabled) {
  transform:
    translateY(-3px);

  background:
    linear-gradient(
      135deg,
      var(--fuchsia),
      var(--fuchsia-dark)
    );

  box-shadow:
    0 12px 25px rgba(180,80,110,.30);
}


.claim-button:disabled {
  cursor: default;

  opacity: .7;
}


/* =====================================================
   DESCARGA
===================================================== */

.download-button {
  margin-top: 10px;

  padding: 11px 20px;

  border:
    1px solid var(--pink-border);

  border-radius: 40px;

  background: transparent;

  color: var(--fuchsia-dark);

  cursor: pointer;

  transition:
    background .3s ease,
    border-color .3s ease,
    color .3s ease;
}


.download-button:hover:not(:disabled) {
  background: var(--fuchsia-soft);

  border-color: var(--fuchsia);

  color: var(--fuchsia-dark);
}


.download-button:disabled {
  cursor: wait;
}


/* =====================================================
   RECLAMADO
===================================================== */

.claimed {
  display: none;

  margin-top: 20px;
}


.claimed.show {
  display: block;

  animation:
    aparecer .6s ease;
}


.claimed-message {
  margin-bottom: 12px;

  color: var(--fuchsia-dark);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(21px, 6vw, 24px);
}


/* =====================================================
   SELLO
===================================================== */

.claimed-stamp {
  position: absolute;

  top: 50%;
  left: 50%;

  z-index: 10;

  width: min(170px, 55vw);
  height: 70px;

  display: flex;

  align-items: center;
  justify-content: center;

  border:
    4px solid #d77f9d;

  border-radius: 12px;

  background:
    rgba(255,255,255,.9);

  color: #d77f9d;

  font-size:
    clamp(14px, 4vw, 18px);

  font-weight: 600;

  letter-spacing: 3px;

  opacity: 0;

  pointer-events: none;

  transform:
    translate(-50%,-50%)
    rotate(-12deg)
    scale(0);
}


.claimed-stamp.show {
  animation:
    sello .8s cubic-bezier(.2,.8,.2,1)
    forwards;
}


@keyframes sello {

  0% {
    opacity: 0;

    transform:
      translate(-50%,-50%)
      rotate(-12deg)
      scale(2);
  }

  60% {
    opacity: 1;

    transform:
      translate(-50%,-50%)
      rotate(-12deg)
      scale(.95);
  }

  100% {
    opacity: .9;

    transform:
      translate(-50%,-50%)
      rotate(-12deg)
      scale(1);
  }

}


/* =====================================================
   FINAL
===================================================== */

.final {
  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding:
    clamp(25px, 6vw, 30px);

  text-align: center;
}


.final h2 {
  color: var(--title);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size:
    clamp(45px, 10vw, 70px);
}


.final p {
  width: min(100%, 500px);

  margin-top: 20px;

  line-height: 1.8;
}


.small-final {
  margin-top: 35px;

  color: var(--fuchsia);

  font-size: 13px;
}


/* =====================================================
   CORAZÓN AL TOCAR
===================================================== */

.tap-heart {
  position: fixed;

  z-index: 9999;

  pointer-events: none;

  color: var(--fuchsia);

  font-size: 22px;

  animation:
    tapAnimation 1s ease forwards;
}


@keyframes tapAnimation {

  0% {
    opacity: 1;

    transform:
      translate(-50%,-50%)
      scale(.5);
  }

  50% {
    opacity: 1;

    transform:
      translate(-50%,-100%)
      scale(1.2);
  }

  100% {
    opacity: 0;

    transform:
      translate(-50%,-170%)
      scale(.8);
  }

}


/* =====================================================
   TARJETA DE DESCARGA
   Esta tarjeta mantiene 900x600 porque está
   diseñada para generar una imagen.
===================================================== */

.download-card {
  position: fixed;

  left: -10000px;
  top: 0;

  width: 900px;
  height: 600px;

  padding: 45px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(255,214,229,.9),
      transparent 25%
    ),

    radial-gradient(
      circle at 85% 80%,
      rgba(255,224,236,.9),
      transparent 25%
    ),

    radial-gradient(
      circle at 50% 50%,
      rgba(236,109,165,.08),
      transparent 40%
    ),

    var(--paper);

  color: #694453;

  font-family:
    "Poppins",
    sans-serif;
}


.download-card::before {
  content: "";

  position: absolute;

  inset: 22px;

  border:
    2px solid #e5a9bd;

  border-radius: 20px;
}


.download-card::after {
  content: "";

  position: absolute;

  inset: 32px;

  border:
    1px solid rgba(217,149,172,.5);

  border-radius: 15px;
}


/* =====================================================
   FLORES
===================================================== */

.card-flower {
  position: absolute;

  color: var(--fuchsia);

  font-size: 60px;

  opacity: .75;
}


.flower-1 {
  top: 45px;
  left: 55px;

  transform:
    rotate(-15deg);
}


.flower-2 {
  top: 55px;
  right: 55px;

  transform:
    rotate(15deg);
}


.flower-3 {
  bottom: 45px;
  left: 65px;

  transform:
    rotate(20deg);
}


.flower-4 {
  bottom: 45px;
  right: 65px;

  transform:
    rotate(-20deg);
}


/* =====================================================
   CONTENIDO TARJETA
===================================================== */

.card-content {
  position: relative;

  z-index: 2;

  height: 100%;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;
}


.card-label {
  margin-bottom: 15px;

  color: var(--fuchsia);

  font-size: 15px;

  letter-spacing: 5px;

  text-transform: uppercase;
}


.card-title {
  margin-bottom: 18px;

  color: var(--fuchsia-dark);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 62px;

  font-weight: 500;

  line-height: .9;
}


.card-subtitle {
  margin-bottom: 28px;

  color: var(--fuchsia);

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 31px;
}


.card-divider {
  display: flex;

  width: 430px;

  max-width: 80%;

  margin-bottom: 25px;

  align-items: center;

  gap: 15px;

  color: var(--fuchsia);

  font-size: 18px;
}


.card-divider::before,
.card-divider::after {
  content: "";

  height: 1px;

  flex: 1;

  background: #e2b4c4;
}


.card-text {
  max-width: 510px;

  color: #694b58;

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 25px;

  line-height: 1.45;
}


/* =====================================================
   QR
===================================================== */

.card-qrcode {
  position: absolute;

  left: 65px;
  bottom: 100px;

  width: 120px;
  height: 120px;

  padding: 10px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: white;

  box-shadow:
    0 3px 8px rgba(100,50,70,.15);
}


.card-qrcode img,
.card-qrcode canvas {
  display: block;

  width: 100% !important;
  height: 100% !important;

  image-rendering: pixelated;
}


/* =====================================================
   CÓDIGO
===================================================== */

.card-code {
  position: absolute;

  bottom: 50px;

  padding: 8px 18px;

  border:
    1px dashed var(--pink-border);

  border-radius: 30px;

  background:
    rgba(255,255,255,.65);

  color: var(--fuchsia-dark);

  font-family: monospace;

  font-size: 14px;

  letter-spacing: 2px;
}


/* =====================================================
   SELLO TARJETA
===================================================== */

.card-seal {
  position: absolute;

  right: 105px;
  bottom: 105px;

  width: 78px;
  height: 78px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background:
    linear-gradient(
      135deg,
      var(--fuchsia-light),
      var(--fuchsia)
    );

  color: white;

  font-family:
    "Cormorant Garamond",
    serif;

  font-size: 17px;

  line-height: 1;

  text-align: center;

  transform:
    rotate(8deg);

  box-shadow:
    0 5px 12px rgba(130,70,90,.18);
}


.card-footer {
  position: absolute;

  right: 0;
  bottom: 35px;
  left: 0;

  color: #aa7184;

  font-size: 13px;

  letter-spacing: 1px;

  text-align: center;
}


/* =====================================================
   MÓVILES PEQUEÑOS
===================================================== */

@media (max-width: 400px) {

  .container {
    width: 92%;
  }


  .small {
    font-size: 12px;

    letter-spacing: 2px;
  }


  .intro p {
    font-size: 15px;

    line-height: 1.65;
  }


  .main-btn {
    padding: 13px 22px;
  }


  .envelope-text {
    font-size: 22px;
  }


  .letter {
    border-radius: 14px;
  }


  .coupon {
    padding: 25px 20px;
  }


  .coupon h3 {
    font-size: 31px;
  }


  .claimed-message {
    font-size: 21px;
  }

}


/* =====================================================
   TABLETS / PANTALLAS GRANDES
===================================================== */

@media (min-width: 768px) {

  .container {
    width: min(90%, 700px);
  }

}


/* =====================================================
   REDUCIR ANIMACIONES
===================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;

    animation-iteration-count: 1 !important;

    scroll-behavior: auto !important;

    transition-duration: .01ms !important;
  }

}
