/* =========================================================
   Invitación DWB-006 · Digital Wedding Bolivia
   «Sobre negro y lacre» · marfil, dorado y negro — mobile first
   ========================================================= */

/* ---------- 0. Fuentes (alojadas en /fonts, subconjunto latino, variables) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond.woff2") format("woff2");
}

@font-face {
  font-family: "Great Vibes";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/great-vibes.woff2") format("woff2");
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Paleta (tomada del video del sobre) */
  --paper: #f5efe7;          /* marfil del fondo, igual al del video */
  --paper-deep: #e9dfd0;     /* fondo de escritorio */
  --card: #fbf8f2;           /* tarjetas de papel */
  --ink: #1b1915;            /* negro del sobre: nombres y botones */
  --text: #4a4237;           /* texto corrido */
  --muted: #6b6153;          /* texto secundario (≥ 4,5:1 sobre --paper) */
  --gold: #c9a35e;           /* dorado decorativo (no se usa para texto) */
  --gold-light: #e2c88f;
  --gold-deep: #85622d;      /* dorado oscuro: el único dorado para texto sobre marfil */
  --line: rgba(133, 98, 45, .26);
  --line-soft: rgba(133, 98, 45, .14);
  --error: #a3402b;

  --envelope: linear-gradient(160deg, #2a2721 0%, #171511 55%, #0f0e0b 100%);

  /* Tipografía */
  --font-script: "Great Vibes", "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  /* Medidas */
  --invite-max: 440px;
  --gutter: clamp(1.7rem, 8vw, 2.2rem);
  --radius: 4px;

  /* Grano de papel (SVG inline, trama ≤ 0,05) */
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--paper-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fondo de escritorio en una capa fija propia (background-attachment: fixed repintaría en cada scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--tex-grain),
    radial-gradient(70% 55% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(170deg, #efe7da, var(--paper-deep));
  pointer-events: none;
}

.invitation:focus { outline: none; }

img, svg { display: block; max-width: 100%; }

/* hidden siempre gana: varias clases (.btn, .countdown__grid) fijan su propio display */
[hidden] { display: none !important; }

h1, h2, h3, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

/* Cifras alineadas en fechas, horas y códigos (Cormorant usa numerales antiguos por defecto) */
.hero__date, .calendar, .countdown, .timeline, .place__eyebrow, .finale__date, .finale__cite,
.design-code__code, .brand__demo, .stepper__value, .rsvp .lead { font-variant-numeric: lining-nums; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

/* ---------- 3. Lienzo de la invitación ---------- */
.invitation {
  position: relative;
  width: 100%;
  max-width: var(--invite-max);
  margin-inline: auto;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 40% at 50% 0%, rgba(255, 255, 255, .6), transparent 70%);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Marco dorado doble a lo largo de toda la invitación, como el borde de la tarjeta de la referencia.
   Va en ::before (primero en el orden de pintado): flores y fotos quedan por encima. */
.invitation::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 163, 94, .55);
  outline: 1px solid rgba(201, 163, 94, .3);
  outline-offset: 3px;
  pointer-events: none;
}

/* En pantallas más anchas la invitación se ve como un teléfono */
@media (min-width: 480px) {
  .invitation {
    margin-block: 32px;
    border-radius: 6px;
    box-shadow:
      0 0 0 1px rgba(133, 98, 45, .18),
      0 40px 70px -30px rgba(60, 44, 20, .45),
      0 12px 26px -14px rgba(60, 44, 20, .3);
  }
}

/* El espacio entre secciones se reparte arriba y abajo: así las sombras de las tarjetas
   quedan dentro de su sección (content-visibility recorta lo que sobresale). */
.block {
  position: relative;
  padding: 2rem var(--gutter);
  text-align: center;
}

/* ---------- 4. Tipografía común ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* Títulos en versales espaciadas, como «INVITACIÓN» en el sobre */
.title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  margin-top: .35rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.55rem, 7.4vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.title::before,
.title::after {
  content: "";
  flex: 1;
  max-width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.title::after { background: linear-gradient(270deg, transparent, var(--gold)); }

/* Títulos largos («¿Nos acompañas?») en una sola línea */
.title--long {
  font-size: clamp(1.2rem, 5.8vw, 1.45rem);
  letter-spacing: .14em;
  text-indent: .14em;
  white-space: nowrap;
}

.ornament {
  width: 64px;
  height: 26px;
  margin: 0 auto .4rem;
  color: var(--gold);
}

.lead {
  max-width: 30em;
  margin: 1rem auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 4.6vw, 1.15rem);
  line-height: 1.55;
  color: var(--text);
}

.lead--small { font-size: 1rem; color: var(--muted); }

.amp {
  font-family: var(--font-script);
  color: var(--gold);
}

/* ---------- 5. Fotografías ---------- */
/* --lqip: miniatura borrosa incrustada en el HTML (< 0,5 KB) que se ve al instante mientras llega la foto */
.photo {
  position: relative;
  overflow: hidden;
  background:
    var(--lqip, none) center / cover no-repeat,
    linear-gradient(150deg, #efe5d4, #ddcfb8);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* La foto nítida aparece con un fundido sobre la miniatura (main.js añade .is-loaded) */
.js .photo img {
  opacity: 0;
  transition: opacity .6s ease;
}

.js .photo img.is-loaded { opacity: 1; }

/* Alternativa visual si una imagen falla: fondo y corazón, nunca un hueco roto */
.photo--error img { visibility: hidden; }

.photo--error::after {
  content: "♡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--gold-deep);
}

/* Decoraciones florales recortadas del video (WebP/AVIF con transparencia) */
.deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.deco img { width: 100%; height: auto; }

/* ---------- 6. Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  padding: .7rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .18em;
  text-indent: .18em;
  white-space: nowrap;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .25s ease, box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

/* Negro del sobre con letras doradas */
.btn--dark {
  color: var(--gold-light);
  border-color: rgba(201, 163, 94, .65);
  background: var(--envelope);
  box-shadow: inset 0 0 0 3px #1b1915, inset 0 0 0 4px rgba(201, 163, 94, .35), 0 12px 22px -14px rgba(27, 25, 21, .8);
}

.btn--ghost {
  color: var(--gold-deep);
  border-color: rgba(133, 98, 45, .45);
  background-color: rgba(255, 255, 255, .4);
}

.btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.btn:disabled { opacity: .7; cursor: progress; }

/* Sin destino configurado: se muestra, pero no se presenta como accionable */
.btn[aria-disabled="true"] { cursor: default; opacity: .75; }

@media (hover: hover) {
  .btn--dark:not([aria-disabled="true"]):hover {
    translate: 0 -2px;
    box-shadow: inset 0 0 0 3px #1b1915, inset 0 0 0 4px rgba(201, 163, 94, .5), 0 16px 26px -14px rgba(27, 25, 21, .85);
  }

  .btn--ghost:not([aria-disabled="true"]):hover {
    border-color: var(--gold-deep);
    background-color: rgba(255, 255, 255, .75);
  }
}

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

/* ---------- 7. Encabezado de demo ---------- */
.brand {
  padding: calc(2.6rem + env(safe-area-inset-top)) var(--gutter) 1.4rem;
  text-align: center;
}

.brand__logo {
  width: min(36%, 150px);
  margin-inline: auto;
  aspect-ratio: 1069 / 580;
  overflow: hidden;
}

.brand__logo img {
  width: 100%;
  height: auto;
  margin-top: -23.4%; /* 250px de 1069px: el PNG tiene aire transparente arriba y abajo */
}

.brand__name {
  margin-top: .8rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand__name span { color: var(--gold-deep); }

.brand__tagline {
  margin-top: .25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .66rem;
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__demo {
  display: inline-grid;
  gap: .15rem;
  margin-top: 1rem;
  padding: .55rem 1.6rem .6rem;
  border: 1px solid rgba(201, 163, 94, .8);
  border-radius: 999px;
  background: rgba(201, 163, 94, .1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.62rem, 2.9vw, .68rem);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-deep);
}

.brand__demo-label {
  font-style: italic;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .02em;
  text-indent: 0;
  text-transform: none;
  color: var(--text);
}

.brand__demo strong { color: var(--ink); }

/* ---------- 8. Los novios: nombres, foto, fecha y cuenta regresiva ---------- */
.hero {
  position: relative;
  padding: 1rem var(--gutter) 2rem;
  text-align: center;
}

.kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.95rem, 4.4vw, 1.08rem);
  letter-spacing: .36em;
  text-indent: .36em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-deep);
}

.kicker::before,
.kicker::after {
  content: "";
  flex: 1;
  max-width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.kicker::after { background: linear-gradient(270deg, transparent, var(--gold)); }

.hero__names {
  margin-top: .5rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.7rem, 13vw, 3.5rem);
  line-height: 1.15;
  white-space: nowrap;
  color: var(--ink);
}

.hero__ink { display: inline-block; padding-inline: .1em; }

/* Foto enmarcada como la tarjeta dentro del sobre; las flores la abrazan por dos esquinas */
.hero__frame {
  position: relative;
  width: 76%;
  margin: 1.4rem auto 0;
  padding: 7px;
  background: #fffdf8;
  box-shadow:
    0 0 0 1px rgba(201, 163, 94, .55),
    0 22px 36px -22px rgba(60, 44, 20, .55);
}

.hero__frame .photo {
  aspect-ratio: 4 / 5;
  outline: 1px solid rgba(201, 163, 94, .45);
  outline-offset: -5px;
}

.hero__frame .photo img { object-position: 50% 20%; }

.deco--hero-top {
  right: -24%;
  top: -16%;
  width: 46%;
}

.deco--hero-bottom {
  left: -25%;
  bottom: -20%;
  width: 46%;
}

.hero__date {
  margin-top: 2.6rem;
  font-family: var(--font-display);
  color: var(--ink);
}

.hero__date time {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .9rem;
}

.hero__weekday,
.hero__month {
  padding-block: .4rem;
  border-block: 1px solid var(--line);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.hero__weekday small,
.hero__month small {
  display: block;
  margin-top: .2rem;
  font-size: .95rem;
  letter-spacing: .12em;
  text-transform: none;
  color: var(--ink);
}

.hero__day {
  font-weight: 500;
  font-size: clamp(3.2rem, 15vw, 3.8rem);
  line-height: .9;
}

.hero__place {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--muted);
}

.countdown { margin-top: 1.8rem; }

.countdown__lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--gold-deep);
}

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

