/* ATELIER 65 — paper grain. Static forever: the seed is fixed at load and
   nothing moves after that. Animated grain is TV static in a paper costume. */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  filter: url(#grain);
  opacity: 0.06;                 /* the band is 0.04-0.08. Below it does nothing,
                                    above it the reader starts noticing texture. */
  mix-blend-mode: soft-light;    /* darkens highlights, lifts shadows, adds no hue */
}

/* Dark theme: black alpha-only grain over near-black is invisible under EVERY
   blend mode. The blend was never the problem, the grain's color was.
   invert(1) after the SVG filter turns the same shape white; ~60% of the light
   opacity keeps it from reading as snow. */
:root:not([data-theme="light"]) .grain,
:root[data-theme="dark"] .grain {
  filter: url(#grain) invert(1);
  opacity: 0.035;
}
