/* MB Enterprise — Nexus Coil site-wide navigation */
:root {
  --nx-void: #05070D;
  --nx-ink: #0B1220;
  --nx-neon: #1CFFC1;
  --nx-neon-ink: #032019;
  --nx-flare: #FF4D2E;
  --nx-glass: rgba(7, 11, 20, 0.92);
  --nx-text: #FFFFFF;
  --nx-muted: #C5D0E0;
  --nx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nx-morph: cubic-bezier(0.34, 1.4, 0.64, 1);
  --nx-r: 22px;
  --nx-type: 0.9rem;
  --nx-type-sm: 0.7rem;
  --nx-track: -0.03em;
}

.nx-root {
  position: fixed;
  z-index: 1200;
  inset: 0;
  pointer-events: none;
}

.nx-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--nx-ease), visibility 0.35s;
  pointer-events: none;
}
.nx-root.is-open .nx-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nx-coil {
  position: absolute;
  top: max(0.85rem, env(safe-area-inset-top));
  right: max(0.85rem, env(safe-area-inset-right));
  width: 64px;
  height: 64px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--nx-glass);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 18px 48px rgba(5, 7, 13, 0.45),
    0 0 0 1px rgba(28, 255, 193, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition:
    width 0.5s var(--nx-morph),
    height 0.5s var(--nx-morph),
    border-radius 0.5s var(--nx-ease),
    padding 0.4s var(--nx-ease),
    box-shadow 0.4s var(--nx-ease);
}
.nx-root.is-open .nx-coil {
  width: min(320px, calc(100vw - 1.5rem));
  height: auto;
  max-height: min(560px, calc(100vh - 1.75rem));
  border-radius: var(--nx-r);
  padding: 0.7rem;
  gap: 0.55rem;
  box-shadow:
    0 28px 64px rgba(5, 7, 13, 0.55),
    0 0 0 1px rgba(28, 255, 193, 0.28),
    0 0 48px rgba(28, 255, 193, 0.12);
}

.nx-core {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--nx-void);
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  box-shadow: 0 8px 24px rgba(28, 255, 193, 0.25);
  transition:
    width 0.45s var(--nx-morph),
    height 0.45s var(--nx-morph),
    border-radius 0.45s var(--nx-ease),
    background 0.25s var(--nx-ease),
    color 0.25s var(--nx-ease),
    transform 0.35s var(--nx-morph),
    box-shadow 0.25s var(--nx-ease);
}
.nx-root.is-open .nx-core {
  width: 100%;
  height: auto;
  min-height: 52px;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  box-shadow: none;
}
.nx-core:hover,
.nx-core:focus-visible {
  background: var(--nx-neon);
  color: var(--nx-neon-ink);
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}
.nx-root:not(.is-open) .nx-core:hover,
.nx-root:not(.is-open) .nx-core:focus-visible {
  transform: scale(1.05);
}
.nx-core-mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: var(--nx-track);
  line-height: 1;
}
.nx-core-copy {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  text-align: left;
  min-width: 0;
}
.nx-root.is-open .nx-core-copy { display: flex; flex: 1; }
.nx-core-copy strong {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: var(--nx-track);
  color: inherit;
}
.nx-core-copy em {
  font-family: "Literata", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.74rem;
  color: #065F4D;
}
.nx-core:hover .nx-core-copy em,
.nx-core:focus-visible .nx-core-copy em {
  color: #032019;
}
.nx-core-meta {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin-left: auto;
}
.nx-root.is-open .nx-core-meta { display: flex; }
.nx-core-meta span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #065F4D;
}
.nx-core:hover .nx-core-meta span,
.nx-core:focus-visible .nx-core-meta span {
  color: #032019;
}
.nx-core-chev {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.35s var(--nx-morph);
}
.nx-root.is-open .nx-core-chev { transform: rotate(45deg); }
.nx-root:not(.is-open) .nx-core-chev { display: none; }

.nx-orbit {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
  scrollbar-width: thin;
}
.nx-root.is-open .nx-orbit { display: flex; }

