/* ==========================================================
   Diseño "Cielo" · Bautizo · "Un regalo del cielo"
   Nubes pastel que se borran con el dedo → globo aerostático con la foto,
   angelitos, palomitas, arcoíris y avioncito con banderita.
   Paleta: celeste, rosa durazno, crema y dorado suave.
   ========================================================== */

:root {
  --crema: #fff8ee;
  --celeste: #cfe8f8;
  --celeste-2: #9ccbec;
  --azul: #5f8fc6;
  --azul-2: #4d79ad;
  --rosa: #ffd6df;
  --rosa-2: #e48aa4;
  --durazno: #ffdcc8;
  --oro: #ecc879;
  --oro-2: #c99b45;
  --tinta: #4e4b70;
  --suave: #7f7b9b;
  --fuente: "Fredoka", system-ui, sans-serif;
  --script: "Pacifico", "Fredoka", cursive;
  --mano: "Caveat", "Fredoka", cursive;

  --s-fondo: var(--crema);
  --s-tinta: var(--tinta);
  --s-suave: var(--suave);
  --s-acento: var(--azul);
  --s-acento-tinta: #fff;
  --s-tarjeta: #ffffff;
  --s-borde: rgba(156, 203, 236, .4);
  --s-radio: 26px;
  --s-sombra: 0 16px 30px -20px rgba(80, 100, 170, .45);
  --s-fuente: var(--fuente);
  --s-titulo: var(--script);
  --s-titulo-tam: clamp(1.9rem, 8.4vw, 2.4rem);
  --s-titulo-color: #d97e9b;
  --s-etiqueta: var(--fuente);
  --s-num: var(--fuente);
  --s-num-color: var(--azul);
  --s-btn-linea-color: var(--tinta);
}

body {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 214, 223, .45) 0 5px, transparent 6px) 0 0 / 110px 110px,
    radial-gradient(circle at 70% 70%, rgba(207, 232, 248, .6) 0 6px, transparent 7px) 0 0 / 90px 90px,
    linear-gradient(180deg, #eef6fc, #fff6ee);
  color: var(--tinta);
  font-family: var(--fuente);
}

/* ================= CIELO (INTRO) ================= */
.cielo {
  position: relative;
  width: min(100%, 540px);
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 0 60px -30px rgba(78, 75, 112, .4);
  /* ancho del globo: cabe a lo ancho y a lo alto (globo 1:1.25 + banderola ~125px) */
  --gw: clamp(130px, min(60vw, 300px, calc((100vh - 305px) * .8)), 300px);
  --gw: clamp(130px, min(60vw, 300px, calc((100svh - 305px) * .8)), 300px);
}
@media (min-width: 541px) {
  .cielo { --gw: clamp(130px, min(324px, 300px, calc((100svh - 305px) * .8)), 300px); }
}

