/* ==========================================================================
   Baby Shower — estilos mobile-first
   Base = celular (320–430px). Luego min-width: 768px (tablet) y 1024px (escritorio).
   ========================================================================== */

:root {
  /* Paleta — acuarela tierna, limpia y vibrante: cielo, sol, menta y rosa */
  --bg: #fffdf9;
  --bg-soft: #fdf0f2;
  --bg-lilac: #f4eaf5;
  --bg-sky: #eef6fb;
  --bg-lavender: #f7f1fa;
  --surface: #ffffff;
  --ink: #5c4f58;
  --ink-soft: #998b93;
  --accent: #f2c6ce;
  --accent-strong: #e592a4;
  --gold: #ffc94d;
  --gold-strong: #e0a83a;
  --sky: #7dc8ea;
  --sky-strong: #4fa4c9;
  --sage: #5fd1a3;
  --sage-strong: #3fae82;
  --lavender-strong: #9c7cc4;
  --line: #f8e1e5;
  --error: #d1483f;

  /* Tipografía: script fino (Sacramento) solo para el nombre; todo lo demás en la manuscrita del sobre (Caveat).
     Caveat se ve más pequeña que una sans, por eso los tamaños son un poco mayores */
  --font-name: "Sacramento", cursive;
  --font-script: "Caveat", cursive;
  --font-sans: "Caveat", cursive;
  --fs-body: clamp(1.25rem, 1.2rem + 0.25vw, 1.4rem);
  --fs-small: 1.1rem;
  --fs-eyebrow: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
  --fs-h2: clamp(1.9rem, 1.6rem + 1.5vw, 2.5rem);
  --fs-hero: clamp(3.25rem, 2.2rem + 7vw, 5.5rem);
  --fs-script: clamp(1.25rem, 1.1rem + 1vw, 1.75rem);

  /* Escala de espaciado (8 · 16 · 24 · 32 · 48 · 64 · 96) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;

  --section-py: clamp(var(--s-5), 9vw, var(--s-6));
  --gutter: clamp(var(--s-2), 5vw, var(--s-4));
  --radius: 1rem;
  --radius-lg: 1.75rem;
  --tap: 2.75rem; /* 44px */

  --shadow: 0 0.5rem 1.5rem rgba(229, 146, 164, 0.12);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 450ms;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
  position: relative;
  z-index: 1; /* el contenido siempre por encima de las mariposas/flores decorativas */
  width: 100%;
  max-width: 30rem; /* ~480px de ancho de lectura en celular */
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}

.section {
  position: relative;
  padding-block: var(--section-py);
  overflow: hidden;
}

.section--soft { background: var(--bg-soft); }
/* Fondos con degradado suave hacia el crema en los bordes,
   para que el cambio de color entre secciones no sea tan brusco */
.section--pink {
  background: linear-gradient(to bottom,
    var(--bg) 0%, #fef8f9 25%, #fef8f9 75%, var(--bg) 100%);
}

.section__title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-bottom: var(--s-3);
}

.section__title--sm {
  font-size: clamp(1.8rem, 1.55rem + 1vw, 2.2rem);
}

.section__text {
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
}

.eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin-bottom: var(--s-1);
}

/* Color del eyebrow distinto por sección, para que contraste con su fondo
   (misma tipografía en todas, solo cambia el color) */
.eyebrow--caps {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  font-size: var(--fs-eyebrow);
}

