/* =========================================================
   Invitación DWB-005 · Digital Wedding Bolivia
   «Bajo las estrellas» · azul noche y dorado — mobile first
   ========================================================= */

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

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/playfair-display.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/playfair-display-italic.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 */
  --night: #15172b;          /* fondo de la invitación */
  --night-deep: #0d0e1c;     /* fondo de escritorio */
  --card: #1c1e36;           /* tarjetas */
  --card-edge: #262947;
  --ivory: #f3eee4;          /* títulos */
  --text: #d6d7e3;           /* texto corrido */
  --muted: #a3a6bd;          /* texto secundario (≥ 4,5:1 sobre --night) */
  --gold: #c9a35e;
  --gold-light: #e2c88f;
  --gold-deep: #a9813f;
  --ink: #17182b;            /* texto sobre botones dorados */
  --line: rgba(226, 200, 143, .16);
  --line-soft: rgba(255, 255, 255, .09);
  --error: #f2a493;

  --gold-button: linear-gradient(180deg, #dcbb76 0%, #c79f57 100%);

  /* Tipografía */
  --font-script: "Great Vibes", "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Medidas */
  --invite-max: 440px;
  --gutter: clamp(1.1rem, 5.6vw, 1.6rem);
  --radius: 16px;

  /* 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='.04'/%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-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--night-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-image:
    radial-gradient(1px 1px at 30px 40px, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 140px 160px, rgba(226, 200, 143, .7), transparent),
    radial-gradient(1.5px 1.5px at 220px 70px, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1px 1px at 90px 230px, rgba(255, 255, 255, .5), transparent),
    radial-gradient(80% 60% at 20% 10%, rgba(60, 66, 130, .35), transparent 70%),
    linear-gradient(170deg, #161833, var(--night-deep));
  background-size: 260px 260px, 260px 260px, 260px 260px, 260px 260px, 100% 100%, 100% 100%;
  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 { margin: 0; }
ol, ul { padding: 0; list-style: none; }

/* Cifras alineadas en fechas, horas y códigos */
.hero__date, .calendar, .countdown, .timeline, .place__info, .intro__date, .finale__date,
.design-code__code, .brand__demo, .stepper__value { 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;
  /* Azul noche uniforme: las fotos se funden con él sin dejar costuras */
  background-color: var(--night);
  background-image: var(--tex-grain);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* En pantallas más anchas la invitación se ve como un teléfono */
@media (min-width: 480px) {
  .invitation {
    margin-block: 32px;
    border-radius: 30px;
    box-shadow:
      0 0 0 8px #22253f,
      0 0 0 9px rgba(226, 200, 143, .18),
      0 40px 70px -28px rgba(0, 0, 0, .85),
      0 10px 24px -12px rgba(0, 0, 0, .6);
  }
}

/* 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: 1.7rem var(--gutter);
  text-align: center;
}

.block--tight { padding-block: 1rem; }

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

.title {
  margin-top: .55rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.25rem, 5.8vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--ivory);
}

.lead {
  max-width: 30em;
  margin: 1.1rem auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(.9rem, 4vw, .98rem);
  line-height: 1.7;
  color: var(--text);
}

.lead--plain {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: .84rem;
  color: var(--muted);
}

/* Separador: línea fina con un destello al centro */
.divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: min(64%, 240px);
  margin: 2.2rem auto 1.4rem;
  color: var(--gold);
}

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

.divider::after { background: linear-gradient(270deg, transparent, var(--gold) 70%); }
.divider svg { width: 14px; height: 14px; flex: none; }

/* ---------- 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, #2a2d4d, #4a4d6c);
}

.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 estrella, 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: rgba(226, 200, 143, .8);
}

/* ---------- 6. Botones (píldoras) ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 46px;
  padding: .7rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .16em;
  text-indent: .16em;
  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;
}

.btn--gold {
  color: var(--ink);
  background: var(--gold-button);
  box-shadow: inset 0 1px 0 rgba(255, 246, 220, .55), 0 10px 22px -12px rgba(201, 163, 94, .65);
}

.btn--ghost {
  color: var(--text);
  border-color: rgba(255, 255, 255, .14);
  background-color: rgba(255, 255, 255, .02);
}

.btn--ghost svg { color: var(--gold-light); }

.btn:focus-visible {
  outline: 2px solid var(--gold-light);
  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: .8; }

@media (hover: hover) {
  .btn--gold:not([aria-disabled="true"]):hover {
    translate: 0 -2px;
    box-shadow: inset 0 1px 0 rgba(255, 246, 220, .6), 0 14px 26px -12px rgba(201, 163, 94, .8);
  }

  .btn--ghost:not([aria-disabled="true"]):hover {
    border-color: rgba(226, 200, 143, .5);
    background-color: rgba(226, 200, 143, .06);
  }
}

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

/* ---------- 7. Encabezado de demo ---------- */
.brand {
  padding: calc(2.4rem + env(safe-area-inset-top)) var(--gutter) 2rem;
  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: .9rem;
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--ivory);
}

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