.cielo__fondo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 16% 9%, rgba(255, 246, 214, .95) 0, rgba(255, 240, 200, .5) 16%, transparent 42%),
    linear-gradient(180deg, #a9d6f3 0%, #c7e5f8 28%, #e9f1f8 50%, #ffe6da 70%, #fff3e6 100%);
}
.cielo__rayos {
  position: absolute;
  inset: -10%;
  z-index: 1;
  background: repeating-conic-gradient(from 0deg at 22% 13%, rgba(255, 255, 255, .55) 0deg 5deg, rgba(255, 255, 255, 0) 5deg 16deg);
  -webkit-mask-image: radial-gradient(circle at 22% 13%, #000 0, rgba(0, 0, 0, .5) 30%, transparent 70%);
  mask-image: radial-gradient(circle at 22% 13%, #000 0, rgba(0, 0, 0, .5) 30%, transparent 70%);
  opacity: .5;
  animation: rayos 7s ease-in-out infinite alternate;
}
@keyframes rayos { from { opacity: .3; } to { opacity: .7; } }

.sol {
  position: absolute;
  z-index: 2;
  left: -6%;
  top: calc(env(safe-area-inset-top) - 4%);
  width: min(34vw, 170px);
  height: auto;
}
.sol__rayos { transform-origin: 60px 60px; animation: girar 40s linear infinite; }
@keyframes girar { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Arcoíris: se dibuja al revelar */
.arcoiris {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 19%;
  width: 150%;
  height: auto;
  transform: translateX(-50%);
  opacity: .8;
}
.arcoiris path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.revelado .arcoiris path { animation: trazo 2.4s cubic-bezier(.4, .1, .2, 1) .5s forwards; }
.revelado .arcoiris path:nth-child(2) { animation-delay: .62s; }
.revelado .arcoiris path:nth-child(3) { animation-delay: .74s; }
.revelado .arcoiris path:nth-child(4) { animation-delay: .86s; }
.revelado .arcoiris path:nth-child(5) { animation-delay: .98s; }
.revelado .arcoiris path:nth-child(6) { animation-delay: 1.1s; }
@keyframes trazo { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Destellos dorados */
.chispas { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.chispa { position: absolute; width: 14px; height: 14px; fill: var(--oro); opacity: 0; transition: opacity 1s; }
.chispa--1 { fill: #fff; width: 11px; height: 11px; }
.chispa--2 { fill: #f7b9c9; width: 10px; height: 10px; }
.chispa--3 { width: 9px; height: 9px; }
.chispa:nth-child(1) { left: 12%; top: 22%; }
.chispa:nth-child(2) { left: 86%; top: 18%; }
.chispa:nth-child(3) { left: 8%;  top: 58%; }
.chispa:nth-child(4) { left: 90%; top: 46%; }
.chispa:nth-child(5) { left: 18%; top: 78%; }
.chispa:nth-child(6) { left: 82%; top: 72%; }
.chispa:nth-child(7) { left: 50%; top: 12%; }
.chispa:nth-child(8) { left: 66%; top: 30%; }
.revelado .chispa { opacity: 1; animation: titila 2.6s ease-in-out infinite alternate; }
.revelado .chispa:nth-child(even) { animation-delay: -1.3s; }
.revelado .chispa:nth-child(3n) { animation-duration: 3.4s; }
@keyframes titila { from { transform: scale(.55) rotate(0); opacity: .35; } to { transform: scale(1.1) rotate(45deg); opacity: 1; } }

/* Angelitos */
.angel {
  position: absolute;
  z-index: 5;
  width: clamp(58px, 17vw, 92px);
  height: auto;
  opacity: 0;
  transform: translateY(30px) scale(.8);
  transition: opacity 1.2s ease 1.3s, transform 1.6s cubic-bezier(.2, .8, .2, 1) 1.3s;
}
.angel--i { left: 2%; top: 26%; }
.angel--d { right: 2%; top: 50%; transition-delay: 1.7s; }
.revelado .angel { opacity: 1; transform: none; animation: flotar 4.5s ease-in-out 3s infinite alternate; }
.revelado .angel--d { animation-delay: 3.6s; animation-duration: 5.2s; }
.angel__ala { transform-box: fill-box; animation: aletear .5s ease-in-out infinite alternate; }
.angel__ala--i { transform-origin: 100% 40%; }
.angel__ala--d { transform-origin: 0 40%; animation-delay: -.25s; animation-direction: alternate-reverse; }
.angel__aureola { animation: aureola 2.4s ease-in-out infinite alternate; }
@keyframes flotar { from { transform: translateY(0); } to { transform: translateY(-12px); } }
@keyframes aletear { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes aureola { from { opacity: .6; } to { opacity: 1; } }

/* Escena del globo: centrada entre el avioncito (arriba) y el aviso (abajo) */
.escena {
  position: absolute;
  z-index: 6;
  inset: calc(env(safe-area-inset-top) + 76px) 0 calc(env(safe-area-inset-bottom) + 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.globo-mov { will-change: transform; }
.globo-sube {
  transform: translateY(16%);
  transition: transform 2.8s cubic-bezier(.3, .1, .2, 1);
}
.revelado .globo-sube { transform: none; }
.globo-vaiven {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 40%;
}
.revelado .globo-vaiven { animation: vaiven 6s ease-in-out 2.6s infinite alternate; }
@keyframes vaiven {
  from { transform: translateY(0) rotate(-2.2deg); }
  to   { transform: translateY(-9px) rotate(2.2deg); }
}
.globo__svg {
  display: block;
  width: var(--gw);
  height: calc(var(--gw) * 1.25);
  filter: drop-shadow(0 14px 18px rgba(120, 110, 170, .22));
}
/* (solo opacidad: los destellos del globo ya llevan transform como atributo SVG) */
.globo__chispas { animation: brillo-op 2.2s ease-in-out infinite alternate; }
@keyframes brillo-op { from { opacity: .55; } to { opacity: 1; } }

/* Banderola que cuelga de la canastilla */
.banderola {
  position: relative;
  margin-top: -4px;
  padding-top: 16px;
  width: calc(var(--gw) * 1.14);
  max-width: calc(100vw - 24px);
  transform: scaleY(0);
  transform-origin: 50% 0;
  opacity: 0;
  filter: drop-shadow(0 6px 8px rgba(150, 120, 140, .2));
  transition: transform 1s cubic-bezier(.3, 1.4, .5, 1) 1.6s, opacity .4s ease 1.6s;
}
.banderola::before,
.banderola::after {
  content: "";
  position: absolute;
  top: 0;
  width: 1.5px;
  height: 20px;
  background: #c8a27c;
}
.banderola::before { left: 30%; transform: rotate(18deg); transform-origin: top; }
.banderola::after  { right: 30%; transform: rotate(-18deg); transform-origin: top; }
.revelado .banderola { transform: none; opacity: 1; }
.banderola__tela {
  padding: 10px 12% 12px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .9), transparent 70%),
    linear-gradient(180deg, #fffaf1, #ffeede);
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%, 8% 50%);
  box-shadow: inset 0 0 0 2px rgba(236, 200, 121, .5);
}
.banderola__nombre {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: max(1.5rem, calc(var(--gw) * .15));
  line-height: 1.25;
  color: var(--rosa-2);
  overflow-wrap: anywhere;
}
.banderola__titulo {
  margin: 0;
  font-size: max(.7rem, calc(var(--gw) * .05));
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--azul);
}
.banderola__fecha {
  margin: 2px 0 0;
  font-size: max(.75rem, calc(var(--gw) * .054));
  color: var(--tinta);
}

/* Palomitas que cruzan el cielo */
.paloma { position: absolute; z-index: 7; width: clamp(44px, 12vw, 64px); height: auto; opacity: 0; }
.paloma--1 { top: 16%; left: -20%; }
.paloma--2 { top: 38%; left: -20%; width: clamp(34px, 9vw, 48px); }
.revelado .paloma--1 { animation: cruzar 16s linear 2.2s infinite; }
.revelado .paloma--2 { animation: cruzar 21s linear 6s infinite; }
.paloma__ala { transform-box: fill-box; transform-origin: 50% 100%; animation: ala-paloma .42s ease-in-out infinite alternate; }
@keyframes cruzar {
  0%   { opacity: 0; transform: translate(0, 0); }
  6%   { opacity: 1; }
  25%  { transform: translate(40vw, -14px); }
  50%  { transform: translate(80vw, 6px); }
  75%  { transform: translate(115vw, -10px); }
  94%  { opacity: 1; }
  100% { opacity: 0; transform: translate(150vw, 0); }
}
@media (min-width: 541px) {
  @keyframes cruzar {
    0%   { opacity: 0; transform: translate(0, 0); }
    6%   { opacity: 1; }
    50%  { transform: translate(400px, 6px); }
    94%  { opacity: 1; }
    100% { opacity: 0; transform: translate(760px, 0); }
  }
}
@keyframes ala-paloma { from { transform: scaleY(1); } to { transform: scaleY(-.55); } }

/* Avioncito de papel con banderita */
.avion {
  position: absolute;
  z-index: 8;
  left: 14px;
  top: calc(env(safe-area-inset-top) + 14px);
  max-width: calc(100% - 78px);
  opacity: 0;
  transform: translate(-130%, 50px) rotate(-10deg);
  pointer-events: none;
}
.avion.llega { animation: avion-llega 2.6s cubic-bezier(.25, .8, .3, 1) forwards; }
@keyframes avion-llega {
  0%   { opacity: 0; transform: translate(-130%, 50px) rotate(-10deg); }
  15%  { opacity: 1; }
  65%  { transform: translate(6%, -8px) rotate(4deg); }
  100% { opacity: 1; transform: translate(0, 0) rotate(0); }
}
.avion__flota { display: flex; align-items: center; }
.avion.llega .avion__flota { animation: flotar 3.2s ease-in-out 2.6s infinite alternate; }
.avion__banderita {
  margin: 0;
  padding: 7px 16px 7px 12px;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--tinta);
  background: linear-gradient(180deg, #fff, #fff3ea);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 7px 50%);
  box-shadow: inset 0 -3px 0 #ffd6df;
}
.avion__flota { filter: drop-shadow(0 4px 6px rgba(100, 110, 170, .22)); }
.avion__banderita span { color: var(--rosa-2); }
.avion__hilo { flex: 0 0 14px; height: 1.5px; background: #9fc4e4; }
.avion__svg { flex: 0 0 auto; width: 44px; height: auto; }

/* Colchón de nubes en el suelo de la escena */
.colchon {
  position: absolute;
  z-index: 9;
  left: -6%;
  right: -6%;
  bottom: -26px;
  height: 92px;
  pointer-events: none;
}
.colchon i {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff 0, #fff 55%, #f4f0fa 100%);
}
.colchon i:nth-child(1) { left: 0;   width: 30%; height: 80px; }
.colchon i:nth-child(2) { left: 20%; width: 26%; height: 100px; bottom: -14px; }
.colchon i:nth-child(3) { left: 40%; width: 28%; height: 84px; }
.colchon i:nth-child(4) { left: 60%; width: 24%; height: 104px; bottom: -18px; }
.colchon i:nth-child(5) { left: 78%; width: 26%; height: 82px; }

/* Lienzos de nubes (los dimensiona el JS según el contenedor) */
.nubes, .volutas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nubes { z-index: 10; touch-action: none; cursor: grab; }
.nubes.libre { touch-action: pan-y; cursor: default; }
.volutas { z-index: 11; pointer-events: none; }

/* Textos sobre las nubes */
.nubes__ui {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 64px) 22px calc(env(safe-area-inset-bottom) + 26px);
  text-align: center;
  pointer-events: none;
  transition: opacity .8s ease;
}
.despejado .nubes__ui { opacity: 0; }
.nubes__arriba { transition: opacity .6s ease; }
.nubes__ui.tenue .nubes__arriba { opacity: .35; }
.nubes__pre {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(1.8rem, 8.6vw, 2.5rem);
  line-height: 1.3;
  color: #d97e9b;
  text-shadow: 0 2px 0 #fff, 0 0 18px #fff;
}
.nubes__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--azul-2);
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 8px 20px -14px rgba(77, 121, 173, .6);
}
.nubes__dedo { display: inline-grid; animation: dedo 1.8s ease-in-out infinite; }
@keyframes dedo {
  0%, 100% { transform: translateX(-6px) rotate(-8deg); }
  50%      { transform: translateX(6px) rotate(8deg); }
}
.nubes__abajo { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.progreso {
  width: min(200px, 60vw);
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 0 0 1px rgba(156, 203, 236, .6);
  overflow: hidden;
}
.progreso i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc7d4, #ffe1b8, #bfe3f7);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .25s ease;
}
.btn-cielo {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-family: var(--fuente);
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #7aa7da, var(--azul));
  box-shadow: 0 12px 22px -12px rgba(77, 121, 173, .8), inset 0 2px 0 rgba(255, 255, 255, .35);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .2s ease;
}
.btn-cielo:active { transform: scale(.96); }
.btn-cielo:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.despejado .btn-cielo { pointer-events: none; }

/* Aviso "el globito te sigue" */
.cielo__sigue {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 70px);
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--mano);
  font-size: 1.25rem;
  line-height: 1.2;
  text-align: center;
  color: var(--azul-2);
  background: rgba(255, 255, 255, .78);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
.listo .cielo__sigue { opacity: 1; }
.listo .cielo__sigue.oculto { opacity: 0; }

/* Botón de sonidos */
.btn-sonido {
  all: unset;
  position: absolute;
  z-index: 13;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 12px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--azul-2);
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 6px 14px -8px rgba(77, 121, 173, .7);
  cursor: pointer;
}
.btn-sonido:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.btn-sonido__off { display: none; }
.btn-sonido[aria-pressed="false"] .btn-sonido__on { display: none; }
.btn-sonido[aria-pressed="false"] .btn-sonido__off { display: block; }

.cielo .desliza-c { z-index: 12; color: var(--azul-2); }

/* ================= INVITACIÓN ================= */
.contenido { background: transparent; }

.mensaje-sec { padding-top: 64px; }
.retrato { margin: 0; width: min(320px, 86vw); }
.retrato__svg { display: block; width: 100%; height: auto; overflow: visible; }
.retrato .retrato__ala { transform-box: fill-box; transform-origin: 100% 60%; }
.retrato.visible .retrato__ala { animation: ala-retrato 3.2s ease-in-out infinite alternate; }
@keyframes ala-retrato { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

.tarjeta {
  margin-top: 18px;
  padding: 18px 26px;
  max-width: 22em;
  border-radius: 24px;
  background: #fff;
  border: 1.5px dashed rgba(236, 200, 121, .8);
  box-shadow: var(--s-sombra);
}
.tarjeta__pre { margin: 0; font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--suave); }
.tarjeta__nombre { margin: 4px 0 0; font-family: var(--script); font-size: 1.7rem; line-height: 1.3; color: var(--rosa-2); overflow-wrap: anywhere; }
.tarjeta__pases { margin: 6px 0 0; font-family: var(--mano); font-size: 1.3rem; color: var(--azul); }
.mensaje { margin: 22px 0 0; max-width: 23em; font-size: 1.08rem; line-height: 1.65; }

.familia .s-titulo { margin-bottom: 20px; }
.paloma--sep { position: static; width: 64px; margin-bottom: 8px; }
.familia__rejilla { width: 100%; display: grid; gap: 14px; }
.familia__item { padding: 18px 20px; border-radius: var(--s-radio); background: #fff; border: 1px solid var(--s-borde); box-shadow: var(--s-sombra); }
.familia__t { margin: 0; font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--azul); }
.familia__n { margin: 6px 0 0; font-size: 1.12rem; line-height: 1.4; }

.separador { display: block; width: 180px; height: auto; margin: 0 auto; }

.s-evento__icono { background: #f3f9fe; }

.banda { margin: 30px auto 0; padding: 0 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.banda__arco {
  width: min(300px, 78vw);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 999px 999px 28px 28px;
  border: 6px solid #fff;
  box-shadow: var(--s-sombra), 0 0 0 2px rgba(236, 200, 121, .6);
}
.banda__arco img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.banda figcaption { margin: 16px 0 0; max-width: 18em; font-family: var(--mano); font-size: 1.5rem; line-height: 1.25; color: var(--azul-2); }

.s-pie__n { font-family: var(--script); color: var(--rosa-2); }

/* ================= Pantallas bajas / angostas ================= */
@media (max-height: 640px) {
  .nubes__ui { padding-top: calc(env(safe-area-inset-top) + 58px); }
  .nubes__pre { font-size: clamp(1.6rem, 7.6vw, 2.1rem); }
  .angel { width: clamp(50px, 14vw, 76px); }
}
@media (max-width: 380px) {
  .nubes__hint { font-size: .92rem; padding: 7px 12px; }
  .avion__banderita { font-size: .82rem; }
}

/* ================= Movimiento reducido ================= */
@media (prefers-reduced-motion: reduce) {
  .cielo__rayos, .sol__rayos, .nubes__dedo, .angel__ala, .angel__aureola, .paloma__ala, .globo__chispas { animation: none; }
  .revelado .angel, .revelado .chispa, .revelado .globo-vaiven, .avion.llega .avion__flota, .retrato.visible .retrato__ala { animation: none; }
  .revelado .paloma { animation: none; opacity: 1; }
  .paloma--1 { left: 8%; top: 14%; }
  .paloma--2 { left: 74%; top: 36%; }
  .globo-sube, .angel, .banderola { transition-duration: .3s; transition-delay: 0s; }
  .revelado .arcoiris path { animation: none; stroke-dashoffset: 0; }
  .avion.llega { animation: none; opacity: 1; transform: none; }
}
