/* Art déco: puertas de elevador con incrustaciones de oro; adentro, marco de esquinas escalonadas, abanico y mayúsculas espaciadas.
   Las puertas toman un tono muy oscuro del acento; el oro de las incrustaciones es fijo. */
:root {
  --letra-titulo: "Josefin Sans", system-ui, sans-serif;
  --letra-firma: "Poiret One", Georgia, serif;
  --suave: #55535C;
  --linea: #E2DED6;
  --sombra: rgba(22, 21, 26, .08);
  --apertura: 3300ms;
  --curva: cubic-bezier(.2, .7, .2, 1);
  --oro: #D8B46A;
  --puerta: color-mix(in oklab, var(--acento) 30%, #0E0D11);
  --brillo: color-mix(in oklab, var(--acento), #FFF 30%);
}

.defs { position: absolute; }
.abanico { display: block; width: 150px; height: 75px; margin: 0 auto 1.2rem; color: var(--acento); overflow: visible; }
.abanico.abajo { margin: 1.4rem auto 0; transform: scaleY(-1); }
.divisor { display: block; width: 180px; height: 18px; margin: 1.2rem auto; color: var(--acento); overflow: visible; }

/* Marco con esquinas escalonadas: dos líneas y cuatro escalones. */
.marco { position: relative; width: min(calc(100% - 40px), 22rem); padding: 2.2rem 1.4rem 2.4rem; border: 1.5px solid var(--acento); text-align: center; background: #FFFFFF; }
.marco::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--acento); pointer-events: none; }
.marco::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none;
  background:
    linear-gradient(var(--acento), var(--acento)) 0 0 / 14px 1.5px, linear-gradient(var(--acento), var(--acento)) 0 0 / 1.5px 14px,
    linear-gradient(var(--acento), var(--acento)) 100% 0 / 14px 1.5px, linear-gradient(var(--acento), var(--acento)) 100% 0 / 1.5px 14px,
    linear-gradient(var(--acento), var(--acento)) 0 100% / 14px 1.5px, linear-gradient(var(--acento), var(--acento)) 0 100% / 1.5px 14px,
    linear-gradient(var(--acento), var(--acento)) 100% 100% / 14px 1.5px, linear-gradient(var(--acento), var(--acento)) 100% 100% / 1.5px 14px;
  background-repeat: no-repeat;
}
.marco.con-trazo::before { border-color: transparent; }
.marco .trazo rect + rect { stroke-width: 1; }