.brand__tagline {
  margin-top: .35rem;
  font-size: .58rem;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__demo {
  display: inline-grid;
  gap: .2rem;
  margin-top: 1.1rem;
  padding: .6rem 1.6rem .65rem;
  border: 1px solid rgba(201, 163, 94, .7);
  border-radius: 999px;
  background: rgba(201, 163, 94, .08);
  font-weight: 500;
  font-size: clamp(.54rem, 2.5vw, .6rem);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-light);
}

.brand__demo-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .82rem;
  letter-spacing: .02em;
  text-indent: 0;
  text-transform: none;
}

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

/* ---------- 8. Portada ---------- */
.hero {
  position: relative;
  isolation: isolate;
  color: var(--ivory);
  text-align: center;
}

.hero__photo {
  aspect-ratio: 480 / 800;
  max-height: 92svh;
  width: 100%;
}

.hero__photo img { object-position: 50% 30%; }

/* Degradado hacia el azul noche para que el texto se lea sobre la foto */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(21, 23, 43, .55) 0%, rgba(21, 23, 43, 0) 14%),
    linear-gradient(180deg, rgba(21, 23, 43, 0) 30%, rgba(21, 23, 43, .45) 52%, rgba(21, 23, 43, .88) 80%, var(--night) 100%);
  pointer-events: none;
}

.hero__content {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 0 var(--gutter) 1.4rem;
}

.hero__script {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 10.5vw, 2.75rem);
  line-height: 1.1;
  color: var(--ivory);
  text-shadow: 0 2px 14px rgba(13, 14, 28, .45);
}

.hero__date {
  margin-top: .1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.5rem, 18.5vw, 4.6rem);
  line-height: .9;
  letter-spacing: .01em;
  text-shadow: 0 4px 24px rgba(13, 14, 28, .45);
}

.hero__date span { display: block; }

.hero__names {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(.78rem, 3.6vw, .9rem);
  letter-spacing: .24em;
  text-transform: uppercase;
}

.hero__and {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(243, 238, 228, .15), rgba(243, 238, 228, .6), rgba(243, 238, 228, .15));
}

.hero__venue {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .92rem;
  color: var(--gold-light);
}

.hero__scroll {
  display: grid;
  justify-items: center;
  gap: .45rem;
  margin-top: 1.4rem;
  font-size: .52rem;
  font-weight: 600;
  letter-spacing: .4em;
  text-indent: .4em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__scroll::after {
  content: "";
  width: 1px;
  height: 22px;
  background: linear-gradient(var(--gold), transparent);
  transform-origin: top;
  animation: scroll-cue 2.2s ease-in-out infinite;
}

@keyframes scroll-cue {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- 9. Invitación, calendario y cuenta regresiva ---------- */
.calendar { margin-top: 1rem; }

.calendar__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 8vw, 2rem);
  line-height: 1.1;
  color: var(--ivory);
}

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

.calendar__table th {
  padding-bottom: .7rem;
  font-weight: 600;
  font-size: .56rem;
  letter-spacing: .1em;
  color: var(--muted);
}

.calendar__table td {
  height: 38px;
  padding: 0;
  font-size: .76rem;
  text-align: center;
  color: var(--text);
}

.calendar__mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(201, 163, 94, .16);
  font-weight: 700;
  color: var(--gold-light);
}

