/* The night sky sits behind the optical bench. Its two depths never cross
   the opaque photographic viewport or the measured star chart. */
.meridian-night-sky {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none; user-select: none; background: #040404;
}
.meridian-night-sky .night-galaxy {
  position: absolute; width: clamp(780px, 75vw, 1800px); aspect-ratio: 1700 / 1133;
  left: clamp(3%, calc((100vw - 1504px) / 4), 12%); top: 42%; translate: -50% -50%;
  background: center / 100% auto no-repeat url("../../../scenes/meridian/andromeda-field.webp");
  mask-image: radial-gradient(ellipse 54% 51% at 50% 50%, #000 0%, #000 34%, #000e 51%, #0006 76%, transparent 100%);
  opacity: .44; filter: grayscale(1) contrast(1.08);
}
.meridian-night-sky .night-stars {
  position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px);
}
@media (prefers-reduced-motion:no-preference) {
  .meridian-night-sky .night-galaxy { animation: meridian-sidereal-turn 96s ease-in-out -29s infinite alternate; }
  .meridian-night-sky .night-stars { animation: meridian-sidereal-shift 59s ease-in-out -17s infinite alternate; }
}
@keyframes meridian-sidereal-turn {
  from { transform: translate3d(-12px,7px,0) rotate(-2deg) scale(1.012); }
  to { transform: translate3d(14px,-11px,0) rotate(1.6deg) scale(1.048); }
}
@keyframes meridian-sidereal-shift {
  from { transform: translate3d(-8px,-9px,0); }
  to { transform: translate3d(14px,12px,0); }
}
.meridian-night-sky[data-still] > *,
html[data-studio-motion=off] .meridian-night-sky > *,
body.atlas-paused .meridian-night-sky > * {animation-play-state:paused;}
@media(forced-colors:active) { .meridian-night-sky {display:none;} }

html[data-ver-cursor=meridian] body:has(> .meridian-night-sky) { isolation:isolate; }
html[data-ver-cursor=meridian] body > .meridian-night-sky {position:fixed;}
html[data-ver-cursor=meridian] body:has(> .meridian-night-sky) #main,
html[data-ver-cursor=meridian] body:has(> .meridian-night-sky) #main > :is(#top.hero,.dispatch,#atlas,#campus,#exhibits,#plan,.questions) {
  background:transparent;
}
html[data-ver-cursor=meridian] body.red-light > .meridian-night-sky { filter:grayscale(1) sepia(1) saturate(6) hue-rotate(320deg) brightness(.53); }
html[data-meridian-sky] body {isolation:isolate;}
html[data-meridian-sky] body > .meridian-night-sky {position:fixed;}
html[data-meridian-sky] .night-scene .photograph {opacity:.48;}
html[data-meridian-sky] body.night > .meridian-night-sky {filter:grayscale(1) sepia(1) saturate(6) hue-rotate(320deg) brightness(.53);}
.night-photo-credit {margin:0;font:400 12px/1.45 system-ui,sans-serif;color:#b6b4b2;}
.night-photo-credit summary {cursor:pointer;min-height:44px;align-content:center;}
.night-photo-credit p {max-width:49ch;}
.night-photo-credit a {color:inherit;text-decoration:underline;}

#theater #stage .mde-room:has(> .meridian-night-sky) {isolation:isolate;background:#060606;}
#theater #stage .mde-room .night-galaxy {
  width:clamp(520px,75%,1060px);left:57%;top:54px;opacity:.55;
}
#theater #stage .mde-room:has(> .meridian-night-sky) .mde-switch {
  background:linear-gradient(90deg,#060606a8,transparent 52%,#0606063b);
}
#theater #stage .mde-room:has(> .meridian-night-sky) .mde-switch::before {content:none;}
#theater #stage .mde-room:has(> .meridian-night-sky) .mde-worktop {background:transparent;}
#theater #stage .mde-room:has(> .meridian-night-sky) .mde-atlas:not([data-night=true]),
#theater #stage .mde-room:has(> .meridian-night-sky) .md-galaxies.mo-optics {
  background:linear-gradient(142deg,#111111cf,#050505b8 48%,#0d0d0de8);
}
#theater #stage .mde-room:has(.mde-atlas[data-night=true]) .meridian-night-sky {filter:grayscale(1) sepia(1) saturate(6) hue-rotate(320deg) brightness(.56);}
@media(max-width:660px) {
  .meridian-night-sky .night-galaxy {width:max(540px,125vw);left:18%;top:32%;}
  #theater #stage .mde-room .night-galaxy {width:max(350px,90%);left:80%;top:54px;}
}