.hero .eyebrow--caps { font-size: clamp(1.4rem, 1.15rem + 1.2vw, 1.8rem); }
.section--pink .eyebrow { color: var(--accent-strong); }
#mapa .eyebrow { color: var(--gold); font-size: 1.6rem; } /* amarillo como "Baby Shower", del tamaño de "Faltan" */
#foto .eyebrow { color: var(--gold); } /* "Con todo nuestro amor" en amarillo */
#mapa .section__title,
#rsvp .section__title { color: var(--accent-strong); } /* la dirección y "Confirma tu asistencia" en rosado, igual que "Nihan" */
.center {
  display: flex;
  justify-content: center;
  margin-top: var(--s-4);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.75rem var(--s-4);
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn--primary {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0.5rem 1.25rem rgba(200, 110, 135, 0.35);
}
.btn--primary:hover { background: #d27a8e; }
.btn--primary[disabled] { opacity: 0.6; cursor: progress; }

.btn--ghost {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: transparent;
}
.btn--ghost:hover { background: var(--accent); color: #fff; }

.btn--block { width: 100%; }

/* Botón grande de confirmar */
.btn--big {
  gap: 0.6rem;
  padding: 0.9rem 2.6rem;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #efa3b5, #e2879c);
}


/* ---------- 1. Portada ---------- */
.hero {
  position: relative;
  overflow-x: clip; /* la cigüeña entra desde fuera de la pantalla */
  display: flex;
  align-items: center;
  min-height: 80vh;
  min-height: 80svh;
  padding-top: max(var(--section-py), env(safe-area-inset-top));
  background:
    radial-gradient(1.4px 1.4px at 12% 20%, var(--accent) 40%, transparent 41%),
    radial-gradient(1.8px 1.8px at 82% 15%, var(--gold) 40%, transparent 41%),
    radial-gradient(1.4px 1.4px at 25% 78%, var(--sky) 40%, transparent 41%),
    radial-gradient(1.8px 1.8px at 88% 68%, var(--accent) 40%, transparent 41%),
    radial-gradient(1.4px 1.4px at 55% 88%, var(--sage) 40%, transparent 41%),
    radial-gradient(1.4px 1.4px at 68% 30%, var(--sky) 40%, transparent 41%),
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(242, 198, 206, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 30% at 50% 65%, rgba(125, 200, 234, 0.12), transparent 55%),
    var(--bg);
}

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

.hero__sun {
  position: absolute;
  top: 3%;
  left: 8%;
  width: clamp(4rem, 9vw, 5.75rem);
}

.flower {
  position: absolute;
  width: 2.75rem;
}
.flower--sm { width: 1.9rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero__sun { animation: sunGlow 5s ease-in-out infinite; }
  .deco--tr { animation: floatButterfly 6.5s ease-in-out infinite; }
  .deco--tl { animation: floatButterfly 5.8s ease-in-out infinite 0.5s; }
  .deco--br { animation: floatButterfly 7s ease-in-out infinite 1s; }
  .deco--bl { animation: floatButterfly 6.2s ease-in-out infinite 0.8s; }
}

/* Definiciones SVG compartidas: no ocupan espacio */
.svg-defs { position: absolute; }

/* Nubes de la portada: las mismas del sobre, más suaves para no competir
   con el texto */
.hero-cloud {
  position: absolute;
  aspect-ratio: 200 / 110;
  height: auto;
  opacity: 0.8;
  filter: drop-shadow(0 4px 6px rgba(214, 140, 160, 0.15));
}
.hero-cloud--1 { width: 30%; max-width: 11rem; top: 27%; left: -5%; }
.hero-cloud--2 { width: 26%; max-width: 10rem; top: 36%; right: -4%; }
.hero-cloud--5 { width: 20%; max-width: 8rem; top: 1%; right: 3%; }

@media (prefers-reduced-motion: no-preference) {
  .hero-cloud { animation: cloudDrift 9s ease-in-out infinite alternate; }
  .hero-cloud--2, .hero-cloud--5 { animation-duration: 11s; animation-delay: -3s; }
}

/* Corazoncitos y puntitos dorados de la portada */
.deco-heart {
  position: absolute;
  width: var(--z);
  height: var(--z);
  fill: #f0a9bb;
}
.deco-heart--line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2.2;
}
.deco-dot {
  position: absolute;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
}
.deco-dot--pink { background: #f0a9bb; }

@media (prefers-reduced-motion: no-preference) {
  .deco-heart { animation: floatGentle 6s ease-in-out infinite; }
  .deco-heart:nth-of-type(2n) { animation-duration: 7.5s; animation-delay: -2s; }
}

/* Mariposas que cruzan la portada: el span vuela, la imagen aletea.
   Sin animación se quedan quietas en su sitio */
.flyer {
  position: absolute;
  left: 0;
  width: 3.1rem;
  transform: translateX(var(--rest));
}
.flyer img { width: 100%; height: auto; }
.flyer--1 { top: 30%; --rest: 6vw; }
.flyer--2 { top: 55%; --rest: 80vw; width: 2.8rem; }

@media (prefers-reduced-motion: no-preference) {
  .flyer--1 { animation: flyAcross 16s linear infinite; }
  .flyer--2 { animation: flyAcrossBack 19s linear infinite -7s; }
  .flyer img { animation: flap 0.35s ease-in-out infinite alternate; }
  .flyer--2 img { animation-duration: 0.42s; }
}

/* Cruza de izquierda a derecha en ondas */
@keyframes flyAcross {
  0% { transform: translate(-15vw, 0) rotate(8deg); }
  25% { transform: translate(20vw, -2.5rem) rotate(-6deg); }
  50% { transform: translate(50vw, 0.5rem) rotate(8deg); }
  75% { transform: translate(80vw, -2rem) rotate(-6deg); }
  100% { transform: translate(115vw, 0) rotate(8deg); }
}

/* De derecha a izquierda, mirando hacia donde va */
@keyframes flyAcrossBack {
  0% { transform: translate(115vw, 0) scaleX(-1) rotate(8deg); }
  25% { transform: translate(80vw, -2rem) scaleX(-1) rotate(-6deg); }
  50% { transform: translate(50vw, 0.5rem) scaleX(-1) rotate(8deg); }
  75% { transform: translate(20vw, -2.5rem) scaleX(-1) rotate(-6deg); }
  100% { transform: translate(-15vw, 0) scaleX(-1) rotate(8deg); }
}

@keyframes flap {
  from { transform: scaleX(1); }
  to { transform: scaleX(0.55); }
}

@keyframes floatButterfly {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  50% { transform: translate(-6px, -14px) rotate(6deg); }
}

@keyframes floatGentle {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, -9px); }
}

@keyframes sunGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Mariposas decorativas en el resto de las secciones */
.deco-butterfly {
  position: absolute;
  width: 2.75rem;
  pointer-events: none;
}
.deco-butterfly--sm { width: 1.9rem; }
.deco--tr { top: 6%; right: 6%; }
.deco--tl { top: 8%; left: 6%; }
.deco--br { bottom: 8%; right: 8%; }
.deco--bl { bottom: 10%; left: 6%; }

/* Variación de tamaño por sección: la del RSVP más discreta para no
   distraer del formulario */
#rsvp .deco-butterfly:not(.deco-butterfly--sm) { width: 2.25rem; }

/* PNG con fondo transparente.
   Va debajo del título "Baby Shower"; left + translate la centran igual que
   hacen las animaciones de entrada y vuelo */
.hero__stork-box {
  --stork: clamp(12rem, 52vw, 16rem);
  position: relative;
  align-self: stretch;
  margin: var(--s-2) 0;
}

.hero__stork {
  position: relative;
  left: 50%;
  display: block;
  width: var(--stork);
  height: auto;
  transform: translateX(-50%);
}

/* Caminito punteado que sale de la cola de la cigüeña */
.hero__trail {
  position: absolute;
  top: 34%;
  right: calc(50% + var(--stork) * 0.4);
  width: 6.5rem;
  height: auto;
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 1.6;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
  opacity: 0.8;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__stork {
    animation:
      storkArrive 2.6s var(--ease-out) 0.4s both,
      storkFloat 3.2s ease-in-out 3s infinite;
  }
  /* Aparece cuando la cigüeña ya llegó */
  .hero__trail { animation: trailIn 900ms ease 2.6s both; }
}

@keyframes trailIn {
  from { opacity: 0; }
  to { opacity: 0.8; }
}

/* Entra volando en diagonal desde la izquierda */
@keyframes storkArrive {
  0% { transform: translate(calc(-50% - 70vw), 2.5rem) rotate(-8deg); opacity: 0; }
  70% { transform: translate(calc(-50% + 0.5rem), -0.3rem) rotate(2deg); opacity: 1; }
  100% { transform: translate(-50%, 0) rotate(0deg); opacity: 1; }
}

/* Luego sube y baja suave, como planeando */
@keyframes storkFloat {
  0%, 100% { transform: translate(-50%, 0) rotate(0deg); }
  50% { transform: translate(-50%, -0.5rem) rotate(-2deg); }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
}

.hero__wreath {
  width: min(100%, 14rem);
  height: auto;
  color: var(--sage);
  margin-bottom: var(--s-1);
}

.hero__script {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  font-weight: 600;
  color: var(--gold); /* amarillo, igual que "Baby Shower" */
  margin-bottom: var(--s-1);
}

.hero__title {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.1;
  color: var(--accent-strong);
  margin-bottom: var(--s-2);
  transform-origin: 50% 100%;
  position: relative;
}

/* Corazoncitos de contorno a los lados del nombre */
.hero__title::before,
.hero__title::after {
  content: "";
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5l-1.3-1.2C5.6 14.7 2.5 11.9 2.5 8.4 2.5 5.6 4.7 3.5 7.4 3.5c1.6 0 3.2.8 4.6 2.2 1.4-1.4 3-2.2 4.6-2.2 2.7 0 4.9 2.1 4.9 4.9 0 3.5-3.1 6.3-8.2 10.9L12 20.5z' fill='none' stroke='%23e592a4' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero__title::before { left: -1.5rem; top: 22%; }
.hero__title::after { right: -1.3rem; top: 6%; width: 0.8rem; height: 0.8rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero__title { animation: nameSway 6s ease-in-out infinite; }
}

@keyframes nameSway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

.hero__lead {
  color: var(--ink-soft);
  max-width: 22rem;
  margin-bottom: var(--s-2);
}

/* Separador: línea — corazón — línea */
.divider {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  width: min(60%, 12rem);
  margin: 0 auto var(--s-3);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-strong));
}
.divider::after { background: linear-gradient(90deg, var(--accent-strong), transparent); }
.divider--sm { width: min(40%, 7rem); margin-bottom: var(--s-1); }
.divider svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.music-toggle svg,
.footer__heart {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 2. Zapatitos y nombres ---------- */
/* Capa de adornos detrás del contenido de una sección */
.section__decor { position: absolute; inset: 0; pointer-events: none; }

/* Adornos sueltos reutilizables: nube rosada, flor/mariposa que flota
   y caminito punteado */
.deco-cloud {
  position: absolute;
  aspect-ratio: 200 / 110;
  height: auto;
  fill: url(#nubeRosa);
  opacity: 0.8;
  filter: drop-shadow(0 4px 6px rgba(214, 140, 160, 0.15));
}
.deco-float { position: absolute; height: auto; }

/* Montañitas rosadas al pie de la sección, difuminadas hacia el crema */
.hills {
  position: absolute;
  left: -3%;
  bottom: 0;
  width: 106%;
  height: 9rem;
  filter: blur(3px);
}
.deco-trail {
  position: absolute;
  height: auto;
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 1.6;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
  opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
  .deco-cloud { animation: cloudDrift 10s ease-in-out infinite alternate; }
  .deco-cloud:nth-child(2n) { animation-duration: 12s; animation-delay: -4s; }
  .deco-float { animation: floatButterfly 6.5s ease-in-out infinite; }
}

/* Cigüeñas ilustradas arriba de cada sección (PNG con fondo transparente) */
.scene {
  display: block;
  width: min(80%, 17rem);
  height: auto;
  margin: var(--s-2) auto var(--s-3);
}
/* Las cigüeñas de los zapatitos y de "¿Cómo llegar?", un poco más pequeñas */
#foto .scene,
#mapa .scene { width: min(68%, 14.5rem); }
@media (prefers-reduced-motion: no-preference) {
  .scene.is-visible { animation: floatGentle 6s ease-in-out infinite; }
}

/* Espacio extra abajo para que el texto no quede sobre las montañitas */
#inicio,
#foto,
#mapa,
#rsvp { padding-bottom: calc(var(--section-py) + 4.5rem); }

/* Nombres de los papás con la misma letra de "Nihan" */
.section__title--names {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(2.8rem, 2.2rem + 4vw, 3.6rem);
  color: var(--accent-strong); /* rosado, igual que "Nihan" */
  margin-bottom: var(--s-1);
}

/* Cigüeña con la bebé arriba de "Te esperamos" */
.rsvp__stork {
  display: block;
  width: clamp(15rem, 82vw, 21rem);
  height: auto;
  margin: 0 auto var(--s-2);
}
@media (prefers-reduced-motion: no-preference) {
  .rsvp__stork.is-visible { animation: floatGentle 6s ease-in-out infinite; }
}

/* ---------- 3. Cuenta regresiva ---------- */
/* "Faltan" en tono oscuro, con corazoncitos a los lados */
.section--pink .countdown__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  color: var(--accent-strong); /* rosado, igual que "Nihan" */
  font-size: 1.6rem;
}
.countdown__title::before,
.countdown__title::after {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5l-1.3-1.2C5.6 14.7 2.5 11.9 2.5 8.4 2.5 5.6 4.7 3.5 7.4 3.5c1.6 0 3.2.8 4.6 2.2 1.4-1.4 3-2.2 4.6-2.2 2.7 0 4.9 2.1 4.9 4.9 0 3.5-3.1 6.3-8.2 10.9L12 20.5z' fill='%23f0a9bb'/%3E%3C/svg%3E") center / contain no-repeat;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-inline: 0.25rem;
  border-right: 1.5px dotted #f0b7c4;
}
.countdown__item:last-child { border-right: none; }

/* Cada número dentro de una burbuja rosada de borde ondulado */
.countdown__num {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23fde3e9'%3E%3Ccircle cx='50' cy='50' r='37'/%3E%3Ccircle cx='87' cy='50' r='12'/%3E%3Ccircle cx='79.9' cy='71.7' r='12'/%3E%3Ccircle cx='61.4' cy='85.2' r='12'/%3E%3Ccircle cx='38.6' cy='85.2' r='12'/%3E%3Ccircle cx='20.1' cy='71.7' r='12'/%3E%3Ccircle cx='13' cy='50' r='12'/%3E%3Ccircle cx='20.1' cy='28.3' r='12'/%3E%3Ccircle cx='38.6' cy='14.8' r='12'/%3E%3Ccircle cx='61.4' cy='14.8' r='12'/%3E%3Ccircle cx='79.9' cy='28.3' r='12'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  font-family: var(--font-script);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.6rem, 1.3rem + 1.6vw, 2.1rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
}

.countdown__label {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.countdown__done {
  margin-top: var(--s-3);
  font-family: var(--font-script);
  font-size: 1.75rem;
  color: var(--accent-strong);
}

/* ---------- 4. Detalles: tarjeta blanca con borde punteado ---------- */
#detalles { padding-bottom: calc(var(--section-py) + 4.5rem); }

.details {
  max-width: 30rem;
  margin-inline: auto;
  padding: var(--s-4) var(--s-3) var(--s-2);
  background: rgba(255, 255, 255, 0.78);
  border: 1.5px dashed #f2c4ce;
  border-radius: var(--radius-lg);
  box-shadow: 0 0.5rem 1.5rem rgba(229, 146, 164, 0.1);
}
.details__title { margin-bottom: 0; }

.cards {
  display: flex;
  flex-direction: column;
}

/* Ícono a la izquierda en un círculo rosado, texto a la derecha */
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-block: var(--s-2);
  text-align: left;
  border-bottom: 1.5px dashed #f4cdd6;
}
.card:last-child { border-bottom: none; }

/* Corazoncito en medio de la línea punteada */
.card:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.7rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #fffafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5l-1.3-1.2C5.6 14.7 2.5 11.9 2.5 8.4 2.5 5.6 4.7 3.5 7.4 3.5c1.6 0 3.2.8 4.6 2.2 1.4-1.4 3-2.2 4.6-2.2 2.7 0 4.9 2.1 4.9 4.9 0 3.5-3.1 6.3-8.2 10.9L12 20.5z' fill='%23f0a9bb'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
  transform: translateX(-50%);
}

