:root {
  --crema: #c4dafa;
  --crema-2: #b3cdf5;
  --lila: #6e62c2;
  --lila-oscuro: #5440a8;
  --periwinkle: #4f5ca8;
  --morado: #5b3a9a;
  --pizarra: #6d6c9c;
  --oro: #f2b632;
  --salmon: rgba(255,255,255,.9);
  --espiral: #6c73bd;
  --icono: #afaa86;
  --script: "Courgette", "Segoe Script", cursive;
  --slab: "Bree Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--periwinkle);
  background:
    radial-gradient(120% 80% at 50% 0%, #dce9fd 0%, transparent 70%),
    linear-gradient(180deg, var(--crema) 0%, var(--crema-2) 100%) fixed;
  background-color: var(--crema);
  font-family: var(--script);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.bloqueado { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
.script { font-family: var(--script); }
.slab { font-family: var(--slab); text-transform: uppercase; letter-spacing: .02em; }
.suave { color: var(--lila); margin: 0; }

/* ---------- Portada "sobre" ---------- */
.sobre {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(80% 60% at 50% 40%, #e3eefe 0%, var(--crema) 60%, var(--crema-2) 100%);
  transition: opacity .8s ease, visibility .8s;
}
.sobre.abierto { opacity: 0; visibility: hidden; }
.sobre__contenido { text-align: center; max-width: 420px; }
.sobre__pre { color: var(--lila); font-size: 1.4rem; margin: 4px 0 0; }
.sobre__nombre {
  color: var(--lila-oscuro); font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.8rem); line-height: 1.1; margin: 4px 0 28px;
}
.sobre__nota { color: var(--lila); font-size: .95rem; margin-top: 14px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--script); color: #fff;
  background: linear-gradient(135deg, #9a7fe3, #8ac0f5);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(91, 58, 154, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(91, 58, 154, .3); }
.btn:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--lila-oscuro); outline-offset: 3px; }
.btn--grande { font-size: 1.3rem; padding: 14px 30px; animation: latido 2.4s ease-in-out infinite; }
.btn--chico { font-size: 1rem; padding: 8px 18px; margin-top: 10px; }
.btn--rsvp {
  font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.15;
  padding: 22px 40px; border-radius: 28px; text-align: center;
  background: linear-gradient(135deg, #7b67c9, #6d6c9c 55%, #8ab0e6);
}

/* ---------- Secciones ---------- */
.sec { position: relative; padding: 56px 16px; overflow: hidden; }
.sec + .sec { border-top: 1px solid rgba(255,255,255,.45); }
.grid {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  display: grid; gap: 28px; align-items: center; justify-items: center;
}
@media (min-width: 760px) {
  .sec { padding: 72px 32px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .grid--invertido > :first-child { order: 0; }
}

.deco-espiral {
  position: absolute; left: -24px; top: 0; z-index: 0;
  width: 150px; height: 100%; color: var(--espiral); opacity: .35;
  pointer-events: none;
}
@media (min-width: 760px) { .deco-espiral { width: 210px; opacity: .75; left: -10px; } }

/* ---------- Marcos de princesa ---------- */
.marco {
  position: relative; margin: 0;
  width: min(84vw, 340px); aspect-ratio: 340 / 430;
  border: 1.5px solid var(--salmon);
  display: grid; place-items: end center;
  padding: 14px 6px 0;
  background: radial-gradient(70% 55% at 50% 60%, rgba(255,255,255,.55), transparent 70%);
}
.marco--ovalo { border-radius: 50% / 34%; padding: 10px 6px 28px; place-items: center; }
.marco--arco { border-radius: 999px 999px 0 0; }
.marco img { width: 100%; filter: drop-shadow(0 6px 10px rgba(91, 58, 154, .18)); animation: flotar 6s ease-in-out infinite; }

/* ---------- Portada ---------- */
.hero__texto { text-align: center; width: 100%; max-width: 380px; }
.tiara { display: block; width: 220px; height: 100px; margin: 0 auto -6px; color: #8f7fe6; }
.tiara--sm { width: 170px; height: 78px; }
.titulo, .nombre {
  margin: 0; font-weight: 400; color: #8f7fe6; line-height: 1.05;
  text-transform: uppercase; letter-spacing: .06em;
  -webkit-text-stroke: .5px #6a58c9;
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
}
.titulo span, .nombre span { display: block; }
.titulo { font-size: clamp(2.6rem, 11vw, 3.6rem); margin-bottom: 10px; }
.nombre { font-size: clamp(2.4rem, 10vw, 3.3rem); margin-top: 18px; }

/* ---------- Reproductor ---------- */
.reproductor { margin: 16px auto 0; max-width: 320px; }
.reproductor__botones { display: flex; justify-content: center; align-items: center; gap: 22px; }
.reproductor button { border: 0; background: none; cursor: pointer; padding: 0; color: #9d91de; }
.icono svg { width: 26px; height: 26px; fill: currentColor; }
.play {
  width: 64px; height: 64px; border-radius: 50%;
  background: #c5bbf3 !important; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(123, 103, 201, .3);
}
.play svg { width: 30px; height: 30px; fill: #8e7fe0; }
.play .i-pausa, .sonando .play .i-play { display: none; }
.sonando .play .i-pausa { display: block; }
#progreso {
  -webkit-appearance: none; appearance: none;
  width: 100%; margin: 16px 0 4px; height: 4px; cursor: pointer; border-radius: 4px;
  background: linear-gradient(90deg, #9d91de var(--avance, 0%), #d9d2f5 var(--avance, 0%));
}
#progreso::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #8e7fe0; border: 0; }
#progreso::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #8e7fe0; border: 0; }
.reproductor__tiempo { display: flex; justify-content: space-between; font-size: .85rem; color: var(--lila); }

/* ---------- Contador ---------- */
.sec--contador { text-align: center; padding-top: 40px; padding-bottom: 44px; }
.contador { display: flex; justify-content: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.contador div {
  min-width: 72px; padding: 12px 8px 8px;
  border: 1.5px solid rgba(169, 155, 230, .6); border-radius: 18px;
  background: rgba(255, 255, 255, .45);
}
.contador b { display: block; font-family: var(--slab); font-weight: 400; font-size: 2rem; color: var(--lila-oscuro); line-height: 1; }
.contador span { font-size: .9rem; color: var(--lila); }
.contador__fin { font-size: 1.6rem; color: var(--lila-oscuro); }

/* ---------- Mensaje ---------- */
.mensaje {
  text-align: center; font-size: clamp(1.25rem, 4.6vw, 1.55rem); line-height: 1.45;
  color: #4f5ca8; max-width: 420px;
}
.mensaje p { margin: 0 0 .8em; }
.mensaje p:last-child { color: var(--lila-oscuro); }

/* ---------- Detalles ---------- */
.sec--detalles { text-align: center; }
.ornamento { display: block; width: min(92%, 700px); height: 90px; margin: 0 auto; color: var(--pizarra); }
.celebra { font-size: clamp(2.4rem, 10vw, 3.4rem); font-weight: 400; color: #5a6fc6; margin: 4px 0 30px; line-height: 1.1; }
.tarjetas {
  max-width: 1000px; margin: 0 auto;
  display: grid; gap: 22px;
}
@media (min-width: 760px) { .tarjetas { grid-template-columns: repeat(3, 1fr); } }
.tarjeta {
  padding: 22px 16px 24px; border-radius: 24px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255,255,255,.7);
}
.tarjeta__icono { height: 96px; width: auto; margin: 0 auto 8px; }
.tarjeta h3 { color: #5a6fc6; font-size: 1.7rem; margin: 6px 0 8px; font-weight: 400; }
.tarjeta p { margin: 0 0 4px; font-size: 1.1rem; color: #5d4ab8; }
.tarjeta strong { font-weight: 400; color: var(--lila-oscuro); }

/* ---------- Confirmar ---------- */
.rsvp { text-align: center; }
.rsvp .suave { font-size: 1.6rem; margin-bottom: 16px; }
.rsvp__nota { font-size: .95rem; color: var(--lila); margin-top: 14px; }
.pie { position: relative; z-index: 1; text-align: center; color: var(--lila); margin: 48px 0 0; font-size: 1.15rem; }

/* ---------- Botón flotante ---------- */
.musica-flotante {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #9a7fe3, #8ac0f5); color: #fff; font-size: 1.6rem;
  box-shadow: 0 6px 18px rgba(91, 58, 154, .35);
}
.musica-flotante.sonando .nota { display: inline-block; animation: girar 3s linear infinite; }
.musica-flotante:not(.sonando)::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: #fff; transform: rotate(-45deg);
}

/* ---------- Animaciones ---------- */
.revelar { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.revelar.visible { opacity: 1; transform: none; }
@keyframes flotar { 50% { transform: translateY(-6px); } }
@keyframes brillo { 50% { opacity: .35; transform: scale(.75); } }
@keyframes latido { 50% { transform: scale(1.05); } }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { opacity: 1; transform: none; }
}
.btn.slab { font-family: var(--slab); }
