/* ============================================================
   Invitación Real — Mini Princesa
   Paleta: rosa pastel, lavanda, dorado
   ============================================================ */

:root {
  --pink-100: #fff0f6;
  --pink-200: #ffd6e7;
  --pink-300: #ffb3d1;
  --pink-400: #ff8fb3;
  --pink-500: #ff6b9d;
  --lilac-200: #e9d5f5;
  --lilac-300: #d6b9ec;
  --lilac-400: #b78bd8;
  --lilac-500: #9b6bc3;
  --purple-700: #5b3a78;
  --gold-300: #ffe9a8;
  --gold-400: #f7c948;
  --gold-600: #d4a017;
  --ink: #4a3557;
  --wa: #25d366;

  --font-title: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', serif;
  --font-body: 'Quicksand', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--pink-100);
  min-height: 100vh;
  overflow-x: hidden;
}

body.locked { overflow: hidden; height: 100vh; }

/* ---------- canvas de brillos ---------- */
#sparkles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ============================================================
   CIELO VIVO (capas que se funden con el scroll)
   ============================================================ */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.sky--dawn {
  opacity: 1;
  background: linear-gradient(180deg, #ffe9f4 0%, #ffd6e7 55%, #ecd9f7 100%);
}

/* nubes flotando */
.cloud {
  position: absolute;
  width: 130px;
  height: 44px;
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  opacity: .8;
  animation: cloudDrift 70s linear infinite;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before { width: 58px; height: 58px; top: -28px; left: 20px; }
.cloud::after  { width: 40px; height: 40px; top: -18px; left: 66px; }

.cloud--1 { top: 12%; }
.cloud--2 { top: 32%; transform: scale(.65); animation-duration: 95s; animation-delay: -40s; }
.cloud--3 { top: 58%; transform: scale(1.25); opacity: .45; animation-duration: 80s; animation-delay: -70s; }

@keyframes cloudDrift {
  from { left: -170px; }
  to   { left: 110%; }
}

/* ============================================================
   PORTADA — LIBRO
   ============================================================ */

.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(800px 400px at 50% 30%, rgba(255,255,255,.7), transparent 70%),
    linear-gradient(160deg, var(--lilac-300), var(--pink-300));
  transition: opacity .9s ease, visibility .9s;
}

.cover.opened {
  opacity: 0;
  visibility: hidden;
}

.book {
  position: relative;
  width: min(340px, 88vw);
  perspective: 1200px;
}

.book__glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(closest-side, rgba(255,233,168,.55), transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.06); }
}

.book__page {
  position: relative;
  background: linear-gradient(165deg, #fffdf8, #fff5fa);
  border: 3px solid var(--gold-400);
  border-radius: 18px;
  padding: 2.4rem 1.6rem 2rem;
  text-align: center;
  box-shadow:
    0 20px 50px rgba(91,58,120,.35),
    inset 0 0 0 6px rgba(247,201,72,.15);
  transform-style: preserve-3d;
  transform-origin: left center;
  animation: bookFloat 4s ease-in-out infinite;
  transition: transform 1.1s cubic-bezier(.4,.1,.2,1);
}

.cover.opened .book__page {
  animation: none;
  transform: rotateY(-160deg);
}

@keyframes bookFloat {
  0%, 100% { transform: translateY(0) rotateZ(-1deg); }
  50%      { transform: translateY(-12px) rotateZ(1deg); }
}

.crown svg {
  width: 110px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(212,160,23,.4));
  animation: crownSparkle 3s ease-in-out infinite;
}

@keyframes crownSparkle {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05) rotate(-2deg); }
}

.cover__once {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--lilac-500);
  margin-top: 1rem;
}

