:root {
  --bg: #0b0a08;
  --bg-2: #14110d;
  --cream: #f3e9d7;
  --cream-dim: rgba(243, 233, 215, 0.65);
  --gold: #d9b77a;
  --gold-line: rgba(217, 183, 122, 0.3);
  --glow: #ffcf85;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", "Brush Script MT", cursive;
  --sans: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

/* Máscara para revelar texto desde abajo (con aire para los trazos de la letra cursiva) */
.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.12em 0.2em 0.18em;
  margin: -0.12em -0.2em -0.18em;
}
.mask > span { display: inline-block; }
.split-line { overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }

/* Tinta: el texto aparece de izquierda a derecha, como escrito a mano (main.js anima --ink de 100% a 0%).
   El padding deja espacio a los trazos de la letra cursiva para que la máscara no los corte. */
.ink {
  display: inline-block;
  padding: 0.15em 0.3em 0.25em; margin: -0.15em -0.3em -0.25em;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
          mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: var(--ink, 0%) 0; mask-position: var(--ink, 0%) 0;
}

/* Brillo dorado que recorre el texto cada pocos segundos */
.gild {
  padding: 0.15em 0.3em 0.25em; margin: -0.15em -0.3em -0.25em;
  background: linear-gradient(100deg, var(--cream) 42%, #fff8ea 47%, var(--gold) 50%, #fff8ea 53%, var(--cream) 58%) 100% 0 / 300% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gild 7s ease-in-out 3s infinite;
}
@keyframes gild {
  0%, 55% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

/* Adorno dorado (lo dibuja main.js dentro de [data-ornament]) */
.ornament { width: min(72vw, 300px); line-height: 0; }
.ornament svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: var(--gold); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.ornament .orn__heart { fill: var(--gold); stroke: none; }

/* ---------- Pantalla de entrada ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
}
.gate__half {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: radial-gradient(ellipse at 50% 100%, #1d1812 0%, var(--bg) 70%);
}
.gate__half--top { top: 0; border-bottom: 1px solid var(--gold-line); }
.gate__half--bottom {
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, #1d1812 0%, var(--bg) 70%);
}
.gate__content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 0 1.5rem;
}
.gate__monogram {
  font-family: var(--script);
  font-size: clamp(4.5rem, 16vw, 7.5rem);
  line-height: 1;
  display: flex; align-items: baseline; gap: 0.18em;
  margin: 0.5rem 0 2.5rem;
}
.gate__monogram em { font-style: normal; color: var(--gold); font-size: 0.6em; }
.gate__note {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.25em;
  color: var(--cream-dim); margin: 1.25rem 0 0;
}
.gate__btn { box-shadow: 0 0 0 0 rgba(217,183,122,0.5); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217,183,122,0.45); }
  70%, 100% { box-shadow: 0 0 0 18px rgba(217,183,122,0); }
}

/* ---------- Botón de música ---------- */
.music-btn {
  position: fixed; z-index: 50;
  right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(11, 10, 8, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.music-btn:hover { border-color: var(--gold); transform: scale(1.06); }
.music-btn__bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music-btn__bars i {
  width: 2px; height: 100%;
  background: var(--gold);
  border-radius: 1px;
  transform-origin: bottom;
  animation: eq 1s ease-in-out infinite;
}
.music-btn__bars i:nth-child(2) { animation-delay: -0.3s; }
.music-btn__bars i:nth-child(3) { animation-delay: -0.6s; }
.music-btn__bars i:nth-child(4) { animation-delay: -0.15s; }
.music-btn[aria-pressed="false"] .music-btn__bars i { animation-play-state: paused; transform: scaleY(0.2); }
@keyframes eq {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}

/* ---------- Foquitos flotantes ---------- */
.lights { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.light {
  position: absolute;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 12px 4px rgba(255, 207, 133, 0.55), 0 0 32px 10px rgba(255, 207, 133, 0.18);
  opacity: 0;
}

main { position: relative; z-index: 2; }
section { position: relative; }

/* ---------- 1. Portada ---------- */
.hero {
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: grid; place-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.hero__frame {
  position: absolute; inset: 0;
  overflow: hidden;
  will-change: clip-path;
}
.hero__img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  transform: scale(1.25);
  will-change: transform;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(11,10,8,0.15) 0%, rgba(11,10,8,0.7) 75%),
    linear-gradient(to bottom, rgba(11,10,8,0.2) 0%, rgba(11,10,8,0.85) 100%);
}
.hero__content {
  position: relative; z-index: 2;
  width: 100%;
  text-align: center;
  padding: 0 1.25rem;
  margin-top: 30vh;
}
.hero__names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  line-height: 1;
  font-size: clamp(3.8rem, 15vw, 9rem);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 0 0.25em;
  /* drop-shadow y no text-shadow: text-shadow se pinta encima del brillo dorado (.gild) */
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.6));
}
.hero__amp { display: inline-block; color: var(--gold); font-size: 0.6em; }
.hero__date {
  font-family: var(--sans); font-weight: 300;
  letter-spacing: 0.5em;
  font-size: 0.85rem;
  margin: 1.5rem 0 0;
  color: var(--cream-dim);
}
@media (max-width: 600px) {
  .hero__names { flex-direction: column; flex-wrap: nowrap; align-items: center; }
  .hero__amp { margin: -0.15em 0; }
}
.scroll-hint {
  position: absolute; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--cream-dim);
}
.scroll-hint i {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: drip 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- 2. Frase ---------- */
.quote {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6rem 1.5rem;
  text-align: center;
}
.quote__text {
  max-width: 16ch;
  margin: 0;
  font-weight: 300; font-style: italic;
  font-size: clamp(2.1rem, 6.5vw, 4.4rem);
  line-height: 1.15;
}
.quote__text .word { display: inline-block; opacity: 0.1; margin-right: 0.22em; will-change: opacity, filter; }
.quote__orn { margin-top: 3rem; }

/* ---------- 3. Foto reveal ---------- */
.reveal { height: 260vh; }
.reveal__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: calc(10vh + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
/* El recuadro (arco) lo dimensiona main.js: empieza como un marco 3:4 con la foto completa y crece a pantalla completa */
.reveal__mask {
  position: absolute; inset: 0;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.reveal__mask::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(11,10,8,0.92) 100%);
  opacity: var(--shade, 1);
}
.reveal__img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 30%;
  will-change: transform;
}
.reveal__caption, .reveal__title { position: relative; z-index: 2; padding: 0 1.5rem; }
.reveal__caption { font-style: italic; font-size: clamp(1.05rem, 3.5vw, 1.4rem); max-width: 28ch; margin: 0 0 0.5rem; opacity: 0; }
.reveal__title {
  margin: 0;
  font-family: var(--script); font-weight: 400;
  font-size: clamp(3.5rem, 13vw, 7.5rem);
  line-height: 1.1;
}

