/* Minimal: solo letra y espacio. Nombres grandes en Cormorant ligera, etiquetas en Jost espaciada.
   El movimiento también es tipográfico: la portada se cierra hacia una línea y los nombres suben desde una máscara. */
:root {
  --letra-titulo: "Jost", system-ui, sans-serif;
  --letra-firma: "Cormorant Garamond", Georgia, serif;
  --suave: #5E5E66;
  --linea: #E4E4E8;
  --sombra: rgba(31, 31, 36, .06);
  --apertura: 2700ms;
  --curva: cubic-bezier(.2, .7, .15, 1);
}

body { font-weight: 400; }
.etiqueta { font-family: var(--letra-titulo); font-size: .8rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--acento); }
.raya { display: block; width: 48px; height: 1px; margin: 1.6rem auto; background: var(--tinta); }

/* ---------- Portada ---------- */
#portada .tarjeta { width: min(100%, 22rem); text-align: center; }
#portada .para { margin-top: .5rem; font-size: 1.6rem; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
#portada .nombre { font-size: calc(2.6rem / var(--nombres-ancho, 1)); font-weight: var(--nombres-peso, 300); line-height: 1.1; overflow-wrap: anywhere; font-family: var(--nombres-letra, "Cormorant Garamond", Georgia, serif); font-style: var(--nombres-estilo, normal); text-transform: var(--nombres-mayus, none); letter-spacing: var(--nombres-espacio, normal); }
#portada .nombre b { display: block; font-weight: 300; font-style: italic; font-size: .7em; color: var(--acento); }
#portada .fecha { margin-top: 1rem; color: var(--suave); font-size: 1.15rem; }
#abrir { margin-top: 2.4rem; padding: 0 2.2rem; border: 1px solid var(--tinta); background: #FFFFFF; color: var(--tinta); font-family: var(--letra-titulo); font-size: .8rem; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; transition: background .25s, color .25s; }
#abrir:hover, #abrir:focus-visible { background: var(--tinta); color: #FFFFFF; outline: none; }
/* La línea que cierra la portada: cruza la pantalla a media altura. */
#portada::after { content: ""; position: fixed; left: 0; right: 0; top: 50%; height: 1px; background: var(--tinta); transform: scaleX(0); pointer-events: none; }

/* ---------- Encabezado ---------- */
#encabezado { isolation: isolate; }
#encabezado .etiqueta { transform: translateY(calc(var(--sube) * -30vh)); }
#encabezado .nombres { margin-top: 2rem; font-size: calc(min(4.6rem, var(--ancho) * 1.5 / (var(--letras) * var(--nombres-ancho, 1)))); font-weight: var(--nombres-peso, 300); line-height: .98; letter-spacing: var(--nombres-espacio, -.01em); transform: translateY(calc(var(--sube) * -18vh)); font-family: var(--nombres-letra, "Cormorant Garamond", Georgia, serif); font-style: var(--nombres-estilo, normal); text-transform: var(--nombres-mayus, none); }
#encabezado .nombres b { display: block; margin: .25em 0 .2em; font-weight: 300; font-style: italic; font-size: .5em; color: var(--acento); transform: rotate(calc(var(--sube) * -40deg)); }
#encabezado .raya { transform: scaleX(calc(1 + var(--sube) * 5)); }
#encabezado .fecha { font-size: 1.2rem; letter-spacing: .04em; color: var(--suave); transform: translateY(calc(var(--sube) * -8vh)); }
#encabezado .baja { position: absolute; left: 50%; bottom: calc(1.6rem + env(safe-area-inset-bottom)); width: 1px; height: 44px; background: linear-gradient(var(--tinta), transparent); transform-origin: top; opacity: 0; }
.abierto #encabezado .baja { animation: baja 2.2s var(--curva) infinite; opacity: 1; }
@keyframes baja { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Movimiento: solo si hay `.animar` (sin movimiento reducido) ---------- */
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }
@keyframes sale { to { opacity: 0; transform: translateY(-12px); } }
@keyframes traza { to { transform: scaleX(1); } }
@keyframes cierra { 0% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(50% 0 calc(50% - 1px) 0); } }
@keyframes apaga { to { opacity: 0; } }
@keyframes aparece { from { opacity: 0; } }
@keyframes etiqueta { from { opacity: 0; letter-spacing: .9em; } }
@keyframes letra { from { opacity: 0; transform: translateY(.55em); filter: blur(5px); } }
@keyframes amp { from { opacity: 0; transform: scale(.3) rotate(-35deg); } }
@keyframes raya { from { transform: scaleX(0); } }

