/* One viewport-sized background for public pages only. No layout or font rules. */
body.public-site[data-nx-ambient]:not(.admin-body):not(.admin-page):not(.is-telegram-webapp):not(.telegram-miniapp) { isolation: isolate; }
body.public-site[data-nx-ambient]:not(.admin-body):not(.admin-page):not(.is-telegram-webapp):not(.telegram-miniapp)::before,
body.public-site[data-nx-ambient]:not(.admin-body):not(.admin-page):not(.is-telegram-webapp):not(.telegram-miniapp)::after { content: none !important; }
.nx-site-ambient {
  --nx-ambient-color: #85cfdf;
  --nx-ambient-secondary: #939fc9;
}
body.public-site[data-nx-ambient] > .nx-site-ambient {
  --nx-ambient-ready: 1;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  contain: strict;
  color: var(--nx-ambient-color);
}
.nx-site-ambient[data-ambient-theme="quant"] { --nx-ambient-color: #8dc5e3; --nx-ambient-secondary: #a4a0d1; }
.nx-site-ambient[data-ambient-theme="research"] { --nx-ambient-color: #8ecbd8; --nx-ambient-secondary: #a29dcd; }
.nx-site-ambient[data-ambient-theme="tools"] { --nx-ambient-color: #8dd1d4; --nx-ambient-secondary: #8cb9ce; }
.nx-site-ambient[data-ambient-theme="market"] { --nx-ambient-color: #83cdd9; --nx-ambient-secondary: #91a8d7; }
.nx-site-ambient > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nx-site-ambient > .nx-ambient-haze {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 9% 20%, rgba(63, 150, 170, .07), transparent 47%), radial-gradient(ellipse at 94% 76%, rgba(104, 118, 169, .055), transparent 44%);
}
.nx-site-ambient .nx-ambient-routes { stroke-width: .8; opacity: .095; }
.nx-site-ambient .nx-ambient-orbits { stroke-width: .8; color: var(--nx-ambient-secondary); opacity: .09; }
.nx-site-ambient .nx-ambient-streams { stroke-width: 1.35; opacity: .24; }
.nx-site-ambient .nx-ambient-stream { stroke-dasharray: 110 1600; animation: nx-site-ambient-flow 44s linear infinite; animation-play-state: paused; }
.nx-site-ambient .nx-ambient-stream-slow { animation-duration: 62s; animation-direction: reverse; }
.nx-site-ambient .nx-ambient-stream-cross { animation-duration: 54s; animation-delay: -18s; color: var(--nx-ambient-secondary); }
.nx-site-ambient .nx-ambient-nodes { opacity: .22; }
.nx-site-ambient[data-ambient-state="running"] .nx-ambient-stream { animation-play-state: running; }
@keyframes nx-site-ambient-flow { to { stroke-dashoffset: -1710; } }
@media (max-width: 680px) {
  body.public-site[data-nx-ambient] > .nx-site-ambient { opacity: .7; }
  .nx-site-ambient .nx-ambient-streams { stroke-width: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-site-ambient .nx-ambient-stream { animation: none !important; }
}
@media print {
  body.public-site[data-nx-ambient] > .nx-site-ambient { display: none !important; }
}
/* Embedded Telegram/admin views retain their own surface and never run this motion. */
body:is(.admin-body, .admin-page, .is-telegram-webapp, .telegram-miniapp) > .nx-site-ambient { display: none !important; }
