/* ═══════════ Boda Civil · Marbella & Teodoro ═══════════ */

:root {
  --marfil: #f6f1e7;
  --crema: #ece4d4;
  --verde: #243126;
  --verde-medio: #4a5b47;
  --salvia: #8c9a7e;
  --terracota: #9c4a2f;
  --arena: #c9a876;
  --arena-clara: #e3c998;
  --texto: #262a24;
  --texto-suave: #4a4f45;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --script: 'Pinyon Script', cursive;
  --sans: 'Jost', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--marfil);
  color: var(--texto);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, ol { margin: 0; padding: 0; }

.contenedor {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
}

.seccion { padding: 96px 0; position: relative; }
.crema { background: var(--crema); }
.oscura { background: var(--verde); color: var(--marfil); }

/* ── tipografía común ── */
.etiqueta {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--terracota);
}
.oscura .etiqueta { color: var(--arena-clara); }

.titulo {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(36px, 9.5vw, 54px);
  line-height: 1.12;
  margin: 14px 0 26px;
  color: var(--verde);
  text-wrap: balance;
}
.oscura .titulo { color: var(--marfil); }

.texto { margin: 0 auto 18px; max-width: 480px; text-wrap: pretty; }
.texto em { font-family: var(--serif); font-size: 1.25em; color: var(--terracota); }
.texto strong, .nota-civil strong { font-weight: 500; }
.nota { font-size: 16px; color: var(--texto-suave); letter-spacing: .04em; }

.rama { width: 150px; height: 45px; color: var(--salvia); display: block; margin: 0 auto 22px; }
.oscura .rama { color: var(--arena); }

.linea-fina { width: 44px; height: 1px; background: var(--arena); margin: 22px auto; }

/* ── botones ── */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 30px;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s;
  -webkit-tap-highlight-color: transparent;
}
.btn-oscuro { background: var(--verde); color: var(--marfil); border-color: var(--verde); }
.btn-oscuro:hover { background: var(--verde-medio); border-color: var(--verde-medio); }
.btn-linea-clara { background: transparent; color: var(--marfil); border-color: rgba(246, 241, 231, .6); }
.btn-linea-clara:hover { background: var(--marfil); color: var(--verde); }

/* ═══════════ PORTADA ═══════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 70px 24px 90px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, #fffaf0 0%, transparent 60%),
    var(--marfil);
}
.hero-marco { position: absolute; inset: 14px; border: 1px solid rgba(156, 74, 47, .3); pointer-events: none; }
.hero .rama { width: 190px; height: 57px; }
.rama-arriba { margin-bottom: 30px; }
.rama-abajo { transform: scale(-1, -1); margin: 30px auto 0; }

.hero-nombres {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(54px, 16.5vw, 104px);
  line-height: .98;
  color: var(--verde);
  margin: 22px 0 34px;
  display: flex; flex-direction: column; align-items: center;
}
.hero-nombres .amp {
  font-style: italic;
  font-size: .5em;
  color: var(--terracota);
  line-height: 1.2;
  margin: .04em 0 0;
}

.fecha-bloque {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  color: var(--verde);
}
.fecha-lado {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
  padding: 9px 0; width: 118px;
  border-top: 1px solid var(--arena); border-bottom: 1px solid var(--arena);
}
.fecha-dia { font-family: var(--serif); font-weight: 400; font-size: 64px; line-height: 1; }
.hero-anio { margin-top: 16px; font-size: 14px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--texto-suave); }

.hero-scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--texto-suave);
}
.hero-scroll i { width: 1px; height: 30px; background: var(--terracota); animation: caer 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes caer { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ═══════════ MENSAJE ═══════════ */
.numero-grande {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(120px, 38vw, 200px);
  line-height: .8;
  color: var(--terracota);
  margin-bottom: 18px;
}
.mensaje .etiqueta { color: var(--texto-suave); max-width: 300px; margin: 0 auto; line-height: 2; }
.mensaje .titulo { margin-top: 0; }
.firma { font-family: var(--script); font-size: 44px; color: var(--verde); margin-top: 22px; line-height: 1.2; }

.fotos {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 60px;
}
.arco {
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  aspect-ratio: 1 / 1.2;
  background: var(--crema);
  box-shadow: 0 0 0 1px var(--arena), 0 0 0 6px var(--marfil), 0 0 0 7px rgba(201, 168, 118, .5);
}
.arco img {
  width: 100%; height: 100%; object-fit: cover;
  /* tono cálido uniforme para fotos de distinto origen */
  filter: grayscale(1) sepia(.28) contrast(1.05) brightness(1.04);
}
.arco-lado { margin-bottom: 26px; }

