/* ══ PACOVERSO Blog · capa WOW + blog estático ═════════════════════════════
   Usa las variables de la plantilla (--bg --surface --line --ink --muted
   --gold --violet). Todo lo animado vive bajo html.pv-wow: con «reducir
   movimiento» o con el botón ☾ la página queda tranquila y legible. */

/* ── Blog estático: mientras estatico.js pinta resultados, sin parpadeo ── */
html.pv-consulta .blog-main [data-pv-lista-estatica],
html.pv-consulta .blog-main .pv-pag { visibility: hidden; }
.pv-hueco { min-height: 40px; }
.pv-hueco:empty { display: block; border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: pvBrillo 1.4s linear infinite; margin-bottom: 18px; min-height: 120px; }
@keyframes pvBrillo { to { background-position: -200% 0; } }

/* ── 1. Cielo de constelaciones en las cabeceras ── */
.page-hero { position: relative; overflow: hidden; }
.pv-cielo { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
html.pv-wow .pv-cielo { opacity: 1; }
.page-hero > .wrap { position: relative; z-index: 2; }

/* ── 3. Intro ── */
.pv-intro { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #1a1530 0%, var(--bg, #08080c) 70%); cursor: pointer; transition: opacity .7s ease, transform .7s ease; }
.pv-intro.fuera { opacity: 0; transform: scale(1.06); pointer-events: none; }
.pv-intro-logo { position: absolute; width: min(70vmin, 520px); aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; animation: pvLogoIn 1.4s cubic-bezier(.2,.8,.2,1) both; }
.pv-intro-logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: blur(3px) drop-shadow(0 0 40px rgba(138,109,255,.5)); opacity: .5; }
@keyframes pvLogoIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.pv-intro-txt b, .pv-intro-txt small { text-shadow: 0 2px 18px rgba(0,0,0,.75); }
.pv-intro-txt { position: relative; text-align: center; color: var(--ink, #f3f1ea); }
.pv-intro-txt b { display: block; font: 700 clamp(30px, 7vw, 64px)/1 "Space Grotesk", system-ui, sans-serif; letter-spacing: .14em; }
.pv-intro-txt b span { display: inline-block; animation: pvLetra .7s cubic-bezier(.2,.8,.2,1.2) backwards; animation-delay: calc(var(--i) * 70ms + 150ms);
  background: linear-gradient(120deg, #fff 20%, var(--gold, #e3b341) 50%, var(--violet, #8a6dff) 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pv-intro-txt small { display: block; margin-top: 16px; color: var(--muted, #a9a6b8); font-size: 15px; letter-spacing: .08em; animation: pvSube .8s ease .9s backwards; }
.pv-intro-txt em { display: block; margin-top: 30px; font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--gold, #e3b341); animation: pvSube .8s ease 1.4s backwards, pvLate 1.6s ease-in-out 2.2s infinite; }
@keyframes pvLetra { from { opacity: 0; transform: translateY(24px) scale(.6); filter: blur(8px); } }
@keyframes pvSube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pvLate { 50% { opacity: .35; } }

/* ── 4. Paleta Ctrl+K ── */
.pv-paleta { position: fixed; inset: 0; z-index: 9998; background: rgba(4,4,10,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pv-paleta[hidden] { display: none; }
.pv-paleta-caja { width: min(640px, 100%); background: color-mix(in srgb, var(--surface, #12121a) 92%, transparent); border: 1px solid var(--line, #26263a); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(138,109,255,.25); overflow: hidden; animation: pvPaleta .22s ease; }
@keyframes pvPaleta { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.pv-paleta-q { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line, #26263a); }
.pv-paleta-q > span { color: var(--gold, #e3b341); font-size: 20px; }
.pv-paleta-q input { flex: 1; background: none; border: 0; outline: 0; color: var(--ink, #f3f1ea); font-size: 18px; min-width: 0; }
.pv-paleta-q kbd { font-size: 11px; color: var(--muted, #a9a6b8); border: 1px solid var(--line, #26263a); border-radius: 6px; padding: 2px 6px; }
.pv-paleta-res { max-height: 56vh; overflow: auto; padding: 8px; }
.pv-paleta-res a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink, #f3f1ea); text-decoration: none; }
.pv-paleta-res a.on, .pv-paleta-res a:hover { background: linear-gradient(90deg, rgba(138,109,255,.22), rgba(227,179,65,.1)); }
.pv-paleta-res img, .pv-paleta-res i { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; font-style: normal; color: var(--gold, #e3b341); background: rgba(255,255,255,.04); }
.pv-paleta-res b { display: block; font-weight: 600; line-height: 1.3; }
.pv-paleta-res small { color: var(--muted, #a9a6b8); font-size: 12px; }
.pv-paleta-msg { margin: 6px 12px 10px; color: var(--muted, #a9a6b8); font-size: 13px; }
html.pv-paleta-on { overflow: hidden; }

/* Botones flotantes */
.pv-wow-botones { position: fixed; left: 16px; bottom: 96px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.pv-wow-b { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line, #26263a); background: color-mix(in srgb, var(--surface, #12121a) 85%, transparent); color: var(--gold, #e3b341); font-size: 18px; cursor: pointer; backdrop-filter: blur(6px); transition: transform .2s ease, box-shadow .2s ease; }
.pv-wow-b:hover, .pv-wow-b:focus-visible { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 3px rgba(138,109,255,.35), 0 8px 24px rgba(0,0,0,.4); outline: none; }
@media (max-width: 760px) { .pv-wow-botones { bottom: 150px; left: 12px; } .pv-wow-b { width: 40px; height: 40px; } }
@media print { .pv-wow-botones, .pv-cielo, .pv-intro, .pv-paleta, .pv-polvo { display: none !important; } }

/* ── 5. Tarjetas 3D con foco de luz ── */
html.pv-wow a.post, html.pv-wow .pv-col, html.pv-wow .pv-xp, html.pv-wow .pv-exp { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease; will-change: transform; }
html.pv-wow .pv-luz { transform: perspective(900px) rotateX(var(--pv-rx, 0)) rotateY(var(--pv-ry, 0)) translateY(-4px); box-shadow: 0 24px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(138,109,255,.25); }
html.pv-wow a.post::after, html.pv-wow .pv-col::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--pv-mx, 50%) var(--pv-my, 50%), rgba(227,179,65,.16), rgba(138,109,255,.10) 35%, transparent 60%); }
html.pv-wow a.post.pv-luz::after, html.pv-wow .pv-col.pv-luz::after { opacity: 1; }
a.post, .pv-col { position: relative; }

/* ── 6. Entrada del título ── */
html.pv-wow .page-hero h1.pv-entra { animation: pvTitulo 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pvTitulo { from { opacity: 0; filter: blur(14px); transform: translateY(18px) scale(.98); letter-spacing: .04em; } to { opacity: 1; filter: none; transform: none; } }

/* ── 7. Artículo del día ── */
.pv-dia { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 0; margin: 0 0 26px; border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--ink, #f3f1ea); position: relative;
  background: linear-gradient(135deg, rgba(138,109,255,.18), rgba(227,179,65,.10)); border: 1px solid rgba(227,179,65,.35); box-shadow: 0 18px 50px rgba(0,0,0,.35); isolation: isolate; }
.pv-dia::before { content: ""; position: absolute; inset: -2px; z-index: -1; background: conic-gradient(from var(--pv-ang, 0deg), var(--gold, #e3b341), var(--violet, #8a6dff), transparent 40%, var(--gold, #e3b341)); opacity: .35; filter: blur(14px); }
html.pv-wow .pv-dia::before { animation: pvGira 8s linear infinite; }
.pv-dia img { width: 100%; height: 100%; min-height: 160px; object-fit: cover; }
.pv-dia-txt { padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.pv-dia-txt small { color: var(--gold, #e3b341); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.pv-dia-txt b { font: 700 clamp(19px, 2.4vw, 26px)/1.25 "Space Grotesk", system-ui, sans-serif; }
.pv-dia-txt em { font-style: normal; color: var(--muted, #a9a6b8); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv-dia:hover b, .pv-dia:focus-visible b { color: var(--gold, #e3b341); }
@media (max-width: 640px) { .pv-dia { grid-template-columns: 1fr; } .pv-dia img { max-height: 180px; } }

/* ── 8. Polvo de estrellas ── */
.pv-polvo { position: fixed; z-index: 9997; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff, var(--gold, #e3b341) 50%, transparent 70%); animation: pvPolvo .9s ease-out forwards; }
@keyframes pvPolvo { to { opacity: 0; transform: translate(var(--dx, 0), 26px) scale(.2); } }

/* ── 9. Lluvia de meteoritos ── */
.pv-lluvia { position: fixed; inset: 0; z-index: 9996; pointer-events: none; overflow: hidden; }
.pv-lluvia i { position: absolute; top: -10%; width: 2px; height: 120px; background: linear-gradient(to bottom, transparent, #fff 70%, var(--gold, #e3b341)); transform: rotate(-24deg); animation: pvMeteoro 1.2s linear forwards; opacity: 0; }
@keyframes pvMeteoro { 0% { opacity: 0; transform: translate(0, 0) rotate(-24deg); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(-40vh, 120vh) rotate(-24deg); } }

/* ── Aparición al hacer scroll ── */
html.pv-wow .pv-aparece { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
html.pv-wow .pv-aparece.pv-visto { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html:not(.pv-wow) .pv-cielo, html:not(.pv-wow) .pv-intro, html:not(.pv-wow) .pv-polvo, html:not(.pv-wow) .pv-lluvia { display: none !important; }
  html:not(.pv-wow) .pv-entra, html:not(.pv-wow) .pv-aparece { opacity: 1 !important; transform: none !important; animation: none !important; filter: none !important; }
}

/* Studio: portada (.vhero) */
html.pv-wow .vhero h1.pv-entra { animation: pvTitulo 1.1s cubic-bezier(.2,.8,.2,1) both; }