/* Cada cifra en una tarjeta negra con filete dorado, como el sobre */
.countdown__unit {
  display: grid;
  justify-items: center;
  gap: .25rem;
  padding: .75rem 0 .65rem;
  border-radius: 3px;
  background: var(--envelope);
  box-shadow: inset 0 0 0 3px #1b1915, inset 0 0 0 4px rgba(201, 163, 94, .4), 0 12px 20px -14px rgba(27, 25, 21, .8);
  overflow: hidden;
}

.countdown__unit { position: relative; }

/* Línea central de las paletas, como en un reloj antiguo */
.countdown__unit::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 41%;
  height: 1px;
  background: rgba(0, 0, 0, .55);
  box-shadow: 0 1px 0 rgba(201, 163, 94, .18);
}

.countdown__value {
  display: block;
  transform-origin: 50% 85%;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 8.4vw, 2.1rem);
  line-height: 1;
  color: var(--gold-light);
}

.countdown__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .6rem;
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  color: rgba(226, 200, 143, .8);
}

.countdown__done {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold-deep);
}

/* ---------- 9. Mensaje de invitación ---------- */
.invite__parents {
  display: grid;
  gap: .1rem;
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--ink);
}

.invite__parents span {
  font-style: normal;
  font-weight: 700;
  font-size: .64rem;
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------- 10. Calendario ---------- */
.calendar {
  margin-top: 1.1rem;
  padding: 1.4rem 1rem 1.2rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 32px -24px rgba(60, 44, 20, .5);
  outline: 1px solid var(--line-soft);
  outline-offset: -7px;
}

.calendar__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 6.6vw, 1.65rem);
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
  color: var(--ink);
}