/* ═══════════ CUENTA REGRESIVA ═══════════ */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); margin: 34px auto 44px; max-width: 440px; }
.cd-item { display: flex; flex-direction: column; align-items: center; border-left: 1px solid rgba(201, 168, 118, .35); }
.cd-item:first-child { border-left: 0; }
.cd-num { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 13vw, 66px); line-height: 1; font-variant-numeric: tabular-nums; }
.cd-label { font-size: 12.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--arena-clara); margin-top: 10px; }

/* ═══════════ DÓNDE ═══════════ */
.tarjeta {
  border: 1px solid var(--arena);
  padding: 44px 24px 46px;
  position: relative;
  background: #fbf8f1;
}
.tarjeta::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(201, 168, 118, .4); pointer-events: none; }
.tarjeta-fecha { font-size: 14px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--texto-suave); }
.tarjeta-hora { font-family: var(--serif); font-weight: 500; font-size: 58px; line-height: 1.1; color: var(--terracota); margin-top: 8px; }
.tarjeta-lugar { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 31px; line-height: 1.15; color: var(--verde); }
.tarjeta-nota { font-size: 16px; color: var(--texto-suave); margin: 8px 0 30px; }
.nota-civil { margin-top: 34px; font-size: 17px; color: var(--texto-suave); }

/* ═══════════ PROGRAMA ═══════════ */
.linea-tiempo {
  list-style: none;
  max-width: 440px;
  margin: 26px auto 0;
  position: relative;
}
.linea-tiempo::before { content: ''; position: absolute; left: 50%; top: 30px; bottom: 30px; width: 1px; background: var(--arena); }
.linea-tiempo li { display: grid; grid-template-columns: 1fr 58px 1fr; column-gap: 16px; align-items: center; padding: 10px 0; position: relative; }
.linea-tiempo .paso { grid-column: 2; grid-row: 1 / span 2; width: 58px; height: 58px; }
.linea-tiempo .paso svg { width: 29px; height: 29px; }
.linea-tiempo time, .linea-tiempo span { grid-column: 1; text-align: right; }
.linea-tiempo li:nth-child(even) time, .linea-tiempo li:nth-child(even) span { grid-column: 3; text-align: left; }
.linea-tiempo time { grid-row: 1; align-self: end; }
.linea-tiempo span { grid-row: 2; align-self: start; margin-top: 5px; line-height: 1.25; }
.paso {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--marfil); color: var(--terracota);
  border: 1px solid var(--arena);
  position: relative; z-index: 1;
  transform: scale(.4); opacity: 0;
  transition: transform .7s cubic-bezier(.3, 1.6, .5, 1) .15s, opacity .5s ease .15s;
}
.paso svg { width: 24px; height: 24px; }
.linea-tiempo li.visible .paso { transform: none; opacity: 1; }
.linea-tiempo li:last-child .paso { background: var(--terracota); color: var(--marfil); border-color: var(--terracota); animation: latir 2.4s ease-in-out infinite 1s; }
@keyframes latir { 0%, 100% { box-shadow: 0 0 0 0 rgba(156, 74, 47, .35); } 50% { box-shadow: 0 0 0 10px rgba(156, 74, 47, 0); } }
.linea-tiempo time { font-family: var(--serif); font-size: 31px; font-weight: 500; line-height: 1; color: var(--terracota); font-variant-numeric: tabular-nums; white-space: nowrap; }
.linea-tiempo time small { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin-left: 5px; }
.linea-tiempo span { font-size: 17.5px; color: var(--verde); }
.linea-tiempo li:last-child span { font-family: var(--serif); font-style: italic; font-size: 27px; line-height: 1; }

