/* LER homepage screen overlay (Ed, 2026-12-02): a CRT layer that shows only while the visitor scrolls past the 3D
   Macintosh intro. Built from Odama's measured layers; the element and its behaviour live in ler-crt-overlay-20261202.js.
   Desktop only. Stacking: above the page and the header (z 30 on the homepage), above the compact-menu backdrop (49),
   below an open menu (.nav.is-open is 60), the search and lightbox dialogs (200) and the cursor layers (2147483644+). */
.ler-crt {
  position: fixed; top: 0; left: 0; right: 0;
  height: 100vh; height: 100lvh;
  z-index: 55;
  display: none;
  overflow: hidden;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  contain: layout paint style;
  visibility: hidden; opacity: 0;
  /* Off: fade out over 100 ms, then leave the compositor. */
  transition: opacity .1s ease-out, visibility 0s linear .1s;
}
@media (min-width: 768px) { .ler-crt { display: block; } }
/* On: fade in over 150 ms. */
.ler-crt.is-on { visibility: visible; opacity: 1; transition: opacity .15s ease-out, visibility 0s linear 0s; }

.ler-crt__layer { position: absolute; inset: 0; }

/* Under the noise: white wash .07, 12px scanlines (black .015), 16px RGB stripe grid (pink / green / blue). */
.ler-crt__base {
  background:
    linear-gradient(to bottom, transparent 35%, rgb(0 0 0 / .015) 85%, transparent) 0 0 / 100% 12px,
    linear-gradient(to right, rgb(255 60 120 / .045), rgb(80 255 120 / .03) 33%, rgb(90 110 255 / .045) 66%, rgb(255 60 120 / .045)) 0 0 / 16px 100%,
    rgb(255 255 255 / .07);
}

/* 160px grey noise tile (generated in the script), shown at 240px, opacity .03, re-positioned every second frame by a pre-rolled animation. */
.ler-crt__noise {
  inset: auto; top: 0; left: 0;
  width: calc(100% + 240px); height: calc(100% + 240px);
  opacity: .03; background-size: 240px;
  image-rendering: pixelated;
  will-change: transform;
}

/* A 30%-tall bar that rolls down the screen every 4 s (white .07 at its centre). Compositor-only. */
.ler-crt__roll {
  inset: 0 0 auto 0; height: 30%;
  background: linear-gradient(to bottom, transparent, rgb(255 255 255 / .07), transparent);
  transform: translate3d(0, -100%, 0);
  will-change: transform;
  animation: ler-crt-roll 4s linear infinite paused;
}
.ler-crt.is-on .ler-crt__roll { animation-play-state: running; }
@keyframes ler-crt-roll { from { transform: translate3d(0, -100%, 0); } to { transform: translate3d(0, 333.3333%, 0); } }

/* Black flicker; the script animates opacity through pre-rolled random values of 0 to .06 * .32, one per 60 Hz frame. */
.ler-crt__flicker { background: #000; opacity: 0; will-change: opacity; }

/* Over the noise: pink / cyan edge fringes (.09), then the vignette (black .077 at 72% to .333 at 94%) with its inset glow. */
.ler-crt__top {
  background:
    radial-gradient(75% 75% at 50% 50%, transparent 48%, rgb(0 0 0 / .077) 72%, rgb(0 0 0 / .3325) 94%),
    radial-gradient(130% 130% at 45% 50%, transparent 60%, rgb(255 40 70 / .09) 100%),
    radial-gradient(130% 130% at 55% 50%, transparent 60%, rgb(40 200 255 / .09) 100%);
  box-shadow: inset 0 0 140px 10px rgb(0 0 0 / .105);
}

/* Never over an open menu (the script also checks .nav.is-open / .is-mega-open on every scroll; no :has() here, it costs style
   recalculation on every class change), the Start a project inquiry, the quick-mode page, reduced motion, print or forced colours. */
html.ler-quick-mode .ler-crt,
html.mac-inquiry-active .ler-crt,
html.mac-intro-loading .ler-crt,
html.mac-home-arrival .ler-crt,
html.mac-return-frame .ler-crt,
html.mobile-nav-open .ler-crt { display: none !important; }
@media (prefers-reduced-motion: reduce), print, (forced-colors: active) { .ler-crt { display: none !important; } }
