/* Edition VIII · One continuous passage of light. These are static paint layers
   and short opacity changes; the measured moon geometry never moves here. */

/* The last cinematic frame already shares the sanctuary's moon centers. Give
   the painted room a brief dim-to-clear exposure while that frame hands off. */
.temple-shade::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(ellipse 55% 44% at 50% 35%,#d6e6ff16,transparent 76%),
    linear-gradient(#0304082b,#03040818);
}
#site.cinematic-landed .temple-shade::before{
  animation:moonwalkerRoomExposure 900ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes moonwalkerRoomExposure{
  from{opacity:1}
  to{opacity:0}
}

/* One editorial light falls from each scene into its first reading chapter.
   The darker local scrim stays behind the text, so detailed art cannot wash
   out the introduction. The realms retain their distinct color and geometry. */
#reader[data-page=faction][data-affinity=azure]{
  --director-hero-ink:#06132c;
  --director-hero-light:#8dd3ff;
}
#reader[data-page=faction][data-affinity=golden]{
  --director-hero-ink:#201409;
  --director-hero-light:#ffe0a3;
}
#reader[data-page=faction][data-affinity=crimson]{
  --director-hero-ink:#1c0713;
  --director-hero-light:#ff799e;
}
@media(min-width:761px){
  #reader[data-page=faction] .faction-scene-shade{
    background:
      radial-gradient(ellipse 58% 72% at 16% 83%,color-mix(in srgb,var(--director-hero-light) 13%,transparent),transparent 76%),
      linear-gradient(90deg,color-mix(in srgb,var(--director-hero-ink) 96%,transparent),color-mix(in srgb,var(--director-hero-ink) 80%,transparent) 36%,color-mix(in srgb,var(--director-hero-ink) 25%,transparent) 78%,transparent),
      linear-gradient(0deg,var(--bg),transparent 38%);
  }
}
#reader[data-page=faction] .faction-scene-copy>p,
#reader[data-page=faction] .faction-scene-caption{
  text-shadow:0 2px 12px #000d,0 0 24px #0009;
}
#reader[data-page=faction] .faction-chapter{
  background:radial-gradient(ellipse 75% 230px at 50% 0,color-mix(in srgb,var(--director-hero-light) 10%,transparent),transparent 100%);
}

/* A bright sky should not inherit a dark arrival exposure if the owner returns
   to Daylight at the end of the cinematic. Existing theme crossfade owns it. */
body.daylight #site.cinematic-landed .temple-shade::before{animation:none;opacity:0}

@media(prefers-reduced-motion:reduce){
  #site.cinematic-landed .temple-shade::before{animation:none;opacity:0}
}
body.reduced-motion #site.cinematic-landed .temple-shade::before,
body.quality-lite #site.cinematic-landed .temple-shade::before{
  animation:none;
  opacity:0;
}