/* ---------- 4. Fecha ---------- */
.date {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem;
}
.date__big {
  display: flex; align-items: center; gap: clamp(0.4rem, 2vw, 1.5rem);
  font-weight: 300;
  font-size: clamp(4rem, 17vw, 11rem);
  line-height: 1;
}
.date__sep { color: var(--gold); font-size: 0.4em; }
.date__long { font-style: italic; font-size: 1.4rem; margin: 1rem 0 2rem; color: var(--cream-dim); }

/* Calendario del mes con el día marcado a mano */
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem 0.4rem;
  width: min(100%, 340px);
  margin: 0 0 2.75rem;
  font-size: 1.1rem;
}
.cal > * { display: grid; place-items: center; height: 2.2rem; }
.cal b { font-family: var(--sans); font-weight: 300; font-size: 0.65rem; letter-spacing: 0.15em; color: var(--gold); }
.cal span { color: var(--cream-dim); font-variant-numeric: lining-nums; }
.cal .cal__mark { position: relative; color: var(--cream); font-weight: 600; }
.cal__mark svg {
  position: absolute; left: 50%; top: 50%;
  width: 3.3rem; transform: translate(-50%, -50%);
  overflow: visible; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round;
}

.countdown {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 460px);
}
.countdown div {
  border: 1px solid var(--gold-line);
  border-radius: 999px 999px 8px 8px;
  padding: 1.1rem 0.25rem 0.8rem;
  display: flex; flex-direction: column; align-items: center;
}
.countdown strong { font-weight: 400; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { font-family: var(--sans); font-size: 0.6rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); margin-top: 0.4rem; }

