/* =========================================================
   Boda Melissa & Ottoniel — paleta tomada de la invitación
   ========================================================= */
:root {
  --crema: #f7ecdf;
  --crema-2: #f1e0cc;
  --papel: #fbf5ec;
  --vino: #7b1a28;
  --vino-osc: #520c18;
  --oro: #b0823d;
  --oro-claro: #e2c07e;
  --oro-osc: #8a5f26;
  --tinta: #4a2c22;
  --tinta-suave: #6e5146;
  --grad-oro: linear-gradient(135deg, #8a5f26 0%, #d7b06a 35%, #f0d79a 50%, #c4974c 70%, #8a5f26 100%);
  --sombra: 0 18px 40px -18px rgba(82, 12, 24, .35);
  --script: "Great Vibes", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cinzel", Georgia, serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--crema);
  background-image:
    radial-gradient(ellipse at top, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(226,192,126,.18), transparent 60%);
  overflow-x: hidden;
}
body.sobre-cerrado { overflow: hidden; height: 100dvh; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.6em;
  border-radius: 999px; border: 0;
  font-family: var(--caps); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-dorado {
  background: var(--grad-oro); background-size: 200% 100%;
  color: #3d2410; box-shadow: 0 8px 22px -10px rgba(138,95,38,.8), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-dorado:hover { filter: brightness(1.06); }
.btn-vino { background: var(--vino); color: var(--crema); box-shadow: 0 8px 20px -12px var(--vino-osc); }
.btn-vino:hover { background: var(--vino-osc); }
.btn-borde-claro { border: 1px solid rgba(240,215,154,.7); color: #f6e6c5; background: rgba(0,0,0,.18); backdrop-filter: blur(4px); }
.btn-grande { width: 100%; padding: 1.05em; font-size: .85rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Sobre de apertura ---------- */
.sobre {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.12), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0,0,0,.35), transparent 55%),
    linear-gradient(160deg, #8e2232, var(--vino-osc) 60%, #3a0710);
  transition: opacity .9s ease, visibility .9s;
}
.sobre.abierto { opacity: 0; visibility: hidden; transition-delay: .5s; }
.sobre.abierto .sobre-tarjeta { transform: translateY(30px) scale(.96); transition-delay: .5s; }
.sobre.abierto .sobre-solapa { transform: rotateX(180deg); }
.sobre.abierto .sello, .sobre.abierto .sobre-toque { opacity: 0; transform: scale(.6); animation: none; }
.sobre-tarjeta {
  position: relative; width: min(100%, 380px);
  padding: 268px 28px 34px; text-align: center;
  perspective: 900px;
  background: var(--papel);
  border-radius: 6px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
  outline: 1px solid var(--oro); outline-offset: -10px;
  overflow: hidden;
  transition: transform .9s ease;
  animation: aparecer 1s ease both;
}
.sobre-solapa {
  position: absolute; top: 0; left: 0; width: 100%; height: 170px; overflow: visible;
  transform-origin: top center; transition: transform .7s ease;
  filter: drop-shadow(0 6px 6px rgba(82,12,24,.16));
}
.sobre-solapa path:first-child { fill: #f3e6d4; }
.sobre-solapa path:last-child { stroke: var(--oro); stroke-width: .5; vector-effect: non-scaling-stroke; }
.sobre-flores {
  position: absolute; top: 0; left: 0; width: 62%; z-index: 1;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 55%, transparent 80%);
          mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 55%, transparent 80%);
}
.sobre-pre { margin: 0; font-family: var(--caps); font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--oro-osc); }
.sobre-nombre { margin: .2em 0 .8em; font-family: var(--script); font-size: 2.4rem; line-height: 1.15; color: var(--vino); }
.sobre-toque {
  position: absolute; z-index: 2; top: 220px; left: 0; right: 0; margin: 0;
  font-style: italic; font-size: .95rem; color: var(--oro-osc);
  transition: opacity .3s ease, transform .3s ease;
}
.sobre-cupos {
  display: inline-block; margin: 0 0 16px; padding: 6px 16px; border-radius: 999px;
  background: var(--vino); color: var(--crema);
  font-family: var(--caps); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
.sello {
  position: absolute; z-index: 2; top: 128px; left: 50%; margin-left: -42px;
  width: 84px; height: 84px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  transition: opacity .3s ease, transform .3s ease;
  animation: latido 2.2s ease-in-out infinite;
  background: radial-gradient(circle at 35% 30%, #a3303f, var(--vino) 55%, #3f0811);
  box-shadow: 0 6px 14px -4px rgba(0,0,0,.5), inset 0 0 0 4px rgba(0,0,0,.12), inset 0 0 0 6px rgba(255,255,255,.08);
  color: var(--oro-claro); font-family: var(--script); font-size: 1.4rem;
}
.sello i { font-style: normal; font-size: .8em; margin: 0 1px; }
.sobre-nombres { margin: 0 0 22px; font-family: var(--caps); font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: var(--tinta-suave); }

/* ---------- Portada ---------- */
.portada { position: relative; height: 100svh; min-height: 560px; overflow: hidden; color: #fff8ec; }
.portada-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform: scale(1.06); transition: transform 6s ease-out; }
body:not(.sobre-cerrado) .portada-foto { transform: scale(1); }
.portada::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(40,10,10,.15) 0%, transparent 30%, transparent 45%, rgba(45,10,14,.75) 85%, rgba(45,10,14,.9) 100%);
}
.portada-texto { position: absolute; z-index: 1; left: 0; right: 0; bottom: 11vh; text-align: center; padding: 0 16px; }
.portada-pre { margin: 0; font-family: var(--caps); font-size: .78rem; letter-spacing: .35em; text-transform: uppercase; color: var(--oro-claro); }
.nombres { margin: .15em 0 .25em; font-family: var(--script); font-weight: 400; font-size: clamp(2.8rem, 12vw, 4.6rem); line-height: 1.02; }
.nombres span { display: block; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.nombres .y { font-size: .55em; color: var(--oro-claro); }
.portada-fecha { margin: 0; font-family: var(--caps); letter-spacing: .3em; font-size: .95rem; color: #f6e6c5; }
.bajar { position: absolute; z-index: 1; left: 50%; bottom: 18px; translate: -50% 0; color: var(--oro-claro); animation: flotar 2.2s ease-in-out infinite; }

/* ---------- Secciones ---------- */
.seccion { padding: 56px 16px; max-width: 600px; margin: 0 auto; }
.seccion-ancha { max-width: 900px; }
.titulo { margin: 0 0 .6em; text-align: center; font-family: var(--script); font-weight: 400; font-size: 2.7rem; line-height: 1.1; color: var(--vino); }
.subtitulo { margin: 0 0 .6em; text-align: center; font-family: var(--script); font-weight: 400; font-size: 2.1rem; color: var(--oro-osc); }

.marco {
  position: relative; padding: 48px 24px 40px; text-align: center;
  background: var(--papel);
  border: 1px solid rgba(176,130,61,.55);
  outline: 1px solid rgba(176,130,61,.35); outline-offset: 6px;
  border-radius: 4px; box-shadow: var(--sombra);
  overflow: visible;
}
.flores { position: absolute; pointer-events: none; }
.flores-tl {
  top: -26px; left: -22px; width: 58%; max-width: 260px;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 50%, transparent 78%);
          mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 50%, transparent 78%);
}
.flores-br {
  bottom: -24px; right: -18px; width: 30%; max-width: 140px;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 100% 100%, #000 52%, transparent 80%);
          mask-image: radial-gradient(ellipse 100% 100% at 100% 100%, #000 52%, transparent 80%);
}

.versiculo { position: relative; margin: 70px 0 0; font-family: var(--script); font-size: 2rem; line-height: 1.2; color: var(--vino); }
.versiculo cite { display: block; margin-top: .4em; font-family: var(--serif); font-style: normal; font-size: 1rem; color: var(--tinta-suave); }
.divisor { display: flex; justify-content: center; align-items: center; margin: 22px auto; color: var(--oro); }
.divisor span { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--oro), transparent); }
.divisor svg { filter: drop-shadow(0 1px 0 rgba(255,255,255,.6)); }
.historia { margin: 0 auto 1em; max-width: 30em; font-size: 1.12rem; }
.historia-invita { margin: 0; font-size: 1.15rem; font-style: italic; }
.historia-invita strong { font-family: var(--caps); font-style: normal; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: .95rem; color: var(--vino); }