/* ═══════════ VESTIMENTA ═══════════ */
.vestimenta .titulo { font-size: clamp(48px, 13vw, 70px); margin-bottom: 14px; }
.estilos { list-style: none; padding: 0; margin: 30px auto 0; max-width: 440px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.estilos li { display: grid; justify-items: center; gap: 12px; }
.estilos .paso { width: 64px; height: 64px; }
.estilos svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.vestimenta .visible .paso { transform: none; opacity: 1; }
.estilos li:nth-child(2) .paso { transition-delay: .3s; }
.estilos li:nth-child(3) .paso { transition-delay: .45s; }
.estilos h3 { margin: 0; font: 500 24px/1.1 var(--serif); color: var(--verde); }
.paleta { display: flex; justify-content: center; gap: 12px; margin: 28px 0 22px; }
.paleta i { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px var(--marfil), 0 0 0 2px var(--arena); }

/* ═══════════ REGALOS ═══════════ */
.regalos .titulo { font-size: clamp(32px, 8.4vw, 46px); }
.regalos .texto { margin-bottom: 0; }
.regalos .texto + .texto { margin-top: 16px; }

/* ═══════════ RSVP ═══════════ */
.rsvp-form { margin-top: 34px; text-align: left; display: grid; gap: 22px; }
.rsvp-form label { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--texto-suave); display: grid; gap: 8px; }
.rsvp-form small { letter-spacing: .04em; text-transform: none; font-size: 13px; font-weight: 400; }
.rsvp-form input[type=text], .rsvp-form select, .rsvp-form textarea {
  width: 100%;
  font: 400 18px/1.4 var(--sans);
  letter-spacing: 0; text-transform: none;
  color: var(--verde);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--arena);
  border-radius: 0;
  padding: 10px 2px;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.rsvp-form textarea { border: 1px solid var(--arena); padding: 12px; resize: vertical; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { border-color: var(--terracota); }
.rsvp-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsvp-form .opcion { display: block; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; }
.opcion span {
  display: block; text-align: center;
  padding: 15px 8px;
  border: 1px solid var(--arena);
  font-size: 13px; letter-spacing: .08em; color: var(--verde);
  transition: background .25s, color .25s, border-color .25s;
}
.opcion input:checked + span { background: var(--verde); border-color: var(--verde); color: var(--marfil); }
.opcion input:focus-visible + span { outline: 2px solid var(--terracota); outline-offset: 2px; }
.rsvp-form .btn { width: 100%; margin-top: 6px; }

/* ═══════════ CIERRE ═══════════ */
.cierre { padding: 110px 0 120px; }
.cierre-frase { font-size: 13.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--terracota); }
.cierre-nombres { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(40px, 11vw, 60px); line-height: 1.15; color: var(--verde); margin: 12px 0 18px; }
.cierre-nombres span { color: var(--terracota); }
.cierre .etiqueta { color: var(--texto-suave); }

/* ═══════════ HOJAS CAYENDO ═══════════ */
.hojas { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.hoja {
  position: absolute; top: -40px;
  width: 16px; height: 8px;
  border-radius: 100% 0 100% 0;
  opacity: 0;
  animation: caer-hoja linear infinite;
}
@keyframes caer-hoja {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--opacidad); }
  25%  { transform: translate3d(calc(var(--deriva) * .6), 27vh, 0) rotate(140deg); }
  50%  { transform: translate3d(calc(var(--deriva) * -.3), 54vh, 0) rotate(250deg); }
  75%  { transform: translate3d(calc(var(--deriva) * .8), 80vh, 0) rotate(400deg); }
  92%  { opacity: var(--opacidad); }
  100% { transform: translate3d(var(--deriva), 108vh, 0) rotate(520deg); opacity: 0; }
}

/* ramas que se mecen */
.rama { transform-origin: 50% 80%; animation: mecer 6s ease-in-out infinite; }
.rama-abajo { animation-name: mecer-abajo; }
@keyframes mecer { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@keyframes mecer-abajo { 0%, 100% { rotate: 2.5deg; } 50% { rotate: -2.5deg; } }

/* entrada escalonada de la portada */
.hero .reveal:nth-child(2) { transition-delay: .15s; }
.hero .reveal:nth-child(3) { transition-delay: .35s; }
.hero .reveal:nth-child(4) { transition-delay: .6s; }
.hero .reveal:nth-child(5) { transition-delay: .75s; }
.hero .reveal:nth-child(6) { transition-delay: .9s; }

/* segundos de la cuenta regresiva con pulso */
#cdSeg { animation: pulso 1s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ═══════════ MÚSICA ═══════════ */
.musica-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--arena);
  background: var(--marfil); color: var(--verde);
  font-size: 18px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(36, 49, 38, .18);
}
.musica-btn.silencio { opacity: .55; text-decoration: line-through; }

/* ═══════════ ANIMACIÓN DE ENTRADA ═══════════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.visible { opacity: 1; transform: none; }
.rama-abajo.reveal { transform: scale(-1, -1) translateY(22px); }
.rama-abajo.reveal.visible { transform: scale(-1, -1); }


/* ═══════════ ANIMACIONES AL DESLIZAR ═══════════ */
/* las entradas laterales no deben generar scroll horizontal en móvil */
html, body { overflow-x: clip; }
.seccion { overflow-x: clip; }
/* barra de avance */
.avance { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; background: var(--arena); transform: scaleX(var(--avance, 0)); transform-origin: left; pointer-events: none; }

