/* =========================================================
   Invitación DWB-004 · Digital Wedding Bolivia
   Pase de abordar · azul marino · papel marfil — 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 */
  --navy: #0f1d36;
  --navy-deep: #0a1428;
  --navy-night: #070f1f;
  --navy-soft: #1c2c4b;
  --ivory: #f4efe4;
  --ivory-light: #faf7f0;
  --ivory-dim: #d9dce3;      /* texto corrido sobre azul marino */
  --ink: #1b2436;            /* texto sobre marfil */
  --ink-soft: #4b5262;
  --rule: #8a8c90;
  --heart: #a3262a;
  --gold: #c9a15a;
  --gold-soft: #d8b979;
  --gold-light: #e8cf98;
  --gold-ink: #85622d;       /* dorado oscuro para texto sobre marfil (AA) */

  --gold-gradient: linear-gradient(120deg, #9a7232 0%, #d9ba7c 38%, #f0dcaa 50%, #b58b45 68%, #d2b170 100%);

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

  /* Medidas */
  --invite-max: 440px;
  --gutter: clamp(1rem, 5vw, 1.5rem);
  --space-s: .75rem;
  --space-m: 1.25rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --line: 1px;

  /* Texturas (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='.05'/%3E%3C/svg%3E");

  /* Borde troquelado del papel: semicírculos arriba y abajo + esquinas recortadas */
  --sc: 4.5px;
  --sc-gap: 12px;
  --corner: 13px;
  --m-scallop:
    radial-gradient(circle var(--sc) at 50% 0, #0000 96%, #000) 50% 0 / var(--sc-gap) 100% repeat-x,
    radial-gradient(circle var(--sc) at 50% 100%, #0000 96%, #000) 50% 0 / var(--sc-gap) 100% repeat-x;
  --m-corners:
    radial-gradient(circle var(--corner) at 0 0, #0000 96%, #000),
    radial-gradient(circle var(--corner) at 100% 0, #0000 96%, #000),
    radial-gradient(circle var(--corner) at 0 100%, #0000 96%, #000),
    radial-gradient(circle var(--corner) at 100% 100%, #0000 96%, #000);
}

/* ---------- 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-text);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ivory);
  background-color: var(--navy-night);
  -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-image:
    var(--tex-grain),
    radial-gradient(90% 60% at 20% 10%, rgba(60, 85, 130, .35), transparent 70%),
    radial-gradient(80% 60% at 85% 85%, rgba(0, 0, 0, .5), transparent 70%),
    linear-gradient(160deg, var(--navy-deep), var(--navy-night));
  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; }

/* Cormorant usa numerales antiguos por defecto: fechas, horas y códigos con cifras alineadas */
.flight, .calendar, .timeline, .countdown, .design-code__code, .brand__demo-code, .venue__address,
.intro__date, .board__gate { font-variant-numeric: lining-nums; }
h1, h2, h3, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
abbr[title] { text-decoration: none; }

.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 (azul marino) ---------- */
.invitation {
  position: relative;
  width: 100%;
  max-width: var(--invite-max);
  margin-inline: auto;
  overflow: hidden;
  background-color: var(--navy);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 30% at 0% 0%, rgba(70, 95, 140, .35), transparent 60%),
    radial-gradient(100% 25% at 100% 45%, rgba(60, 85, 130, .25), transparent 70%);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* En pantallas más anchas la invitación se ve como un teléfono */
@media (min-width: 460px) {
  .invitation {
    margin-block: 28px;
    border-radius: 6px;
    box-shadow:
      0 0 0 6px rgba(244, 239, 228, .06),
      0 30px 60px -24px rgba(0, 0, 0, .7),
      0 8px 20px -10px rgba(0, 0, 0, .5);
  }
}

.section {
  position: relative;
  padding-inline: var(--gutter);
}

/* Boleto de papel marfil con borde troquelado */
.ticket {
  --m-extra: linear-gradient(#000, #000);
  position: relative;
  color: var(--ink);
  background-color: var(--ivory);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(225, 214, 192, .45), transparent 70%);
  -webkit-mask: var(--m-scallop), var(--m-corners), var(--m-extra);
  -webkit-mask-composite: source-in;
  mask: var(--m-scallop), var(--m-corners), var(--m-extra);
  mask-composite: intersect;
}

/* Muescas laterales a la altura del talón (--ny desde abajo) */
.ticket--notched {
  --m-extra:
    radial-gradient(circle 11px at 0 calc(100% - var(--ny)), #0000 96%, #000),
    radial-gradient(circle 11px at 100% calc(100% - var(--ny)), #0000 96%, #000);
}

.ticket__eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.72rem, 3.3vw, .8rem);
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}

.ticket__footer {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.9vw, .72rem);
  letter-spacing: .38em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-soft);
}

.ticket__footer::before,
.ticket__footer::after {
  content: "";
  flex: 1;
  border-top: var(--line) dashed var(--rule);
}

/* ---------- 4. Tipografía y ornamentos comunes ---------- */
.title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 6.6vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}

.title span { display: block; }

.title--light { color: var(--ivory); }

/* Línea punteada con un avión al centro */
.plane-rule {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: min(78%, 290px);
  margin: .5rem auto .7rem;
  color: var(--ink);
}

.plane-rule::before,
.plane-rule::after {
  content: "";
  flex: 1;
  border-top: var(--line) dashed var(--rule);
}

.plane-rule svg {
  width: 17px;
  height: 17px;
  flex: none;
  rotate: 90deg;
}

.plane-rule--light { color: var(--ivory); }
.plane-rule--light::before,
.plane-rule--light::after { border-top-color: rgba(244, 239, 228, .45); }

/* Ruta de vuelo punteada decorativa */
.route {
  width: 100%;
  height: auto;
  color: rgba(244, 239, 228, .75);
}

/* Sello postal circular */
.stamp {
  color: var(--ink);
  fill: currentColor;
}

.stamp text {
  font-family: var(--font-display);
  font-weight: 700;
  fill: currentColor;
}

.postmark {
  width: 120px;
  height: 44px;
  color: var(--ink);
}

/* ---------- 5. Fotografías ---------- */
/* --lqip: miniatura borrosa incrustada en el HTML (≈1 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, #2a3a58, #8f97a8);
}

.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-family: var(--font-display);
  font-size: 2.4rem;
  color: rgba(255, 255, 255, .85);
}

/* ---------- 6. Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  min-height: 48px;
  padding: .75rem 1.6rem;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--navy-soft) 0%, var(--navy) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 10px 20px -12px rgba(10, 20, 40, .85);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.84rem, 3.8vw, .94rem);
  letter-spacing: .18em;
  white-space: nowrap;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ivory);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--gold-light);
}

.btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}

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

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

@media (hover: hover) {
  .btn:not([aria-disabled="true"]):hover {
    translate: 0 -2px;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .14),
      0 14px 24px -12px rgba(10, 20, 40, .9);
  }
}

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

.btn--light {
  background: linear-gradient(180deg, var(--ivory-light), #e7dfcd);
  box-shadow: inset 0 0 0 1px rgba(201, 161, 90, .6), 0 10px 22px -12px rgba(0, 0, 0, .6);
  color: var(--navy);
}

.btn--light svg { color: var(--gold-ink); }
.btn--light:focus-visible { outline-color: var(--gold-light); }

/* ---------- 7. Sección 1 · Encabezado de demo ---------- */
.brand {
  padding: calc(var(--space-l) + env(safe-area-inset-top)) var(--gutter) var(--space-l);
  text-align: center;
}

/* El PNG original es cuadrado con aire transparente arriba y abajo:
   se recorta solo ese margen con CSS, sin editar el archivo. */
.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 */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
}

.brand__name {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 6.8vw, 1.75rem);
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ivory);
}

