/* NYXO stable shell — loaded LAST on every page (see _security_headers).
 *
 * Why this file exists
 * --------------------
 * Ten stylesheets used to paint competing backgrounds on <body>:
 *   - a fixed-attachment body background (forces a repaint per scroll frame)
 *   - fixed pseudo-elements with animated background-position / hue-rotate filters
 *   - a particle <canvas> + pointer spotlight + blurred orbs
 *   - a sticky header with backdrop-filter: blur(22px) painted OVER all of the above
 * The browser re-blurred an ever-changing backdrop on every scroll frame, which
 * made the header shake. This sheet replaces all of that with ONE static,
 * local programming-icon wallpaper layer and a stable header.
 */

:root {
  --nx-bg-0: #05080d;
  --nx-bg-1: #08111a;
  --nx-line: rgba(143, 205, 226, .13);
  --nx-cyan: 88, 214, 232;
  --nx-violet: 128, 112, 235;
  --nx-header-bg: rgba(7, 12, 19, .94);
}

html {
  background: var(--nx-bg-0) !important;
  scrollbar-gutter: stable;
  overflow-anchor: auto;
}

/* ---- 1. one static background, never repainted while scrolling ---------- */
body {
  position: relative;
  isolation: isolate;
  background-color: var(--nx-bg-0) !important;
  background-image:
    linear-gradient(rgba(5, 8, 13, .12), rgba(5, 8, 13, .12)),
    url("/static/img/nyxo-pattern-wallpaper.webp") !important;
  background-attachment: scroll, scroll !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 414px 602px !important;
  background-position: center top, center top !important;
  transition: none !important;
}

body::before {
  content: none !important;
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -2 !important;
  pointer-events: none !important;
  animation: none !important;
  filter: none !important;
  opacity: 1 !important;
  contain: strict;
  transform: translateZ(0);
  /* soft aurora + a faint engineering grid */
  background:
    radial-gradient(60rem 34rem at 6% -6%, rgba(var(--nx-cyan), .14), transparent 70%),
    radial-gradient(52rem 30rem at 98% 8%, rgba(var(--nx-violet), .11), transparent 70%),
    radial-gradient(46rem 26rem at 50% 112%, rgba(20, 96, 120, .16), transparent 70%),
    linear-gradient(rgba(150, 205, 225, .035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(150, 205, 225, .035) 1px, transparent 1px) 0 0 / 56px 56px !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* a quiet vignette keeps text contrast high; static, one layer */
/* The workbench root previously painted a competing gradient/grid over body.
 * Keep the icon wallpaper on the actual content canvas so it remains visible
 * behind translucent cards on every viewport. */
#pb_root {
  background-color: var(--nx-bg-0) !important;
  background-image:
    linear-gradient(rgba(5, 8, 13, .08), rgba(5, 8, 13, .08)),
    url("/static/img/nyxo-pattern-wallpaper.webp") !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 414px 602px !important;
  background-position: center top, center top !important;
}

#pb_root > .app_shell {
  background: transparent !important;
}

body::after {
  content: "" !important;
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  animation: none !important;
  filter: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  contain: strict;
  transform: translateZ(0);
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, .34) 100%) !important;
}

/* everything that used to move or blur behind the content */
.nx-aura,
.nx-aura *,
.nx-spotlight,
.ambient_grid,
.ambient_orb,
.nx-circuit-rgb,
.nx-spectrum,
.nyxo-rgb-border,
.nyxo-glow-layer {
  display: none !important;
  animation: none !important;
  filter: none !important;
}
.nx-aura__canvas { display: none !important; }

