:root {
  --tinta: #141012;
  --papel: #f6f2ec;
  --vino: #4a1220;
  --vino-2: #6e1f33;
  --vino-luz: #c9a0a6;
  --gris: #8b847e;
  --linea-osc: rgba(246, 242, 236, .22);
  --linea-clr: rgba(20, 16, 18, .16);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --guion: "Pinyon Script", cursive;
  --ancho: 480px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--tinta);
  background: #0a0809;
  -webkit-font-smoothing: antialiased;
}
body.cerrado { overflow: hidden; height: 100svh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.invitacion {
  max-width: var(--ancho);
  margin: 0 auto;
  background: var(--papel);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, .6);
  container-type: inline-size;   /* las letras se escalan con el ancho de la invitación, no de la pantalla */
  position: relative;
}
section, footer { position: relative; padding: 88px clamp(18px, 7.5cqi, 32px); text-align: center; }

/* En pantallas anchas (compu, tablet): fondo con la foto difuminada a los lados */
@media (min-width: 600px) {
  body::before {
    content: ""; position: fixed; inset: -40px; z-index: -1;
    background: url("fotos/bosque-2.jpg") center / cover no-repeat;
    filter: grayscale(1) blur(3px) brightness(.34);
  }
  body { background: #0a0809; }
  .invitacion { margin: 0 auto; }
}
.oscuro { background: var(--tinta); color: var(--papel); }
.vino { background: radial-gradient(140% 90% at 50% 0%, var(--vino-2), var(--vino) 55%, #2c0a13); color: var(--papel); }
.claro { background: var(--papel); color: var(--tinta); }

/* ----- Tipografía ----- */
.titulo {
  font-weight: 400;
  font-size: clamp(28px, 11cqi, 56px);
  line-height: .95;
  letter-spacing: .12em;
  padding-left: .12em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.guion { font-family: var(--guion); font-weight: 400; text-transform: none; letter-spacing: 0; }
.titulo-guion { font-size: clamp(32px, 11.5cqi, 52px); line-height: 1.05; margin-bottom: 8px; }
.claro .titulo-guion { color: var(--vino-2); }
.oscuro .titulo-guion { color: var(--vino-luz); }
.etiqueta, .mini, small {
  font-size: 13px;
  letter-spacing: .38em;
  text-transform: uppercase;
}
.nota { max-width: 34ch; margin: 0 auto 20px; font-size: 19px; font-style: italic; opacity: .88; }

/* ----- Sobre de entrada ----- */
.sobre {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  color: var(--papel);
  cursor: pointer;
  outline: none;
}
.sobre-mitad {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: radial-gradient(120% 90% at 50% 100%, #221a1d, #0b0809);
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
.sobre-mitad.arriba { top: 0; border-bottom: 1px solid var(--linea-osc); }
.sobre-mitad.abajo { bottom: 0; transform: scaleY(-1); }
.sobre-centro { position: relative; text-align: center; transition: opacity .6s, transform .8s; }
.sello {
  width: 144px; height: 144px; margin: 26px auto;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, #a4485c, var(--vino-2) 45%, var(--vino) 80%);
  color: #f3dfe2;
  font-family: var(--guion); font-size: 30px; line-height: 1; white-space: nowrap; padding: 0 18px 4px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7), inset 0 0 0 9px rgba(0, 0, 0, .12), inset 0 0 0 10px rgba(255, 255, 255, .12), inset 0 -8px 18px rgba(0, 0, 0, .35);
  animation: latido 2.6s ease-in-out infinite;
}
.toca { font-style: italic; opacity: .75; animation: parpadeo 2.6s ease-in-out infinite; }
.sobre.abierto { pointer-events: none; }
.sobre.abierto .sobre-centro { opacity: 0; transform: scale(1.15); }
.sobre.abierto .arriba { transform: translateY(-101%); }
.sobre.abierto .abajo { transform: scaleY(-1) translateY(-101%); }
@keyframes latido { 50% { transform: scale(1.05); } }
@keyframes parpadeo { 50% { opacity: .35; } }

/* ----- Fotos ----- */
.foto-fondo, .foto-marco { background: #1d1d1d center / cover no-repeat; position: relative; }
.vacia { background-image: linear-gradient(160deg, #3a3a3a, #121212); }
.foto-fondo { position: absolute; inset: 0; filter: grayscale(1); background-position: 50% 30%; }
.foto-fondo::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,18,.45) 0%, rgba(20,16,18,0) 22%, rgba(20,16,18,.15) 45%, rgba(20,16,18,.82) 70%, var(--tinta) 100%);
}
.foto-marco {
  width: min(78%, 300px); aspect-ratio: 2 / 3; margin: 0 auto 44px;
  filter: grayscale(1);
  outline: 1px solid var(--linea-osc); outline-offset: 10px;
}

/* ----- Portada ----- */
.portada {
  min-height: max(100svh, 620px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 96px;
}
.portada-texto { position: relative; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.portada .etiqueta {
  font-size: clamp(15px, 4.6cqi, 19px);
  letter-spacing: .42em; padding-left: .42em;
  color: #ead9bd;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 22px rgba(0, 0, 0, .55);
}
.nombres { font-weight: 400; margin: 18px 0 22px; line-height: .9; }
.nombre {
  display: block;
  font-size: clamp(38px, 15cqi, 72px);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding-left: .12em;
}
.nombres .y { display: block; font-size: clamp(44px, 16cqi, 76px); line-height: .8; margin: 4px 0 8px; color: var(--vino-luz); }
.fecha-corta { font-size: 17px; letter-spacing: .32em; text-transform: uppercase; }
.ciudad { font-style: italic; opacity: .78; margin-top: 4px; }
.bajar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; }
.bajar small { font-size: 10px; letter-spacing: .42em; padding-left: .42em; opacity: .8; color: #ead9bd; animation: parpadeo 2.6s ease-in-out infinite; }
.bajar-linea { position: relative; width: 1px; height: 40px; background: var(--linea-osc); overflow: hidden; }
.bajar-linea span { position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: var(--papel); animation: bajar 2s ease-in-out infinite; }
@keyframes bajar { to { top: 100%; } }

.letras .l { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(6px); }
body.listo .letras .l { animation: letra .9s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms + 500ms); }
@keyframes letra { to { opacity: 1; transform: none; filter: none; } }

/* ----- Cuenta regresiva ----- */
.cuenta { padding-top: 56px; }
.contador {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--linea-osc); border-bottom: 1px solid var(--linea-osc);
  margin-top: 18px;
}
.contador div { padding: 18px 0 14px; }
.contador div + div { border-left: 1px solid var(--linea-osc); }
.contador b { display: block; font-weight: 300; font-size: clamp(26px, 10cqi, 46px); line-height: 1; font-variant-numeric: tabular-nums; }
.contador small { font-size: 11px; opacity: .6; letter-spacing: .25em; }

/* ----- Fecha ----- */
.calendario {
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: clamp(8px, 3cqi, 14px);
  margin: 8px 0 4px;
}
.cal-lado {
  font-size: clamp(11px, 3.6cqi, 15px); letter-spacing: clamp(.12em, 1.2cqi, .3em); text-transform: uppercase;
  border-top: 1px solid var(--linea-clr); border-bottom: 1px solid var(--linea-clr);
  padding: 8px 0;
}
.cal-dia { font-size: clamp(78px, 30cqi, 132px); font-weight: 300; line-height: .9; color: var(--vino-2); }
.anio { font-size: 17px; letter-spacing: .5em; padding-left: .5em; margin-bottom: 34px; }

/* ----- Botones ----- */
.botones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.boton {
  display: inline-block;
  padding: 12px 20px;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  border: 1px solid currentColor;
  color: inherit; text-decoration: none;
  transition: background .3s, color .3s, border-color .3s;
}
.claro .boton:hover, .claro .boton:focus-visible { background: var(--tinta); color: var(--papel); }
.oscuro .boton:hover, .oscuro .boton:focus-visible, .vino .boton:hover, .vino .boton:focus-visible { background: var(--papel); color: var(--vino); }
.boton.lleno { background: var(--vino); color: var(--papel); border-color: var(--vino); }
.claro .boton.lleno:hover, .claro .boton.lleno:focus-visible { background: var(--vino-2); border-color: var(--vino-2); }
.boton.solido { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.claro .boton.solido:hover, .claro .boton.solido:focus-visible { background: var(--vino); border-color: var(--vino); }
.boton svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.boton.grande { width: 100%; padding: 17px; }
.agendar { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gris); margin-bottom: 12px; }
.fecha .botones .boton { flex: 1 1 150px; max-width: 200px; padding: 14px 12px; }
.boton:disabled { opacity: .55; cursor: wait; }

/* ----- Canción ----- */
.tema { font-size: 14px; letter-spacing: .32em; text-transform: uppercase; opacity: .85; margin-bottom: 30px; }
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: #000; outline: 1px solid var(--linea-osc); outline-offset: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.video iframe, .video > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ----- Versículo ----- */
blockquote p { font-style: italic; font-size: 21px; line-height: 1.5; max-width: 32ch; margin: 0 auto; }
blockquote cite { display: block; font-size: 40px; margin-top: 16px; font-style: normal; color: var(--vino-luz); }

/* ----- Lugar + itinerario ----- */
.lugar-tarjeta {
  max-width: 340px; margin: 0 auto 56px; padding: 28px 20px;
  border: 1px solid var(--linea-clr);
  display: grid; gap: 4px; justify-items: center;
}
.lugar-tarjeta small { color: var(--gris); font-size: 11px; }
.lugar-tarjeta strong { font-weight: 400; font-size: 28px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.2; }
.lugar-tarjeta span { font-style: italic; margin-bottom: 16px; }
.linea { list-style: none; position: relative; max-width: 320px; margin: 0 auto; }
.linea li {
  display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; column-gap: 14px;
  padding: 0 0 26px; position: relative;
}
.linea li::after {
  content: ""; position: absolute; left: 50%; top: 22px; bottom: -4px; width: 1px;
  background: var(--linea-clr); transform: translateX(-50%);
}
.linea li:last-child::after { display: none; }
.linea li:last-child { padding-bottom: 0; }
.linea .hora { text-align: right; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: var(--gris); }
.linea .punto {
  width: 11px; height: 11px; justify-self: center; border-radius: 50%;
  background: var(--papel); border: 1px solid var(--vino-2); box-shadow: 0 0 0 4px var(--papel);
  position: relative; z-index: 1;
}
.linea .que { text-align: left; }
.linea h3 { font-family: var(--guion); font-weight: 400; font-size: 32px; line-height: 1.15; color: var(--vino-2); }
.linea .detalle { font-size: 14px; font-style: italic; color: var(--gris); line-height: 1.2; }

/* ----- Vestimenta ----- */
.tipo { font-size: 24px; letter-spacing: .36em; text-transform: uppercase; padding-left: .36em; margin-bottom: 16px; }
.muestras { list-style: none; display: flex; justify-content: center; gap: clamp(4px, 2cqi, 10px); margin-top: 8px; }
.muestras li { width: min(58px, 17cqi); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; line-height: 1.3; }
.muestras i {
  display: block; width: min(46px, 12cqi); aspect-ratio: 1; margin: 0 auto 10px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--linea-osc), 0 0 0 5px var(--tinta), 0 0 0 6px var(--linea-osc);
}

/* ----- Regalo ----- */
.tarjeta-sinpe {
  max-width: 320px; margin: 8px auto 0; padding: 30px 22px;
  border: 1px solid var(--linea-osc); background: rgba(0, 0, 0, .12);
  display: grid; gap: 6px; justify-items: center;
}
.tarjeta-sinpe small { opacity: .7; }
.tarjeta-sinpe strong { font-weight: 400; font-size: 42px; letter-spacing: .08em; margin-bottom: 4px; }
.tarjeta-sinpe span { font-style: italic; margin-bottom: 10px; }
.tarjeta-sinpe span:empty { display: none; }

/* ----- RSVP ----- */
.formulario { max-width: 380px; margin: 30px auto 0; text-align: left; display: grid; gap: 22px; }
.formulario > label, .formulario legend, .sub { display: grid; gap: 6px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; }
.opcional { letter-spacing: 0; text-transform: none; font-style: italic; color: var(--gris); }
.formulario input:not([type=radio]), .formulario textarea {
  font: inherit; font-size: 19px; letter-spacing: 0; text-transform: none;
  width: 100%; padding: 10px 2px;
  background: transparent; color: var(--tinta);
  border: 0; border-bottom: 1px solid var(--linea-clr); border-radius: 0;
  outline: none; transition: border-color .3s;
}
.formulario input:focus, .formulario textarea:focus { border-bottom-color: var(--vino-2); }
.formulario textarea { resize: vertical; }
.opciones { border: 0; display: grid; gap: 10px; }
.opciones legend { margin-bottom: 10px; }
.opciones label { display: block; font-size: 19px; }
.opciones input { position: absolute; opacity: 0; }
.opciones span { display: block; padding: 12px 16px; border: 1px solid var(--linea-clr); cursor: pointer; transition: all .25s; }
.opciones input:checked + span { background: var(--vino); color: var(--papel); border-color: var(--vino); }
.opciones input:focus-visible + span { outline: 2px solid var(--vino-luz); outline-offset: 2px; }
.acompanantes { display: grid; gap: 10px; }
.acompanantes ol { list-style: none; display: grid; gap: 8px; counter-reset: p; }
.acompanantes li { display: grid; grid-template-columns: 24px 1fr 36px; align-items: end; gap: 6px; counter-increment: p; }
.acompanantes li::before { content: counter(p) "."; color: var(--gris); padding-bottom: 12px; font-size: 16px; }
.quitar { width: 36px; height: 40px; font-size: 24px; line-height: 1; color: var(--gris); }
.quitar:hover { color: var(--vino-2); }
.agregar {
  justify-self: start; padding: 10px 0;
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--vino-2);
  border-bottom: 1px solid currentColor;
}
.agregar:disabled { opacity: .4; cursor: default; }
.estado { text-align: center; font-style: italic; min-height: 1.5em; }
.estado.error { color: #9b1c2e; }
.gracias { margin-top: 30px; }
.gracias .guion { font-size: 64px; line-height: 1; color: var(--vino-2); margin-bottom: 10px; }

/* ----- Pie ----- */
.pie { padding: 70px 28px 90px; }
.pie .guion { font-size: 50px; line-height: 1.1; color: var(--vino-luz); }
.pie .mini { opacity: .5; margin-top: 10px; }

/* ----- Música flotante ----- */
.musica {
  position: fixed; z-index: 40; right: max(16px, calc(50vw - var(--ancho) / 2 + 16px)); bottom: 18px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(74, 18, 32, .9); color: var(--papel);
  border: 1px solid var(--linea-osc);
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.barras { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.barras i { width: 3px; height: 100%; background: currentColor; animation: barra 1s ease-in-out infinite; transform-origin: bottom; }
.barras i:nth-child(2) { animation-delay: -.4s; }
.barras i:nth-child(3) { animation-delay: -.7s; }
.musica.pausa .barras i { animation: none; transform: scaleY(.3); }
@keyframes barra { 50% { transform: scaleY(.3); } }

/* ----- Aviso ----- */
.aviso {
  position: fixed; z-index: 60; left: 50%; bottom: 80px; transform: translate(-50%, 20px);
  background: var(--papel); color: var(--tinta); padding: 10px 18px;
  font-size: 15px; letter-spacing: .1em; opacity: 0; pointer-events: none; transition: all .35s;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.aviso.ver { opacity: 1; transform: translate(-50%, 0); }

/* ----- Aparición al hacer scroll ----- */
.revelar { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.revelar.en { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar, .letras .l { opacity: 1; transform: none; filter: none; }
}

/* ----- Bosque y adornos ----- */
.bosque { isolation: isolate; }
.bosque::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--img) center / cover no-repeat;
  filter: grayscale(1) contrast(1.05); opacity: .34;
}
.bosque::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--tinta) 0%, rgba(20,16,18,.35) 30%, rgba(20,16,18,.35) 70%, var(--tinta) 100%);
}
.bosque-a { --img: url("fotos/bosque-1.jpg"); }
.bosque-b { --img: url("fotos/bosque-2.jpg"); }
.bosque-suave { isolation: isolate; }
.bosque-suave::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; z-index: -1;
  background: url("fotos/bosque-2.jpg") center bottom / cover no-repeat;
  filter: grayscale(1) sepia(.35); opacity: .13;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, transparent 100%);
}
.rama {
  width: 150px; height: 22px; margin: 0 auto 22px;
  background: var(--vino-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20160%2024'%3E%3Cpath%20d%3D'M4%2012H64M96%2012H156'%20stroke%3D'black'%20stroke-width%3D'1'%2F%3E%3Cpath%20d%3D'M80%206l5%206-5%206-5-6z'%20fill%3D'black'%2F%3E%3Cg%20fill%3D'black'%3E%3Cpath%20d%3D'M30%2012c4-6%2010-7%2014-6-3%204-8%206-14%206z'%2F%3E%3Cpath%20d%3D'M30%2012c4%206%2010%207%2014%206-3-4-8-6-14-6z'%2F%3E%3Cpath%20d%3D'M48%2012c3-5%208-6%2011-5-2%203-6%205-11%205z'%2F%3E%3Cpath%20d%3D'M48%2012c3%205%208%206%2011%205-2-3-6-5-11-5z'%2F%3E%3Cpath%20d%3D'M130%2012c-4-6-10-7-14-6%203%204%208%206%2014%206z'%2F%3E%3Cpath%20d%3D'M130%2012c-4%206-10%207-14%206%203-4%208-6%2014-6z'%2F%3E%3Cpath%20d%3D'M112%2012c-3-5-8-6-11-5%202%203%206%205%2011%205z'%2F%3E%3Cpath%20d%3D'M112%2012c-3%205-8%206-11%205%202-3%206-5%2011-5z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20160%2024'%3E%3Cpath%20d%3D'M4%2012H64M96%2012H156'%20stroke%3D'black'%20stroke-width%3D'1'%2F%3E%3Cpath%20d%3D'M80%206l5%206-5%206-5-6z'%20fill%3D'black'%2F%3E%3Cg%20fill%3D'black'%3E%3Cpath%20d%3D'M30%2012c4-6%2010-7%2014-6-3%204-8%206-14%206z'%2F%3E%3Cpath%20d%3D'M30%2012c4%206%2010%207%2014%206-3-4-8-6-14-6z'%2F%3E%3Cpath%20d%3D'M48%2012c3-5%208-6%2011-5-2%203-6%205-11%205z'%2F%3E%3Cpath%20d%3D'M48%2012c3%205%208%206%2011%205-2-3-6-5-11-5z'%2F%3E%3Cpath%20d%3D'M130%2012c-4-6-10-7-14-6%203%204%208%206%2014%206z'%2F%3E%3Cpath%20d%3D'M130%2012c-4%206-10%207-14%206%203-4%208-6%2014-6z'%2F%3E%3Cpath%20d%3D'M112%2012c-3-5-8-6-11-5%202%203%206%205%2011%205z'%2F%3E%3Cpath%20d%3D'M112%2012c-3%205-8%206-11%205%202-3%206-5%2011-5z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;
}
.oscuro .rama, .vino .rama { background: var(--vino-luz); }
.itinerario .rama { margin: -8px auto 30px; }