/* ---------- Saludo personal ---------- */
.personal { text-align: center; padding-top: 8px; }
.personal-pre { margin: 0; font-family: var(--caps); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--oro-osc); }
.personal-nombre { margin: .1em 0 .3em; font-family: var(--script); font-size: clamp(2.4rem, 10vw, 3.3rem); line-height: 1.15; color: var(--vino); }
.personal-texto { margin: 0 auto 22px; max-width: 26em; font-style: italic; }
.cupos {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 128px; height: 128px; border-radius: 50%;
  background: var(--papel);
  border: 2px solid transparent;
  background-image: linear-gradient(var(--papel), var(--papel)), var(--grad-oro);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: var(--sombra);
}
.cupos-num { font-family: var(--caps); font-weight: 700; font-size: 2.8rem; line-height: 1; color: var(--vino); }
.cupos-label { font-family: var(--caps); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-suave); margin-top: 6px; text-align: center; line-height: 1.3; }

/* ---------- Fecha ---------- */
.fecha-banda { position: relative; overflow: hidden; color: #fff8ec; text-align: center; padding: 72px 16px; }
.fecha-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
.fecha-banda::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(58,7,16,.72), rgba(58,7,16,.62)); }
.fecha-contenido { position: relative; z-index: 2; max-width: 520px; margin: 0 auto; }
.fecha-pre { margin: 0 0 10px; font-family: var(--script); font-size: 2.3rem; color: var(--oro-claro); }
.fecha-placa {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 14px 26px;
  border-top: 1px solid rgba(226,192,126,.7); border-bottom: 1px solid rgba(226,192,126,.7);
  font-family: var(--caps); letter-spacing: .18em; text-transform: uppercase; font-size: .85rem;
}
.fecha-placa strong { font-size: 3rem; font-weight: 500; letter-spacing: 0; line-height: 1; color: var(--oro-claro); }
.contador { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 28px auto; max-width: 380px; }
.contador div { padding: 12px 4px; border-radius: 6px; background: rgba(255,248,236,.1); border: 1px solid rgba(226,192,126,.35); }
.contador b { display: block; font-family: var(--caps); font-weight: 500; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.contador small { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--oro-claro); }

