/* One cover-aligned mask covers every registered ruin position; the ground and
   head stay opaque. Astronomy replaces only the sky, never the moving film. */
#bg-gallery[data-marcus-sky] #astronomical-sky {z-index:0;}
#bg-gallery[data-marcus-sky] #bg-poster,
#bg-gallery[data-marcus-sky] #bg-video {
  mask-image:var(--marcus-landscape-mask);mask-mode:alpha;mask-size:cover;mask-position:center;mask-repeat:no-repeat;
  -webkit-mask-image:var(--marcus-landscape-mask);-webkit-mask-size:cover;-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;
  filter:brightness(var(--marcus-ground-light,1)) saturate(var(--marcus-ground-saturation,1));
}
#bg-gallery[data-marcus-sky] #bg-poster {z-index:1;}
#bg-gallery[data-marcus-sky] #bg-video {z-index:2;}
#bg-gallery[data-marcus-sky] #landing-night-veil {display:none;}
body:has(#bg-gallery[data-marcus-sky]):not(.immersive) #bg-overlay {background:linear-gradient(180deg,rgba(7,8,10,.08),transparent 55%,rgba(7,8,10,.26));}
#bg-gallery[data-marcus-stage] #bg-video,#bg-gallery[data-marcus-stage] #bg-poster {visibility:hidden;}
/* Keep the same field of view when switching between the decoder and GPU. */
#bg-gallery[data-world-profile="marcus"] :is(#bg-video,#bg-poster) {
  transform:scale(var(--marcus-overscan,1));transform-origin:center;
}
#marcus-stage,#marcus-authored {position:absolute;inset:0;pointer-events:none;}
#bg-gallery[data-marcus-sky] #marcus-stage,#bg-gallery[data-marcus-sky] #marcus-authored,#bg-gallery[data-marcus-sky] #marcus-quiet-trail {filter:brightness(var(--marcus-ground-light,1)) saturate(var(--marcus-ground-saturation,1));}

/* A wider portrait composition retains both landmarks. The foreground fades
   before the source film ends instead of stretching or cropping the ruins. */
#bg-gallery[data-marcus-framed] #bg-video,#bg-gallery[data-marcus-framed] #bg-poster {
  inset:auto;left:var(--marcus-film-x);top:var(--marcus-film-y);
  width:var(--marcus-film-width);height:var(--marcus-film-height);object-fit:fill;
}
#marcus-ground-fill {display:none;pointer-events:none;}
#sky-actions {display:flex;gap:12px;margin-top:18px;}
#sky-actions :is(#landing-reset-toggle,#landing-sound-toggle) {position:static;width:44px;height:44px;min-height:44px;padding:10px;border-radius:50%;display:grid;place-items:center;}
#sky-actions :is(#landing-reset-toggle,#landing-sound-toggle)[hidden] {display:none;}
#sky-actions svg {width:22px;height:22px;}
#bg-gallery[data-marcus-framed] #marcus-ground-fill {
  display:block;position:absolute;z-index:4;left:0;right:0;bottom:0;
  top:calc(var(--marcus-film-bottom) - 40px);
  background:linear-gradient(to bottom,transparent,#07080a 40px);
}