.brand__name span {
  background: var(--gold-gradient);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gold-shimmer 5s ease-in-out 1.5s 2 alternate both;
}

.brand__country {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: min(66%, 250px);
  margin: .4rem auto 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.8vw, .72rem);
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.brand__country::before,
.brand__country::after {
  content: "";
  flex: 1;
  height: var(--line);
  background: linear-gradient(90deg, transparent, var(--gold));
}

.brand__country::after { transform: scaleX(-1); }

.brand__tagline {
  margin-top: .4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.58rem, 2.6vw, .66rem);
  letter-spacing: .3em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.brand__tagline span { display: block; }

/* Aviso de demo: deja claro qué modelo se está viendo */
.brand__demo {
  display: inline-grid;
  justify-items: center;
  gap: .15rem;
  margin-top: .8rem;
  padding: .45rem 1.3rem .5rem;
  border: var(--line) solid var(--gold-soft);
  border-radius: 999px;
  background: rgba(28, 44, 75, .7);
  box-shadow: inset 0 0 0 2px rgba(232, 207, 152, .1);
}

.brand__demo-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(.82rem, 3.6vw, .92rem);
  line-height: 1.2;
  color: var(--gold-light);
}

.brand__demo-code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.66rem, 2.9vw, .74rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.brand__demo-code strong {
  font-weight: 700;
  color: var(--ivory);
}

/* Titular tipo póster: «Invitación de nuestra boda» */
.brand__poster { margin-top: var(--space-l); }

.brand__script {
  font-family: var(--font-script);
  font-size: clamp(3.3rem, 17vw, 4.2rem);
  line-height: 1;
  color: var(--ivory);
}

.brand__title {
  margin-top: -.15em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 6.6vw, 1.7rem);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ivory);
}

.brand__poster .plane-rule { margin-block: .35rem .45rem; }

.brand__motto {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.6rem, 2.7vw, .68rem);
  letter-spacing: .4em;
  text-indent: .4em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

/* ---------- 8. Sección 2 · Pase de abordar ---------- */
.boarding {
  margin-inline: var(--gutter);
  padding: 1.6rem clamp(1rem, 5vw, 1.5rem) 1.2rem;
  text-align: center;
}

.boarding__globe {
  width: clamp(96px, 30vw, 122px);
  height: auto;
  aspect-ratio: 1;
  margin: .2rem auto .5rem;
}

