/* The tone over everything (board #153, Dodd 10-26: "that noise effect over everything... animated-ish, more alive").
   The world (bg.js) prints its scene with the tone: a dot screen in the light and a slow film grain, the same on every
   scene set. This is the same grain, very faint, over the whole page (the desk's panels, cards and menus, and the site
   pages: landing, join, sign in, pricing, story, booked), so everything sits in one print. grain.js makes the two noise
   tiles once and adds the layer; nothing runs per frame in JS.
   - Two layers of grain fade into each other (one fades out while the other fades in) and each jumps to a new spot
     only while it is invisible, so the grain boils slowly instead of flickering like TV static.
   - Compositor only (opacity and transform), pointer-events none, very faint, so text stays crisp and live.
   - Reduced motion or Settings > Stills (html.grain-still): the grain holds still. A hidden tab runs no animations.
   - Phones (narrow or touch): one layer, which moves less often (cheaper on memory). */
.iris-grain { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; overflow: hidden; contain: strict;
  opacity: var(--grain-a, .08); }
.iris-grain i { position: absolute; top: -160px; left: -160px; right: 0; bottom: 0; background-size: 160px 160px;
  will-change: transform, opacity; opacity: 0;
  animation: ig-boil 1.2s ease-in-out infinite, ig-hop 4.8s steps(1, end) infinite; }
.iris-grain i + i { animation-delay: -.6s, -.6s; }
/* each layer: invisible, full, invisible again over one beat; its jumps land on the beats (when it can't be seen) */
@keyframes ig-boil { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes ig-hop {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(97px, 41px, 0); }
  50% { transform: translate3d(23px, 131px, 0); }
  75% { transform: translate3d(139px, 83px, 0); }
}
/* the site pages had a still grain (site.css body::after); this replaces it */
html.has-grain body::after { content: none; }
@media (max-width: 600px), (pointer: coarse) {
  .iris-grain i + i { display: none; }
  .iris-grain i { opacity: .8; animation: ig-hop 2.4s steps(1, end) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .iris-grain i { animation: none !important; opacity: .8; }
  .iris-grain i + i { display: none; }
}
html.grain-still .iris-grain i { animation: none !important; opacity: .8; }
html.grain-still .iris-grain i + i { display: none; }