.calendar__table {
  width: min(100%, 300px);
  margin: 1rem auto 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar__table th {
  padding-bottom: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--gold-deep);
}

.calendar__table td {
  height: 38px;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  color: var(--text);
}

/* Día de la boda: un pequeño sello de lacre dorado */
.calendar__mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #f4dca2, #cfa257 45%, #a87b37 80%, #7d5822);
  box-shadow: inset 0 0 0 2px rgba(125, 88, 34, .45), 0 4px 10px -4px rgba(125, 88, 34, .8);
  font-weight: 700;
  color: #2b1f0c;
}

.calendar__day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.calendar__day strong {
  padding: 0 1rem;
  border-inline: 1px solid var(--line);
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}

.calendar__day span:last-child { text-transform: none; }

.date .btn { margin-top: 1.4rem; }

/* ---------- 11. Itinerario ---------- */
.timeline {
  position: relative;
  margin-top: 1.8rem;
}

/* Eje central */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 1px;
  margin-left: -.5px;
  background: linear-gradient(transparent, var(--gold) 8%, var(--gold) 92%, transparent);
  transform-origin: top;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: start;
  column-gap: .7rem;
  padding-bottom: 1.4rem;
}

.timeline__item:last-child { padding-bottom: 0; }

/* Iconos en un medallón negro con filete dorado */
.timeline__icon {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--envelope);
  box-shadow: inset 0 0 0 2px #1b1915, inset 0 0 0 3px rgba(201, 163, 94, .55), 0 8px 16px -8px rgba(27, 25, 21, .7);
  color: var(--gold-light);
}

.timeline__icon svg { width: 21px; height: 21px; }

.timeline__text {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  gap: .05rem;
  padding-top: .1rem;
  text-align: right;
}

.timeline__item:nth-child(even) .timeline__text {
  grid-column: 3;
  text-align: left;
}

.timeline__text time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold-deep);
}

.timeline__text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
  color: var(--ink);
}

.timeline__text span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: .92rem;
  line-height: 1.3;
  color: var(--muted);
}

/* ---------- 12. Galería (carrusel) ---------- */
.carousel { margin-top: 1.3rem; }

/* Deslizamiento nativo con scroll-snap: fluido con el dedo y sin librerías */
.carousel__track {
  display: flex;
  gap: 14px;
  --slide: min(74vw, 326px);
  margin-inline: calc(var(--gutter) * -1);
  /* Margen lateral para que la primera y la última foto también queden centradas
     (el % del padding se mide sobre .carousel, que es 2 × gutter más estrecho que la pista) */
  padding: 10px calc(50% + var(--gutter) - var(--slide) / 2) 26px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel__track::-webkit-scrollbar { display: none; }

.carousel__track:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: -2px;
}

/* Fotos impresas: borde blanco de papel, sombra e inclinación leve alternada */
.carousel__slide {
  flex: 0 0 var(--slide);
  scroll-snap-align: center;
  padding: 7px 7px 22px;
  background: #fffdf8;
  box-shadow: 0 0 0 1px rgba(133, 98, 45, .12), 0 16px 26px -16px rgba(60, 44, 20, .6);
  rotate: -1.4deg;
}

.carousel__slide:nth-child(even) { rotate: 1.2deg; }

.carousel__slide .photo { aspect-ratio: 4 / 5; }

.carousel__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.carousel__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--envelope);
  box-shadow: inset 0 0 0 2px #1b1915, inset 0 0 0 3px rgba(201, 163, 94, .5);
  color: var(--gold-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .2s ease;
}

.carousel__btn:active { scale: .92; }
.carousel__btn svg { width: 20px; height: 20px; }

.carousel__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.carousel__dots {
  display: flex;
  gap: 8px;
}

.carousel__dots li {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(133, 98, 45, .28);
  transition: scale .3s ease, background-color .3s ease;
}

.carousel__dots li.is-active {
  background: var(--gold-deep);
  scale: 1.35;
}