.nx-node {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: #FFFFFF;
  color: var(--nx-ink);
  text-decoration: none !important;
  border: 2px solid #FFFFFF;
  box-shadow: 0 6px 18px rgba(5, 7, 13, 0.12);
  opacity: 0;
  transform: translateX(12px);
  transition:
    opacity 0.35s var(--nx-ease),
    transform 0.4s var(--nx-morph),
    background 0.2s var(--nx-ease),
    color 0.2s var(--nx-ease),
    border-color 0.2s var(--nx-ease),
    box-shadow 0.2s var(--nx-ease);
}
.nx-root.is-open .nx-node {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--ni, 0) * 40ms);
}
.nx-node:hover,
.nx-node:focus-visible {
  background: var(--nx-void);
  color: #FFFFFF;
  border-color: var(--nx-neon);
  outline: none;
  box-shadow: 0 0 0 3px rgba(28, 255, 193, 0.28);
  transform: translateX(-3px);
}
.nx-node.is-active {
  background: var(--nx-neon);
  color: var(--nx-neon-ink);
  border-color: var(--nx-neon);
  font-weight: 800;
}
.nx-node.is-active:hover,
.nx-node.is-active:focus-visible {
  background: #FFFFFF;
  color: var(--nx-void);
  border-color: #FFFFFF;
}
.nx-node-idx {
  flex-shrink: 0;
  width: 1.6rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0A7A62;
}
.nx-node:hover .nx-node-idx,
.nx-node:focus-visible .nx-node-idx { color: var(--nx-neon); }
.nx-node.is-active .nx-node-idx { color: var(--nx-neon-ink); }
.nx-node.is-active:hover .nx-node-idx,
.nx-node.is-active:focus-visible .nx-node-idx { color: #0A7A62; }
.nx-node-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.15;
}
.nx-node-copy strong {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: var(--nx-type);
  font-weight: 800;
  letter-spacing: var(--nx-track);
  color: inherit;
}
.nx-node-copy em {
  font-style: normal;
  font-size: var(--nx-type-sm);
  font-weight: 600;
  color: #2F3A4C;
}
.nx-node:hover .nx-node-copy em,
.nx-node:focus-visible .nx-node-copy em { color: #E8EEF7; }
.nx-node.is-active .nx-node-copy em { color: #032019; }
.nx-node.is-active:hover .nx-node-copy em,
.nx-node.is-active:focus-visible .nx-node-copy em { color: #2F3A4C; }
.nx-node-go {
  margin-left: auto;
  font-size: 0.9rem;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.25s var(--nx-morph);
}
.nx-node:hover .nx-node-go,
.nx-node:focus-visible .nx-node-go {
  opacity: 1;
  transform: translate(2px, -2px);
}

.nx-tools {
  display: none;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.nx-root.is-open .nx-tools { display: grid; }

.nx-scan {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: #FFFFFF;
  border: 2px solid #FFFFFF;
}
.nx-scan:focus-within {
  box-shadow: 0 0 0 3px rgba(28, 255, 193, 0.5);
}
.nx-scan input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--nx-ink);
}
.nx-scan input::placeholder {
  color: #3A4456;
  opacity: 1;
}

.nx-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  text-decoration: none !important;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: var(--nx-track);
  transition: background 0.2s, color 0.2s, transform 0.3s var(--nx-morph);
}
.nx-tool:hover,
.nx-tool:focus-visible {
  background: #FFFFFF;
  color: var(--nx-void);
  outline: none;
  transform: translateY(-2px);
}
.nx-tool-bag {
  background: var(--nx-flare);
  border-color: transparent;
}
.nx-tool-bag:hover,
.nx-tool-bag:focus-visible {
  background: #FF8A6E;
  color: #FFFFFF;
}
.nx-tool-bag i {
  position: absolute;
  top: -6px;
  right: -4px;
  font-style: normal;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--nx-void);
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--nx-flare);
}

.nx-pulse {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(28, 255, 193, 0.45);
  animation: nxPulse 2s ease-out infinite;
  pointer-events: none;
}
.nx-root.is-open .nx-pulse { display: none; }
@keyframes nxPulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

@media (max-width: 480px) {
  .nx-root.is-open .nx-coil {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    top: 0.5rem;
  }
  .nx-tools { grid-template-columns: 1fr 1fr; }
  .nx-scan { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-coil,
  .nx-core,
  .nx-node,
  .nx-pulse { animation: none !important; transition-duration: 0.01ms !important; }
}