.calendar__day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.1rem;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar__day strong {
  padding: 0 1rem;
  border-inline: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--gold-light);
}

.countdown { margin-top: 2.2rem; }

.countdown__lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .9rem;
  color: var(--gold);
}

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

.countdown__unit {
  display: grid;
  justify-items: center;
  gap: .3rem;
}

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

.countdown__label {
  font-weight: 600;
  font-size: .54rem;
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.invite .btn { margin-top: 1.8rem; }

/* ---------- 10. Nuestra historia ---------- */
.chapter {
  margin-top: 1.6rem;
  padding: 1.6rem 1.3rem 1.4rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(226, 200, 143, .06), transparent 70%),
    var(--card);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .025), 0 20px 40px -24px rgba(0, 0, 0, .7);
}

.chapter__eyebrow {
  font-weight: 600;
  font-size: .56rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--gold);
}

.chapter__title {
  margin-top: .6rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ivory);
}

.chapter__text {
  display: grid;
  gap: .8rem;
  margin: 1rem 0 1.3rem;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--muted);
}

/* Cerrada: solo un adelanto de tres líneas */
.chapter__text:not(.is-open) p:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.chapter__text:not(.is-open) p + p { display: none; }
.chapter__text.is-open p { animation: field-in .5s ease both; }
.chapter .btn { width: 100%; }

/* ---------- 11. Fotos de la pareja ---------- */
.gallery { padding: 1.7rem var(--gutter); }

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gallery__item {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
}

.gallery__item .photo { height: 100%; }
.gallery__item:nth-child(2) img { object-position: 50% 30%; }

/* ---------- 12. Cronograma ---------- */
.timeline {
  position: relative;
  margin-top: 2rem;
}

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

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

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

.timeline__icon {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(201, 163, 94, .7);
  border-radius: 50%;
  background: var(--night);
  color: var(--gold-light);
}

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

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

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

.timeline__text time {
  font-weight: 700;
  font-size: .78rem;
  color: var(--gold-light);
}

.timeline__text strong {
  font-weight: 500;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--ivory);
}

.timeline__text span {
  font-size: .7rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- 13. Ubicación ---------- */
.place {
  padding: 1.5rem 1.25rem 1.3rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .7);
}

.place__eyebrow {
  font-weight: 600;
  font-size: .56rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--gold);
}

.place__name {
  margin-top: .5rem;
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--ivory);
}

.place__info {
  display: grid;
  gap: .55rem;
  margin: 1.1rem 0 1.2rem;
  text-align: left;
}

.place__info li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  column-gap: .75rem;
  min-height: 28px;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--text);
}

.place__info li > svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}

.place__copy {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background-color .2s ease;
}

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

.place__copy:hover { color: var(--gold-light); }
.place__copy.is-done { color: var(--gold-light); }

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

.place .btn + .btn { margin-top: .6rem; }

.places__then {
  display: grid;
  justify-items: center;
  gap: .7rem;
  padding: .9rem 0;
  font-weight: 600;
  font-size: .56rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

.places__then::before,
.places__then::after {
  content: "";
  width: 1px;
  height: 26px;
  background: linear-gradient(transparent, rgba(201, 163, 94, .6));
}

.places__then::after { background: linear-gradient(rgba(201, 163, 94, .6), transparent); }

.places__status {
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--gold-light);
}

.places__status:empty { display: none; }

/* ---------- 14. Cortejo ---------- */
.party__group {
  margin: 2.2rem 0 1.2rem;
  font-weight: 600;
  font-size: .6rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-align: left;
  color: var(--gold);
}

.party__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 1rem;
}

.person {
  display: grid;
  justify-items: center;
  align-content: start;
}

.person__photo {
  width: min(100%, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(201, 163, 94, .35), 0 14px 28px -14px rgba(0, 0, 0, .8);
}

.person__role {
  margin-top: .9rem;
  font-weight: 600;
  font-size: .52rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

.person__name {
  margin-top: .3rem;
  font-weight: 600;
  font-size: .84rem;
  color: var(--ivory);
}

.person__note {
  margin-top: .35rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- 15. Confirmación de asistencia ---------- */
.rsvp__photo {
  position: relative;
  margin-top: 1.6rem;
}

.rsvp__photo .photo { aspect-ratio: 480 / 300; }

/* La foto se funde con el azul noche arriba y abajo */
.rsvp__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--night), rgba(21, 23, 43, 0) 22%, rgba(21, 23, 43, 0) 70%, var(--night));
  pointer-events: none;
}