/* ---------- 13. Padrinos ---------- */
.party__card {
  margin-top: 1.4rem;
  padding: 1.5rem 1.2rem 1.3rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 32px -24px rgba(60, 44, 20, .5);
  outline: 1px solid var(--line-soft);
  outline-offset: -7px;
}

.party__group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.party__group svg { width: 20px; height: 20px; }

.party__list {
  display: grid;
  gap: 1rem;
  margin-top: 1.1rem;
}

.party__list div + div {
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.party__list dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .64rem;
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.party__list dd {
  margin-top: .2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.16rem;
  line-height: 1.3;
  color: var(--ink);
}

/* ---------- 14. Ubicación ---------- */
.place {
  position: relative;
  margin-top: 2.6rem;
  padding: 2.2rem 1.2rem 1.3rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 32px -24px rgba(60, 44, 20, .5);
}

.place:first-of-type { margin-top: 2.2rem; }

/* Medallón negro que asoma por el borde superior */
.place__icon {
  position: absolute;
  left: 50%;
  top: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: var(--envelope);
  box-shadow: inset 0 0 0 2px #1b1915, inset 0 0 0 3px rgba(201, 163, 94, .55);
  color: var(--gold-light);
}

.place__icon svg { width: 22px; height: 22px; }

.place__eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .66rem;
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.place__name {
  margin-top: .45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink);
}

.place__address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  margin-top: .5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--muted);
}

.place__copy {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gold-deep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.place__copy svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.place__copy.is-done svg { background: rgba(201, 163, 94, .18); }

.place__copy:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: -4px;
}

/* Mapa de Google: se carga solo al pedirlo (evita ~1 MB de terceros en la carga inicial) */
.place__map {
  margin-top: 1rem;
  aspect-ratio: 16 / 11;
  background: #eee6d8;
  box-shadow: 0 0 0 1px var(--line);
}

.place__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.place__actions {
  display: grid;
  gap: .6rem;
  margin-top: 1.1rem;
}

.places__status {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-deep);
}

.places__status:empty { display: none; }

.dress {
  display: grid;
  gap: .15rem;
  margin-top: 2rem;
  font-family: var(--font-display);
}

.dress__label {
  font-weight: 700;
  font-size: .66rem;
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.dress strong {
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: .06em;
  color: var(--ink);
}

.dress__note {
  font-style: italic;
  font-size: .98rem;
  color: var(--muted);
}

/* ---------- 15. Confirmación de asistencia ---------- */
.rsvp__card {
  margin-top: 1.4rem;
  padding: 1.5rem 1.15rem 1.4rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 18px 32px -24px rgba(60, 44, 20, .5);
}

.rsvp__form {
  display: grid;
  gap: 1.1rem;
  text-align: left;
}

.field {
  display: grid;
  gap: .4rem;
  min-width: 0;
}

.field__label {
  padding: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .95rem;
  border: 1px solid rgba(133, 98, 45, .32);
  border-radius: 3px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px evita el zoom automático en iOS */
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.field__input::placeholder { color: #8d8373; }

.field__input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(201, 163, 94, .25);
}

.field__input--area {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.field__input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(163, 64, 43, .12);
}

.field__error {
  font-size: .9rem;
  line-height: 1.35;
  color: var(--error);
}

.field__error:empty { display: none; }

.field__hint {
  font-size: .9rem;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(133, 98, 45, .32);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.stepper__btn {
  width: 48px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold-deep);
  cursor: pointer;
  transition: background-color .2s ease;
}

.stepper__btn:hover:not(:disabled) { background-color: rgba(201, 163, 94, .14); }
.stepper__btn:disabled { opacity: .3; cursor: default; }

.stepper__btn:focus-visible,
.stepper__value:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: -3px;
}

.stepper__value {
  width: 3.2rem;
  height: 46px;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper__value::-webkit-inner-spin-button,
.stepper__value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.companions {
  display: grid;
  gap: .4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.companions__list {
  display: grid;
  gap: .7rem;
  padding-left: .9rem;
  border-left: 1px solid var(--line);
}

.companion {
  gap: .3rem;
  animation: field-in .5s ease both;
}

.companion__label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
}

@keyframes field-in {
  from { opacity: 0; translate: 0 -6px; }
}

.rsvp__form .btn { margin-top: .3rem; }

.rsvp__status {
  text-align: center;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--gold-deep);
}

.rsvp__status:empty { display: none; }
.rsvp__status.is-error { color: var(--error); }

.rsvp__success {
  display: grid;
  justify-items: center;
  gap: .6rem;
  padding: .5rem 0;
  text-align: center;
  animation: field-in .8s ease both;
}

.rsvp__success:focus { outline: none; }

.rsvp__success-seal {
  width: 64px;
  height: 64px;
  animation: seal-pop .9s cubic-bezier(.3, 1.6, .5, 1) .15s both;
}

@keyframes seal-pop {
  from { transform: scale(0) rotate(-40deg); }
  to { transform: none; }
}

.rsvp__success-title {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 12vw, 3rem);
  line-height: 1.1;
  color: var(--ink);
}

.rsvp__success-text {
  max-width: 22em;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

/* ---------- 16. Despedida y código del diseño ---------- */
.finale {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 2.2rem var(--gutter) calc(5.4rem + env(safe-area-inset-bottom));
  text-align: center;
}

.finale__seal {
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 6px 8px rgba(125, 88, 34, .35));
}

.finale__quote {
  max-width: 19em;
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 4.9vw, 1.22rem);
  line-height: 1.5;
  color: var(--text);
}