/* ---------- Portada: puertas de elevador ---------- */
#portada { overflow: hidden; background: var(--puerta); }
.puerta { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 35%, rgba(0, 0, 0, .28)), var(--puerta); }
.puerta.izq { left: 0; }
.puerta.der { right: 0; transform: scaleX(-1); }
/* Doble filete y tres líneas junto a la junta. */
.puerta::before { content: ""; position: absolute; inset: 20px 16px 20px 20px; border: 1.5px solid var(--oro); box-shadow: inset 0 0 0 6px var(--puerta), inset 0 0 0 7.5px var(--oro); opacity: .9; }
.puerta::after { content: ""; position: absolute; top: 0; bottom: 0; right: 4px; width: 9px; background: repeating-linear-gradient(90deg, var(--oro) 0 1px, transparent 1px 4px); opacity: .8; }
/* Medio sol en cada hoja: juntas forman uno completo. */
.puerta .sol { position: absolute; left: 100%; top: 50%; width: min(170%, 520px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 13.3%, var(--oro) 13.4% 14%, transparent 14.1% 46.8%, var(--oro) 46.9% 47.5%, transparent 47.6%),
    repeating-conic-gradient(var(--oro) 0 .6deg, transparent .6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, #000 0 9%, transparent 9.1% 13.3%, #000 13.4% 47.6%, transparent 47.7%);
  mask: radial-gradient(circle, #000 0 9%, transparent 9.1% 13.3%, #000 13.4% 47.6%, transparent 47.7%); opacity: .85; }
/* Galones: líneas en diagonal que con la otra hoja hacen chevrones. */
.puerta .galon { position: absolute; left: 34px; right: 22px; height: 54px; background: repeating-linear-gradient(135deg, transparent 0 9px, var(--oro) 9px 10.5px); opacity: .7; }
.puerta .galon.arriba { top: 44px; }
.puerta .galon.abajo { bottom: 44px; }
/* Indicador de piso con su aguja. */
.indicador { position: absolute; z-index: 1; top: calc(84px + env(safe-area-inset-top)); left: 50%; width: 120px; height: 60px; margin-left: -60px; border: 1.5px solid var(--oro); border-bottom: 0; border-radius: 60px 60px 0 0; background: var(--puerta); }
.indicador::before { content: ""; position: absolute; inset: 4px 4px 0; border-radius: 56px 56px 0 0;
  background: repeating-conic-gradient(from 270deg at 50% 100%, var(--oro) 0 1.2deg, transparent 1.2deg 22.5deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 0 40px, #000 40.5px); mask: radial-gradient(circle at 50% 100%, transparent 0 40px, #000 40.5px); }
.indicador::after { content: ""; position: absolute; left: 50%; top: -16px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #3A3122; border: 1px solid var(--oro); }
.aguja { position: absolute; left: 50%; bottom: 0; width: 2px; height: 48px; margin-left: -1px; background: var(--oro); transform-origin: 50% 100%; transform: rotate(-68deg); border-radius: 2px; }
.aguja::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--oro); }
#portada .marco { z-index: 1; box-shadow: 0 30px 70px rgba(0, 0, 0, .55); }
#portada::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #FFF6DE; box-shadow: 0 0 18px 6px rgba(255, 238, 200, .7); opacity: 0; pointer-events: none; }

#portada .para { font-family: var(--letra-titulo); font-size: .85rem; letter-spacing: .3em; text-transform: uppercase; color: var(--suave); overflow-wrap: anywhere; }
#portada .para span { display: block; margin-top: .4rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--tinta); }
#portada .nombre { margin-top: 1.2rem; font-family: var(--nombres-letra, var(--letra-firma)); font-size: calc(2.3rem / var(--nombres-ancho, 1)); line-height: 1.15; letter-spacing: var(--nombres-espacio, .06em); text-transform: var(--nombres-mayus, uppercase); overflow-wrap: anywhere; font-weight: var(--nombres-peso, 400); font-style: var(--nombres-estilo, normal); }
#portada .nombre b { display: block; font-weight: 400; font-size: .6em; color: var(--acento); }
#portada .fecha { font-size: 1.15rem; color: var(--suave); }
#abrir { margin-top: 1.8rem; padding: 0 1.8rem; border: 1.5px solid var(--acento); background: #FFFFFF; color: var(--tinta); font-family: var(--letra-titulo); font-size: .82rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; transition: background .25s, color .25s; }
#abrir:hover, #abrir:focus-visible { background: var(--acento); color: #FFFFFF; outline: none; }

/* ---------- Encabezado ---------- */
#encabezado { isolation: isolate; background: #FFFFFF; }
.rayos { position: absolute; z-index: -1; left: 50%; top: 50%; width: min(190vw, 1000px); aspect-ratio: 1; translate: -50% -50%; rotate: calc(var(--sube) * 50deg); border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in oklab, var(--acento) 20%, #FFF) 0 1.4deg, transparent 1.4deg 9deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%); }
.abierto .rayos { animation: rueda 140s linear infinite; }
@keyframes rueda { to { transform: rotate(360deg); } }
#encabezado .marco.grande { width: min(calc(100% - 40px), 24rem); padding: 2.6rem 1.4rem; translate: 0 calc(var(--sube) * -10vh); }
#encabezado .frase { font-family: var(--letra-titulo); font-size: .85rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--acento); }
#encabezado .nombres { position: relative; margin-top: 1rem; font-family: var(--nombres-letra, var(--letra-firma)); font-weight: var(--nombres-peso, 400); font-size: calc(min(3.4rem, var(--ancho) * 1.15 / (var(--letras) * var(--nombres-ancho, 1)))); line-height: 1.12; letter-spacing: var(--nombres-espacio, .06em); text-transform: var(--nombres-mayus, uppercase); font-style: var(--nombres-estilo, normal); }
#encabezado .nombres b { display: block; font-weight: 400; font-size: .5em; color: var(--acento); }
/* Un destello que solo pinta sobre las letras: en «screen», el blanco se queda blanco. */
#encabezado .nombres::after { content: ""; position: absolute; inset: -10% 0; pointer-events: none; mix-blend-mode: screen; background: linear-gradient(105deg, transparent 42%, var(--brillo) 50%, transparent 58%) 160% 0 / 300% 100% no-repeat; }
.abierto #encabezado .nombres::after { animation: destello 7s ease-in-out 2s infinite; }
@keyframes destello { 0% { background-position: 160% 0; } 35%, 100% { background-position: -60% 0; } }
#encabezado .fecha { font-size: 1.2rem; }
.vivo .arco, .vivo .rayo { stroke-dasharray: 1; }
.divisor .ala.izq { transform-origin: 91px 10px; }
.divisor .ala.der { transform-origin: 109px 10px; }
.divisor .rombo { transform-origin: 100px 10px; }

/* ---------- Movimiento: solo con `.animar` ---------- */
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }
@keyframes aparece { from { opacity: 0; } }
@keyframes sale { to { opacity: 0; transform: scale(.94); } }
@keyframes aguja { to { transform: rotate(68deg); } }
@keyframes foco { to { background: #FFE9A8; box-shadow: 0 0 10px 3px rgba(255, 220, 140, .85); } }
@keyframes rendija { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; transform: scaleX(30); } }
@keyframes izq { to { translate: -101% 0; } }
@keyframes der { to { translate: 101% 0; } }
@keyframes trazo { from { stroke-dashoffset: var(--p); } }
@keyframes linea { from { stroke-dashoffset: 1; } }
@keyframes ala { from { transform: scaleX(0); } }
@keyframes rombo { from { transform: rotate(-90deg) scale(0); } }
@keyframes grabado { from { opacity: 0; transform: scale(1.5); } }
@keyframes espacia { from { opacity: 0; letter-spacing: .9em; } }
@keyframes rayos { from { opacity: 0; transform: rotate(-30deg) scale(.7); } }
@keyframes esquinas { from { opacity: 0; inset: 6px; } }

.animar #portada .marco { animation: aparece .7s ease .1s backwards; }
.animar #portada.saliendo { opacity: 1; background: transparent; transition: background 0s 1.2s; }
.animar #portada.saliendo .marco { animation: sale .45s ease-in both; }
.animar #portada.saliendo .aguja { animation: aguja .9s cubic-bezier(.6, 0, .3, 1) .2s forwards; }
.animar #portada.saliendo .indicador::after { animation: foco .2s ease 1.05s forwards; }
.animar #portada.saliendo .indicador { animation: sale .4s ease-in 1.3s both; }
.animar #portada.saliendo::after { animation: rendija 1.2s ease-out 1.15s both; }
.animar #portada.saliendo .puerta.izq { animation: izq 1.15s cubic-bezier(.65, 0, .35, 1) 1.2s both; }
.animar #portada.saliendo .puerta.der { animation: der 1.15s cubic-bezier(.65, 0, .35, 1) 1.2s both; }

.animar .abriendo .rayos { animation: rayos 2s var(--curva) 1.4s both; }
.animar .abriendo #encabezado .marco.grande::after { animation: esquinas .7s var(--curva) 2.3s both; }
.animar .abriendo #encabezado .marco .trazo rect { animation: trazo 1.4s cubic-bezier(.6, 0, .2, 1) 1.5s both; }
.animar .abriendo #encabezado .marco .trazo rect + rect { animation-delay: 1.7s; }
.animar .abriendo .vivo .arco { animation: linea .9s ease-out both; animation-delay: calc(1.7s + var(--k) * .12s); }
.animar .abriendo .vivo .rayo { animation: linea .7s ease-out both; animation-delay: calc(1.8s + var(--k) * .09s); }
.animar .abriendo .vivo .base { animation: aparece .5s ease 1.7s both; }
.animar .abriendo #encabezado .frase { animation: espacia 1.1s var(--curva) 1.9s both; }
.animar .abriendo #encabezado .nombres .l { animation: grabado .8s var(--curva) both; animation-delay: calc(2.05s + var(--i) * 45ms); }
.animar .abriendo #encabezado .nombres::after { animation: destello 1.4s ease-in-out 2.4s both; }
.animar .abriendo .divisor .ala { animation: ala .8s var(--curva) 2.35s both; }
.animar .abriendo .divisor .rombo { animation: rombo .6s cubic-bezier(.3, 1.6, .5, 1) 2.25s both; }
.animar .abriendo #encabezado .fecha { animation: entra .7s var(--curva) 2.5s both; }

/* ---------- Contenido ---------- */
h2 { font-weight: 600; font-size: .85rem; letter-spacing: .32em; text-transform: uppercase; }
.seccion + .seccion { border-top: 0; }
.seccion + .seccion::before { content: ""; position: absolute; top: 0; left: 50%; width: 120px; height: 5px; margin-left: -60px; border-top: 1px solid var(--acento); border-bottom: 1px solid var(--acento); }
.seccion + .seccion::after { content: ""; position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; background: #FFFFFF; border: 1px solid var(--acento); transform: rotate(45deg); }
.animar .seccion + .seccion::before { transform: scaleX(0); transition: transform 1.2s var(--curva) .15s; }
.animar .seccion + .seccion::after { transform: rotate(-45deg) scale(0); transition: transform .7s cubic-bezier(.3, 1.6, .5, 1); }
.animar .seccion:has(.visto)::before { transform: none; }
.animar .seccion:has(.visto)::after { transform: rotate(45deg); }
.firma { font-size: 1.9rem; letter-spacing: .06em; text-transform: uppercase; }
.pase { border: 1.5px solid var(--acento); outline: 1px solid var(--acento); outline-offset: -7px; }
.pase .num { font-family: var(--letra-firma); }
.cuenta div { border-color: var(--acento); }
.cuenta b { font-family: var(--letra-firma); }
.enviar { background: var(--tinta); font-family: var(--letra-titulo); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .rayos, #encabezado .marco.grande { rotate: none; translate: -50% -50%; }
  #encabezado .marco.grande { translate: none; }
  .abierto .rayos, .abierto #encabezado .nombres::after { animation: none; }
}
