/* A static noise tile moves as one composited layer; no flashing or per-frame repaint. */
html[data-theme] .site-grain {
  display: block; position: fixed; inset: -12px; z-index: 20;
  pointer-events: none; user-select: none; opacity: .065;
  mix-blend-mode: screen; background-size: 160px 160px;
  animation: analog-grain-drift 18s ease-in-out infinite alternate;
}
html[data-theme="day"] .site-grain { opacity: .04; mix-blend-mode: multiply; }
html[data-grain="off"] .site-grain { display: none; animation: none; }
.grain-setting { padding-top: 10px; border-top: 1px solid var(--ui-line); }
@keyframes analog-grain-drift {
  from { transform: translate3d(-6px, -4px, 0); }
  to { transform: translate3d(6px, 4px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme] .site-grain { animation: none; transform: none; }
}

/* Mobile play stays visually anchored; keep the optional texture, without drift. */
@media (max-width: 700px) {
  html[data-theme] .site-grain { animation: none; transform: none; }
}