/* portada se aleja al deslizar */
.hero-contenido { translate: 0 calc(var(--hero, 0) * -70px); opacity: calc(1 - var(--hero, 0) * 1.15); }
.hero-marco { scale: calc(1 - var(--hero, 0) * .04); }

/* títulos: se enfocan */
.titulo.reveal { filter: blur(8px); letter-spacing: .06em; transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1), filter 1.1s ease, letter-spacing 1.3s ease; }
.titulo.reveal.visible { filter: none; letter-spacing: 0; }

/* fotos: suben una por una, luego flotan con el scroll */
.fotos.reveal { opacity: 1; transform: none; }
.fotos .arco { opacity: 0; transform: translateY(60px) scale(.9); transition: opacity 1s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1); translate: 0 calc(var(--flota, 0) * 1px); }
.fotos .arco img { transform: scale(1.25); transition: transform 1.8s cubic-bezier(.2, .7, .2, 1); }
.fotos.visible .arco { opacity: 1; transform: none; }
.fotos.visible .arco img { transform: none; }
.fotos .arco:nth-child(1) { transition-delay: .2s; }
.fotos .arco:nth-child(3) { transition-delay: .4s; }

/* cuenta regresiva: números suben en cascada */
.cuenta .cd-item { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.cuenta .visible .cd-item { opacity: 1; transform: none; }
.cuenta .cd-item:nth-child(2) { transition-delay: .12s; }
.cuenta .cd-item:nth-child(3) { transition-delay: .24s; }
.cuenta .cd-item:nth-child(4) { transition-delay: .36s; }

/* tarjeta: se abre */
.tarjeta.reveal { transform: scale(.92) translateY(30px); }
.tarjeta.reveal.visible { transform: none; }

/* programa: la línea se dibuja y cada paso entra desde su lado */
.linea-tiempo::before { transform: scaleY(var(--linea, 0)); transform-origin: top; }
.linea-tiempo li.reveal { opacity: 1; transform: none; }
.linea-tiempo time, .linea-tiempo span { opacity: 0; transform: translateX(-34px); transition: opacity .8s ease .2s, transform .9s cubic-bezier(.2, .8, .2, 1) .2s; }
.linea-tiempo li:nth-child(even) time, .linea-tiempo li:nth-child(even) span { transform: translateX(34px); }
.linea-tiempo li.visible time, .linea-tiempo li.visible span { opacity: 1; transform: none; }
.linea-tiempo span { transition-delay: .32s; }

/* vestimenta: nombres en cascada */
.estilos h3 { opacity: 0; transform: translateY(12px); transition: opacity .7s ease .35s, transform .7s ease .35s; }
.vestimenta .visible .estilos h3 { opacity: 1; transform: none; }
.estilos li:nth-child(2) h3 { transition-delay: .5s; }
.estilos li:nth-child(3) h3 { transition-delay: .65s; }

@media (prefers-reduced-motion: reduce) {
  .avance { display: none; }
  .hero-contenido, .hero-marco, .fotos .arco { translate: none; scale: none; opacity: 1; }
  .titulo.reveal { filter: none; letter-spacing: 0; }
  .fotos .arco, .fotos .arco img, .cuenta .cd-item, .linea-tiempo time, .linea-tiempo span, .estilos h3 { opacity: 1; transform: none; transition: none; }
  .linea-tiempo::before { transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rama-abajo.reveal { transform: scale(-1, -1); }
  .hero-scroll i, .rama, #cdSeg, .paso { animation: none !important; }
  .paso { transform: none; opacity: 1; transition: none; }
  .hojas { display: none; }
  html { scroll-behavior: auto; }
}

/* ═══════════ PANTALLAS GRANDES ═══════════ */
@media (min-width: 720px) {
  .seccion { padding: 130px 0; }
  .fotos { gap: 22px; }
  .fecha-lado { width: 150px; }
}

.rsvp-aviso { margin: 0; text-align: center; font-size: 16px; color: var(--terracota); }

.hero-hora { display: block; margin-top: 14px; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--terracota); }

/* ═══════════ PANTALLAS ANGOSTAS ═══════════ */
@media (max-width: 420px) {
  .firma { font-size: clamp(30px, 9.6vw, 40px); white-space: nowrap; }
  .fecha-bloque { gap: 12px; }
  .fecha-lado { width: 98px; font-size: 12px; letter-spacing: .16em; }
  .fecha-dia { font-size: 54px; }
}
