/* NEO reskin layer — thin overlay; legacy runtime owns core choreography. */
:root {
  --neo-off-blue: #edf1f6;
  --neo-dark: #050608;
}

/* graphite/ceramic grade on the WebGL scene: desaturate, keep it bright and visible */
canvas:not(.neo-dust) {
  filter: saturate(0.06) contrast(1.05) brightness(1.08);
}

@font-face {
  font-family: "NEO Mono";
  src: url("/fonts/commit-mono.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Top-left brand mark: cinematic wipe reveal ---------- */
a[aria-label="homepage"] > svg,
a[aria-label="NEO Sovereign Systems"] > svg {
  display: none !important;
}
.neo-top-logo-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  animation: neoLogoWipe 900ms cubic-bezier(0.2, 0, 0, 1) 6s forwards;
}
.neo-top-logo-wrap.neo-reveal {
  animation: neoLogoWipe 900ms cubic-bezier(0.2, 0, 0, 1) 150ms forwards;
}
.neo-top-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-130%);
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.34) 50%, transparent 68%);
  pointer-events: none;
}
.neo-top-logo-wrap.neo-reveal::after {
  animation: neoGlint 1100ms cubic-bezier(0.2, 0, 0, 1) 420ms forwards;
}
@keyframes neoLogoWipe {
  to { clip-path: inset(0 0 0 0); }
}
@keyframes neoGlint {
  to { transform: translateX(130%); }
}
.neo-top-logo {
  display: block;
  width: 7.4rem;
  height: 1.45rem;
}
@media (max-width: 639px) {
  .neo-top-logo { width: 5.5rem; height: 1.35rem; }
}

/* ---------- Loader: monochrome sovereign boot sequence ---------- */
.loader .center-wrapper > .relative > svg,
.loader .center-wrapper .flash-square,
.loader .center-wrapper .progress-text,
.loader .center-wrapper .loading-text,
.loader .center-wrapper > .relative > .flex.flex-col.gap-4 {
  opacity: 0 !important;
  visibility: hidden !important;
}

.neo-dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1003;
}
.neo-dust.neo-dust-settled {
  z-index: 5;
}

/* ---------- NEO boot overlay: own layer, decoupled from legacy loader ---------- */
#neo-boot {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: #050608;
  display: flex;
  align-items: center;
  justify-content: center;
}
#neo-boot.neo-released {
  transition: opacity 700ms cubic-bezier(0.2, 0, 0, 1), visibility 0s 760ms;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#neo-boot.neo-loader-complete {
  pointer-events: none;
}

.neo-loader-min {
  position: relative;
  width: min(21rem, 80vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: "NEO Mono", ui-monospace, monospace;
}

/* 0.0s — mark line assembly */
.neo-mark-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 1.9rem 0;
  margin-bottom: 1.9rem;
}
.neo-mark-stage > svg:first-child {
  width: 13.5rem;
  height: auto;
  overflow: visible;
  animation: neoMarkPulse 5s ease-in-out 2.6s infinite;
}
@keyframes neoMarkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}
.neo-loader-min .neo-glyph path {
  fill: var(--neo-off-blue);
  fill-opacity: 0;
  stroke: var(--neo-off-blue);
  stroke-opacity: 0.95;
  stroke-width: 5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation:
    neoDraw 700ms cubic-bezier(0.2, 0, 0, 1) forwards,
    neoFillIn 500ms ease 900ms forwards,
    neoStrokeDim 500ms ease 1250ms forwards;
}
.neo-loader-min .neo-glyph path.neo-facet { animation-name: neoDraw, neoFillFacetIn, neoStrokeDim; }
.neo-loader-min .neo-glyph path.neo-facet-b { animation-name: neoDraw, neoFillFacetBIn, neoStrokeDim; }
.neo-loader-min .neo-glyph-n path { animation-delay: 0ms, 900ms, 1250ms; }
.neo-loader-min .neo-glyph-e path { animation-delay: 180ms, 1020ms, 1350ms; }
.neo-loader-min .neo-glyph-o path { animation-delay: 360ms, 1140ms, 1450ms; }
@keyframes neoDraw { to { stroke-dashoffset: 0; } }
@keyframes neoFillIn { to { fill-opacity: 1; } }
@keyframes neoFillFacetIn { to { fill-opacity: 0.3; } }
@keyframes neoFillFacetBIn { to { fill-opacity: 0.46; } }
@keyframes neoStrokeDim { to { stroke-opacity: 0.12; } }