.rsvp .lead { margin-top: 0; }

.rsvp__card {
  margin-top: 1.6rem;
  padding: 1.5rem 1.2rem 1.4rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .7);
}

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

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

.field__label {
  padding: 0;
  font-weight: 600;
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .95rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px evita el zoom automático en iOS */
  color: var(--ivory);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

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

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

.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(242, 164, 147, .14);
}

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

.field__error:empty { display: none; }

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

.stepper {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}

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

.stepper__btn:hover:not(:disabled) { background-color: rgba(226, 200, 143, .1); }
.stepper__btn:disabled { opacity: .3; cursor: default; }

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

.stepper__value {
  width: 3.2rem;
  height: 46px;
  border: 0;
  border-inline: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-align: center;
  color: var(--ivory);
  -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: .45rem;
  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-size: .86rem;
  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: .82rem;
  line-height: 1.45;
  color: var(--gold-light);
}

.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-star {
  width: 40px;
  height: 40px;
  color: var(--gold);
  animation: star-pop .9s cubic-bezier(.3, 1.6, .5, 1) .15s both;
}

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

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

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

/* Preguntas frecuentes */
.faq {
  margin-top: 1.8rem;
  text-align: left;
}

.faq__item { border-bottom: 1px solid var(--line-soft); }

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
  padding: .7rem .2rem;
  font-weight: 600;
  font-size: .8rem;
  color: var(--ivory);
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item summary::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
}

.faq__item summary svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-left: auto;
  color: var(--muted);
  transition: rotate .3s ease;
}

.faq__item[open] summary svg { rotate: 180deg; }

.faq__item summary:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.faq__item p {
  padding: 0 .2rem 1rem 1.6rem;
  font-size: .8rem;
  line-height: 1.65;
  color: var(--muted);
}

.faq__item[open] p { animation: field-in .4s ease both; }

/* ---------- 16. Frase final con foto ---------- */
.finale {
  position: relative;
  padding-block: 1.7rem;
  text-align: center;
}

.finale__photo .photo { aspect-ratio: 4 / 5; }
.finale__photo img { object-position: 50% 35%; }

.finale__photo {
  position: relative;
}

.finale__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--night), rgba(21, 23, 43, 0) 18%, rgba(21, 23, 43, 0) 52%, rgba(21, 23, 43, .85) 82%, var(--night));
  pointer-events: none;
}

.finale__text {
  position: relative;
  margin-top: -8.5rem;
  padding: 0 var(--gutter);
}

.finale__quote p {
  max-width: 19em;
  margin-inline: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 4.6vw, 1.12rem);
  line-height: 1.55;
  color: var(--ivory);
}

.finale__names {
  margin-top: 1rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 12.5vw, 3.2rem);
  line-height: 1.2;
  color: var(--gold-light);
}

.finale__ink { display: inline-block; }
.finale__ink span { color: var(--gold); }

.finale__date {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-size: .86rem;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--muted);
}

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

.design-code__card {
  width: min(100%, 300px);
  padding: 1.4rem 1.2rem 1.2rem;
  border: 1px solid rgba(201, 163, 94, .35);
  border-radius: var(--radius);
  background: var(--card);
}