/* ---------- Cinta de texto ---------- */
.marquee {
  overflow: hidden;
  padding: 2.5rem 0;
  border-block: 1px solid rgba(217, 183, 122, 0.12);
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; flex: none; }
.marquee__item { font-size: clamp(2.8rem, 9vw, 6rem); line-height: 1.25; padding: 0 0.4em; white-space: nowrap; }
.marquee__item--script { font-family: var(--script); color: var(--cream); }
.marquee__item--outline { font-weight: 300; letter-spacing: 0.04em; color: transparent; -webkit-text-stroke: 1px var(--gold); }
.marquee i { font-style: normal; color: var(--gold); font-size: clamp(0.9rem, 2.6vw, 1.4rem); }

/* ---------- 5. Detalles horizontal ---------- */
.details { overflow: hidden; }
.details__track {
  display: flex;
  width: max-content;
  /* espacio al final para que el último panel termine centrado (y su animación alcance a completarse) */
  padding-right: calc((100vw - min(80vw, 520px)) / 2);
  height: 100vh; height: 100svh;
}
.panel {
  flex: 0 0 auto;
  width: min(80vw, 520px);
  height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  padding: 2rem 1.75rem;
  border-left: 1px solid rgba(217, 183, 122, 0.15);
  position: relative;
}
.panel--intro { width: 100vw; border-left: 0; }
.panel__script {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(3.5rem, 14vw, 7rem);
  margin: 0; line-height: 1.1;
}
.panel__hint { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cream-dim); margin-top: 2rem; }
.panel__icon svg {
  width: 56px; height: 56px;
  fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 1.5rem;
}
.panel__big { font-weight: 300; font-size: clamp(3rem, 11vw, 4.8rem); line-height: 1; margin: 0 0 1rem; }
.panel__big--sm { font-size: clamp(2.6rem, 9vw, 4rem); }
.panel__text { color: var(--cream-dim); font-size: 1.15rem; max-width: 26ch; margin: 0 0 1.75rem; }
.panel--dress { padding-right: 3rem; }
.panel__dancers { width: 120px; margin-bottom: 1.5rem; }
.details__progress {
  position: absolute; left: 50%; bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  width: min(40vw, 180px); height: 1px;
  transform: translateX(-50%);
  background: var(--gold-line);
}
.details__progress i { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--gold);
  padding: 1.1rem 2rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  /* Sin transición de opacity: choca con las animaciones de GSAP y deja el botón invisible */
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn:hover, .btn:focus-visible { background: transparent; color: var(--gold); box-shadow: 0 0 30px rgba(217,183,122,0.35); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn--ghost { background: transparent; color: var(--gold); padding: 0.9rem 1.6rem 0.8rem; }
.btn--ghost:hover { background: var(--gold); color: var(--bg); }

/* ---------- 6. RSVP ---------- */
.rsvp {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  background: radial-gradient(ellipse at 50% 60%, rgba(217,183,122,0.08), transparent 65%);
}
.rsvp__dancers { width: min(42vw, 170px); margin-bottom: 2rem; }
.rsvp__title { font-family: var(--script); font-weight: 400; font-size: clamp(3.2rem, 12vw, 6rem); margin: 0; line-height: 1.1; }
.rsvp__text { font-size: 1.25rem; color: var(--cream-dim); margin: 1rem 0 2.5rem; }
.rsvp__text strong { color: var(--cream); font-weight: 600; }

/* ---------- Recuadro deslizable ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; }
.sheet__overlay {
  position: absolute; inset: 0;
  background: rgba(5, 4, 3, 0.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sheet__panel {
  /* --kb / --vvh los pone main.js cuando se abre el teclado del celular: el recuadro queda encima */
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px);
  width: min(100%, 560px);
  margin-inline: auto;
  max-height: 92vh; max-height: min(92svh, calc(var(--vvh, 100svh) * 0.92));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(to bottom, #1a1611, var(--bg-2));
  border: 1px solid var(--gold-line); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 0.75rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
}
.sheet__handle {
  display: block; margin: 0 auto 1rem;
  padding: 0.6rem 1.5rem;
  background: none; border: 0;
  touch-action: none;
  cursor: grab;
}
.sheet__handle i { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--gold-line); }
.sheet__form, .sheet__done { text-align: center; }
.sheet__title {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(2.6rem, 10vw, 3.4rem); line-height: 1.1;
  margin: 0 0 1.5rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; margin-bottom: 0.75rem; }