/* completion glint sweep */
.neo-mark-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15rem;
  height: 4rem;
  transform: translate(-50%, -50%);
  background: linear-gradient(100deg, transparent 38%, rgba(244, 246, 250, 0.24) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: 200% 0;
  opacity: 0;
  pointer-events: none;
}
.loader.neo-loader-complete .neo-mark-stage::after,
#neo-boot.neo-loader-complete .neo-mark-stage::after {
  animation: neoScan 1100ms cubic-bezier(0.2, 0, 0, 1) 200ms forwards;
}
@keyframes neoScan {
  0% { opacity: 1; background-position: 200% 0; }
  100% { opacity: 0; background-position: -100% 0; }
}

/* 0.8s — technical corner brackets */
.neo-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid rgba(232, 236, 243, 0.32);
  opacity: 0;
  animation: neoBrIn 500ms ease 800ms forwards;
}
.neo-br-tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.neo-br-tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.neo-br-bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.neo-br-br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
@keyframes neoBrIn { to { opacity: 1; } }

/* operator gesture (kept subtle) */
.neo-hand {
  position: absolute;
  right: -3.6rem;
  top: 50%;
  width: 5rem;
  height: 5rem;
  transform: translateY(-46%) rotate(-6deg) translateX(12px);
  opacity: 0;
  transition: opacity 900ms ease, transform 1200ms cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}
.neo-hand-lines path {
  stroke: rgba(232, 236, 243, 0.8);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.neo-loader-min.neo-hand-on .neo-hand {
  opacity: 0.16;
  transform: translateY(-46%) rotate(-6deg) translateX(0);
}
.neo-loader-min.neo-hand-on .neo-hand-lines path {
  animation: neoDraw 1400ms cubic-bezier(0.2, 0, 0, 1) forwards;
}
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(2) { animation-delay: 150ms; }
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(3) { animation-delay: 300ms; }
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(4) { animation-delay: 450ms; }
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(5) { animation-delay: 600ms; }
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(6) { animation-delay: 700ms; }
.neo-loader-min.neo-hand-on .neo-hand-lines path:nth-child(7) { animation-delay: 800ms; }
.neo-hand-ripple {
  fill: none;
  stroke: rgba(232, 236, 243, 0.5);
  stroke-width: 1;
  opacity: 0;
}
.neo-loader-min.neo-touch .neo-hand-ripple {
  animation: neoRipple 1300ms cubic-bezier(0.2, 0, 0, 1) forwards;
}
.neo-loader-min.neo-touch .neo-hand-ripple-2 { animation-delay: 350ms; }
@keyframes neoRipple {
  0% { opacity: 0.7; transform: scale(1); transform-origin: 18px 64px; }
  100% { opacity: 0; transform: scale(3.2); transform-origin: 18px 64px; }
}
.loader.neo-loader-complete .neo-hand,
#neo-boot.neo-loader-complete .neo-hand { opacity: 0 !important; }

/* 0.4s — thin progress line */
.neo-progress {
  position: relative;
  height: 1px;
  width: 100%;
  background: rgba(232, 236, 243, 0.14);
  overflow: hidden;
  opacity: 0;
  animation: neoElIn 500ms ease 400ms forwards;
}
.neo-progress-fill {
  position: absolute;
  inset: 0;
  background: var(--neo-off-blue);
  transform: scaleX(0.02);
  transform-origin: 0 50%;
  transition: transform 420ms cubic-bezier(0.2, 0, 0, 1);
}

/* 0.8s — pixel ticks */
.neo-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  opacity: 0;
  animation: neoElIn 500ms ease 800ms forwards;
}
.neo-ticks i {
  width: 4px;
  height: 4px;
  background: rgba(232, 236, 243, 0.14);
  transition: background 300ms ease;
}
.neo-ticks i.neo-lit {
  background: rgba(240, 243, 248, 0.9);
}