.design-code__title {
  font-weight: 600;
  font-size: .58rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

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

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

.design-code__foot {
  font-weight: 600;
  font-size: .52rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(163, 166, 189, .7);
}

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

/* Portada: entra cuando se abre la intro (main.js añade .is-revealed a <html>) */
.has-reveal .hero__photo img {
  scale: 1.08;
  transition: scale 2.4s cubic-bezier(.2, .7, .2, 1), opacity .6s ease;
}

.has-reveal .hero__script {
  clip-path: inset(-20% 104% -30% -6%);
  transition: clip-path 1.5s cubic-bezier(.55, .1, .3, 1) .2s;
}

.has-reveal .hero__date span,
.has-reveal .hero__venue,
.has-reveal .hero__scroll {
  opacity: 0;
  translate: 0 14px;
  transition: opacity .8s ease, translate .8s cubic-bezier(.2, .7, .2, 1);
}

.has-reveal .hero__date span:nth-child(1) { transition-delay: .5s; }
.has-reveal .hero__date span:nth-child(2) { transition-delay: .62s; }
.has-reveal .hero__date span:nth-child(3) { transition-delay: .74s; }
.has-reveal .hero__venue { transition-delay: 1.2s; }
.has-reveal .hero__scroll { transition-delay: 1.4s; }

.has-reveal .hero__names > span:not(.hero__and) {
  opacity: 0;
  transition: opacity .8s ease 1s, translate .8s cubic-bezier(.2, .7, .2, 1) 1s;
}

.has-reveal .hero__names > span:first-child { translate: -16px 0; }
.has-reveal .hero__names > span:last-child { translate: 16px 0; }

.has-reveal .hero__and {
  scale: 0 1;
  transition: scale 1s cubic-bezier(.55, .1, .3, 1) .9s;
}

.is-revealed .hero__photo img { scale: 1; }
.is-revealed .hero__script { clip-path: inset(-20% -6% -30% -6%); }

.is-revealed .hero__date span,
.is-revealed .hero__venue,
.is-revealed .hero__scroll,
.is-revealed .hero__names > span:not(.hero__and) { opacity: 1; translate: none; }

.is-revealed .hero__and { scale: 1; }

/* Instantánea 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%, #fbf6ea, #cfc9bd);
  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; }

.has-reveal .gallery__item:nth-child(2) .photo::before { transition-delay: .2s; }
.has-reveal .gallery__item:nth-child(3) .photo::before { transition-delay: .3s; }
.has-reveal .gallery__item:nth-child(4) .photo::before { transition-delay: .45s; }

/* Nombres finales: 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"] .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 .finale__ink { clip-path: inset(-20% -6% -30% -6%); }

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

/* Cortejo: los retratos entran en cascada */
.has-reveal .person:nth-child(2) { transition-delay: .12s; }

/* Calendario: el día de la boda se marca 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: 0; }
  to { scale: 1; }
}

/* 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, .3) 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; }
}

@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()) {
  .finale__photo img {
    animation: photo-parallax linear both;
    animation-timeline: view();
  }

  @keyframes photo-parallax {
    from { transform: scale(1.12) translateY(-5%); }
    to { transform: scale(1.12) translateY(5%); }
  }

  .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; }
  }
}

/* ---------- 19. Efecto gota (botones) ---------- */
.drop {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 220, .7) 0%, rgba(255, 246, 220, .25) 45%, rgba(255, 246, 220, 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; }
}

/* ---------- 20. Intro · constelación ---------- */
.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(.5rem, 2.4vh, 1.5rem);
  padding: calc(1.2rem + env(safe-area-inset-top)) var(--gutter) calc(1.2rem + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  color: var(--ivory);
  background:
    radial-gradient(55% 34% at 50% 50%, rgba(80, 86, 150, .38), transparent 70%),
    radial-gradient(140% 100% at 50% 30%, #1e2142 0%, #15172b 55%, #0b0c19 100%);
  transition: opacity .7s 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; }

/* Cielo: tres capas de estrellas estáticas; cada capa titila solo con opacity (3 animaciones en total) */
.intro__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: transform 1.2s cubic-bezier(.6, 0, .9, .5), opacity 1s ease;
}

.stars {
  position: absolute;
  inset: 0;
}

.stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, .6);
}

.stars i.is-gold { background: #f4dfae; box-shadow: 0 0 5px rgba(226, 200, 143, .7); }
.stars i.is-big { width: 3px; height: 3px; }

.stars--1 { animation: twinkle 3.1s ease-in-out infinite; }
.stars--2 { animation: twinkle 4.3s ease-in-out -1.2s infinite; }
.stars--3 { animation: twinkle 5.7s ease-in-out -2.6s infinite; }

@keyframes twinkle {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* Estrella fugaz: cruza dos veces y se detiene */
.intro__meteor {
  position: absolute;
  left: 68%;
  top: 12%;
  width: 110px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, .5) 30%, rgba(255, 255, 255, 0));
  rotate: -24deg;
  opacity: 0;
  pointer-events: none;
}