.card__icon-wrap {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 50%;
  background: #fde4ea;
}

.card__icon {
  width: 2.2rem;
  height: 2.2rem;
  filter: drop-shadow(0 2px 3px rgba(92, 79, 88, 0.14));
}

.card__title {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--accent-strong); /* rosado, igual que "Nihan" */
}

.card__text { color: var(--ink-soft); line-height: 1.3; }

/* ---------- 5. Mapa ---------- */
.map {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--line);
  background: var(--surface);
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- 6. RSVP ---------- */
.form {
  display: grid;
  gap: var(--s-3);
  text-align: left;
  max-width: 22rem;
  margin-inline: auto;
}

.field {
  display: grid;
  gap: var(--s-1);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > label,
.field legend {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent-strong); /* rosado, igual que "Nihan" */
  padding: 0;
}
.field legend { margin-bottom: 0.25rem; }


.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  font-size: 1.25rem; /* ≥16px evita el zoom automático en iOS */
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 0.7rem;
  box-shadow: 0 1px 2px rgba(92, 79, 88, 0.05);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a7274' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2rem;
}

.field textarea { resize: vertical; min-height: 3.25rem; line-height: 1.4; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 198, 206, 0.35);
}

.field input[aria-invalid="true"] { border-color: var(--error); }