/* status stack + percentage */
.neo-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 1.1rem;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: neoElIn 500ms ease 400ms forwards;
}
.neo-status-stack {
  display: grid;
  gap: 0.42rem;
}
.neo-status-stack span {
  color: rgba(232, 236, 243, 0.2);
  transition: color 400ms ease;
}
.neo-status-stack span.neo-done { color: rgba(232, 236, 243, 0.42); }
.neo-status-stack span.neo-on { color: rgba(244, 246, 250, 0.95); }
.neo-status-stack span.neo-on::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.55rem;
  vertical-align: 1px;
  background: rgba(244, 246, 250, 0.95);
}
.neo-pct {
  color: rgba(244, 246, 250, 0.95);
  font-size: 11px;
}
@keyframes neoElIn { to { opacity: 1; } }

/* signature */
.neo-loader-sig {
  opacity: 0;
  animation: neoSigFade 700ms ease 1200ms forwards;
  margin-top: 2.2rem;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.26em;
  color: rgba(232, 236, 243, 0.28);
  text-transform: uppercase;
}
@keyframes neoSigFade { to { opacity: 0.7; } }

.loader.neo-loader-complete {
  pointer-events: none !important;
}
.loader.neo-released {
  transition: opacity 700ms cubic-bezier(0.2, 0, 0, 1), visibility 0s 760ms;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ---------- System HUD: quiet command-surface readout ---------- */
#neo-hud {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  font-family: "NEO Mono", ui-monospace, monospace;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 1100ms ease 300ms;
}
#neo-hud.neo-hud-on { opacity: 1; }
#neo-hud.neo-hud-dim { opacity: 0 !important; transition: opacity 500ms ease; }
.neo-hud-block {
  position: absolute;
  bottom: 6.6rem;
  display: grid;
  gap: 0.55rem;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(232, 236, 243, 0.58);
}
.neo-hud-left { left: 4.4rem; }
.neo-hud-left div { display: flex; gap: 1rem; }
.neo-hud-left span { width: 4.6rem; opacity: 0.45; }
.neo-hud-left b { font-weight: 400; color: rgba(232, 236, 243, 0.85); }
.neo-hud-right { right: 4.4rem; text-align: right; }
.neo-hud-coord { color: rgba(232, 236, 243, 0.85); }
.neo-hud-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.55rem;
  background: var(--neo-off-blue);
  animation: neoBlink 2.4s steps(2, end) infinite;
}
@keyframes neoBlink {
  50% { opacity: 0.25; }
}
@media (max-width: 920px) {
  .neo-hud-block { display: none; }
  .neo-core-reticle { top: 45%; width: 40vmin; height: 40vmin; }
  .neo-core-decal { width: 34vmin; height: 34vmin; }
  .neo-ret-side { display: none; }
}

@keyframes neoMicroIn { to { opacity: 1; } }
@keyframes neoSigIn { to { opacity: 0.6; } }

/* ---------- NEO Sovereign Core reticle ---------- */
.neo-core-reticle {
  position: absolute;
  left: 50%;
  top: 33%;
  width: 22vmin;
  height: 22vmin;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.neo-ret-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(232, 236, 243, 0.06);
  border-radius: 50%;
  border-top-color: rgba(232, 236, 243, 0.16);
  animation: neoRetSpin 46s linear infinite;
}
@keyframes neoRetSpin {
  to { transform: rotate(360deg); }
}
.neo-ret-tick {
  position: absolute;
  background: rgba(232, 236, 243, 0.14);
}
.neo-ret-tick-n { left: 50%; top: -7px; width: 1px; height: 5px; }
.neo-ret-tick-s { left: 50%; bottom: -7px; width: 1px; height: 5px; }
.neo-ret-tick-w { top: 50%; left: -7px; height: 1px; width: 5px; }
.neo-ret-tick-e { top: 50%; right: -7px; height: 1px; width: 5px; }
.neo-ret-label {
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 0.26em;
  color: rgba(232, 236, 243, 0.34);
  white-space: nowrap;
}

.neo-drawer-copy {
  margin-top: 2.2rem;
  font-family: "NEO Mono", ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(10, 12, 14, 0.6);
}

