/* SoundRoots immersion: the page art breathes while a sample plays, takes the light of the hour,
   and picks up the colour of the mood you're following. See immersion.js. */

/* 1. breathing: slow, small, and it holds still (rather than snapping back) when the music stops */
@keyframes sr-breathe{
  from{ transform:scale(1) translateY(0); opacity:0.86; }
  to{ transform:scale(1.02) translateY(-5px); opacity:1; }
}
html.sr-ever-played .bd-scene{
  animation:sr-breathe calc(6s * var(--dur, 1)) ease-in-out infinite alternate;
  animation-play-state:paused;
}
html.sr-playing .bd-scene{ animation-play-state:running; }

/* 2. mood wash and time-of-day light sit over the art, under the page */
#backdrop::before, #backdrop::after{
  content:""; position:absolute; inset:0; z-index:2; pointer-events:none;
  transition:opacity 1.5s ease, background 1.5s ease;
}
#backdrop::before{
  opacity:0;
  background:radial-gradient(ellipse 90% 60% at 50% 105%, color-mix(in srgb, var(--bloom) 26%, transparent), transparent 70%);
}
html[data-mood="1"] #backdrop::before{ opacity:1; }
#backdrop::after{ background:transparent; }
html[data-tod="dawn"] #backdrop::after{ background:linear-gradient(to top, rgba(244,170,140,0.13), rgba(150,120,170,0.05) 55%, transparent); }
html[data-tod="dusk"] #backdrop::after{ background:linear-gradient(to top, rgba(236,120,70,0.14), rgba(110,70,150,0.09) 60%, transparent); }
html[data-tod="night"] #backdrop::after{ background:linear-gradient(to bottom, rgba(8,12,34,0.24), rgba(8,12,34,0.08)); }

@media (prefers-reduced-motion: reduce){
  html.sr-ever-played .bd-scene{ animation:none; }
  #backdrop::before, #backdrop::after{ transition:none; }
}