/* ---------- Lugares ---------- */
.lugares { display: grid; gap: 22px; }
@media (min-width: 620px) { .lugares { grid-template-columns: 1fr 1fr; } }
.lugar {
  text-align: center; padding: 30px 20px 28px;
  background: var(--papel); border-radius: 4px;
  border: 1px solid rgba(176,130,61,.5); box-shadow: var(--sombra);
}
.lugar-icono { width: 54px; height: 54px; margin: 0 auto 4px; color: var(--oro); }
.lugar h3 { margin: 0; font-family: var(--script); font-weight: 400; font-size: 2.4rem; line-height: 1.15; color: var(--oro-osc); }
.lugar-hora { margin: 0 0 8px; font-family: var(--caps); font-weight: 700; font-size: 1.6rem; color: var(--vino); }
.lugar-nombre { margin: 0; font-weight: 600; font-size: 1.15rem; }
.lugar-dir { margin: 0 0 18px; color: var(--tinta-suave); }

/* ---------- Padrinos ---------- */
.padrinos { margin: 0; display: grid; gap: 14px; }
.padrinos div { display: grid; }
.padrinos dt { font-family: var(--caps); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--oro-osc); }
.padrinos dd { margin: 0; font-size: 1.15rem; }
.damas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; }
.damas li { font-size: 1.12rem; padding: 0 14px; }
.damas li + li { border-left: 1px solid rgba(176,130,61,.6); }

/* ---------- Galería ---------- */
.galeria { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; grid-auto-flow: dense; gap: 8px; }
@media (min-width: 620px) { .galeria { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 230px; } }
.galeria button { padding: 0; border: 0; border-radius: 4px; overflow: hidden; cursor: zoom-in; background: var(--crema-2); }
.galeria img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.galeria button:hover img { transform: scale(1.05); }
.g-alta { grid-row: span 2; }
.g-ancha { grid-column: span 2; }