.boarding__side {
  position: absolute;
  left: clamp(.6rem, 3vw, .9rem);
  top: clamp(7.5rem, 36vw, 9rem);
  writing-mode: vertical-rl;
  rotate: 180deg;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .62rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Triángulo dibujado con CSS (el carácter ▶ se vería como emoji en iPhone) */
.boarding__side::before {
  content: "";
  display: inline-block;
  width: .62em;
  height: .7em;
  margin-bottom: .5em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.couple {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: .95;
  color: var(--ink);
}

.couple__name {
  display: block;
  font-size: clamp(2.35rem, 11.6vw, 3rem);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* «Gustavo» en versalitas con la inicial grande, como en el diseño */
.couple__name--cap { font-size: clamp(1.9rem, 9.4vw, 2.45rem); }
.couple__name--cap::first-letter { font-size: 1.32em; }

.couple__and {
  margin: -.12em 0 -.2em;
  font-family: var(--font-script);
  font-size: clamp(2rem, 10vw, 2.5rem);
  line-height: 1;
}

.couple__and::before,
.couple__and::after {
  content: "";
  display: inline-block;
  width: 2.6em;
  height: var(--line);
  margin-inline: .35em;
  vertical-align: .2em;
  background: linear-gradient(90deg, transparent, var(--ink));
}

.couple__and::after { transform: scaleX(-1); }

/* Datos de vuelo: tabla 2 × 2 */
.flight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1rem;
  border: var(--line) solid rgba(27, 36, 54, .55);
  text-align: left;
}

.flight__cell {
  min-width: 0;
  padding: .45rem .6rem .5rem;
}

.flight__cell:nth-child(odd) { border-right: var(--line) solid rgba(27, 36, 54, .55); }
.flight__cell:nth-child(-n + 2) { border-bottom: var(--line) solid rgba(27, 36, 54, .55); }

.flight dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.flight dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.78rem, 3.6vw, .9rem);
  line-height: 1.25;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Sello + matasellos + caligrafía */
.boarding__stamps {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 1rem;
  min-height: 92px;
}

.boarding__stamps .stamp {
  position: relative;
  z-index: 1;
  width: clamp(76px, 24vw, 92px);
  height: auto;
  flex: none;
  rotate: -12deg;
}

.boarding__stamps .postmark {
  position: absolute;
  left: clamp(66px, 21vw, 84px);
  top: 50%;
  translate: 0 -50%;
  width: clamp(96px, 32vw, 120px);
  height: auto;
  aspect-ratio: 120 / 44;
}

.boarding__script {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: grid;
  justify-items: start;
  font-family: var(--font-script);
  font-size: clamp(1.55rem, 7.6vw, 1.95rem);
  line-height: .9;
  color: var(--ink);
}

.boarding__script span:nth-child(1) { margin-left: 1.1em; }
.boarding__script span:nth-child(2) { margin-left: .4em; }

/* ---------- 9. Secciones 3–5 · Mensaje, foto, fecha ---------- */
.welcome {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  text-align: center;
}

.welcome__text {
  max-width: 21em;
  margin: .6rem auto 0;
  font-size: clamp(1rem, 4.4vw, 1.08rem);
  line-height: 1.45;
  color: var(--ivory-dim);
  text-wrap: balance;
}

.welcome__photo {
  margin-top: 1.3rem;
}

.welcome__photo .photo {
  aspect-ratio: 480 / 331;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(244, 239, 228, .14), 0 20px 30px -18px rgba(0, 0, 0, .8);
}

.welcome__photo img { object-position: 50% 40%; }

.welcome .route {
  margin: .4rem 0 1.4rem;
}

/* Calendario en boleto con talón */
.calendar {
  --ny: 7.4rem;
  margin-top: 1.2rem;
  padding: 1.15rem clamp(.8rem, 4vw, 1.2rem) 0;
}

.calendar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.95rem, 4.4vw, 1.05rem);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
}

.calendar__table {
  width: 100%;
  margin-top: .6rem;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.92rem, 4.2vw, 1.02rem);
  color: var(--ink);
}

.calendar__table th {
  padding-bottom: .45rem;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.calendar__table td {
  position: relative;
  height: 2rem;
  text-align: center;
}

/* Día de la boda: número blanco sobre corazón rojo */
.calendar__day--event span:first-of-type {
  position: relative;
  z-index: 1;
  color: #fff;
}

.calendar__heart {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.15rem;
  height: auto;
  aspect-ratio: 32 / 28;
  margin: -1.02rem 0 0 -1.075rem;
  color: var(--heart);
  filter: drop-shadow(0 2px 3px rgba(120, 20, 20, .3));
}

.calendar__save {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .05rem;
  height: var(--ny);
  margin: .6rem 0 0;
  border-top: 1.5px dashed var(--rule);
}

.calendar__eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .66rem;
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.calendar__weekday {
  font-family: var(--font-script);
  font-size: 1.45rem;
  line-height: 1.05;
  color: var(--gold-ink);
}

.calendar__date {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 8.6vw, 2.1rem);
  line-height: 1;
  letter-spacing: .08em;
}

.calendar__heart-end {
  width: 14px;
  height: 12px;
  margin-top: .35rem;
  color: var(--ink);
}

/* Talón de destino */
.stub {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.4rem;
  padding: .95rem 1rem;
  text-align: left;
}

.stub__pin {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--ink);
}