.finale__cite {
  margin-top: .4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .66rem;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.finale__names {
  margin-top: 1.2rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.8rem, 13vw, 3.4rem);
  line-height: 1.2;
  color: var(--ink);
}

.finale__ink { display: inline-block; padding-inline: .1em; }

.finale__date {
  margin-top: .2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--gold-deep);
}

/* Tarjeta negra como el sobre, con el código en dorado */
.design-code {
  position: relative;
  width: min(100%, 290px);
  margin-top: 2.4rem;
  padding: 1.4rem 1.2rem 1.2rem;
  background: var(--envelope);
  box-shadow: inset 0 0 0 5px #1b1915, inset 0 0 0 6px rgba(201, 163, 94, .45), 0 20px 34px -22px rgba(27, 25, 21, .85);
}

.design-code__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .64rem;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: rgba(226, 200, 143, .8);
}

.design-code__code {
  position: relative;
  margin-top: .25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 11vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: .06em;
  color: var(--gold-light);
}

.design-code__brand {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .62rem;
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: var(--gold);
}

.finale > .btn { margin-top: 1.3rem; }

.deco--silk {
  right: 0;
  bottom: 0;
  width: 62%;
  z-index: 0;
}

/* ---------- 17. Animaciones de aparición ---------- */
.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.has-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* Foto que se revela: velo marfil que se desvanece y la foto se asienta.
   Se anima el hijo (velo e imagen), no el elemento observado por el IntersectionObserver. */
.has-reveal [data-reveal="develop"] {
  opacity: 1;
  transform: none;
}

.has-reveal [data-reveal="develop"] .photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, #fffaf0, #e6dccb);
  pointer-events: none;
  transition: opacity 1.05s ease .1s;
}

.has-reveal [data-reveal="develop"] .photo img {
  scale: 1.08;
  transition: scale 1.4s cubic-bezier(.2, .7, .2, 1) .1s, opacity .6s ease;
}

.has-reveal [data-reveal="develop"].is-visible .photo::before { opacity: 0; }
.has-reveal [data-reveal="develop"].is-visible .photo img { scale: 1; }

/* Flores de la portada: entran desde su esquina */
.has-reveal .hero__frame .deco {
  opacity: 0;
  transition: opacity 1s ease .5s, translate 1.2s cubic-bezier(.2, .7, .2, 1) .5s;
}

.has-reveal .deco--hero-top { translate: 14px -14px; }
.has-reveal .deco--hero-bottom { translate: -14px 14px; }
.has-reveal .hero__frame.is-visible .deco { opacity: 1; translate: none; }

/* Nombres escritos a mano (recorte de izquierda a derecha, una sola vez).
   Se recorta el hijo: el elemento observado conserva su área visible. */
.has-reveal [data-reveal="write"] {
  opacity: 1;
  transform: none;
}

.has-reveal [data-reveal="write"] .hero__ink,
.has-reveal [data-reveal="write"] .finale__ink {
  clip-path: inset(-20% 104% -30% -6%);
  transition: clip-path 1.6s cubic-bezier(.55, .1, .3, 1) .15s;
}

.has-reveal [data-reveal="write"].is-visible .hero__ink,
.has-reveal [data-reveal="write"].is-visible .finale__ink { clip-path: inset(-20% -6% -30% -6%); }

/* Itinerario: cascada e iconos que se encienden */
.timeline__item:nth-child(2) { --i: 1; }
.timeline__item:nth-child(3) { --i: 2; }
.timeline__item:nth-child(4) { --i: 3; }
.timeline__item:nth-child(5) { --i: 4; }
.has-reveal .timeline__item[data-reveal] { transition-delay: calc(var(--i, 0) * 70ms); }

.has-reveal .timeline__icon {
  scale: .5;
  transition: scale .7s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i, 0) * 70ms + .1s);
}

.has-reveal .timeline__item.is-visible .timeline__icon { scale: 1; }

/* Calendario: el sello del día se estampa al aparecer */
.has-reveal .calendar__mark { scale: 0; }
.has-reveal .calendar.is-visible .calendar__mark { animation: mark-pop .8s cubic-bezier(.3, 1.6, .5, 1) .4s both; }

@keyframes mark-pop {
  from { scale: 2; opacity: 0; }
  to { scale: 1; opacity: 1; }
}

/* Tarjetas de padrinos y lugares: se despliegan desde arriba como una carta (una sola vez) */
.has-reveal .party__card[data-reveal],
.has-reveal .place[data-reveal] {
  transform: perspective(900px) rotateX(-18deg) translateY(10px);
  transform-origin: 50% 0;
  transition: opacity .8s ease, transform 1s cubic-bezier(.2, .7, .2, 1);
}

.has-reveal .party__card[data-reveal].is-visible,
.has-reveal .place[data-reveal].is-visible { transform: none; }

/* Títulos: los filetes dorados se abren desde el centro */
.has-reveal .title::before,
.has-reveal .title::after,
.has-reveal .kicker::before,
.has-reveal .kicker::after {
  scale: 0 1;
  transition: scale 1s cubic-bezier(.55, .1, .3, 1) .25s;
}

.has-reveal .title::before,
.has-reveal .kicker::before { transform-origin: 100% 50%; }

.has-reveal .title::after,
.has-reveal .kicker::after { transform-origin: 0 50%; }

.has-reveal .title.is-visible::before,
.has-reveal .title.is-visible::after,
.has-reveal .kicker.is-visible::before,
.has-reveal .kicker.is-visible::after { scale: 1 1; }