/* Campo con ícono de personita a la izquierda */
.field__input { position: relative; }
.field__icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  fill: #eea3b4;
  transform: translateY(-50%);
  pointer-events: none;
}
.field__input input[type="text"] {
  min-height: 3.2rem;
  padding-left: 2.9rem;
  border-radius: 1rem;
}
.field input::placeholder { color: #c9b8c0; font-size: 1.1rem; }

.field__error {
  min-height: 0;
  font-size: var(--fs-small);
  color: var(--error);
}
.field__error:empty { display: none; }

.choice-group { display: grid; gap: var(--s-1); }

.choice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.4rem;
  padding: 0.75rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(92, 79, 88, 0.05);
  cursor: pointer;
  font-weight: 600 !important;
  font-size: 1.15rem;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 65%;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.choice input[type="radio"]:checked {
  border-color: var(--accent-strong);
  background-color: var(--accent-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.choice input[type="radio"]:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.choice:has(input:checked) {
  border-color: #f5bfcb;
  background: #fde8ed;
}

/* ---------- Resultado del RSVP ---------- */
.rsvp-result {
  text-align: center;
  padding-block: var(--s-2);
}

.rsvp-result__title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.85rem;
  color: var(--accent-strong);
  margin-bottom: 0.25rem;
}

.rsvp-result__text {
  color: var(--ink-soft);
}
.rsvp-result__title:empty,
.rsvp-result__text:empty { display: none; }

.rsvp-result__thanks {
  margin-top: 0;
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(1.65rem, 1.45rem + 1vw, 2rem);
  line-height: 1.2;
  color: var(--accent-strong);
}

/* Respuesta "sí": entrada alegre con un pequeño rebote */
.rsvp-result.is-yes {
  opacity: 0;
  transform: scale(0.9) translateY(6px);
}
.rsvp-result.is-yes.is-visible {
  animation: rsvpPop 650ms var(--ease-out) both;
}

/* Respuesta "no": mensaje sencillo, solo un fundido tranquilo, sin rebote */
.rsvp-result.is-no .rsvp-result__title {
  font-style: normal;
  font-size: 1.4rem;
  color: var(--accent-strong); /* rosado */
}
.rsvp-result.is-no {
  opacity: 0;
  transform: translateY(6px);
}
.rsvp-result.is-no.is-visible {
  animation: rsvpFade 500ms ease-out both;
}

@keyframes rsvpPop {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); }
  65% { opacity: 1; transform: scale(1.05) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes rsvpFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-result.is-yes,
  .rsvp-result.is-no {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Footer ---------- */
/* Sube sobre el espacio de las montañitas de la confirmación, más cerca del
   botón; sin fondo propio para que las montañitas se vean detrás */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  margin-top: -2.5rem;
  padding: 0 var(--gutter) max(var(--s-5), env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--font-script);
  font-size: clamp(1.65rem, 1.45rem + 1vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-strong);
}

.footer__heart {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--accent);
  fill: var(--accent);
}

/* ---------- Botón de música ---------- */
.music-toggle {
  position: fixed;
  z-index: 10;
  right: max(var(--s-2), env(safe-area-inset-right));
  bottom: max(var(--s-2), env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.music-toggle[hidden] { display: none; }
.music-toggle svg { width: 1.35rem; height: 1.35rem; }
.music-toggle .icon-pause { display: none; }
.music-toggle[aria-pressed="true"] .icon-play { display: none; }
.music-toggle[aria-pressed="true"] .icon-pause { display: block; }

/* ---------- Sobre de bienvenida ---------- */
.envelope { display: none; }

.js .envelope {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: max(var(--s-3), env(safe-area-inset-top)) var(--gutter) max(var(--s-3), env(safe-area-inset-bottom));
  background: #fdf6f6; /* rosado muy claro */
  transition: opacity 500ms ease 1500ms, visibility 0s linear 2000ms;
}

/* Mientras el sobre está cerrado: sin scroll y la cigüeña espera para entrar */
.has-envelope,
.has-envelope body { overflow: hidden; }
.has-envelope .hero__stork,
.has-envelope .hero__trail { animation-play-state: paused; }

/* Nubes y estrellas */
.envelope__sky { position: absolute; inset: 0; pointer-events: none; }
.envelope__sky svg { position: absolute; overflow: visible; }

.cloud {
  aspect-ratio: 200 / 110;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(214, 140, 160, 0.18));
}
/* Nubes rosadas arriba: una grande y una pequeña a cada lado */
.cloud--1 { width: 46%; max-width: 13rem; top: -3%; left: -12%; }
.cloud--8 { width: 30%; max-width: 9rem; top: 2%; left: 16%; }
.cloud--2 { width: 44%; max-width: 13rem; top: -3%; right: -14%; }
.cloud--5 { width: 24%; max-width: 7.5rem; top: 14%; right: -8%; }
/* Nubes grises */
.cloud--3 { width: 32%; max-width: 10rem; top: 11%; left: 38%; }
.cloud--4 { width: 26%; max-width: 8.5rem; bottom: 25%; right: -8%; }
/* Nubes rosadas al final */
.cloud--6 { width: 46%; max-width: 14rem; bottom: 15%; left: -14%; }
.cloud--7 { width: 48%; max-width: 14rem; bottom: 14%; right: -16%; }

.star { width: 2.2rem; height: 2.2rem; }
.star--1 { top: 22%; left: 8%; }
.star--3 { top: 13%; right: 8%; width: 1.9rem; height: 1.9rem; }
.star--5 { bottom: 28%; left: 10%; }
.star--6 { bottom: 30%; right: 9%; width: 1.8rem; height: 1.8rem; }
.star--7 { bottom: 6%; left: 46%; width: 1.9rem; height: 1.9rem; }
.star--8 { bottom: 3%; left: 8%; width: 1.6rem; height: 1.6rem; }
.star--9 { bottom: 4%; right: 18%; width: 2rem; height: 2rem; }

.envelope__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  text-align: center;
}

.envelope__title {
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 1.6rem + 1.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  color: #b8687b; /* rosado profundo, legible sobre blanco */
}

/* Separador pegado al título (el escenario tiene un espacio grande entre elementos) */
.envelope__divider { margin: calc(-1 * var(--s-3)) auto 0; }

.envelope__hint {
  font-size: var(--fs-small);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.envelope__body {
  position: relative;
  width: min(100%, 23rem);
  aspect-ratio: 10 / 6.6;
  perspective: 60rem;
}

/* Interior del sobre (se ve cuando se abre la solapa) */
.envelope__back {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 0.8rem;
  background: linear-gradient(#eeb0be, #f3c0cc);
  box-shadow: 0 1.2rem 2.4rem rgba(214, 140, 160, 0.32), 0 0.2rem 0.5rem rgba(214, 140, 160, 0.15);
}

/* Humo que sale por la boca del sobre al abrirlo: nubecitas rosadas que
   rebosan el bolsillo y suben en remolino por ambos lados, con destellos.
   El humo va detrás del bolsillo (como si saliera de adentro); los
   destellos van encima de todo. Las bolitas las crea script.js */
.envelope__smoke {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 12%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.envelope__smoke--sparkles { z-index: 5; }

.smoke-puff {
  position: absolute;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff 0%, #fde8ed 28%, rgba(242, 188, 203, 0.8) 50%, rgba(242, 188, 203, 0.35) 62%, rgba(242, 188, 203, 0) 72%);
  filter: blur(6px);
  opacity: 0;
}

/* Destello de 4 puntas: brillo redondo + cruz de luz */
.smoke-sparkle {
  position: absolute;
  width: var(--z);
  height: var(--z);
  margin: calc(var(--z) / -2) 0 0 calc(var(--z) / -2);
  background: radial-gradient(circle, #fff 0 14%, rgba(255, 246, 225, 0.85) 22%, rgba(255, 246, 225, 0) 55%);
  filter: drop-shadow(0 0 3px #fff);
  opacity: 0;
  transform: translate(var(--x), var(--y));
}
.smoke-sparkle::before,
.smoke-sparkle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  margin-left: -1px;
  background: linear-gradient(transparent, #fff, transparent);
}
.smoke-sparkle::after { transform: rotate(90deg); }

/* Estrellita de 5 puntas, crema brillante */
.smoke-star {
  position: absolute;
  margin: calc(var(--z) / -2) 0 0 calc(var(--z) / -2);
  font-size: var(--z);
  line-height: 1;
  color: #fffbea;
  text-shadow: 0 0 2px #fff, 0 0 5px #ffd98a, 0 0 10px rgba(255, 217, 138, 0.8);
  opacity: 0;
  transform: translate(var(--x), var(--y));
}

/* Bolsillo delantero en forma de V, rosado claro y plano. Se dibuja con el
   SVG y no con clip-path: al animarse la solapa y la tarjeta, el navegador a
   veces pierde el recorte y el sobre parecía cerrarse y volver a abrirse */
.envelope__front {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 0 0 0.8rem 0.8rem;
  overflow: hidden;
}

/* Dobleces: línea rosada más oscura con un brillo blanco al lado */
.envelope__folds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.envelope__folds polygon { fill: url(#sobreFrente); }
.envelope__folds polyline {
  fill: none;
  stroke: #efb2c0;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1.5px 0 rgba(255, 255, 255, 0.7));
}

/* Solapa: gira hacia arriba al abrir y queda detrás de la tarjeta */
.envelope__flap {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
  transform-origin: 50% 0;
  border-radius: 0.8rem 0.8rem 0 0;
  overflow: hidden;
  /* Borde más oscuro y brillo, como el doblez de la solapa */
  filter: drop-shadow(0 1.5px 0 #e3a7b3) drop-shadow(0 2.5px 0 rgba(255, 255, 255, 0.7));
  transition: transform 450ms var(--ease-out) 100ms, z-index 0s linear 320ms;
}

.envelope__flap-shape {
  width: 100%;
  height: 100%;
  background: linear-gradient(#f9d8e0, #f4c3ce);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Sello: un corazón rosado (es el botón) */
.envelope__seal {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 55%;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 300ms var(--ease-out), opacity 300ms ease;
  -webkit-tap-highlight-color: transparent;
}

.envelope__seal svg {
  width: 100%;
  height: 100%;
  fill: url(#selloGrad);
  filter: drop-shadow(0 4px 6px rgba(200, 110, 135, 0.38));
}
.envelope__seal-shine {
  fill: none;
  stroke: #fff;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.envelope__seal:focus-visible { outline-offset: 2px; border-radius: 50%; }

/* Abriendo: el sello se va, la solapa gira, sale el humo y todo se desvanece */
.envelope.is-opening { opacity: 0; visibility: hidden; }
.envelope.is-opening .envelope__seal { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
.envelope.is-opening .envelope__flap { z-index: 0; transform: rotateX(180deg); }
.envelope.is-opening .smoke-puff {
  animation: smokePuff 750ms var(--ease-out) calc(300ms + var(--d) * 0.5) forwards;
}
.envelope.is-opening .smoke-sparkle,
.envelope.is-opening .smoke-star {
  animation: sparkle 450ms ease-in-out calc(450ms + var(--d) * 0.5) infinite alternate both;
}
/* El título se desvanece para que la solapa abierta no lo tape */
.envelope.is-opening .envelope__hint,
.envelope.is-opening .envelope__title { opacity: 0; }

.envelope__hint,
.envelope__title { transition: opacity 300ms ease; }

@media (prefers-reduced-motion: no-preference) {
  /* Latido suave del corazón para invitar a tocarlo */
  .envelope__seal { animation: sealBeat 1.8s ease-in-out infinite; }
  .envelope.is-opening .envelope__seal { animation: none; }

  /* Nubes que flotan despacio y estrellas que titilan */
  .cloud { animation: cloudDrift 9s ease-in-out infinite alternate; }
  .cloud--2, .cloud--5 { animation-duration: 11s; animation-delay: -3s; }
  .cloud--3, .cloud--6 { animation-duration: 10s; animation-delay: -6s; }
  .star { animation: starTwinkle 3s ease-in-out infinite; }
  .star--3 { animation-delay: -1.6s; }
  .star--5 { animation-delay: -1.1s; }
  .star--6 { animation-delay: -2.6s; }
  .star--7 { animation-delay: -0.6s; }
  .star--8 { animation-delay: -1.9s; }
  .star--9 { animation-delay: -2.9s; }
}

@keyframes sealBeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  15% { transform: translate(-50%, -50%) scale(1.1); }
  30% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -50%) scale(1.07); }
}

/* Sale de la boca del sobre y sube a su lugar en el remolino. Se queda
   visible al final: el sobre entero se desvanece encima */
@keyframes smokePuff {
  0% { opacity: 0; transform: translate(0, 1.5rem) scale(0.3); }
  30% { opacity: 0.9; }
  100% { opacity: 0.9; transform: translate(var(--x), var(--y)) scale(var(--s)); }
}

@keyframes sparkle {
  from { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.4); }
  to { opacity: 1; transform: translate(var(--x), var(--y)) scale(1); }
}

@keyframes cloudDrift {
  from { transform: translateX(-0.6rem); }
  to { transform: translateX(0.6rem); }
}

@keyframes starTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.82) rotate(12deg); opacity: 0.7; }
}

/* ==========================================================================
   Animaciones (solo si hay JS y el usuario no pidió movimiento reducido)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js [data-animate] {
    opacity: 0;
    transition:
      opacity var(--dur) var(--ease-out),
      transform var(--dur) var(--ease-out);
    transition-delay: var(--delay, 0ms);
    will-change: opacity, transform;
  }

  .js [data-animate="hero"],
  .js [data-animate="fade-up"] { transform: translate3d(0, 1.5rem, 0); }
  .js [data-animate="scale"] { transform: scale(0.95); }

  .js [data-animate].is-visible {
    opacity: 1;
    transform: none;
  }

  .js [data-animate="hero"] { transition-duration: 500ms; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Tablet (768px+)
   ========================================================================== */
@media (min-width: 48em) {
  .container { max-width: 36rem; }
  .container--wide { max-width: 44rem; }

}

/* ==========================================================================
   Escritorio (1024px+)
   ========================================================================== */
@media (min-width: 64em) {
  .container--wide { max-width: 56rem; }

  .map { aspect-ratio: 16 / 9; }

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