/* ---- 2. header: stable, composited once, no animated children ------------ */
:is(#pb_topbar, .pub-top, .x-top, .ws-top) {
  position: sticky !important;
  top: 0 !important;
  z-index: 120;
  background: var(--nx-header-bg) !important;
  border-bottom: 1px solid var(--nx-line) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  contain: layout style;
  transition: none !important;
  animation: none !important;
}
:is(#pb_topbar, .pub-top, .x-top, .ws-top)::after {
  animation: none !important;
  background: linear-gradient(90deg, transparent, rgba(var(--nx-cyan), .5), transparent) !important;
  background-size: 100% 100% !important;
  opacity: .55 !important;
}
:is(#pb_topbar, .pub-top, .x-top, .ws-top) *,
.brand_logo {
  animation: none !important;
}
.brand_logo { filter: none !important; }

/* other page shells that carry their own header */
:is(.nyxo-account > main > header, .nyxo-downloads .top, .nyxo-admin .top) {
  background: var(--nx-header-bg) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: none !important;
}

/* ---- 2b. hero panel: one static PCB artwork, low opacity ------------------ */
:where(.hero_panel, .np-hero, .pub-hero) { position: relative; isolation: isolate; overflow: clip; }
:where(.hero_panel, .np-hero, .pub-hero)::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  opacity: .10 !important;
  animation: none !important;
  background: none !important;
  -webkit-mask-image: linear-gradient(115deg, #000 30%, transparent 78%) !important;
  mask-image: linear-gradient(115deg, #000 30%, transparent 78%) !important;
}
:where(.hero_panel, .np-hero, .pub-hero)::after { content: none !important; }

/* ---- 3. cards: no animated decoration ------------------------------------ */
.nx-frame, .nx-rule__seal { animation: none !important; }
:where(.pub-card, .panel, .card-wrap, .hero_panel, .detail, .contact, .identity, .stat, .window, .side, .ws-card, .ws-console) {
  animation: none !important;
}

/* ---- 4. small screens: no blur at all, opaque header --------------------- */
@media (max-width: 760px) {
  :is(#pb_topbar, .pub-top, .x-top, .ws-top, .nyxo-account > main > header, .nyxo-downloads .top, .nyxo-admin .top) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #070c13 !important;
  }
  body::before { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ---- 5. brand name must always be visible ---------------------------------
 * The header title used gradient-clipped text (transparent fill + background-clip:text)
 * inside a composited sticky header. Browsers drop the clipped background there, so the
 * name disappeared. Use a plain solid colour instead. */
#pb_topbar .brand_copy,
#pb_topbar .brand_title_row {
  display: block !important;
  min-width: 0;
  opacity: 1 !important;
  visibility: visible !important;
}
#pb_topbar .brand_title_row { display: flex !important; align-items: center; }
#pb_topbar .brand_title_row h1,
.brand_title_row h1,
.brand_copy h1 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #f5f8fb !important;
  -webkit-text-fill-color: #f5f8fb !important;
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  text-shadow: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
#pb_topbar .brand_title_row h1 { display: block !important; white-space: nowrap; max-width: none !important; }
#pb_topbar .brand_copy { flex: 0 0 auto !important; max-width: none !important; width: auto !important; }
#pb_topbar .brand_title_row h1 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #f5f8fb !important;
  -webkit-text-fill-color: #f5f8fb !important;
  font-size: clamp(1rem, 2vw, 1.2rem) !important;
  font-weight: 850 !important;
  letter-spacing: -.035em !important;
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
}
.nyxo_auth_actions #nyxo_auth_submit,
#nyxo_auth_submit.btn-main {
  background: linear-gradient(110deg, #58d6e8, #a5f3fc 52%, #d9fbff) !important;
  background-color: #58d6e8 !important;
  color: #04121a !important;
  -webkit-text-fill-color: #04121a !important;
  border: 0 !important;
  border-radius: 13px !important;
  font-weight: 800 !important;
  box-shadow: 0 14px 34px rgba(56, 214, 232, .22), inset 0 1px 0 rgba(255, 255, 255, .55) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.nyxo_auth_actions #nyxo_auth_submit:hover,
#nyxo_auth_submit.btn-main:hover {
  box-shadow: 0 18px 42px rgba(56, 214, 232, .3), inset 0 1px 0 rgba(255, 255, 255, .6) !important;
}
@media (max-width: 480px) {
  #pb_topbar .brand_eyebrow { display: none !important; }
  #pb_topbar .nx-guide-btn__text { display: none !important; }
}

/* ---- 6. builds start automatically: the manual build button is gone ------ */
#run_btn { display: none !important; }

/* Final responsive controls: these rules intentionally follow every legacy override. */
@media (max-width: 680px) {
  #pb_topbar .brand_lockup {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: .42rem !important;
  }
  #pb_topbar .nx-guide-btn {
    width: auto !important;
    min-width: 0 !important;
    height: 2.45rem !important;
    padding: 0 .62rem !important;
    justify-content: center !important;
  }
  #pb_topbar .nx-guide-btn__text {
    display: inline !important;
    font-size: .67rem !important;
  }
  #pb_root #pb_topbar .brand_lockup > .nx-guide-btn {
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    flex: 0 0 max-content !important;
    overflow: visible !important;
    gap: .38rem !important;
  }
  #pb_root #pb_topbar .brand_lockup > .nx-guide-btn .nx-guide-btn__text {
    display: inline !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
  }
  #pb_topbar .nx-guide-btn__dot { display: none !important; }
  #pb_topbar .top-bar-items {
    width: max-content !important;
    justify-self: end !important;
    justify-content: flex-end !important;
    gap: .45rem !important;
  }
  #pb_topbar .mobile_search_btn,
  #pb_topbar .notification_btn,
  #pb_topbar .header_icon_btn#auth_open_btn,
  #pb_topbar .nx-sound-btn {
    width: 2.55rem !important;
    min-width: 2.55rem !important;
    max-width: 2.55rem !important;
    height: 2.55rem !important;
    min-height: 2.55rem !important;
  }
  .mobile_bottom_nav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .35rem !important;
    padding: .38rem !important;
  }
  body.scroll_top_on .mobile_bottom_nav { padding-inline-start: 3.5rem !important; }
}