/* Sello de la despedida: cae girando y se estampa */
.has-reveal .finale__seal[data-reveal] {
  transform: scale(1.4) rotate(-16deg) translateY(-14px);
  transition: opacity .5s ease, transform .9s cubic-bezier(.2, .8, .25, 1);
}

.has-reveal .finale__seal[data-reveal].is-visible { transform: none; }

/* ---------- 17 b. Movimiento ambiental (en bucle, solo transform/opacity) ----------
   Las zonas [data-ambient] (portada y despedida) reciben .is-paused desde main.js
   cuando salen de pantalla: nada se anima donde no se ve. */

/* Rosas que respiran: balanceo lento anclado en la esquina que toca la foto.
   Va en la <img>: el <picture> conserva su propio translate de entrada. */
.deco--hero-top img {
  transform-origin: 0 100%;
  animation: sway-a 8.5s ease-in-out 1.8s infinite alternate;
}

.deco--hero-bottom img {
  transform-origin: 100% 0;
  animation: sway-b 9.5s ease-in-out 2.2s infinite alternate;
}

@keyframes sway-a {
  from { rotate: -1.4deg; }
  to { rotate: 1.8deg; }
}

@keyframes sway-b {
  from { rotate: 1.4deg; }
  to { rotate: -1.8deg; }
}

/* Parallax: con scroll, las flores se desplazan un poco más lento que la foto */
@supports (animation-timeline: view()) {
  .deco--hero-top img {
    animation: sway-a 8.5s ease-in-out 1.8s infinite alternate, drift-a linear both;
    animation-timeline: auto, view();
  }

  .deco--hero-bottom img {
    animation: sway-b 9.5s ease-in-out 2.2s infinite alternate, drift-b linear both;
    animation-timeline: auto, view();
  }

  @keyframes drift-a {
    from { translate: 0 16px; }
    to { translate: 0 -16px; }
  }

  @keyframes drift-b {
    from { translate: 0 -12px; }
    to { translate: 0 18px; }
  }
}

/* Cinta de satén: ondula muy lento */
.deco--silk img {
  transform-origin: 100% 100%;
  animation: silk 8s ease-in-out infinite alternate;
}

@keyframes silk {
  from { transform: rotate(-1.2deg) translateX(4px); }
  to { transform: rotate(1deg) translateX(-3px); }
}

/* Destellos dorados que suben y titilan (como los del video del sobre).
   Puntos con degradado estático; la variedad sale de posición y duración por nth-child. */
.sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.sparkles i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf6 0%, #f3d58f 30%, rgba(214, 176, 98, .45) 48%, rgba(214, 176, 98, 0) 70%);
  opacity: 0;
  animation: rise 13s linear infinite;
}

.sparkles i:nth-child(1) { left: 12%; top: 34%; animation-duration: 12s; animation-delay: .4s; }
.sparkles i:nth-child(2) { left: 84%; top: 22%; animation-duration: 15s; animation-delay: 3.5s; width: 7px; height: 7px; }
.sparkles i:nth-child(3) { left: 9%; top: 72%; animation-duration: 14s; animation-delay: 6s; }
.sparkles i:nth-child(4) { left: 90%; top: 64%; animation-duration: 11s; animation-delay: 2s; width: 13px; height: 13px; }
.sparkles i:nth-child(5) { left: 22%; top: 52%; animation-duration: 16s; animation-delay: 8s; width: 7px; height: 7px; }
.sparkles i:nth-child(6) { left: 76%; top: 86%; animation-duration: 13s; animation-delay: 4.5s; }

.finale .sparkles i:nth-child(1) { top: 14%; }
.finale .sparkles i:nth-child(2) { top: 8%; }
.finale .sparkles i:nth-child(3) { top: 40%; }

@keyframes rise {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  15% { opacity: .95; }
  40% { opacity: .45; }
  60% { opacity: .9; }
  100% { transform: translateY(-130px) scale(1); opacity: 0; }
}

[data-ambient].is-paused .deco img,
[data-ambient].is-paused .sparkles i { animation-play-state: paused; }

/* Destello que cruza el código: se mueve con transform (lo resuelve la GPU, sin repintar) */
.shimmer { overflow: hidden; }

.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 244, 212, .35) 50%, transparent 70%);
  transform: translateX(-110%);
  animation: sheen 6s ease-in-out 3;
  pointer-events: none;
}

@keyframes sheen {
  0%, 30% { transform: translateX(-110%); }
  75%, 100% { transform: translateX(110%); }
}

/* Cuenta regresiva: la cifra baja suavemente al cambiar */
.countdown__value.tick { animation: tick .5s cubic-bezier(.3, .7, .4, 1); }
.countdown__value.tick-alt { animation: tick-alt .5s cubic-bezier(.3, .7, .4, 1); }

@keyframes tick {
  from { transform: translateY(-35%); opacity: .2; }
  to { transform: none; opacity: 1; }
}

@keyframes tick-alt {
  from { transform: translateY(-35%); opacity: .2; }
  to { transform: none; opacity: 1; }
}

/* Días, horas y minutos: giro tipo reloj de paletas (los segundos mantienen la caída suave) */
.countdown__value.flip { animation: flip .6s cubic-bezier(.3, .7, .3, 1); }
.countdown__value.flip-alt { animation: flip-alt .6s cubic-bezier(.3, .7, .3, 1); }