.stub__text {
  display: grid;
  min-width: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.stub__label {
  font-weight: 600;
  font-size: .62rem;
  letter-spacing: .24em;
  color: var(--ink-soft);
}

.stub__name {
  font-weight: 600;
  font-size: clamp(.86rem, 4vw, 1rem);
  line-height: 1.2;
  letter-spacing: .07em;
}

.stub__city {
  font-weight: 600;
  font-size: .66rem;
  letter-spacing: .2em;
  color: var(--ink-soft);
}

.stub__stamp {
  position: relative;
  margin-left: auto;
  flex: none;
  width: 58px;
  height: 58px;
}

.stub__stamp .postmark {
  position: absolute;
  right: 26px;
  top: 50%;
  width: 54px;
  height: 20px;
  translate: 0 -50%;
  opacity: .7;
}

.stamp--small {
  position: relative;
  width: 58px;
  height: 58px;
  rotate: 10deg;
}

/* ---------- 10. Lugar del evento ---------- */
.venue {
  margin: 0 var(--gutter);
  padding: 1.5rem clamp(1rem, 5vw, 1.4rem) 1.4rem;
  text-align: center;
}

.venue .title {
  padding-inline: clamp(3rem, 15vw, 3.4rem);
  font-size: clamp(.95rem, 4.6vw, 1.2rem);
}

.venue__stamp {
  position: absolute;
  top: .6rem;
  right: .6rem;
  width: clamp(48px, 15vw, 64px);
  height: auto;
  rotate: 14deg;
  opacity: .9;
}

.venue__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.02rem, 4.8vw, 1.15rem);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.venue__address {
  margin-top: .15rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.venue .btn { margin-top: .9rem; }

.venue__photo {
  margin-top: 1.1rem;
}

.venue__photo .photo {
  aspect-ratio: 480 / 300;
  border-radius: 12px;
}

/* ---------- 11. Itinerario ---------- */
.program {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.program__route {
  position: absolute;
  right: clamp(.6rem, 4vw, 1.2rem);
  top: 3.6rem;
  bottom: 2rem;
  width: 52px;
  height: auto;
  color: rgba(244, 239, 228, .55);
}

.program__plane {
  position: absolute;
  right: clamp(1.2rem, 6vw, 1.9rem);
  top: 2.4rem;
  width: 26px;
  height: 26px;
  color: var(--ivory);
  rotate: -60deg;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.05rem;
  margin-top: 1.4rem;
  padding-right: 3.4rem;
}

/* Línea vertical que une los puntos */
.timeline::before {
  content: "";
  position: absolute;
  left: 3.35rem;
  top: .9rem;
  bottom: .9rem;
  width: var(--line);
  background: rgba(244, 239, 228, .4);
  transform-origin: top;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem 1.6rem 3.1rem 1fr;
  align-items: center;
  font-size: clamp(.98rem, 4.4vw, 1.06rem);
  line-height: 1.25;
}

.timeline__item::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 0 3px var(--navy);
}

.timeline__icon {
  grid-column: 1;
  grid-row: 1;
  color: var(--ivory);
}

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

.timeline time {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08em;
  color: var(--ivory);
}

.timeline__label {
  grid-column: 4;
  grid-row: 1;
  color: var(--ivory-dim);
}

/* ---------- 12. Código de vestimenta ---------- */
.attire {
  position: relative;
  padding: 2.4rem var(--gutter) 2.6rem;
  color: var(--ink);
  text-align: center;
  background-color: var(--ivory);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 50% at 20% 0%, rgba(255, 255, 255, .7), transparent 60%);
  -webkit-mask: var(--m-scallop);
  -webkit-mask-composite: source-in;
  mask: var(--m-scallop);
  mask-composite: intersect;
}

.attire__text {
  margin-top: .5rem;
  font-size: clamp(.98rem, 4.3vw, 1.05rem);
  line-height: 1.4;
  color: var(--ink-soft);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .4rem;
  margin-top: 1.1rem;
}

.swatches li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .4rem;
}

.swatches li::before {
  content: "";
  width: clamp(40px, 12.5vw, 50px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 10px -6px rgba(20, 25, 40, .6);
}

.swatches span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .6rem;
  line-height: 1.3;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.route--loop {
  margin: 1rem 0 .6rem;
  color: var(--ink);
}

.looks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(.8rem, 4vw, 1.2rem);
  margin-top: .6rem;
}

.look {
  display: grid;
  gap: .55rem;
}

.look__title {
  order: -1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.95rem, 4.4vw, 1.08rem);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Fotos impresas, levemente inclinadas */
.look .photo {
  aspect-ratio: 240 / 324;
  border: 5px solid var(--ivory-light);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 25, 40, .15), 0 14px 22px -12px rgba(20, 25, 40, .55);
  rotate: -2deg;
}

.look:nth-child(2) .photo { rotate: 2deg; }

.look .photo img { object-position: 50% 25%; }

.look__text {
  font-size: .92rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* ---------- 13. Amor sin fronteras (mensaje + foto) ---------- */
.love {
  position: relative;
  padding-bottom: var(--space-xl);
  text-align: center;
}

.love__photo .photo { aspect-ratio: 480 / 400; }
.love__photo img { object-position: 45% 50%; }

/* La foto se funde con el azul marino por abajo */
.love__photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(transparent, var(--navy));
  pointer-events: none;
}

.love__photo { position: relative; }

.love__text {
  position: relative;
  z-index: 1;
  margin-top: -2.6rem;
  padding-inline: var(--gutter);
}

.love__script {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 12.6vw, 3.1rem);
  line-height: 1.1;
  color: var(--gold-light);
}

.love__message {
  max-width: 21em;
  margin: .6rem auto 0;
  font-size: clamp(1rem, 4.4vw, 1.08rem);
  line-height: 1.5;
  color: var(--ivory-dim);
  text-wrap: balance;
}

.love__names {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 5vw, 1.25rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ivory);
}

.love__names span {
  font-family: var(--font-script);
  font-size: 1.3em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-light);
}

/* ---------- 14. Frase + cuenta regresiva (tablero de salidas) ---------- */
.departure {
  padding-bottom: var(--space-xl);
  text-align: center;
}

.departure__quote {
  max-width: 19em;
  margin: 0 auto 1.4rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 5.8vw, 1.45rem);
  line-height: 1.3;
  color: var(--ivory);
}

.board {
  padding: 1.4rem clamp(.9rem, 4.5vw, 1.3rem) 1.3rem;
}

.board__route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 9vw, 2.2rem);
  line-height: 1;
  letter-spacing: .08em;
}

.board__route svg {
  width: 26px;
  height: 26px;
  rotate: 90deg;
}

.board__title {
  margin-top: .6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .36em;
  text-indent: .36em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.countdown { margin-top: .8rem; }

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.35rem, 2vw, .6rem);
}

.countdown__unit {
  display: grid;
  gap: .35rem;
}

/* Paleta del tablero: dos mitades con una bisagra al centro */
.countdown__flap {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(58px, 17vw, 70px);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #1f3053 0%, #15233f 49.5%, #0d1830 50.5%, #13213b 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 14px -8px rgba(10, 20, 40, .8);
  perspective: 240px;
}

.countdown__flap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, .55);
}

