/* AMBIENCE: the slow light behind a page (tpl/head.php prints the layer, assets/ambience.js swaps a scene in place).
   The owner, 2026-11-04: "When they pick a location, a little animation or a background. A strip club, strobe
   lights." and "When you attack and cops are available, a subtle police light in the background." His standing rule:
   Downtown's top-down map is the bar; skylines, glows, caution tape are corny. So the light is felt at the edges and
   never sits on the content: one fixed layer under everything (z-index -1, under the page's own grounds and paper),
   masked so the middle of the screen stays clear, a few gradients per scene, nothing faster than a slow breath.

   The scene is a body attribute the server prints (page_start 'scene', 'scene_heat' 1 to 4, 'scene_once'), so it is
   there with scripts off. Nothing here moves layout or touches a number: only opacity and transform, on a layer no
   pointer reaches. Off for an account that switched it off (no layer is printed), under reduced motion, in print.

   Layers: .ez-amb::before and ::after carry the moving light, the two <i> the still wash. Scenes:
     strip        Strip Clubs: a hot red and orange wash at the sides and a slow strobe, red left, amber right, in turn
     prison       Prison Contacts: a sodium yard light sweeping along the top edge, an amber haze under it
     projects     Projects: one tired streetlamp in the top corner that sputters now and then
     social       Social Media: a cool phone glow from the bottom corners, breathing
     downtown     Downtown: headlights passing along the bottom edge, tail lights the other way
     immigration  Immigration Dept: a fluorescent tube's flat green-white from the top, a faint hum
     bars         Local Bars: warm neon bleeding in at the sides, red and amber out of step
     cops         Attack: a cruiser two streets over: soft red and blue low at the far edges, taking turns; nearer toward the cap
                  (data-scene-heat 1 to 4); data-scene-pass: one pass, then it rests, still and faint */