@keyframes flip {
  from { transform: perspective(300px) rotateX(-90deg); opacity: .1; }
  to { transform: perspective(300px) rotateX(0deg); opacity: 1; }
}

@keyframes flip-alt {
  from { transform: perspective(300px) rotateX(-90deg); opacity: .1; }
  to { transform: perspective(300px) rotateX(0deg); opacity: 1; }
}

@keyframes heartbeat {
  0%, 60%, 100% { scale: 1; }
  15% { scale: 1.25; }
  30% { scale: 1.05; }
  45% { scale: 1.2; }
}

/* Efecto ligado al scroll (navegadores con scroll-driven animations) */
@supports (animation-timeline: view()) {
  .timeline::before {
    animation: draw-line linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 50%;
  }

  @keyframes draw-line {
    from { scale: 1 0; }
    to { scale: 1 1; }
  }
}

/* ---------- 18. Efecto gota (botones) ---------- */
.drop {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 190, .65) 0%, rgba(255, 236, 190, .22) 45%, rgba(255, 236, 190, 0) 70%);
  pointer-events: none;
  animation: drop-spread .75s cubic-bezier(.2, .6, .3, 1) forwards;
}

@keyframes drop-spread {
  from { transform: scale(0); opacity: 1; }
  to { transform: scale(16); opacity: 0; }
}

/* ---------- 19. Intro · video del sobre ---------- */
.intro { display: none; }

html.intro-active { overflow: hidden; }

.js .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  background: var(--paper);
  transition: opacity .8s ease;
}

.intro.is-leaving { opacity: 0; pointer-events: none; }

/* Seguro de vida: si main.js no cargó y el temporizador del <head> quitó .intro-active, la intro no tapa la invitación */
html:not(.intro-active) .intro:not(.is-leaving) { display: none; }

/* Escenario con la proporción del video (9:16). Ocupa todo el alto:
   en teléfonos más altos que 9:16 recorta un poco los lados (como object-fit: cover);
   en pantallas más anchas queda completo y centrado sobre el mismo marfil. */
.intro__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
}

.intro__poster,
.intro__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro__poster {
  background: var(--lqip, none) center / cover no-repeat, var(--paper);
}

.intro__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro__video {
  object-fit: cover;
  opacity: 0;
  pointer-events: none; /* sin controles: el video no se puede pausar ni adelantar */
}

/* El primer fotograma es idéntico al póster: el cambio no se nota */
.intro.is-playing .intro__video { opacity: 1; }

/* Botón invisible sobre el sello de lacre y su etiqueta (posición medida en el video) */
.intro__seal {
  position: absolute;
  left: 37%;
  top: 42.5%;
  width: 47%;
  height: 17.5%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.intro__seal:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* Ondas doradas que invitan a tocar el sello */
.intro__pulse {
  position: absolute;
  left: 50%;
  top: 50.4%;
  width: 24%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.intro__pulse i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(226, 200, 143, .9);
  opacity: 0;
  animation: seal-ring 2.6s cubic-bezier(.2, .6, .35, 1) 1s infinite;
}

.intro__pulse i:nth-child(2) { animation-delay: 2.3s; }

@keyframes seal-ring {
  from { transform: scale(.9); opacity: .9; }
  to { transform: scale(1.7); opacity: 0; }
}

.intro__hint {
  position: absolute;
  left: 50%;
  top: 90.6%;
  padding: .45rem 1.1rem;
  border: 1px solid rgba(201, 163, 94, .6);
  border-radius: 999px;
  background: rgba(250, 246, 239, .9);
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.68rem, 3.1vw, .76rem);
  letter-spacing: .22em;
  text-indent: .22em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--gold-deep);
  animation: hint-in .8s ease .6s both, hint-pulse 2.4s ease-in-out 1.4s infinite;
}

@keyframes hint-in { from { opacity: 0; } }

@keyframes hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* Al tocar: el aviso cambia a «Abriendo…» mientras el video arranca, y se oculta al reproducirse */
.intro.is-opening .intro__pulse { display: none; }
.intro.is-opening .intro__seal { pointer-events: none; }
.intro.is-playing .intro__hint { opacity: 0; transition: opacity .4s ease; animation: none; }

/* Mientras la intro está cerrada, la invitación no se dibuja (ahorra trabajo en la carga).
   Se prepara durante el video. No se anima la invitación completa: sería una capa enorme. */
.js.intro-active:not(.intro-opening) .invitation { content-visibility: hidden; }

/* ---------- 20. Música ---------- */
.music {
  --size: 44px;
  position: fixed;
  z-index: 60;
  left: calc(50% + min(50%, var(--invite-max) / 2) - var(--size) - 22px - env(safe-area-inset-right));
  top: calc(22px + env(safe-area-inset-top));
  width: var(--size);
  height: var(--size);
  transition: opacity .6s ease .5s, scale .6s cubic-bezier(.3, 1.4, .5, 1) .5s, visibility 0s .5s;
}

.intro-active .music {
  opacity: 0;
  scale: .6;
  visibility: hidden; /* tampoco se alcanza con Tab mientras la intro está cerrada */
  pointer-events: none;
}

.music__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(201, 163, 94, .8);
  border-radius: 50%;
  overflow: hidden;
  color: var(--gold-light);
  background: var(--envelope);
  box-shadow:
    inset 0 0 0 3px #1b1915,
    inset 0 0 0 4px rgba(201, 163, 94, .3),
    0 10px 20px -8px rgba(27, 25, 21, .6);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .3s ease;
}