.countdown__value {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 8.6vw, 2.2rem);
  line-height: 1;
  color: var(--ivory);
}

.countdown__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .64rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.countdown__done {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.board__gate {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: var(--line) dashed var(--rule);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

/* ---------- 15. Confirmación de asistencia ---------- */
.rsvp { padding-bottom: var(--space-xl); }

.rsvp__card {
  padding: 1.6rem clamp(1.1rem, 5vw, 1.6rem) 1.8rem;
  text-align: center;
}

.rsvp__card .title { margin-top: .5rem; }

.rsvp__intro {
  max-width: 20em;
  margin: 0 auto 1.4rem;
  font-size: clamp(.95rem, 4.2vw, 1.02rem);
  line-height: 1.45;
  color: var(--ink-soft);
}

.rsvp__form {
  position: relative;
  display: grid;
  gap: 1.15rem;
  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: clamp(.7rem, 3.1vw, .76rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--navy);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  border: var(--line) solid rgba(27, 36, 54, .35);
  border-radius: 6px;
  background: rgba(255, 255, 255, .7);
  font-family: var(--font-text);
  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, background-color .25s ease;
}

.field__input::placeholder { color: #7c8190; }

.field__input:focus {
  outline: none;
  border-color: var(--navy);
  background-color: #fffdf8;
  box-shadow: 0 0 0 3px rgba(15, 29, 54, .14);
}

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

.field__input[aria-invalid="true"] {
  border-color: #a4473a;
  box-shadow: 0 0 0 3px rgba(164, 71, 58, .12);
}

.field__error {
  font-size: .86rem;
  line-height: 1.3;
  color: #8f3427;
}

.field__error:empty { display: none; }

.field__hint {
  font-size: .85rem;
  color: var(--ink-soft);
}

.stepper {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: var(--line) solid rgba(27, 36, 54, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  overflow: hidden;
}

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

.stepper__btn:hover:not(:disabled) { background-color: rgba(15, 29, 54, .08); }
.stepper__btn:disabled { opacity: .3; cursor: default; }

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

.stepper__value {
  width: 3.2rem;
  height: 46px;
  border: 0;
  border-inline: var(--line) solid rgba(27, 36, 54, .25);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  font-variant-numeric: lining-nums;
  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: var(--line) dashed var(--rule);
}

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

.companion__label {
  font-family: var(--font-text);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
}

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

.rsvp__form .btn { margin-top: .4rem; }
.rsvp__form .btn svg { rotate: 45deg; }

@media (hover: hover) {
  .rsvp__form .btn:hover svg { animation: take-off 1s ease-in-out infinite alternate; }
}

@keyframes take-off {
  to { translate: 3px -3px; }
}

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

.rsvp__status:empty { display: none; }
.rsvp__status.is-error { color: #8f3427; }

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

.rsvp__success:focus { outline: none; }

.rsvp__success-heart {
  width: 72px;
  aspect-ratio: 64 / 48;
  height: auto;
  color: var(--heart);
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw-heart 1.8s ease .2s forwards;
}

@keyframes draw-heart { to { stroke-dashoffset: 0; } }

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

.rsvp__success-text {
  max-width: 20em;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---------- 16. Código del diseño ---------- */
.design-code {
  display: grid;
  justify-items: center;
  gap: 1.3rem;
  padding: 0 var(--gutter) calc(var(--space-xl) + env(safe-area-inset-bottom));
  text-align: center;
}

.design-code__ticket {
  width: min(100%, 300px);
  padding: 1.3rem 1.2rem 1.1rem;
}

.design-code__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .36em;
  text-indent: .36em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.design-code__code {
  position: relative;
  margin-top: .2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 11vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: .08em;
  color: var(--navy);
}

.barcode {
  width: 78%;
  height: 34px;
  margin: .5rem auto 0;
  color: var(--ink);
}

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

/* ---------- 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 de la pareja: se "revela" como una instantánea */
.has-reveal .welcome__photo[data-reveal] { transform: translateY(24px) scale(.97); transition-duration: .9s; }
.has-reveal .welcome__photo[data-reveal].is-visible { transform: none; }

.has-reveal .welcome__photo .photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, #faf7f0, #d9d6cc);
  pointer-events: none;
  transition: opacity 1.2s ease .25s;
}

.has-reveal .welcome__photo .photo img {
  scale: 1.08;
  transition: scale 1.6s cubic-bezier(.2, .7, .2, 1) .25s, opacity .6s ease;
}

.has-reveal .welcome__photo.is-visible .photo::before { opacity: 0; }
.has-reveal .welcome__photo.is-visible .photo img { scale: 1; }

/* Fotos con telón. Se recorta la imagen y no el contenedor, que es el que observa el IntersectionObserver. */
.has-reveal [data-reveal="curtain"] {
  opacity: 1;
  transform: none;
}

.has-reveal [data-reveal="curtain"] img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.05s cubic-bezier(.65, 0, .25, 1), opacity .6s ease;
}

.has-reveal [data-reveal="curtain"].is-visible img { clip-path: inset(0); }
.has-reveal .look:nth-child(2) img { transition-delay: .15s; }

/* Rutas punteadas: se dibujan de izquierda a derecha (recorte del svg, una sola vez) */
.has-reveal .route[data-reveal] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.3s cubic-bezier(.55, .1, .3, 1) .15s;
}

.has-reveal .route[data-reveal].is-visible { clip-path: inset(0 -2% 0 0); }

/* Nombres: aparecen como escritos a mano */
.has-reveal .couple[data-reveal] { opacity: 1; transform: none; }

.has-reveal .couple__name,
.has-reveal .couple__and {
  clip-path: inset(-30% 108% -40% -15%);
  transition: clip-path .9s cubic-bezier(.55, .1, .3, 1) .2s;
}

.has-reveal .couple__and { transition-delay: .9s; transition-duration: .45s; }
.has-reveal .couple__name--cap { transition-delay: 1.1s; }

.has-reveal .couple.is-visible .couple__name,
.has-reveal .couple.is-visible .couple__and { clip-path: inset(-30% -15% -40% -15%); }

/* Globo: gira un cuarto de vuelta al aparecer */
.has-reveal .boarding__globe[data-reveal] { transform: rotate(-30deg) scale(.85); transition-duration: 1.1s; }
.has-reveal .boarding__globe[data-reveal].is-visible { transform: none; }

/* Sello: cae sobre el papel */
.has-reveal .boarding__stamps .stamp {
  scale: 1.6;
  opacity: 0;
  transition: scale .5s cubic-bezier(.5, 0, .7, 1) .5s, opacity .3s ease .5s;
}

.has-reveal .boarding__stamps.is-visible .stamp { scale: 1; opacity: 1; }

/* Itinerario: los elementos entran en cascada */
.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; }
.timeline__item:nth-child(6) { --i: 5; }
.has-reveal .timeline__item[data-reveal] { transition-delay: calc(var(--i, 0) * 80ms); }

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

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

/* Colores del código de vestimenta: aparecen uno a uno */
.has-reveal .swatches li {
  scale: .4;
  opacity: 0;
  transition: scale .6s cubic-bezier(.3, 1.5, .5, 1), opacity .4s ease;
}

.swatches li:nth-child(2) { transition-delay: .08s; }
.swatches li:nth-child(3) { transition-delay: .16s; }
.swatches li:nth-child(4) { transition-delay: .24s; }
.swatches li:nth-child(5) { transition-delay: .32s; }
.has-reveal .swatches.is-visible li { scale: 1; opacity: 1; }

/* Calendario: el corazón del día de la boda late una vez al aparecer */
.has-reveal .calendar.is-visible .calendar__heart { animation: heart-pop .9s cubic-bezier(.3, 1.6, .5, 1) .4s both; }

@keyframes heart-pop {
  from { scale: 0; }
  to { scale: 1; }
}

/* Brillo dorado de la marca: un solo paso de ida y vuelta (no repinta indefinidamente) */
@keyframes gold-shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* 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(201, 161, 90, .25) 50%, transparent 70%);
  transform: translateX(-110%);
  animation: sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

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

/* Cuenta regresiva: la cifra cae como una paleta del tablero de aeropuerto */
.countdown__value.tick { animation: flap .45s cubic-bezier(.3, .7, .4, 1); }
.countdown__value.tick-alt { animation: flap-alt .45s cubic-bezier(.3, .7, .4, 1); }

@keyframes flap {
  from { transform: rotateX(-80deg); opacity: .3; }
  to { transform: none; opacity: 1; }
}

@keyframes flap-alt {
  from { transform: rotateX(-80deg); opacity: .3; }
  to { transform: none; opacity: 1; }
}

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

/* Efectos ligados al scroll (navegadores con scroll-driven animations) */
@supports (animation-timeline: view()) {
  .photo--parallax img {
    scale: 1.14;
    animation: photo-parallax linear both;
    animation-timeline: view();
  }

  @keyframes photo-parallax {
    from { translate: 0 -6%; }
    to { translate: 0 6%; }
  }

  .timeline::before {
    animation: draw-line linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 55%;
  }

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

  /* El avión del itinerario baja por su ruta al desplazarse */
  .program__plane {
    animation: plane-glide linear both;
    animation-timeline: view();
    animation-range: entry 20% exit 60%;
  }

  @keyframes plane-glide {
    from { translate: 0 0; }
    to { translate: -8px 40px; }
  }
}

/* ---------- 18. Efecto gota (botones) ---------- */
.drop {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 225, 185, .6) 0%, rgba(240, 225, 185, .25) 45%, rgba(240, 225, 185, 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 · anillos que se entrelazan ---------- */
.intro { display: none; }

html.intro-active { overflow: hidden; }

.js .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(.8rem, 3.6vh, 2rem);
  padding: calc(1.5rem + env(safe-area-inset-top)) var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  color: var(--ivory);
  background:
    radial-gradient(70% 45% at 50% 46%, rgba(70, 100, 155, .45), transparent 70%),
    radial-gradient(130% 90% at 50% 40%, #13254a 0%, #0b1730 55%, #060d1c 100%);
  transition: opacity .8s ease;
}

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

/* Cielo con estrellas finas (estático) */
.intro__sky {
  position: absolute;
  inset: 0;
  opacity: .55;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 120px, #e8cf98, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff, transparent),
    radial-gradient(1px 1px at 230px 170px, #fff, transparent),
    radial-gradient(1px 1px at 60px 210px, #e8cf98, transparent),
    radial-gradient(1.5px 1.5px at 190px 240px, #fff, transparent);
  background-size: 260px 260px;
  pointer-events: none;
}

/* Ruta de vuelo y avión que la cruza una vez */
.intro__route {
  position: absolute;
  left: -4%;
  top: calc(env(safe-area-inset-top) + 2vh);
  width: 108%;
  height: auto;
  max-width: none;
  opacity: .45;
  pointer-events: none;
}

.intro__plane {
  position: absolute;
  left: 0;
  top: calc(env(safe-area-inset-top) + 2vh);
  width: 22px;
  height: 22px;
  color: var(--gold-light);
  opacity: 0;
  pointer-events: none;
}

.intro__plane svg { width: 100%; height: 100%; rotate: 90deg; }

.intro.is-ready .intro__plane { animation: plane-fly 5s ease-in-out .3s both; }

@keyframes plane-fly {
  0% { transform: translate(-30px, 26vw) rotate(-40deg); opacity: 0; }
  10% { opacity: .9; }
  45% { transform: translate(55vw, 2vw) rotate(-6deg); }
  75% { transform: translate(80vw, 6vw) rotate(16deg); opacity: .9; }
  100% { transform: translate(104vw, 3vw) rotate(-20deg); opacity: 0; }
}

.intro__title,
.intro__couple,
.intro__hint {
  position: relative;
  z-index: 2;
  text-align: center;
  transition: opacity .6s ease, translate .6s ease;
}

.intro__title { width: min(84vw, 340px); }

.intro__couple {
  display: grid;
  justify-items: center;
  gap: .3rem;
  width: min(86vw, 340px);
}

/* Letras doradas "bordadas con hilo": se dibuja el contorno y después se rellena de oro */
.thread {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .55));
}

.thread text {
  font-family: var(--font-script);
  text-anchor: middle;
  fill: url(#g-thread);
  fill-opacity: 0;
  stroke: #ecd6a4;
  stroke-width: .75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
}

.intro.is-ready .thread text {
  animation:
    thread-stitch 1.3s cubic-bezier(.45, .05, .35, 1) forwards,
    thread-gild .7s ease .85s forwards;
}

.intro.is-ready .thread--names text { animation-delay: .4s, 1.15s; }

@keyframes thread-stitch { to { stroke-dashoffset: 0; } }

@keyframes thread-gild {
  to { fill-opacity: 1; stroke-opacity: .35; }
}

.intro__rule {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 62%;
  color: var(--gold-light);
  opacity: 0;
  transition: opacity 1s ease 1.4s;
}

.intro__rule::before,
.intro__rule::after {
  content: "";
  flex: 1;
  border-top: var(--line) dashed rgba(232, 207, 152, .6);
}

.intro__rule svg { width: 14px; height: 14px; rotate: 90deg; }

.intro__date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--ivory-dim);
  opacity: 0;
  transition: opacity 1s ease 1.6s;
}

.intro.is-ready .intro__rule,
.intro.is-ready .intro__date { opacity: .95; }

.intro__hint {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 3vw, .72rem);
  letter-spacing: .22em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
}

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

.intro.is-ready .intro__hint { animation: hint-in .8s ease 1.8s forwards, hint-pulse 2.4s ease-in-out 2.6s infinite; }

@keyframes hint-in { to { opacity: .9; } }

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

.intro.is-opening .intro__hint { animation: none; opacity: 0; }
.intro.is-opening .intro__title { opacity: .35; translate: 0 -8px; }

/* Partículas doradas que suben (main.js las crea) */
.intro__sparks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.spark {
  position: absolute;
  bottom: -12px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #fff7dc 0%, #e8cf98 35%, rgba(232, 207, 152, 0) 70%);
  opacity: 0;
  animation: spark-rise var(--dur) linear var(--delay) infinite;
}

.spark--b { animation-name: spark-rise-b; }

@keyframes spark-rise {
  0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  50% { transform: translate3d(14px, -55vh, 0) scale(1); }
  85% { opacity: .7; }
  100% { transform: translate3d(-8px, -108vh, 0) scale(.5); opacity: 0; }
}

@keyframes spark-rise-b {
  0% { transform: translate3d(0, 0, 0) scale(.5); opacity: 0; }
  20% { opacity: .8; }
  50% { transform: translate3d(-16px, -52vh, 0) scale(1.1); }
  80% { opacity: .6; }
  100% { transform: translate3d(10px, -108vh, 0) scale(.6); opacity: 0; }
}

/* Escena de los anillos */
.rings {
  position: relative;
  z-index: 3;
  width: min(66vw, 260px);
  aspect-ratio: 1.55;
  flex: none;
}

.rings__float {
  position: absolute;
  inset: 0;
  animation: rings-float 4.2s ease-in-out infinite;
}

@keyframes rings-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.ring {
  position: absolute;
  left: 24%;
  top: 2%;
  width: 52%;
  aspect-ratio: 120 / 126;
  transition: transform 1s cubic-bezier(.6, 0, .25, 1.12);
}

.ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring--a { transform: translateX(-48%) rotate(-12deg); }
.ring--b { transform: translateX(48%) rotate(10deg); }

/* Giro suave en 3D mientras esperan (solo transform) */
.ring__spin {
  width: 100%;
  height: 100%;
  animation: ring-sway 5s ease-in-out infinite;
}

.ring--b .ring__spin { animation-name: ring-sway-b; }

@keyframes ring-sway {
  0%, 100% { transform: perspective(600px) rotateX(10deg) rotateY(-26deg); }
  50% { transform: perspective(600px) rotateX(4deg) rotateY(18deg); }
}

@keyframes ring-sway-b {
  0%, 100% { transform: perspective(600px) rotateX(8deg) rotateY(24deg); }
  50% { transform: perspective(600px) rotateX(2deg) rotateY(-16deg); }
}

/* Al tocar: los anillos se acercan y quedan entrelazados */
.intro.is-opening .ring__spin { animation-play-state: paused; }
.intro.is-joining .ring--a { transform: translateX(-17%) rotate(-6deg); }
.intro.is-joining .ring--b { transform: translateX(17%) rotate(6deg); }

.rings__shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -6%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  animation: shadow-breathe 4.2s ease-in-out infinite;
}

