.atmosphere { position: fixed; inset: 0; z-index: 60; pointer-events: none; } /* Cursor-tracked glow. Sits under the content it lights (z-index below the page would kill it entirely, so it lives here at very low opacity instead). */ .glow { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); background: radial-gradient( 26rem 26rem at var(--x, 50%) var(--y, 40%), color-mix(in srgb, var(--color-accent) 13%, transparent), transparent 70% ); } .glow[data-active='true'] { opacity: 1; } /* Horizontal scanlines — the CRT/monitor read. Kept at 2px so it never moirés against the image grid on a 1x display. */ .scanlines { position: absolute; inset: 0; opacity: 0.5; background: repeating-linear-gradient( to bottom, transparent 0 2px, color-mix(in srgb, var(--color-bg) 55%, transparent) 2px 3px ); } /* Film grain. An inline SVG turbulence rather than a bitmap: no extra request, and it stays sharp at any DPR. */ .grain { position: absolute; inset: -50%; opacity: 0.16; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E"); } @media (prefers-reduced-motion: no-preference) { .grain { animation: drift 700ms steps(3) infinite; } } /* Shifts the noise field a few pixels each step so the grain reads as moving film rather than a static texture pasted over the page. */ @keyframes drift { 0% { transform: translate(0, 0); } 33% { transform: translate(-2%, 1%); } 66% { transform: translate(1%, -2%); } 100% { transform: translate(0, 0); } }