/* Front end only: the ground and the ambient screen effects. Everything ambient hangs off html.crt (kit section 9);
   the footer switch adds html.no-scan, which removes the scanlines only (owner's call, 2026-10-01). */

html { min-height:100%; background:var(--ground) fixed, var(--surface-0); }
html body { background:none; }
.wp-site-blocks { position:relative; z-index:1; display:flex; flex-direction:column; min-height:calc(100vh - var(--wp-admin--admin-bar--height,0px)); }
body .wp-site-blocks > * { margin-block:0; }
.wp-site-blocks > .irz-main { flex:1 0 auto; width:100%; }
.irz-strip { position:sticky; top:var(--wp-admin--admin-bar--height,0px); z-index:10; }

html.crt body::before {
  content:""; position:fixed; top:-96px; left:-56px; right:-56px; bottom:-96px; z-index:0; pointer-events:none;
  opacity:.07; background:url(hex.svg) repeat; background-size:55.4256px 96px; animation:irz-drift 55s linear infinite;
}
@keyframes irz-drift { to { transform:translate(55.4256px,96px); } }

html.crt::after {
  content:""; position:fixed; inset:-3px 0 0; pointer-events:none; z-index:9999;
  background:var(--scanlines); mix-blend-mode:multiply; animation:irz-scan-roll var(--scan-roll) steps(3) infinite;
}
@keyframes irz-scan-roll { to { transform:translateY(3px); } }
html.crt.reading::after { animation:none; background:repeating-linear-gradient(to bottom,rgba(0,0,0,0) 0 2px,rgba(0,0,0,.12) 2px 3px); }

.crt-flicker { position:fixed; inset:0; pointer-events:none; z-index:0; background:#05070D; opacity:0; animation:irz-flicker var(--flicker-cycle) infinite; }
@keyframes irz-flicker { 0%,100% { opacity:0; } 37% { opacity:.012; } 61% { opacity:0; } 84% { opacity:.015; } }
html:not(.crt) .crt-flicker { display:none; }

@media (max-width:1024px) {
  html.crt body::before, .crt-flicker { display:none; }
  html.crt::after { background:repeating-linear-gradient(to bottom,rgba(0,0,0,0) 0 2px,rgba(0,0,0,.12) 2px 3px); }
}
@media (max-width:600px) {
  html.crt::after { animation:none; background:repeating-linear-gradient(to bottom,rgba(0,0,0,0) 0 2px,rgba(0,0,0,.10) 2px 3px); }
  html.crt.reading::after { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  html.crt::after, html.crt body::before { animation:none; }
  .crt-flicker { display:none; }
}
html.crt.no-scan::after, html.crt.no-scan.reading::after { display:none; }