@keyframes shadow-breathe {
  0%, 100% { transform: scaleX(1); opacity: .8; }
  50% { transform: scaleX(.86); opacity: .55; }
}

/* Halo y chispas cuando se unen */
.rings__halo {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 120%;
  aspect-ratio: 1;
  margin: -60% 0 0 -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 243, 207, .75) 0%, rgba(232, 207, 152, .3) 35%, rgba(232, 207, 152, 0) 65%);
  opacity: 0;
  transform: scale(.3);
  pointer-events: none;
}

.intro.is-joined .rings__halo { animation: halo-flash 1.1s ease-out forwards; }

@keyframes halo-flash {
  0% { opacity: 0; transform: scale(.3); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}

.rings__burst {
  position: absolute;
  left: 50%;
  top: 22%;
  pointer-events: none;
}

.rings__burst i {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf0, #e8cf98 60%, rgba(232, 207, 152, 0));
  opacity: 0;
}

.rings__burst i:nth-child(2) { rotate: 45deg; }
.rings__burst i:nth-child(3) { rotate: 90deg; }
.rings__burst i:nth-child(4) { rotate: 135deg; }
.rings__burst i:nth-child(5) { rotate: 180deg; }
.rings__burst i:nth-child(6) { rotate: 225deg; }
.rings__burst i:nth-child(7) { rotate: 270deg; }
.rings__burst i:nth-child(8) { rotate: 315deg; }

.intro.is-joined .rings__burst i { animation: burst .9s cubic-bezier(.2, .7, .3, 1) forwards; }
.intro.is-joined .rings__burst i:nth-child(even) { animation-name: burst-far; }

@keyframes burst {
  0% { transform: translateY(0) scale(.4); opacity: 1; }
  100% { transform: translateY(-58px) scale(1); opacity: 0; }
}

@keyframes burst-far {
  0% { transform: translateY(0) scale(.4); opacity: 1; }
  100% { transform: translateY(-84px) scale(.8); opacity: 0; }
}

.rings__btn {
  position: absolute;
  left: -10%;
  top: -12%;
  z-index: 2;
  width: 120%;
  height: 124%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rings__btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: -6px;
}

/* Mientras la intro está cerrada, la invitación no se dibuja (ahorra trabajo en la carga).
   Se prepara al tocar los anillos, durante la animación.
   No se anima la invitación completa: sería una capa enorme para la memoria del móvil. */
.js.intro-active:not(.intro-opening) .invitation { content-visibility: hidden; }

/* ---------- 20. Música y progreso ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 60;
  width: min(100%, var(--invite-max));
  height: 2px;
  translate: -50% 0;
  pointer-events: none;
  transition: opacity .6s ease;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transform-origin: left;
}

.music {
  --size: 46px;
  position: fixed;
  z-index: 60;
  left: calc(50% + min(50%, var(--invite-max) / 2) - var(--size) - 14px - env(safe-area-inset-right));
  top: calc(14px + 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,
.intro-active .scroll-progress {
  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: var(--line) solid var(--gold-soft);
  border-radius: 50%;
  overflow: hidden;
  color: var(--gold-light);
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 35% 28%, rgba(90, 120, 175, .5), transparent 60%),
    linear-gradient(160deg, var(--navy-soft), var(--navy-night));
  box-shadow:
    inset 0 0 0 3px rgba(7, 15, 31, .55),
    inset 0 0 0 4px rgba(232, 207, 152, .25),
    0 10px 20px -8px rgba(0, 0, 0, .7);
  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);
  outline-offset: 5px;
}

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

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

.music__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(#fbf0d2, #e6d3a6 45%, #c39f5c);
  box-shadow: 0 0 4px rgba(240, 220, 170, .45);
  transform-origin: bottom;
  scale: 1 .35;
}

.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 .3; }
  20% { scale: 1 .85; }
  40% { scale: 1 .5; }
  60% { scale: 1 1; }
  80% { scale: 1 .45; }
}

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

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

/* 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%;
  /* dorado medio: se ve tanto sobre el azul marino como sobre el papel marfil */
  border: 2px solid rgba(201, 161, 90, .85);
  box-shadow: 0 0 6px rgba(232, 207, 152, .5);
  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; }
}

