:root {
  --letra-titulo: "Cinzel", serif;
  --suave: #5E5A70;
  --linea: #E6E4EE;
  --sombra: rgba(20, 18, 40, .18);
  --noche: color-mix(in srgb, var(--acento) 14%, #070818);
}

body.cerrado { overflow: hidden; height: 100vh; height: 100svh; }
#escena { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--noche); color: #FFFFFF; }
#nl-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Grano de ilustración y viñeta */
#nl-grano { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 8, .45)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Textos sobre la noche ---------- */
.nl-texto { position: absolute; left: 0; right: 0; z-index: 3; padding: 0 1.4rem; text-align: center; opacity: 0; pointer-events: none; color: #FFFFFF; text-shadow: 0 0 18px rgba(255, 190, 120, .45), 0 2px 10px rgba(0, 0, 10, .6); }
.nl-texto .ornato { display: block; margin-bottom: .35rem; font-family: "Cinzel", serif; font-size: .78rem; letter-spacing: .3em; color: #F3D9A4; }
.nl-texto p { font-size: 1.35rem; font-style: italic; }
#t1 { bottom: calc(9% + env(safe-area-inset-bottom)); }
#t2 { top: 13%; }
#t3 { top: 60%; }
#t2 .nombre { display: block; font-family: var(--nombres-letra, "Great Vibes", cursive); font-size: min(4.6rem, calc(var(--ancho) * 1.5 / (var(--letras) * var(--nombres-ancho, 1)))); line-height: 1.1; overflow-wrap: anywhere; font-weight: var(--nombres-peso, 400); font-style: var(--nombres-estilo, normal); text-transform: var(--nombres-mayus, none); letter-spacing: var(--nombres-espacio, normal); color: #FFF4E2; text-shadow: 0 0 24px rgba(255, 180, 100, .7), 0 0 4px rgba(255, 220, 170, .6); }
#t2 .nombre .linea { display: block; }
#t2 .nombre .palabra { display: inline-block; white-space: nowrap; }
#t2 .nombre .l { display: inline-block; }
#t2 .nombre .y { font-size: .6em; color: #F3D9A4; }
#t2 .sub { display: block; margin-top: .6rem; font-family: "Cinzel", serif; font-size: .85rem; letter-spacing: .3em; color: #F3D9A4; }
#t3 .fecha { display: block; font-family: "Cinzel", serif; font-size: 1.35rem; letter-spacing: .16em; }
#t3 p { margin-top: .3rem; color: #E9E2F2; font-size: 1.25rem; }
#desliza { position: absolute; z-index: 3; bottom: calc(1.1rem + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .95rem; font-style: italic; color: #FFFFFF; opacity: 0; }
#desliza i { width: 1px; height: 26px; background: linear-gradient(#FFFFFF, transparent); transform-origin: top; animation: gota 1.8s ease-in-out infinite; }
@keyframes gota { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Portada: tarjeta de noche con filo dorado, quieta ---------- */
#portada { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; padding-bottom: 18svh; }
.tarjeta { pointer-events: auto; width: min(72vw, 16.5rem); padding: 1.5rem 1.2rem 1.3rem; text-align: center; color: #FFFFFF;
  background: linear-gradient(180deg, rgba(10, 10, 30, .72), rgba(10, 10, 30, .55)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(243, 217, 164, .55); box-shadow: 0 18px 40px rgba(0, 0, 10, .45), inset 0 0 0 5px rgba(10, 10, 30, .2), inset 0 0 0 6px rgba(243, 217, 164, .25); }
.tarjeta .para { font-family: "Cinzel", serif; font-size: .7rem; letter-spacing: .24em; color: #F3D9A4; }
.tarjeta .nombre { margin: .4rem 0 .15rem; font-family: var(--nombres-letra, "Great Vibes", cursive); font-size: min(2.7rem, calc(var(--ancho) * .62 / (var(--letras) * var(--nombres-ancho, 1)))); line-height: 1.15; overflow-wrap: anywhere; font-weight: var(--nombres-peso, 400); font-style: var(--nombres-estilo, normal); text-transform: var(--nombres-mayus, none); letter-spacing: var(--nombres-espacio, normal); text-shadow: 0 0 16px rgba(255, 190, 120, .5); }
.tarjeta .nombre b { font-weight: 400; font-size: .7em; color: #F3D9A4; }
.tarjeta .sub { font-style: italic; color: #E4DEEE; }
#abrir { width: 100%; margin-top: 1.1rem; padding: .85rem 1rem; border: 0; background: linear-gradient(180deg, #F6DDA6, #E2B866); color: #1E1830; font-family: "Cinzel", serif; font-size: .74rem; letter-spacing: .18em; cursor: pointer; box-shadow: 0 0 22px rgba(255, 190, 110, .45); }
#abrir:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }

/* ---------- Música ---------- */
#musica { position: fixed; z-index: 20; right: max(1rem, calc(50vw - var(--col) / 2 + 1rem)); top: calc(1rem + env(safe-area-inset-top)); display: none; place-items: center; width: 44px; height: 44px; border: 1px solid var(--linea); border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--tinta); cursor: pointer; }
#musica.ver { display: grid; }
#musica svg { width: 20px; height: 20px; }
#musica .barras { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
#musica .barras i { width: 3px; height: 30%; background: var(--tinta); animation: barra 1s ease-in-out infinite; }
#musica .barras i:nth-child(2) { animation-delay: -.3s; }
#musica .barras i:nth-child(3) { animation-delay: -.6s; }
@keyframes barra { 50% { height: 100%; } }

@media (prefers-reduced-motion: reduce) {
  #desliza i, #musica .barras i { animation: none; }
  .nl-texto { opacity: 1; }
}