@media (max-width: 360px) {
  #pb_topbar .brand_logo { width: 1.68rem !important; }
  #pb_topbar .brand_title_row h1 { font-size: .76rem !important; }
  #pb_topbar .nx-guide-btn { padding-inline: .4rem !important; }
  #pb_root #pb_topbar .nx-guide-btn__text { display: inline !important; font-size: .6rem !important; }
  #pb_topbar .top-bar-items { gap: .28rem !important; }
  #pb_topbar .mobile_search_btn,
  #pb_topbar .notification_btn,
  #pb_topbar .header_icon_btn#auth_open_btn,
  #pb_topbar .nx-sound-btn { width: 2.25rem !important; min-width: 2.25rem !important; max-width: 2.25rem !important; }
}

/* The secondary guide action used to inherit the washed-out/black button treatment. */
.nx-guide__ghost {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 2.7rem !important;
  padding: 0 1rem !important;
  border: 1px solid rgba(165, 243, 252, .62) !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, #243a50, #14283a) !important;
  color: #f5fbff !important;
  -webkit-text-fill-color: #f5fbff !important;
  font-weight: 850 !important;
  opacity: 1 !important;
  filter: none !important;
}
.nx-guide__cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 2.7rem !important;
  background: linear-gradient(110deg, #58d6e8, #a5f3fc 55%, #d9fbff) !important;
  color: #04121a !important;
  -webkit-text-fill-color: #04121a !important;
  font-weight: 900 !important;
  opacity: 1 !important;
  filter: none !important;
  animation: none !important;
}

/* Unified navigation: brand + search + primary destinations + utilities + guide. */
#pb_root #pb_topbar {
  direction: ltr !important;
  grid-template-columns: minmax(11rem, auto) minmax(13rem, 1fr) auto auto !important;
  grid-template-areas: "brand search actions guide" !important;
  column-gap: clamp(.65rem, 1.35vw, 1.2rem) !important;
}
#pb_root #pb_topbar .brand_lockup { grid-area: brand !important; direction: ltr !important; }
#pb_root #pb_topbar .desktop_search { grid-area: search !important; min-width: 0 !important; }
#pb_root #pb_topbar .top-bar-items {
  grid-area: actions !important;
  display: flex !important;
  width: max-content !important;
  min-width: 0 !important;
  justify-content: flex-end !important;
  gap: .38rem !important;
  direction: ltr !important;
}
#pb_root #pb_topbar .nx-guide-btn {
  grid-area: guide !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
  padding: 0 .72rem !important;
  white-space: nowrap !important;
}
#pb_root #pb_topbar .top_projects_link,
#pb_root #pb_topbar .engine_pill,
#pb_root #pb_topbar #settings_btn { display: none !important; }
#pb_root #pb_topbar .nx-header-nav {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: .2rem !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
#pb_root #pb_topbar .nx-header-nav .mobile_nav_item {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .35rem !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 2.65rem !important;
  padding: 0 .58rem !important;
  border: 1px solid transparent !important;
  border-radius: .82rem !important;
  font-size: .69rem !important;
  white-space: nowrap !important;
}
#pb_root #pb_topbar .nx-header-nav .mobile_nav_item .svg_icon { width: 1rem !important; height: 1rem !important; }
#pb_root #pb_topbar .scroll_top_btn { display: none !important; }