.cover__name {
  font-family: var(--font-title);
  font-size: 4.2rem;
  line-height: 1.25;
  padding: 0 .12em .08em;
  background: linear-gradient(120deg, var(--pink-500), var(--lilac-500), var(--gold-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: .4rem 0 .5rem;
}

.cover__sub {
  font-size: 1rem;
  color: var(--purple-700);
  margin-bottom: 1.6rem;
}

.cover__hint {
  margin-top: .9rem;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lilac-500);
  animation: hintBlink 1.8s ease-in-out infinite;
}

@keyframes hintBlink { 50% { opacity: .4; } }

/* ============================================================
   BOTONES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: .9rem 1.8rem;
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn--royal {
  background: linear-gradient(120deg, var(--pink-500), var(--lilac-400));
  color: #fff;
  box-shadow: 0 8px 24px rgba(255,107,157,.45);
  animation: btnPulse 2.2s ease-in-out infinite;
}

.btn--royal:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,107,157,.55); }

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(255,107,157,.45); }
  50%      { box-shadow: 0 8px 34px rgba(155,107,195,.7); }
}

.btn--whatsapp {
  background: var(--wa);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37,211,102,.4);
  margin-top: 1.2rem;
}

.btn--whatsapp:hover { transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--purple-700);
  border: 2px solid var(--lilac-300);
  font-size: .9rem;
  padding: .65rem 1.3rem;
  margin-top: .7rem;
}

.btn--ghost:hover { background: rgba(214,185,236,.25); }

/* ============================================================
   MAIN
   ============================================================ */

.main { position: relative; z-index: 10; }

/* ---------- HERO ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  position: relative;
  z-index: 2;
}

.hero__castle {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 95vw);
  pointer-events: none;
  z-index: 1;
  animation: castleRise 1.4s ease-out both;
}

.hero__castle img {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(46vh, 400px);
  margin: 0 auto;
  opacity: .85;
}

@keyframes castleRise {
  from { transform: translateX(-50%) translateY(60px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

.hero > *:not(.hero__castle) {
  position: relative;
  z-index: 2;
}

.hero__once {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--lilac-500);
  margin-bottom: .5rem;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--purple-700);
  letter-spacing: .06em;
  margin-bottom: 1rem;
}

.hero__name {
  font-family: var(--font-title);
  font-size: clamp(4.5rem, 18vw, 7.5rem);
  line-height: 1.25;
  padding: .08em .12em;
  background: linear-gradient(120deg, var(--pink-500) 10%, var(--lilac-500) 55%, var(--gold-600) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 12px rgba(255,107,157,.25));
}

.hero__age {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: .4rem 0 .8rem;
}

.hero__num {
  font-family: var(--font-title);
  font-size: 3.4rem;
  color: var(--gold-600);
  text-shadow: 0 2px 0 var(--gold-300);
}

.hero__yeartext {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--purple-700);
}

.hero__invite {
  font-size: 1.05rem;
  color: var(--purple-700);
  max-width: 22rem;
  text-shadow: 0 1px 8px rgba(255,255,255,.9), 0 0 20px rgba(255,255,255,.8);
}

.hero__scroll {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--purple-700);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(4px);
  padding: .6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(214,185,236,.6);
  animation: bob 1.8s ease-in-out infinite;
}

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

/* ---------- SECCIONES ---------- */

.section {
  padding: 4rem 1.4rem;
  max-width: 640px;
  margin: 0 auto;
}

.section__title {
  font-family: var(--font-title);
  font-size: 2.6rem;
  line-height: 1.3;
  padding: 0 .15em .1em;
  text-align: center;
  color: var(--pink-500);
  margin-bottom: 1.6rem;
}

.card {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(6px);
  border-radius: 22px;
  border: 2px solid rgba(247,201,72,.5);
  padding: 2rem 1.6rem;
  box-shadow: 0 14px 40px rgba(155,107,195,.18);
  text-align: center;
}

.card--gold {
  background: linear-gradient(170deg, #fffdf6, #fff6f9);
  border-color: var(--gold-400);
}

.story__text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--purple-700);
}

.story__signature {
  margin-top: 1.2rem;
  font-style: italic;
  color: var(--pink-500);
}

/* ---------- COUNTDOWN ---------- */

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .7rem;
}

.countdown__box {
  background: rgba(255,255,255,.85);
  border: 2px solid var(--pink-300);
  border-radius: 16px;
  padding: 1rem .3rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(255,143,179,.2);
}

.countdown__box span {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2rem;
  color: var(--lilac-500);
  font-variant-numeric: tabular-nums;
}

.countdown__box small {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pink-500);
}

.countdown__done {
  text-align: center;
  font-size: 1.4rem;
  margin-top: 1rem;
}

/* ---------- DETALLES ---------- */