/* Halo dorado que late suave detrás del botón mientras suena */
.music::after {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 207, 152, .55) 0%, rgba(232, 207, 152, .18) 55%, rgba(232, 207, 152, 0) 72%);
  opacity: 0;
  transition: opacity .5s ease;
}

.music.is-playing::after {
  opacity: 1;
  animation: glow-beat 1.6s ease-in-out infinite;
}

@keyframes glow-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.music.is-playing .music__btn {
  border-color: var(--gold-light);
  box-shadow:
    inset 0 0 0 3px rgba(7, 15, 31, .55),
    inset 0 0 0 4px rgba(232, 207, 152, .45),
    0 0 14px rgba(232, 207, 152, .35),
    0 10px 20px -8px rgba(0, 0, 0, .7);
}

/* 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; }

/* ondas de gota alrededor del botón */
.music__wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(216, 185, 121, .85);
  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). */
.venue,
.program,
.attire,
.love,
.departure,
.rsvp,
.design-code {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

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

  .photo--parallax img,
  .timeline::before,
  .program__plane,
  .rings__float,
  .rings__shadow,
  .ring__spin,
  .intro__plane,
  .brand__name span,
  .shimmer::after,
  .music::after,
  .music__rings i,
  .music__bars i { animation: none !important; }

  /* Sin movimiento: el ecualizador queda quieto con alturas distintas */
  .music__bars i:nth-child(odd) { scale: 1 .55; }
  .music__bars i:nth-child(even) { scale: 1 .9; }

  .has-reveal [data-reveal] { opacity: 1; }
  .photo--parallax img { scale: 1; }

  .thread text { fill-opacity: 1; stroke-opacity: .35; stroke-dashoffset: 0; }
  .intro__rule,
  .intro__date,
  .intro__hint { opacity: .9; }
}