.intro.is-ready .intro__meteor { animation: meteor 7s ease-out 2.2s 2; }

@keyframes meteor {
  0% { transform: translateX(0); opacity: 0; }
  2% { opacity: 1; }
  12% { transform: translateX(-240px); opacity: 0; }
  100% { transform: translateX(-240px); opacity: 0; }
}

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

.intro__title { width: min(80vw, 320px); }

.intro__couple {
  display: grid;
  justify-items: center;
  gap: .25rem;
  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;
}

.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;
}

.thread--names tspan { fill: #c9a35e; }

.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: .45s, 1.2s; }

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

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

.intro__date {
  margin-top: .2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .2em;
  text-indent: .2em;
  color: var(--ivory);
}

/* La intro solo usa las dos fuentes precargadas (Great Vibes y Playfair) */
.intro__place {
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro__date,
.intro__place {
  opacity: 0;
  transition: opacity 1s ease 1.5s;
}

.intro.is-ready .intro__date { opacity: .95; }
.intro.is-ready .intro__place { opacity: .9; }

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

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

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

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

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

/* Estrella central (sello) con su constelación */
.sky-star {
  position: relative;
  z-index: 3;
  width: min(66vw, 34vh, 260px);
  aspect-ratio: 1;
  flex: none;
}

.constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: drift 90s linear infinite;
}

@keyframes drift { to { transform: rotate(360deg); } }

.constellation__lines path {
  opacity: .5;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
}

.constellation__nodes { opacity: 0; transition: opacity 1s ease .2s; }

.intro.is-ready .constellation__lines path { animation: thread-stitch 1.6s cubic-bezier(.45, .05, .35, 1) .3s forwards; }
.intro.is-ready .constellation__lines path:nth-child(2) { animation-delay: .55s; }
.intro.is-ready .constellation__lines path:nth-child(3) { animation-delay: .8s; }
.intro.is-ready .constellation__lines path:nth-child(4) { animation-delay: 1.05s; }
.intro.is-ready .constellation__nodes { opacity: 1; }

.sky-star__body {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  aspect-ratio: 1;
  margin: -25% 0 0 -25%;
  animation: star-float 4.2s ease-in-out infinite;
}

.sky-star__body svg { width: 100%; height: 100%; overflow: visible; }

.sky-star__initials {
  font-family: var(--font-display);
  font-weight: 500;
  fill: #f1d9a2;
}

@keyframes star-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}

/* Halo dorado que respira y onda que invita a tocar (transform y opacity) */
.sky-star__halo,
.sky-star__pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
}

.sky-star__halo {
  width: 86%;
  aspect-ratio: 1;
  margin: -43% 0 0 -43%;
  background: radial-gradient(circle, rgba(255, 238, 196, .42) 0%, rgba(226, 200, 143, .16) 38%, rgba(226, 200, 143, 0) 68%);
  animation: halo-breathe 3.6s ease-in-out infinite;
}

@keyframes halo-breathe {
  0%, 100% { transform: scale(.92); opacity: .75; }
  50% { transform: scale(1.06); opacity: 1; }
}

.sky-star__pulse {
  width: 34%;
  aspect-ratio: 1;
  margin: -17% 0 0 -17%;
  border: 1px solid rgba(226, 200, 143, .7);
  opacity: 0;
}

.intro.is-ready .sky-star__pulse { animation: pulse-out 2.8s cubic-bezier(.2, .6, .35, 1) 2.2s infinite; }

@keyframes pulse-out {
  from { transform: scale(1); opacity: .8; }
  to { transform: scale(2.4); opacity: 0; }
}

.sky-star__btn {
  position: absolute;
  left: 22%;
  top: 22%;
  z-index: 2;
  width: 56%;
  height: 56%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sky-star__btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
}

/* Estelas del salto: cada una se orienta con un rotate fijo (no animado);
   solo se anima su hijo con transform y opacity, con tres variantes fijas. */