@media (max-width: 680px) {
  #pb_root #pb_topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "brand guide" "actions actions" !important;
    column-gap: .35rem !important;
    row-gap: .42rem !important;
    align-items: center !important;
    padding: .55rem .62rem .62rem !important;
  }
  #pb_root #pb_topbar .brand_lockup {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    gap: .35rem !important;
  }
  #pb_root #pb_topbar .brand_logo { width: 1.8rem !important; margin: 0 !important; }
  #pb_root #pb_topbar .brand_copy { flex: 0 0 auto !important; }
  #pb_root #pb_topbar .brand_title_row h1 { font-size: .9rem !important; }
  #pb_root #pb_topbar .nx-guide-btn {
    justify-self: end !important;
    height: 2.55rem !important;
    padding: 0 .7rem !important;
  }
  #pb_root #pb_topbar .nx-guide-btn__text { display: inline !important; font-size: .68rem !important; }
  #pb_root #pb_topbar .nx-guide-btn__dot { display: none !important; }
  #pb_root #pb_topbar .desktop_search { display: none !important; }
  #pb_root #pb_topbar .top-bar-items {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    grid-template-rows: 2.8rem 3.15rem !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    gap: .25rem !important;
    justify-content: stretch !important;
    align-items: center !important;
  }
  #pb_root #pb_topbar .mobile_search_btn { display: grid !important; grid-row: 1 !important; grid-column: 1 / span 3 !important; }
  #pb_root #pb_topbar .notification_btn { display: grid !important; grid-row: 1 !important; grid-column: 4 / span 3 !important; }
  #pb_root #pb_topbar #auth_open_btn { display: grid !important; grid-row: 1 !important; grid-column: 7 / span 3 !important; }
  #pb_root #pb_topbar .nx-sound-btn { display: grid !important; grid-row: 1 !important; grid-column: 10 / span 3 !important; }
  #pb_root #pb_topbar #auth_button_label { display: none !important; }
  #pb_root #pb_topbar .mobile_bottom_nav {
    position: static !important;
    inset: auto !important;
    display: contents !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #pb_root #pb_topbar .nx-header-nav .mobile_nav_item {
    display: grid !important;
    grid-row: 2 !important;
    grid-column: span 4 !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    min-width: 0 !important;
    min-height: 2.9rem !important;
    gap: .12rem !important;
    padding: .18rem .12rem !important;
    border-radius: .76rem !important;
    font-size: .56rem !important;
    line-height: 1.1 !important;
  }
  #pb_root #pb_topbar .nx-header-nav .mobile_nav_item .svg_icon { width: 1.08rem !important; height: 1.08rem !important; }
  #pb_root #pb_topbar .scroll_top_btn { display: none !important; }
  .mobile_bottom_nav { padding: 0 !important; }
  body.scroll_top_on #toast_host { bottom: 1rem !important; }
}

@media (max-width: 360px) {
  #pb_root #pb_topbar { padding-inline: .48rem !important; }
  #pb_root #pb_topbar .brand_logo { width: 1.55rem !important; }
  #pb_root #pb_topbar .brand_title_row h1 { font-size: .78rem !important; }
  #pb_root #pb_topbar .nx-guide-btn { padding-inline: .5rem !important; }
  #pb_root #pb_topbar .nx-guide-btn__text { font-size: .61rem !important; }
}