.details__grid {
  display: grid;
  gap: 1.1rem;
}

.detail-card {
  background: rgba(255,255,255,.85);
  border-radius: 20px;
  border: 2px solid var(--lilac-200);
  padding: 1.6rem 1.4rem;
  text-align: center;
  box-shadow: 0 10px 28px rgba(155,107,195,.15);
}

.detail-card__icon {
  font-size: 2.2rem;
  margin-bottom: .4rem;
}

.detail-card h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lilac-500);
  margin-bottom: .5rem;
}

.detail-card__big {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--purple-700);
  margin-bottom: .3rem;
}

.detail-card p:last-of-type { color: #7a6490; }

/* ---------- FOOTER ---------- */

.footer {
  text-align: center;
  padding: 3.5rem 1.5rem 4rem;
  position: relative;
  z-index: 2;
}

.footer__quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--lilac-500);
}

.footer__names {
  margin: 1.2rem 0 .6rem;
  color: var(--purple-700);
}

.footer__names span {
  font-family: var(--font-title);
  font-size: 2.2rem;
  line-height: 1.3;
  display: inline-block;
  padding: 0 .15em .08em;
  color: var(--pink-500);
}

.footer__mini {
  font-size: .8rem;
  color: #a08bb5;
}

/* ---------- CORTE REAL ---------- */

.court__text {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--purple-700);
  margin-bottom: 1.8rem;
}

.court__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  justify-items: center;
  perspective: 800px;
}

.court__item {
  text-align: center;
  opacity: 0;
  perspective: 800px;
}

.court__item.visible { opacity: 1; }

.court__item img {
  width: 110px;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(91,58,120,.3));
}

.court__item figcaption {
  margin-top: .4rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lilac-500);
}

/* ---------- BOTÓN MÚSICA ---------- */

.music-btn {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold-400);
  background: rgba(255,255,255,.9);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(155,107,195,.3);
  transition: transform .2s;
}

.music-btn.playing { animation: musicSpin 3s linear infinite; }

@keyframes musicSpin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

/* ---------- CAMINO REAL ---------- */

.royal-path {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: .9;
}

/* ---------- FONDOS ILUSTRADOS DE ESCENA ---------- */

.has-bg {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.scene-bg {
  position: absolute;
  left: calc(50% - 50vw);
  top: -6vh;
  bottom: -6vh;
  width: 100vw;
  pointer-events: none;
  z-index: -1;
}

.scene-bg picture,
.scene-bg img {
  width: 100%;
  height: 100%;
}

.scene-bg img {
  object-fit: cover;
  will-change: transform;
  /* bordes fundidos para que la escena fluya con el cielo rosa */
  -webkit-mask-image: linear-gradient(180deg,
      transparent 0%, #000 14%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg,
      transparent 0%, #000 14%, #000 88%, transparent 100%);
}

.has-bg .section__title {
  text-shadow: 0 2px 14px rgba(255,255,255,.9), 0 0 24px rgba(255,255,255,.7);
}

/* ---------- PAISAJE POR CAPAS (colinas encadenadas) ---------- */

.landscape {
  position: absolute;
  left: calc(50% - 50vw);
  bottom: 0;
  width: 100vw;
  height: 150px;
  pointer-events: none;
  z-index: -1;
  overflow: visible;
}

.landscape__layer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  will-change: transform;
}

.landscape__layer svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- PROPS DE ESCENA (parallax) ---------- */

.section { position: relative; z-index: 2; }

.scene-prop {
  position: absolute;
  z-index: 2;
  font-size: 3.2rem;
  opacity: .85;
  filter: drop-shadow(0 6px 14px rgba(91,58,120,.25));
  pointer-events: none;
  will-change: transform;
}

.scene-prop--sm { font-size: 1.8rem; }

@media (max-width: 480px) {
  .scene-prop { font-size: 2.4rem; }
  .scene-prop--sm { font-size: 1.3rem; }
}

/* ---------- REVEAL ON SCROLL ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Desktop ---------- */

@media (min-width: 720px) {
  .details__grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 5rem 2rem; }
}

/* ---------- Accesibilidad: menos movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .2s !important;
  }
  .reveal { opacity: 1; transform: none; }
}
