
/* =========================================================
   FUTURE OS 5.6.1 — AMBIENT SPACE LAYER
   ========================================================= */

:root{
  --ambient-star:rgba(88,231,214,.26);
  --ambient-star-soft:rgba(145,171,173,.12);
  --ambient-line:rgba(88,231,214,.075);
  --ambient-particle:rgba(88,231,214,.20);
  --ambient-glow:rgba(88,231,214,.055);
}

html[data-theme="light"]{
  --ambient-star:rgba(28,28,30,.18);
  --ambient-star-soft:rgba(142,142,147,.14);
  --ambient-line:rgba(58,58,60,.065);
  --ambient-particle:rgba(58,58,60,.14);
  --ambient-glow:rgba(142,142,147,.075);
}

.future-ambient-space{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
  opacity:1;
  contain:strict;
}
.future-ambient-space::before,
.future-ambient-space::after{
  content:"";
  position:absolute;
  width:46vw;
  height:46vw;
  min-width:520px;
  min-height:520px;
  border-radius:50%;
  filter:blur(90px);
  background:radial-gradient(circle,var(--ambient-glow),transparent 68%);
}
.future-ambient-space::before{left:-18vw;top:22vh}
.future-ambient-space::after{right:-20vw;bottom:-18vh}

.future-ambient-constellations{
  position:absolute;
  inset:-4%;
  width:108%;
  height:108%;
  overflow:visible;
  opacity:.9;
  transform:translateZ(0);
}
.future-ambient-constellations line{
  stroke:var(--ambient-line);
  stroke-width:.8;
  vector-effect:non-scaling-stroke;
  stroke-dasharray:2 7;
  animation:ambientLinePulse 13s ease-in-out infinite;
  animation-delay:calc(var(--line-index) * -1.2s);
}
.future-ambient-constellations circle{
  fill:var(--ambient-star);
  filter:drop-shadow(0 0 4px var(--ambient-star-soft));
  animation:ambientStarPulse 9s ease-in-out infinite;
  animation-delay:calc(var(--star-index) * -1.15s);
}
.ambient-constellation{
  transform-box:fill-box;
  transform-origin:center;
  animation:ambientConstellationDrift 44s ease-in-out infinite alternate;
}
.constellation-2,.constellation-4{animation-duration:58s;animation-direction:alternate-reverse}
.constellation-3{animation-duration:67s}
.constellation-5{opacity:.60;animation-duration:74s}

.future-ambient-particles{
  position:absolute;
  inset:0;
}
.future-ambient-particles i{
  position:absolute;
  left:var(--x);
  top:var(--y);
  width:var(--size);
  height:var(--size);
  border-radius:50%;
  background:var(--ambient-particle);
  box-shadow:0 0 6px var(--ambient-particle);
  animation:ambientParticleFloat var(--duration) linear infinite;
  animation-delay:var(--delay);
  will-change:transform,opacity;
}

/* All application/site content stays above the ambient layer. */
body>*:not(#future-ambient-space):not(.boot-sequence){
  position:relative;
  z-index:1;
}

/* The boot sequence is a viewport overlay, never part of ambient stacking. */
body>.boot-sequence{
  position:fixed!important;
  inset:0!important;
  z-index:2147483000!important;
}

/* Hero is intentionally opaque to the global constellation layer. */
.future-ambient-exclusion{
  isolation:isolate;
  position:relative;
}
.future-ambient-exclusion::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:var(--future-bg,#020F13);
  pointer-events:none;
}
.future-hero.future-ambient-exclusion::after{
  background:transparent;
}

/* App shell: stars remain behind sidebar, topbar and working area. */
.future-app-shell,
.future-app-main,
.future-page,
.site-shell,
main{
  background-color:transparent!important;
}
.future-app-sidebar,
.future-app-topbar,
.future-panel,
.future-modal,
.future-kpi,
.future-list-card,
.future-module-tile,
.card,
.capability,
.product-panel,
.mission-card{
  isolation:isolate;
}

/* Slightly calmer in the operational system. */
.future-app-shell~.future-ambient-space,
body:has(.future-app-shell) .future-ambient-space{
  opacity:.68;
}
body:has(.future-app-shell) .future-ambient-constellations{
  opacity:.58;
}
body:has(.future-app-shell) .future-ambient-particles{
  opacity:.62;
}

/* Dark visualization modules retain their own backgrounds. */
.network-stage,
.network-project-map,
.cybermap-world,
.command-center,
.future-monitor-frame-shell{
  isolation:isolate;
}

/* Mobile: fewer visible stars, same aesthetic. */
@media(max-width:760px){
  .future-ambient-space{opacity:.72}
  .future-ambient-constellations{width:145%;height:115%;left:-22%}
  .future-ambient-particles i:nth-child(3n){display:none}
}

/* Reduced motion keeps the static constellation. */
@media(prefers-reduced-motion:reduce){
  .future-ambient-constellations line,
  .future-ambient-constellations circle,
  .ambient-constellation,
  .future-ambient-particles i{
    animation:none!important;
  }
  .future-ambient-particles{opacity:.45}
}

html.ambient-space-reduced .future-ambient-constellations line,
html.ambient-space-reduced .future-ambient-constellations circle,
html.ambient-space-reduced .ambient-constellation,
html.ambient-space-reduced .future-ambient-particles i{
  animation:none!important;
}

@keyframes ambientStarPulse{
  0%,100%{opacity:.28;transform:scale(.82)}
  50%{opacity:.92;transform:scale(1.18)}
}
@keyframes ambientLinePulse{
  0%,100%{opacity:.18;stroke-dashoffset:0}
  50%{opacity:.72;stroke-dashoffset:18}
}
@keyframes ambientConstellationDrift{
  0%{transform:translate3d(-8px,5px,0) rotate(-.45deg)}
  100%{transform:translate3d(16px,-13px,0) rotate(.5deg)}
}
@keyframes ambientParticleFloat{
  0%{transform:translate3d(0,0,0);opacity:0}
  12%{opacity:.72}
  78%{opacity:.40}
  100%{transform:translate3d(var(--drift-x),var(--drift-y),0);opacity:0}
}