.music__btn:hover { scale: 1.06; }
.music__btn:active { scale: .94; }

.music__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 5px;
}

.music__icon {
  width: 19px;
  height: 19px;
}

/* Ecualizador: cinco barras doradas con ritmos distintos. Solo se anima scale (GPU) y solo mientras suena. */
.music__bars {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
  height: 20px;
  margin-top: 1px;
}

.music__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(#fff6dc, #e9d29a 45%, #c39f5c);
  transform-origin: bottom;
  scale: 1 .3;
}

.music.is-playing .music__bars i { animation: eq-a .9s ease-in-out infinite; }
.music.is-playing .music__bars i:nth-child(2) { animation-name: eq-b; animation-duration: .75s; animation-delay: -.2s; }
.music.is-playing .music__bars i:nth-child(3) { animation-name: eq-c; animation-duration: 1.05s; animation-delay: -.5s; }
.music.is-playing .music__bars i:nth-child(4) { animation-name: eq-b; animation-duration: .85s; animation-delay: -.65s; }
.music.is-playing .music__bars i:nth-child(5) { animation-name: eq-a; animation-duration: .7s; animation-delay: -.35s; }

/* Valores fijos (sin variables) para que la GPU anime las barras */
@keyframes eq-a {
  0%, 100% { scale: 1 .2; }
  20% { scale: 1 .9; }
  40% { scale: 1 .4; }
  60% { scale: 1 1; }
  80% { scale: 1 .3; }
}

@keyframes eq-b {
  0%, 100% { scale: 1 .6; }
  25% { scale: 1 .15; }
  50% { scale: 1 1; }
  75% { scale: 1 .45; }
}

@keyframes eq-c {
  0%, 100% { scale: 1 .85; }
  30% { scale: 1 .2; }
  55% { scale: 1 1; }
  80% { scale: 1 .35; }
}

/* Ondas de sonido: dos anillos que se expanden y se desvanecen mientras suena */
.music__rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.music__rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 163, 94, .85);
  opacity: 0;
}

.music.is-playing .music__rings i { animation: sound-ring 2.4s cubic-bezier(.2, .6, .35, 1) infinite; }
.music.is-playing .music__rings i:nth-child(2) { animation-delay: 1.2s; }

@keyframes sound-ring {
  from { transform: scale(1); opacity: .75; }
  to { transform: scale(1.75); opacity: 0; }
}

/* mientras la canción carga tras pedirla */
.music.is-loading .music__icon { animation: heartbeat 1.4s ease-in-out infinite; }

.music.is-playing .music__icon { display: none; }
.music.is-playing .music__bars { display: flex; }

/* Efecto gota: ondas alrededor del botón al tocarlo */
.music__wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 163, 94, .9);
  pointer-events: none;
  animation: wave-out 1.3s cubic-bezier(.2, .6, .3, 1) var(--delay, 0s) both;
}

@keyframes wave-out {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(2.2); opacity: 0; }
}

/* ---------- 21. Rendimiento ---------- */
/* Las secciones lejanas no se procesan hasta acercarse al viewport.
   "auto" recuerda la altura real una vez dibujadas, así la barra de scroll no salta.
   Solo en secciones sin adornos que sobresalgan (se recortarían). */
.invite,
.date,
.plan,
.gallery,
.party,
.places,
.rsvp,
.finale {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

/* ---------- 22. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .intro__pulse,
  .intro__hint,
  .timeline::before,
  .shimmer::after,
  .music__rings i,
  .deco img,
  .calendar__mark { animation: none !important; }

  .intro__pulse,
  .sparkles { display: none; }

  /* Fundidos suaves: las secciones aparecen solo con opacidad, sin desplazarse ni girar */
  .has-reveal [data-reveal],
  .has-reveal .hero__frame .deco {
    transform: none !important;
    translate: none !important;
    transition: opacity .7s ease !important;
  }

  .has-reveal [data-reveal="write"]:not(.is-visible) { opacity: 0; }
  .has-reveal [data-reveal="write"] .hero__ink,
  .has-reveal [data-reveal="write"] .finale__ink { clip-path: none !important; }

  .has-reveal [data-reveal="develop"] .photo::before { transition: opacity .9s ease !important; }

  .has-reveal [data-reveal="develop"] .photo img,
  .has-reveal .timeline__icon,
  .has-reveal .calendar__mark,
  .has-reveal .title::before,
  .has-reveal .title::after,
  .has-reveal .kicker::before,
  .has-reveal .kicker::after { scale: none !important; }

  /* El ecualizador sigue moviéndose: es el indicador de que la música suena (pedido de los novios).
     Son 5 barras pequeñas animadas solo con scale (GPU). */
  .music.is-playing .music__bars i { animation: eq-a .9s ease-in-out infinite !important; }
  .music.is-playing .music__bars i:nth-child(2) { animation: eq-b .75s ease-in-out -.2s infinite !important; }
  .music.is-playing .music__bars i:nth-child(3) { animation: eq-c 1.05s ease-in-out -.5s infinite !important; }
  .music.is-playing .music__bars i:nth-child(4) { animation: eq-b .85s ease-in-out -.65s infinite !important; }
  .music.is-playing .music__bars i:nth-child(5) { animation: eq-a .7s ease-in-out -.35s infinite !important; }

  .carousel__slide,
  .carousel__slide:nth-child(even) { rotate: none; }
}
