:root {
  --letra-titulo: "Cormorant Garamond", Georgia, serif;
  --suave: #67626C;
  --linea: #ECE8EC;
  --sombra: rgba(40, 32, 40, .12);
  --tinta-sello: color-mix(in srgb, var(--acento) 85%, #000);
  --mano: color-mix(in srgb, #1F2A4A 85%, var(--acento));
}

body.cerrado { overflow: hidden; height: 100vh; height: 100svh; }
#escena { position: relative; height: 100vh; height: 100svh; overflow: hidden; color: var(--tinta); perspective: 1400px;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, 0) 60%, rgba(50, 45, 60, .07)),
    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='.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .4 0 0 0 0 .45 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    #FFFFFF; }
#pc-fotos { display: none; }
#pc-sueltos { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- La postal: frente con foto y reverso escrito ---------- */
.postal { --pw: min(80vw, 330px, 52svh); position: absolute; width: var(--pw); height: calc(var(--pw) * 1.28); left: calc(50% - var(--pw) / 2); top: calc(44% - var(--pw) * .64); transform-style: preserve-3d; }
#pc-1 { rotate: -2.5deg; z-index: 2; }
#pc-2 { rotate: 3deg; z-index: 1; }
.cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 16px 30px rgba(40, 30, 50, .16); }
.reverso { transform: rotateY(180deg); padding: 7% 7% 6%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .47 0 0 0 0 .45 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }
.frente { padding: 4.5% 4.5% 0; }
.frente .foto { position: relative; height: 84%; overflow: hidden; background: color-mix(in srgb, var(--acento) 18%, #FFFFFF); }
.frente .foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92) contrast(1.02); }
.frente .foto::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 40px rgba(60, 40, 20, .18); }
.frente .foto.vacia { background: linear-gradient(160deg, color-mix(in srgb, var(--acento) 14%, #FFFFFF), color-mix(in srgb, var(--acento) 38%, #FFFFFF)); }
.frente .monograma { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 3.4rem; color: #FFFFFF; white-space: nowrap; }
.pie-foto { margin: 0; height: 16%; display: flex; align-items: center; justify-content: center; font-family: "Special Elite", monospace; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }

/* Reverso */
.titulo-postal { margin: 0; text-align: center; font-family: "Cormorant Garamond", serif; font-size: .78rem; font-weight: 600; letter-spacing: .5em; text-transform: uppercase; color: var(--suave); }
.titulo-postal::after { content: ""; display: block; width: 100%; height: 1px; margin-top: .6rem; background: linear-gradient(90deg, transparent, #CFC9CF 15%, #CFC9CF 85%, transparent); }
.timbre { position: absolute; right: 7%; top: 13%; width: 22%; rotate: 3deg; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.timbre svg { display: block; width: 100%; }
.matasellos { position: absolute; right: 3%; top: 20%; width: 36%; opacity: .78; rotate: -9deg; mix-blend-mode: multiply; }
.matasellos svg { display: block; width: 100%; overflow: visible; }
.direccion { position: absolute; left: 7%; right: 33%; top: 16%; }
.renglon { position: relative; display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .7rem; padding-bottom: .15rem; border-bottom: 1px solid #DAD4DA; min-height: 2rem; }
.etiqueta { flex: none; font-family: "Cormorant Garamond", serif; font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--suave); }
.mano { font-family: "Kalam", cursive; font-weight: 300; color: var(--mano); line-height: 1.35; }
.direccion .mano { font-size: 1.05rem; line-height: 1.1; overflow-wrap: anywhere; }
.direccion .nombre { font-family: var(--nombres-letra, "Kalam", cursive); font-weight: var(--nombres-peso, 400); font-style: var(--nombres-estilo, normal); text-transform: var(--nombres-mayus, none); letter-spacing: var(--nombres-espacio, normal);
  font-size: min(1.45rem, calc(var(--pw) * .5 / (var(--letras) * var(--nombres-ancho, 1)))); }
.direccion .nombre b { font-weight: 300; }
.escrito { position: absolute; left: 8%; right: 8%; top: 46%; bottom: 7%; overflow: hidden; }
.escrito p { margin: 0 0 .5rem; font-size: 1.28rem; }
#pc-1 .escrito p:first-child { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.escrito .firma { margin-top: .6rem; text-align: right; }
.escrito .grande { font-size: 1.8rem; line-height: 1.15; }
#pc-2 .escrito { top: 40%; }
.sello-tinta { position: absolute; right: 8%; bottom: 8%; padding: .45rem .9rem; border: 2.5px solid var(--tinta-sello); border-radius: 50%; rotate: -12deg; opacity: 0; mix-blend-mode: multiply;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.sello-tinta span { display: block; font-family: "Special Elite", monospace; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-sello); white-space: nowrap; }

/* ---------- Portada ---------- */
#portada { position: absolute; inset: auto 0 0; z-index: 8; padding: 0 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; }
#portada .pie { pointer-events: auto; width: min(76vw, 18rem); text-align: center; }
#portada .para { margin: 0 0 .55rem; font-family: "Kalam", cursive; font-size: 1.1rem; color: var(--mano); }
#abrir { width: 100%; padding: .9rem 1rem; border: 0; background: var(--tinta); color: #FFFFFF; font-family: "Special Elite", monospace; font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
#abrir:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }

#desliza { position: absolute; z-index: 8; bottom: calc(1rem + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .2rem; font-family: "Kalam", cursive; font-size: 1.05rem; color: var(--suave); opacity: 0; }
#desliza i { width: 1px; height: 24px; background: linear-gradient(var(--suave), 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; } }

/* Sin animación: las dos postales volteadas, una debajo de otra. */
#escena.plano { height: auto; padding: 2rem 0 3rem; perspective: none; }
.plano .postal { position: relative; left: auto; top: auto; margin: 0 auto 2rem; rotate: 0deg; }
.plano .cara.frente { display: none; }
.plano .cara.reverso { transform: none; }
.plano .sello-tinta { opacity: 1; }

@media (prefers-reduced-motion: reduce) { #desliza i { animation: none; } }