.field span { font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-dim); }
.field input {
  width: 100%;
  font: inherit; font-size: 1.15rem;
  color: var(--cream);
  background: rgba(243, 233, 215, 0.04);
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
}
.field input:focus { border-color: var(--gold); background: rgba(243, 233, 215, 0.07); }
.field input[aria-invalid="true"] { border-color: #e08a7a; }

.toggle {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 1.15rem; text-align: left;
  cursor: pointer; user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__box {
  flex: 0 0 auto;
  width: 44px; height: 26px; border-radius: 13px;
  border: 1px solid var(--gold-line);
  background: rgba(243, 233, 215, 0.05);
  position: relative;
  transition: background 0.3s, border-color 0.3s;
}
.toggle__box::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--cream-dim);
  transition: transform 0.35s var(--ease-out), background 0.3s;
}
.toggle input:checked + .toggle__box { background: rgba(217,183,122,0.25); border-color: var(--gold); }
.toggle input:checked + .toggle__box::after { transform: translateX(18px); background: var(--gold); }
.toggle input:focus-visible + .toggle__box { outline: 2px solid var(--gold); outline-offset: 3px; }

.partner { overflow: hidden; }
.sheet__error { min-height: 1.4em; margin: 0.25rem 0 0.75rem; color: #f0a494; font-size: 1rem; }
.sheet__submit { width: 100%; }
.sheet__done p { color: var(--cream-dim); font-size: 1.2rem; margin: 0 0 2rem; }
.sheet__dancers { width: 90px; margin: 0.5rem auto 1rem; }

/* Destellos al confirmar */
.spark {
  position: absolute; z-index: 3; pointer-events: none;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 10px 3px rgba(255, 207, 133, 0.6);
}
.spark--star { width: auto; height: auto; background: none; box-shadow: none; color: var(--gold); font-size: 14px; line-height: 1; text-shadow: 0 0 8px rgba(255, 207, 133, 0.8); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 4rem 1.5rem calc(5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(217,183,122,0.15);
}
.footer__orn { margin: 0 auto 1.5rem; }
.footer__names { font-family: var(--script); font-size: 2.8rem; margin: 0; }
.footer__date { font-family: var(--sans); letter-spacing: 0.4em; font-size: 0.75rem; color: var(--gold); margin: 0.5rem 0 0; }

/* ---------- Accesibilidad: sin animaciones ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint i, .gate__btn, .music-btn__bars i, .gild { animation: none; }
  .reveal { height: auto; }
  .reveal__sticky { position: relative; }
  .reveal__caption { opacity: 1; }
  .quote__text .word { opacity: 1; }
}
