/* Fondo ambiental de Comportamiento: negro profundo, una sola luz roja lateral y grano fino inline. Solo #fondo y sus pseudo-elementos. */
#fondo {
  background: var(--sup-0);
}

/* Una única luz roja que entra por el lado derecho, como un foco de laboratorio */
#fondo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30vmax 40vmax at 108% 34%, light-dark(color-mix(in srgb, var(--acento) 26%, transparent), color-mix(in srgb, var(--acento) 62%, transparent)), transparent 72%),
    linear-gradient(180deg, transparent 60%, light-dark(rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.55)));
}

/* Grano fino: ruido de fractal en gris, en data: URI (sin petición) */
#fondo::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='r' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: screen;
  opacity: 0.55;
}

/* En claro el grano oscurece (multiplica) en vez de aclarar */
:root[data-tema="claro"] #fondo::after { mix-blend-mode: multiply; opacity: 0.4; }
@media (prefers-color-scheme: light) {
  :root:not([data-tema="oscuro"]) #fondo::after { mix-blend-mode: multiply; opacity: 0.4; }
}
