/* SOMATRO — AMBIENT BACKGROUNDS: the shared binding layer.
   One application preference (ambientBackgroundsEnabled, default true) reaches
   every destination through two attributes on the page root — data-destination
   and data-ambient — and one resolved token, --ambient-canvas.

   Destinations keep their own tokenised ambient identity; none of them owns the
   on/off decision, none defines a second toggle, and no page carries its own
   conditional logic. Panels, cards, hero and programme artwork, video previews,
   focus rings, active states and status colours are never touched here. */

/* Neutral Somatro base canvas — the floor, no destination hue, no residue. */
[data-destination]{--ambient-canvas:var(--canvas-base)}
[data-ambient="on"][data-destination="home"]{--ambient-canvas:var(--ambient-home)}
[data-ambient="on"][data-destination="live"]{--ambient-canvas:var(--ambient-live)}
[data-ambient="on"][data-destination="arena"]{--ambient-canvas:var(--ambient-arena)}
[data-ambient="on"][data-destination="movies"]{--ambient-canvas:var(--ambient-movies)}
[data-ambient="on"][data-destination="series"]{--ambient-canvas:var(--ambient-series)}
[data-ambient="on"][data-destination="library"]{--ambient-canvas:var(--ambient-library)}
[data-ambient="on"][data-destination="settings"]{--ambient-canvas:var(--ambient-settings)}
/* The canvas swaps in place: no relayout, no remount, no restart. */
[data-destination] [data-shell="app"]{transition:var(--ambient-transition)}

/* OFF is absence, not a fade: the controller renders no drift layer at all.
   These rules guarantee that legacy or future markup leaves no residue. */
[data-ambient="off"] [data-part="ambient-drift"],[data-ambient="off"] .hm-drift,[data-ambient="off"] .lt-drift,[data-ambient="off"] .sa-drift{display:none}
/* Reduce Motion and Low Power stop the drift; the static field stays and the
   saved preference is never rewritten. */
[data-ambient="on"][data-motion="reduced"] [data-part="ambient-drift"] i,[data-ambient="on"][data-motion="low"] [data-part="ambient-drift"] i{animation:none}

/* Shared drift field for destinations whose own layers are not built yet —
   Arena, Movies, Series, Library, Settings inherit the controller and need only
   their tokens. Home and Live TV keep their frozen .hm-drift / .lt-drift. */
.sa-drift{position:absolute;inset:-12%;z-index:0;pointer-events:none}
.sa-drift i{position:absolute;display:block;border-radius:50%}
.sa-drift i.a{width:62%;height:58%;right:-8%;top:-16%;background:radial-gradient(circle,var(--sa-amb-a,var(--ambient-home-a)),transparent 68%);animation:saDriftA 31s var(--ease-standard) infinite}
.sa-drift i.b{width:66%;height:62%;left:-12%;top:-18%;background:radial-gradient(circle,var(--sa-amb-b,var(--ambient-home-b)),transparent 66%);animation:saDriftB 43s var(--ease-standard) infinite}
@keyframes saDriftA{0%,100%{transform:translate3d(0,0,0) scale(1);opacity:.86}50%{transform:translate3d(-2.2%,1.6%,0) scale(1.06);opacity:1}}
@keyframes saDriftB{0%,100%{transform:translate3d(0,0,0) scale(1.04);opacity:1}50%{transform:translate3d(1.8%,-1.2%,0) scale(1);opacity:.84}}
[data-destination="arena"]{--sa-amb-a:var(--ambient-arena-a);--sa-amb-b:var(--ambient-arena-b)}
[data-destination="movies"]{--sa-amb-a:var(--ambient-movies-a);--sa-amb-b:var(--ambient-movies-b)}
[data-destination="series"]{--sa-amb-a:var(--ambient-series-a);--sa-amb-b:var(--ambient-series-b)}
[data-destination="library"]{--sa-amb-a:var(--ambient-library-a);--sa-amb-b:var(--ambient-library-b)}
[data-destination="settings"]{--sa-amb-a:var(--ambient-settings-a);--sa-amb-b:var(--ambient-settings-b)}