.visor { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(25,6,9,.94); padding: 16px; }
.visor img { max-height: 88vh; max-width: 100%; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.visor button { position: absolute; border: 0; background: transparent; color: #f6e6c5; cursor: pointer; font-size: 2.6rem; line-height: 1; padding: 10px 14px; }
.visor-cerrar { top: 8px; right: 8px; }
.visor-prev { left: 4px; top: 50%; translate: 0 -50%; }
.visor-next { right: 4px; top: 50%; translate: 0 -50%; }

/* ---------- Regalo ---------- */
.regalo { text-align: center; color: var(--tinta); }
.regalo svg { margin: 0 auto 6px; color: var(--vino); }
.regalo p { margin: 0 auto; max-width: 28em; font-size: 1.1rem; font-style: italic; }

/* ---------- Confirmación ---------- */
.rsvp { padding-bottom: 96px; }
.rsvp-texto { margin: 0 0 6px; font-size: 1.15rem; }
.rsvp-texto strong { color: var(--vino); }
.rsvp-limite { margin: 0 0 6px; font-family: var(--caps); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--oro-osc); }
.opciones { border: 0; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.opciones legend { width: 100%; margin-bottom: 10px; font-family: var(--caps); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--tinta-suave); }
.opcion { position: relative; display: block; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; inset: 0; }
.opcion span {
  display: block; padding: 14px; border-radius: 999px;
  border: 1px solid rgba(176,130,61,.7); background: #fff;
  font-size: 1.12rem; font-weight: 600; transition: all .2s ease;
}
.opcion input:checked + span { background: var(--vino); border-color: var(--vino); color: var(--crema); box-shadow: 0 8px 20px -12px var(--vino-osc); }
.opcion input:focus-visible + span { outline: 2px solid var(--oro); outline-offset: 3px; }

.personas { margin-top: 24px; animation: aparecer .4s ease both; }
.personas-label { margin: 0 0 10px; font-family: var(--caps); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--tinta-suave); }
.stepper { display: inline-flex; align-items: center; gap: 18px; }
.stepper button {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--oro); background: #fff; color: var(--vino); font-size: 1.6rem; line-height: 1;
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 2ch; font-family: var(--caps); font-weight: 700; font-size: 2.6rem; color: var(--vino); }
.personas-max { margin: 6px 0 0; color: var(--tinta-suave); font-style: italic; }

.mensaje { display: block; margin: 24px 0 20px; text-align: left; }
.mensaje span { display: block; margin-bottom: 6px; font-family: var(--caps); font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: var(--tinta-suave); }
.mensaje small { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: .95rem; }
.mensaje textarea {
  width: 100%; padding: 12px 14px; resize: vertical;
  border: 1px solid rgba(176,130,61,.6); border-radius: 8px; background: #fff;
  font: inherit; font-size: 1.05rem; color: var(--tinta);
}
.mensaje textarea:focus { outline: 2px solid var(--oro-claro); border-color: var(--oro); }
.rsvp-error { margin: 0 0 14px; color: #a1122a; font-weight: 600; }

.gracias { color: var(--vino); animation: aparecer .5s ease both; }
.gracias svg { margin: 6px auto 8px; color: var(--oro); }
.gracias-titulo { margin: 0; font-family: var(--script); font-size: 2.4rem; line-height: 1.2; }
.gracias-texto { margin: 6px 0 18px; color: var(--tinta); font-size: 1.12rem; }
.enlace { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--oro-osc); text-decoration: underline; text-underline-offset: 3px; font-size: 1rem; }

/* ---------- Cierre ---------- */
.cierre { position: relative; min-height: 80svh; display: grid; align-items: end; overflow: hidden; color: #fff8ec; text-align: center; margin-top: 30px; }
.cierre-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.cierre::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(transparent 35%, rgba(45,10,14,.85)); }
.cierre-texto { position: relative; z-index: 2; padding: 0 16px 56px; }
.cierre-script { margin: 0; font-family: var(--script); font-size: 3.2rem; line-height: 1.1; color: var(--oro-claro); }
.cierre-nombres { margin: 4px 0; font-family: var(--caps); letter-spacing: .25em; text-transform: uppercase; }
.cierre-fecha { margin: 0; font-family: var(--caps); letter-spacing: .3em; font-size: .85rem; color: #f6e6c5; }

/* ---------- Música ---------- */
.musica {
  position: fixed; z-index: 40; right: 16px; bottom: 16px;
  width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--vino); color: var(--oro-claro); box-shadow: 0 10px 24px -10px rgba(0,0,0,.6);
}
.musica.sonando svg { animation: girar 4s linear infinite; }

/* ---------- Animaciones ---------- */
.revelar { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s ease; }
.revelar.visible { opacity: 1; transform: none; }
@keyframes aparecer { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes flotar { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes latido { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { opacity: 1; transform: none; }
}
