@keyframes lt-fade { from { opacity: 0; } }
body:not([data-entrance="none"]) .page > * { animation: var(--ent, lt-fade) .9s cubic-bezier(.22,1,.36,1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
body[data-entrance="fade"] { --ent: lt-fade; }

/* El contenido crece con el pulso (--zoom lo publica fondo.js). will-change lo deja en su propia capa: el navegador dibuja las letras una vez y las
   escala como imagen; sin eso las redibuja en cada tamaño intermedio y se ven saltar de arriba a abajo. */
.page { scale: calc(1 + var(--zoom, 0)); will-change: transform; text-rendering: geometricPrecision; }
.np { translate: var(--sx, 0px) var(--sy, 0px); } /* temblor brusco: lo escribe fondo.js */

/* Partículas: el canvas lo dibuja js/fondo.js; encima va un grano fino para que el fondo no se vea liso */
.fondo-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body[data-bg-anim="particulas"]::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Cortina: tapa todo en negro y se desvanece, así el fondo "aparece" y después entra el menú */
html::before { content: ""; position: fixed; inset: 0; z-index: 9999; background: #000; pointer-events: none; animation: lt-cortina 1.2s ease-out both; }
html.listo::before { display: none; }
@keyframes lt-cortina { to { opacity: 0; visibility: hidden; } }

/* Celu (sin mouse): quita lo que más cuesta a la GPU. Blur en vivo, ruido con mezcla, animaciones infinitas y fondos que repintan. */
@media (hover: none) {
  body[data-bg-anim="particulas"]::after { display: none; }
  body { background-attachment: scroll; } /* fixed repinta todo en cada scroll en celu */
  .btn > svg:first-child, .btn:hover > svg:first-child { animation: none; }
  .np, .gate, .pv { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .np[data-style="glass"] { background: rgba(28, 28, 32, .72); }
  .gate { background: rgba(10, 10, 14, .9); }
}

/* Sin aceleracion por hardware (index.html agrega .sin-gpu): render por software. Se quita todo lo que repinta o desenfoca en vivo. */
html.sin-gpu body:not([data-entrance="none"]) .page > * { animation-name: lt-fade; }
html.sin-gpu body[data-bg-anim="particulas"]::after { display: none; }
html.sin-gpu body { background-attachment: scroll; }
html.sin-gpu .btn > svg:first-child, html.sin-gpu .btn:hover > svg:first-child { animation: none; }
html.sin-gpu .np, html.sin-gpu .gate, html.sin-gpu .pv { backdrop-filter: none; -webkit-backdrop-filter: none; }
html.sin-gpu .np[data-style="glass"] { background: rgba(28, 28, 32, .72); } /* sin blur: queda translúcido, no un bloque oscuro */
html.sin-gpu .gate { background: rgba(10, 10, 14, .9); }
html.sin-gpu .page, html.sin-gpu .np { translate: none; }
html.sin-gpu::before { display: none; } /* cortina */