/* ---------- NEO Sovereign Core decal (embedded surface language) ---------- */
.neo-core-decal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 21vmin;
  height: 21vmin;
  transform: translate(-50%, -52%) perspective(820px) rotateY(-16deg) rotateX(7deg) skewY(-1.4deg);
  mix-blend-mode: screen;
  opacity: 0.13;
  overflow: hidden;
  pointer-events: none;
}
.neo-core-decal svg {
  width: 100%;
  height: 100%;
  display: block;
}
.neo-decal-mark {
  filter: drop-shadow(0 0 6px rgba(214, 222, 232, 0.35)) drop-shadow(0 2px 2px rgba(0, 16, 36, 0.75));
}
/* traveling scanline across cube face */
.neo-core-decal::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 10%;
  background: linear-gradient(180deg, transparent, rgba(236, 240, 246, 0.18), transparent);
  animation: neoScanline 6.5s cubic-bezier(0.4, 0, 0.6, 1) 2s infinite;
}
@keyframes neoScanline {
  0% { transform: translateY(-20%); opacity: 0; }
  8% { opacity: 1; }
  46% { transform: translateY(1150%); opacity: 1; }
  54% { opacity: 0; }
  100% { transform: translateY(1150%); opacity: 0; }
}
/* light-catch sheen */
.neo-core-decal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.09) 50%, transparent 60%);
  background-size: 300% 100%;
  background-position: 200% 0;
  animation: neoSheen 9s ease-in-out 4s infinite;
}
@keyframes neoSheen {
  0%, 55% { background-position: 200% 0; }
  75% { background-position: -100% 0; }
  100% { background-position: -100% 0; }
}
.neo-ret-side {
  position: absolute;
  top: 50%;
  font-size: 8px;
  letter-spacing: 0.24em;
  color: rgba(232, 236, 243, 0.26);
  white-space: nowrap;
}
.neo-ret-side-l {
  right: calc(100% + 16px);
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
}
.neo-ret-side-r {
  left: calc(100% + 16px);
  transform: translateY(-50%);
  writing-mode: vertical-rl;
}

/* mobile core alignment (must stay last: overrides base reticle/decal geometry) */
@media (max-width: 920px) {
  .neo-core-reticle {
    top: 46%;
    width: 42vw;
    height: 42vw;
  }
  .neo-core-decal {
    width: 30vw;
    height: 30vw;
  }
  .neo-ret-side { display: none; }
  .neo-ret-label { font-size: 7px; }
}

/* rollback pass: no circle/ring around the core, no HUD captions; only the subtle etched decal stays */
.neo-ret-label,
.neo-ret-side,
.neo-ret-ring,
.neo-ret-tick {
  display: none !important;
}

/* ---------- Contrast synchronization: light panels get dark ink ---------- */
/* Light drawer/panel (bg-off-blue): dark text, dark borders, dark accents */
.bg-off-blue { color: #05070a; }
.bg-off-blue .text-off-blue,
.bg-off-blue .text-white,
.bg-off-blue .text-48,
.bg-off-blue a {
  color: #05070a !important;
}
.bg-off-blue .text-off-blue.text-opacity-50,
.bg-off-blue .text-off-blue.opacity-50 {
  color: rgba(5, 7, 10, 0.62) !important;
}
.bg-off-blue .text-off-blue.text-opacity-30,
.bg-off-blue .text-off-blue.opacity-30 {
  color: rgba(5, 7, 10, 0.38) !important;
}
.bg-off-blue .border-off-blue {
  border-color: rgba(5, 7, 10, 0.12) !important;
}
.bg-off-blue svg .fill-off-blue,
.bg-off-blue svg[fill="#EDF1F6"],
.bg-off-blue svg [fill="#EDF1F6"],
.bg-off-blue svg [fill="#edf1f6"] {
  fill: #05070a !important;
}
/* squares/pips drawn with bg-off-blue become invisible on the light panel */
.bg-off-blue .bg-off-blue:not(.text-off-blue):empty {
  background-color: #05070a !important;
}
/* exception: dark sub-surfaces inside the light drawer (e.g. black CLOSE button) keep light ink */
.bg-off-blue .bg-dark-blue .text-off-blue,
.bg-off-blue .solid-dark .text-off-blue,
.bg-off-blue .bg-dark-blue a,
.bg-off-blue .solid-dark a,
.bg-off-blue .bg-dark-blue,
.bg-off-blue .solid-dark {
  color: #f5f5f0 !important;
}
.bg-off-blue .bg-dark-blue svg [fill],
.bg-off-blue .solid-dark svg [fill] {
  fill: #f5f5f0 !important;
}
.bg-off-blue .bg-dark-blue .bg-off-blue:empty,
.bg-off-blue .solid-dark .bg-off-blue:empty {
  background-color: #f5f5f0 !important;
}
