/* ============================================================
   BASE  ·  reset + layout + tipografía + accesibilidad
   (estilo boho-chic quince: bandas de color + flores en esquinas)
   ============================================================ */

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

/* el atributo hidden siempre oculta, aunque el elemento tenga display en CSS */
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 4px; }

/* — contenedor central: la app vive en un ancho de "teléfono" — */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

/* — secciones — */
.module {
  position: relative;
  overflow: hidden;                 /* recorta las flores al borde */
  padding-block: clamp(3.5rem, 12vw, 6rem);
  padding-inline: var(--gutter);
}

/* banda de color mauve (alterna con las secciones crema) */
.module--tint {
  background: var(--color-tint);
  color: var(--color-on-tint);
}

/* — fondo de imagen opcional por módulo (con parallax) + velo de legibilidad — */
.module__bg {
  position: absolute;
  inset: -24% 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transform: translate3d(0, var(--parallax-y, 0), 0);
}
.module__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* fuerte en el centro (texto legible), transparente en los bordes (se ve la imagen) */
  background: radial-gradient(140% 110% at 50% 42%,
    var(--color-bg) 22%,
    color-mix(in srgb, var(--color-bg) 20%, transparent) 100%);
  pointer-events: none;   /* la opacidad general se define inline desde el config */
}

/* flores decorativas en las esquinas (imágenes reales, con vaivén suave) */
.floral {
  position: absolute;
  z-index: 2;
  width: clamp(150px, 52vw, 280px);
  height: auto;
  pointer-events: none;
  opacity: 0.98;
}
.floral--tr { top: -6px; right: -6px; animation: swayA 7s ease-in-out infinite; }
.floral--bl { bottom: -6px; left: -6px; transform: rotate(180deg); animation: swayB 8s ease-in-out infinite; }
@keyframes swayA { 0%, 100% { transform: rotate(0deg); }   50% { transform: rotate(-2.2deg); } }
@keyframes swayB { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(177.8deg); } }

/* el contenido de cada módulo va por encima de fondo, velo y flores */
.portada__arch, .portada__scroll,
.countdown, .invite, .ghost, .dcr, .regalo, .musica, .cierre {
  position: relative;
  z-index: 3;
}

/* — tipografía compartida — */
.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.script {
  font-family: var(--font-script);
  color: var(--color-primary);
  line-height: 0.9;
}
.hairline { width: 64px; height: 1.5px; background: var(--color-accent); border: 0; }

/* — botón: píldora tipo negra con mayúsculas espaciadas — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.95em 1.8em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--color-ink);
  color: #fff;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
}
.btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; border: 1.5px solid var(--color-ink); color: var(--color-ink); }
.btn--sm { padding: 0.55em 1.2em; font-size: 0.72rem; }
/* sobre banda mauve, el botón se invierte a blanco */
.module--tint .btn { background: var(--color-surface); color: var(--color-ink); }

/* — utilidades — */
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* — la app arranca oculta hasta que la intro entrega el control — */
body.is-loading #app { opacity: 0; }
#app { opacity: 1; transition: opacity 0.6s var(--ease); }

/* ============================================================
   LAPTOP / PANTALLAS ANCHAS  (mobile-first; en laptop se expande)
   ============================================================ */
@media (min-width: 64rem) {
  :root { --container: 100%; }        /* a pantalla completa en laptop */
  .module { padding-inline: clamp(3rem, 7vw, 6rem); }
  .floral { width: clamp(200px, 22vw, 380px); }
  /* los fondos van a pantalla completa; el contenido se centra cómodo */
  .countdown { max-width: 60rem; margin-inline: auto; }
  .invite    { max-width: 42rem; margin-inline: auto; }
  .ghost     { max-width: 64rem; margin-inline: auto; }
}

/* — reduce motion — */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .module { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