.ez-amb { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict;
  opacity: 0; transition: opacity 1.4s ease;
  --amb-o: 1; --amb-k: 1;
  -webkit-mask-image: radial-gradient(ellipse farthest-side at 50% 50%, rgb(0 0 0 / .05) 60%, #000 100%);
          mask-image: radial-gradient(ellipse farthest-side at 50% 50%, rgb(0 0 0 / .05) 60%, #000 100%); }
body[data-scene="strip"] .ez-amb::before, body[data-scene="strip"] .ez-amb::after,
body[data-scene="cops"] .ez-amb::before, body[data-scene="cops"] .ez-amb::after { inset: -12% 0; }   /* a layer that drifts up and down never shows its own edge */
.ez-amb::before, .ez-amb::after, .ez-amb i { content: ""; position: absolute; inset: 0; display: block; opacity: 0; }
body[data-scene] .ez-amb { opacity: calc(var(--amb-o) * var(--amb-k)); }
body[data-scene] .ez-amb.is-swap { opacity: 0; transition-duration: .7s; }   /* ambience.js: the old scene fades out, the new one in */
:root[data-theme="light"] .ez-amb { --amb-o: .6; }   /* on bone the same light reads stronger */
@media (max-width: 767px) { .ez-amb { --amb-o: .8; } :root[data-theme="light"] .ez-amb { --amb-o: .5; } }

/* Strip Clubs */
body[data-scene="strip"] .ez-amb i:first-child { opacity: 1;
  background: radial-gradient(55% 85% at 0% 50%, rgb(255 40 60 / .20), transparent 72%),
              radial-gradient(55% 85% at 100% 50%, rgb(255 90 31 / .16), transparent 72%); animation: amb-breathe 9s ease-in-out infinite; }
body[data-scene="strip"] .ez-amb::before { background: radial-gradient(42% 62% at 0% 32%, rgb(255 50 70 / .34), transparent 70%);
  animation: amb-strobe 6s ease-in-out infinite, amb-drift 13s ease-in-out infinite alternate; }
body[data-scene="strip"] .ez-amb::after { background: radial-gradient(42% 62% at 100% 66%, rgb(255 150 40 / .30), transparent 70%);
  animation: amb-strobe 6s ease-in-out -3s infinite, amb-drift 11s ease-in-out -4s infinite alternate-reverse; }

/* Prison Contacts */
body[data-scene="prison"] .ez-amb i:first-child { opacity: 1;
  background: linear-gradient(to bottom, rgb(255 160 52 / .11), transparent 26%),
              radial-gradient(40% 50% at 100% 0%, rgb(255 150 40 / .10), transparent 70%); }
body[data-scene="prison"] .ez-amb::before { inset: 0 -40%; opacity: 1;
  background: radial-gradient(16% 70% at 50% 0%, rgb(255 172 64 / .30), transparent 70%);
  animation: amb-yard 17s ease-in-out infinite alternate; }

/* Projects */
body[data-scene="projects"] .ez-amb i:first-child { opacity: 1;
  background: radial-gradient(38% 52% at 5% 0%, rgb(255 222 150 / .26), transparent 72%),
              linear-gradient(to top, rgb(150 160 180 / .06), transparent 22%);
  animation: amb-sputter 14s ease-in-out infinite; }
body[data-scene="projects"] .ez-amb i:last-child { opacity: 1;
  background: radial-gradient(30% 40% at 100% 100%, rgb(255 210 140 / .10), transparent 70%); }

/* Social Media */
body[data-scene="social"] .ez-amb::before { background: radial-gradient(46% 42% at 22% 100%, rgb(90 170 255 / .28), transparent 72%);
  animation: amb-pulse 6s ease-in-out infinite; }
body[data-scene="social"] .ez-amb::after { background: radial-gradient(40% 38% at 86% 100%, rgb(130 120 255 / .20), transparent 72%);
  animation: amb-pulse 8s ease-in-out -2.5s infinite; }

/* Downtown */
body[data-scene="downtown"] .ez-amb i:first-child { opacity: 1; background: linear-gradient(to top, rgb(255 196 130 / .07), transparent 24%); }
body[data-scene="downtown"] .ez-amb::before {
  background: radial-gradient(9% 20% at 46% 100%, rgb(255 244 214 / .34), transparent 72%),
              radial-gradient(9% 20% at 54% 100%, rgb(255 244 214 / .34), transparent 72%);
  animation: amb-pass 11s linear infinite; }
body[data-scene="downtown"] .ez-amb::after {
  background: radial-gradient(6% 14% at 47% 100%, rgb(255 60 50 / .26), transparent 72%),
              radial-gradient(6% 14% at 53% 100%, rgb(255 60 50 / .26), transparent 72%);
  animation: amb-pass-back 15s linear -6s infinite; }

/* Immigration Dept */
body[data-scene="immigration"] .ez-amb i:first-child { opacity: 1;
  background: linear-gradient(to bottom, rgb(206 255 228 / .14), transparent 20%),
              radial-gradient(28% 60% at 0% 0%, rgb(206 255 228 / .09), transparent 70%),
              radial-gradient(28% 60% at 100% 0%, rgb(206 255 228 / .09), transparent 70%);
  animation: amb-hum 4.5s ease-in-out infinite; }
body[data-scene="immigration"] .ez-amb i:last-child { opacity: 1; background: linear-gradient(to top, rgb(180 220 200 / .05), transparent 18%);
  animation: amb-tube 19s ease-in-out infinite; }

/* Local Bars */
body[data-scene="bars"] .ez-amb i:first-child { opacity: 1; background: linear-gradient(to top, rgb(255 140 60 / .07), transparent 28%); }
body[data-scene="bars"] .ez-amb::before { background: radial-gradient(40% 58% at 100% 34%, rgb(255 78 58 / .26), transparent 70%);
  animation: amb-pulse 7s ease-in-out infinite; }
body[data-scene="bars"] .ez-amb::after { background: radial-gradient(40% 54% at 0% 74%, rgb(255 176 40 / .22), transparent 70%);
  animation: amb-pulse 9s ease-in-out -4s infinite; }

/* Attack: the cops, two streets over (owner, 2026-11-04: "The police color is way too dramatic. It should feel like
   distant lights in the background."). A red glow and a blue glow low at the far edges of the ground, heavily
   blurred, taking turns slowly while they drift a little, like a cruiser's bar thrown off the walls down the block.
   Never a strip of colour at the edge, never a strobe, never over the content (the layer's mask keeps the middle
   clear). More cops make it a little nearer, not louder. The receipt after the cops turned him away uses heat 4. */
body[data-scene="cops"] .ez-amb { --amb-k: .55; }
body[data-scene="cops"][data-scene-heat="1"] .ez-amb { --amb-k: .4; }
body[data-scene="cops"][data-scene-heat="2"] .ez-amb { --amb-k: .55; }
body[data-scene="cops"][data-scene-heat="3"] .ez-amb { --amb-k: .7; }
body[data-scene="cops"][data-scene-heat="4"] .ez-amb { --amb-k: .85; }
body[data-scene="cops"] .ez-amb::before, body[data-scene="cops"] .ez-amb::after { inset: -10% -6%; filter: blur(56px); }
body[data-scene="cops"] .ez-amb::before {
  background: radial-gradient(22% 28% at 4% 74%, rgb(255 52 64 / .62), transparent 72%), radial-gradient(12% 18% at 1% 36%, rgb(255 52 64 / .18), transparent 70%);
  animation: amb-far-red 7s ease-in-out infinite, amb-sweep 16s ease-in-out infinite alternate; }
body[data-scene="cops"] .ez-amb::after {
  background: radial-gradient(22% 28% at 96% 70%, rgb(56 118 255 / .66), transparent 72%), radial-gradient(12% 18% at 99% 32%, rgb(56 118 255 / .2), transparent 70%);
  animation: amb-far-blue 7s ease-in-out infinite, amb-sweep 16s ease-in-out -8s infinite alternate; }
body[data-scene="cops"][data-scene-pass] .ez-amb::before { animation: amb-far-red 7s ease-in-out 1 forwards; }
body[data-scene="cops"][data-scene-pass] .ez-amb::after { animation: amb-far-blue 7s ease-in-out 1 forwards; }

@keyframes amb-breathe { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes amb-strobe { 0% { opacity: 0; } 24% { opacity: 1; } 54% { opacity: 0; } 100% { opacity: 0; } }
@keyframes amb-drift { from { transform: translateY(-5%); } to { transform: translateY(5%); } }
@keyframes amb-yard { from { transform: translateX(-30%); } to { transform: translateX(30%); } }
@keyframes amb-sputter { 0%, 60% { opacity: 1; } 65% { opacity: .45; } 71% { opacity: .82; } 77% { opacity: .5; } 86%, 100% { opacity: 1; } }
@keyframes amb-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes amb-pass { 0% { opacity: 0; transform: translateX(-62vw); } 6% { opacity: 1; } 52% { opacity: 1; } 58% { opacity: 0; transform: translateX(62vw); } 100% { opacity: 0; transform: translateX(62vw); } }
@keyframes amb-pass-back { 0% { opacity: 0; transform: translateX(62vw); } 6% { opacity: 1; } 44% { opacity: 1; } 50% { opacity: 0; transform: translateX(-62vw); } 100% { opacity: 0; transform: translateX(-62vw); } }
@keyframes amb-hum { 0%, 100% { opacity: .84; } 50% { opacity: 1; } }
@keyframes amb-tube { 0%, 70% { opacity: 1; } 74% { opacity: .35; } 79% { opacity: .9; } 84% { opacity: .6; } 90%, 100% { opacity: 1; } }
@keyframes amb-far-red { 0%, 100% { opacity: .3; } 30% { opacity: 1; } 55% { opacity: .3; } }
@keyframes amb-far-blue { 0%, 45%, 100% { opacity: .3; } 75% { opacity: 1; } }
@keyframes amb-sweep { from { transform: translate(-3%, 1%); } to { transform: translate(3%, -1%); } }

@media (prefers-reduced-motion: reduce) { .ez-amb { display: none; } }
@media print { .ez-amb { display: none; } }

/* VOICE: retired 2026-11-04 (owner: "maybe the whole page isn't the right move"). The refusal effects now play inside
   the red bar they belong to: assets/empyrez.css and assets/app.js, block 40 STOP. */