.sky-star__warp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.streak {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.streak i {
  display: block;
  width: 64px;
  height: 2.5px;
  margin-top: -1.25px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 244, 212, 0), rgba(255, 236, 190, .95) 65%, #fff);
  transform-origin: 0 50%;
  transform: translateX(40px) scaleX(.1);
  opacity: 0;
}

.intro.is-warping .streak i { animation: warp-a .95s cubic-bezier(.55, 0, .9, .45) forwards; }
.intro.is-warping .streak:nth-child(3n+2) i { animation-name: warp-b; }
.intro.is-warping .streak:nth-child(3n) i { animation-name: warp-c; }

@keyframes warp-a {
  0% { transform: translateX(40px) scaleX(.1); opacity: 0; }
  12% { opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateX(380px) scaleX(5); opacity: 0; }
}

@keyframes warp-b {
  0% { transform: translateX(30px) scaleX(.1); opacity: 0; }
  12% { opacity: 1; }
  75% { opacity: .9; }
  100% { transform: translateX(560px) scaleX(7); opacity: 0; }
}

@keyframes warp-c {
  0% { transform: translateX(55px) scaleX(.1); opacity: 0; }
  18% { opacity: .9; }
  100% { transform: translateX(280px) scaleX(3.5); opacity: 0; }
}

/* Al tocar: la estrella gira en 3D y destella; el cielo se aleja como en un salto */
.intro.is-opening .intro__hint { animation: none; opacity: 0; }
.intro.is-opening .intro__title { opacity: .2; translate: 0 -10px; }
.intro.is-opening .intro__couple { opacity: .2; translate: 0 10px; }
.intro.is-opening .constellation { opacity: 0; transition: opacity .5s ease; }
.intro.is-opening .sky-star__pulse { animation: none; opacity: 0; }
.intro.is-opening .sky-star__body { animation: star-spin .8s cubic-bezier(.3, .7, .3, 1) forwards; }
.intro.is-opening .sky-star__halo { animation: halo-flash .9s ease-out forwards; }

@keyframes star-spin {
  0% { transform: perspective(500px) rotateY(0deg) scale(1); }
  60% { transform: perspective(500px) rotateY(300deg) scale(1.3); }
  100% { transform: perspective(500px) rotateY(360deg) scale(1.15); }
}

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

.intro.is-warping .intro__sky { transform: scale(1.8); opacity: 0; }
.intro.is-warping .stars { animation-play-state: paused; }

/* Mientras la intro está cerrada, la invitación no se dibuja (ahorra trabajo en la carga).
   Se prepara al tocar la estrella, 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; }

/* ---------- 21. Música ---------- */
.music {
  --size: 44px;
  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 {
  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(226, 200, 143, .7);
  border-radius: 50%;
  overflow: hidden;
  color: var(--gold-light);
  background:
    radial-gradient(circle at 35% 28%, rgba(90, 96, 160, .45), transparent 60%),
    linear-gradient(160deg, #262947, #15172b);
  box-shadow:
    inset 0 0 0 3px rgba(13, 14, 28, .55),
    0 10px 20px -8px rgba(0, 0, 0, .75);
  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: 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: 18px;
  margin-top: 2px;
}

.music__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(#fbf0d2, #e6d3a6 45%, #c39f5c);
  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%;
  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(226, 200, 143, .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; }
}

/* ---------- 22. 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). */
.story,
.gallery,
.plan,
.places,
.party,
.rsvp,
.finale,
.design-code {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

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

  .stars,
  .intro__meteor,
  .constellation,
  .sky-star__body,
  .sky-star__halo,
  .sky-star__pulse,
  .hero__scroll::after,
  .finale__photo img,
  .timeline::before,
  .shimmer::after,
  .music__rings i,
  .music__bars i { animation: none !important; }

  .intro__meteor,
  .sky-star__pulse { display: none; }

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

  .thread text { fill-opacity: 1; stroke-opacity: .3; stroke-dashoffset: 0; }
  .constellation__lines path { stroke-dashoffset: 0; }
  .constellation__nodes,
  .intro__date,
  .intro__place,
  .intro__hint { opacity: .9; }
}
