/* Desk polish — precise flat cards, quiet chrome, Nexus tokens */

:root {
  --polish-ink: var(--nexus-ink);
  --panel-line: color-mix(in srgb, var(--nexus-vault, #22d3ee) 32%, transparent);
  --panel-line-strong: color-mix(in srgb, var(--nexus-gateway, #3b82f6) 55%, transparent);
  --panel-radius: 12px;
}

/* Soften neon blowouts */
.text-shadow-neon,
[class*="text-shadow-neon"],
.box-shadow-neon,
[class*="box-shadow-neon"] {
  text-shadow:
    0 0 8px var(--nexus-gateway-glow),
    0 0 18px color-mix(in srgb, var(--nexus-core) 20%, transparent) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--nexus-gateway) 28%, transparent),
    0 0 18px color-mix(in srgb, var(--nexus-gateway) 18%, transparent) !important;
}

.scanlines {
  opacity: 0.1 !important;
}
.nexus-event-horizon-bg {
  opacity: 0.55 !important;
  filter: saturate(0.88) contrast(1.04);
}
.nexus-depth-scrim {
  background:
    radial-gradient(ellipse 70% 50% at 18% 8%, var(--nexus-gateway-glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 88% 18%, var(--nexus-observer-glow), transparent 60%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--nexus-ink) 55%, transparent),
      color-mix(in srgb, var(--nexus-ink) 90%, transparent)
    ) !important;
}

/* Command rail */
.nexus-command-rail h1 {
  letter-spacing: 0.14em !important;
  background: linear-gradient(105deg, var(--nexus-gateway), var(--nexus-core));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: none !important;
}
.nexus-command-rail {
  backdrop-filter: blur(14px);
  border-color: var(--nexus-line) !important;
}

/* Brand lockup — board N mark + NEXUS wordmark */
.nexus-brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}
.nexus-brand-lockup__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 4.25rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 10px var(--nexus-gateway-glow));
  user-select: none;
  -webkit-user-drag: none;
}
.nexus-brand-lockup__desk {
  letter-spacing: 0.22em !important;
  color: color-mix(in srgb, var(--nexus-vault) 72%, white) !important;
  opacity: 0.85;
}

/* Mobile sticky header — rail is lg-only, so brand lives here */
.nexus-brand-lockup--mobile {
  max-width: min(100%, 14.5rem);
  padding-right: 0.5rem;
}
.nexus-brand-lockup--mobile .nexus-brand-lockup__img {
  max-height: 2.65rem;
  filter: drop-shadow(0 0 8px var(--nexus-gateway-glow));
}
.nexus-brand-lockup--mobile .nexus-brand-lockup__desk {
  font-size: 9px !important;
  line-height: 1.1;
  margin-top: 0.15rem !important;
}

/* Keep lucide icons — don't paint every agent mark onto the rail */
.nexus-command-rail nav a {
  position: relative;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.nexus-command-rail nav a > svg {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--nexus-gateway) 35%, transparent));
}
.nexus-command-rail nav a:hover,
.nexus-command-rail nav a[aria-current="page"],
.nexus-command-rail nav a.bg-primary\/10,
.nexus-command-rail nav a[class*="bg-primary"] {
  border-color: color-mix(in srgb, var(--nexus-gateway) 50%, transparent) !important;
  box-shadow: inset 3px 0 0 var(--nexus-gateway);
}

header .backdrop-blur-xl.text-warning,
.sticky .text-warning {
  letter-spacing: 0.08em !important;
  color: var(--nexus-sentinel) !important;
}

.border-b.border-primary\/25,
[class*="border-primary/25"] {
  border-color: color-mix(in srgb, var(--nexus-gateway) 28%, transparent) !important;
}

.nexus-command-rail > div:first-child svg,
.nexus-command-rail h1 + svg {
  filter: drop-shadow(0 0 6px var(--nexus-gateway-glow));
}

/* —— Precise CyberCard / nexus-panel chrome ——
   SPA draws 2px corner Ls at top-0/left-0 INSIDE a 1px border → crooked double outline.
   Snap corners onto the hairline (or hide if they still fight). */
.nexus-panel {
  position: relative;
  box-sizing: border-box !important;
  border: 1px solid var(--panel-line) !important;
  border-radius: var(--panel-radius) !important;
  background: color-mix(in srgb, var(--nexus-ink, #05070d) 72%, transparent) !important;
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.06),
    0 10px 28px rgb(0 0 0 / 0.28) !important;
  overflow: hidden !important;
}

.nexus-panel:hover {
  border-color: color-mix(in srgb, var(--nexus-gateway) 42%, transparent) !important;
}

/* Corner ticks — sit flush on the hairline */
.nexus-panel > div.absolute.w-3.h-3,
.nexus-panel > div.absolute.w-4.h-4 {
  width: 11px !important;
  height: 11px !important;
  box-sizing: border-box !important;
  border-width: 1px !important;
  border-color: var(--panel-line-strong) !important;
  pointer-events: none;
  z-index: 2;
}

.nexus-panel > div.absolute.top-0.left-0 {
  top: 0 !important;
  left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-top-left-radius: calc(var(--panel-radius) - 1px);
}
.nexus-panel > div.absolute.top-0.right-0 {
  top: 0 !important;
  right: 0 !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
  border-top-right-radius: calc(var(--panel-radius) - 1px);
}
.nexus-panel > div.absolute.bottom-0.left-0 {
  bottom: 0 !important;
  left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom-left-radius: calc(var(--panel-radius) - 1px);
}
.nexus-panel > div.absolute.bottom-0.right-0 {
  bottom: 0 !important;
  right: 0 !important;
  border-left: 0 !important;
  border-top: 0 !important;
  border-bottom-right-radius: calc(var(--panel-radius) - 1px);
}

/* Content sits cleanly inside; no competing decorative layers */
.nexus-panel > .relative.z-10 {
  position: relative;
  z-index: 1;
}

/* Status / badge chips — single crisp outline, no double glow rings */
.nexus-panel [class*="border-success"],
.border-success\/30,
[class*="border-success/30"] {
  box-shadow: none !important;
  animation: none !important;
}

/* Soft stage enter — short, no drift */
@keyframes nexus-stage-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.nexus-dashboard main {
  animation: nexus-stage-in 280ms ease-out both;
}

@media (max-width: 1023px) {
  header h1 {
    font-size: 1.35rem !important;
    letter-spacing: 0.12em !important;
    background: linear-gradient(105deg, var(--nexus-gateway), var(--nexus-core));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none !important;
  }
}

/* Quiet atmosphere — depth without muddying cards */
.nexus-atmos {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0.7;
}
.nexus-atmos::before,
.nexus-atmos::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  width: 80vmax;
  height: 80vmax;
}
.nexus-atmos::before {
  top: -42vmax;
  left: -38vmax;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--nexus-core, #a855f7) 12%, transparent),
    transparent 68%
  );
  animation: nexus-drift-a 50s ease-in-out infinite alternate;
}
.nexus-atmos::after {
  bottom: -46vmax;
  right: -40vmax;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--nexus-vault, #22d3ee) 11%, transparent),
    transparent 68%
  );
  animation: nexus-drift-b 58s ease-in-out infinite alternate;
}
@keyframes nexus-drift-a {
  to {
    transform: translate(14vmax, 10vmax);
  }
}
@keyframes nexus-drift-b {
  to {
    transform: translate(-16vmax, -12vmax);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nexus-atmos::before,
  .nexus-atmos::after {
    animation: none;
  }
  .nexus-dashboard main {
    animation: none;
  }
}