.animar #portada .tarjeta > * { animation: entra .7s var(--curva) both; }
.animar #portada .tarjeta > :nth-child(2) { animation-delay: .08s; }
.animar #portada .tarjeta > :nth-child(3) { animation-name: raya; animation-delay: .2s; }
.animar #portada .tarjeta > :nth-child(4) { animation-delay: .26s; }
.animar #portada .tarjeta > :nth-child(5) { animation-delay: .34s; }
.animar #portada .tarjeta > :nth-child(6) { animation-name: aparece; animation-delay: .42s; }

.animar #portada.saliendo { opacity: 1; animation: cierra .7s cubic-bezier(.7, 0, .3, 1) .75s both; }
.animar #portada.saliendo .tarjeta > * { animation: sale .45s ease-in both; }
.animar #portada.saliendo .tarjeta > :nth-child(2) { animation-delay: .04s; }
.animar #portada.saliendo .tarjeta > :nth-child(3) { animation-delay: .08s; }
.animar #portada.saliendo .tarjeta > :nth-child(4) { animation-delay: .12s; }
.animar #portada.saliendo .tarjeta > :nth-child(5) { animation-delay: .16s; }
.animar #portada.saliendo .tarjeta > :nth-child(6) { animation-delay: .2s; }
.animar #portada.saliendo::after { animation: traza .6s cubic-bezier(.7, 0, .3, 1) .3s forwards, apaga .3s ease 1.3s forwards; }

.animar .abriendo #encabezado .etiqueta { animation: etiqueta 1.2s var(--curva) 1.05s both; }
.animar .abriendo #encabezado .nombres .l { animation: letra 1s var(--curva) both; animation-delay: calc(1.15s + var(--i) * 55ms); }
.animar .abriendo #encabezado .nombres b { animation: amp 1s var(--curva) 1.6s both; }
.animar .abriendo #encabezado .raya { animation: raya .7s var(--curva) 1.85s both; }
.animar .abriendo #encabezado .fecha { animation: entra .7s var(--curva) 1.95s both; }

/* ---------- Contenido ---------- */
.seccion { padding: 4rem 1.8rem; }
.seccion + .seccion { border-top: 0; }
.seccion + .seccion::before { content: ""; position: absolute; top: 0; left: 50%; width: 48px; height: 1px; margin-left: -24px; background: var(--linea); }
.animar .seccion + .seccion::before { transform: scaleX(0); transition: transform 1.1s var(--curva); }
.animar .seccion:has(.visto)::before { transform: none; }
h2 { font-size: .8rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: var(--acento); }
.animar h2.revelar { letter-spacing: .8em; transition: opacity .9s ease-out, transform .9s ease-out, letter-spacing 1.4s var(--curva); }
.animar h2.revelar.visto { letter-spacing: .32em; }
.adorno { display: none; }
.lead { font-style: normal; font-weight: 300; font-size: 1.45rem; }
.animar .lead.revelar { transform: none; clip-path: inset(0 0 100% 0); transition: opacity .9s ease-out, clip-path 1.3s var(--curva); }
.animar .lead.revelar.visto { clip-path: inset(-10% -5% -10% -5%); }
.firma { font-style: italic; font-weight: 300; font-size: 2rem; }
.pase { border: 1px solid var(--tinta); }
.pase .num { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 300; font-size: 4rem; color: var(--tinta); }
.cuenta div { border: 0; border-top: 1px solid var(--tinta); }
.cuenta b { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 300; font-size: 2.2rem; }
.boton { border-color: var(--tinta); font-family: var(--letra-titulo); font-size: .85rem; letter-spacing: .12em; }
.enviar { background: var(--tinta); }

@media (prefers-reduced-motion: reduce) {
  #encabezado .etiqueta, #encabezado .nombres, #encabezado .nombres b, #encabezado .raya, #encabezado .fecha { transform: none; }
  .abierto #encabezado .baja { animation: none; }
}
