/* =============================================================================
   NEURAL COMPUTE CORE — homepage 3D hero
   =============================================================================
   Scoped under #neural-core (an id) so it outranks the typesafe skin's
   `body.theme-typesafe .site-shell p/li/button` rules without !important.
   Layout states set by assets/js/neural-core/main.js:
     .nc-is-static   static SVG schematic (default before JS, no-WebGL, errors)
     .nc-is-live     WebGL scene running
     .nc-story       tall scroll-story section with a sticky stage
     .nc-t-*         intro sequence steps (boot → name → tag → cta → ui)
     .nc-scrolled / .nc-chapter-on / .nc-has-selection / .nc-has-group /
     .nc-explore-mode
   ========================================================================== */

#neural-core {
  --nc-bg: #000;
  --nc-fg: #f0f0fa;
  --nc-soft: rgba(240, 240, 250, 0.78);
  --nc-dim: rgba(240, 240, 250, 0.52);
  --nc-line: rgba(240, 240, 250, 0.14);
  --nc-line-strong: rgba(240, 240, 250, 0.32);
  --nc-panel: rgba(8, 8, 9, 0.78);
  --nc-blue: #6fb2ff;
  --nc-lime: #c6f432;
  --nc-display: var(--ts-display, "Space Grotesk", "Helvetica Neue", Arial, sans-serif);
  --nc-mono: var(--ts-term, "Space Mono", "JetBrains Mono", ui-monospace, Consolas, monospace);
  --nc-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nc-stage-h: calc(100vh - var(--nc-nav, 0px));

  position: relative;
  /* Full-bleed out of the 1040px .site-shell column. --nc-vw is the
     viewport width without the scrollbar (set by main.js). */
  width: var(--nc-vw, 100vw);
  margin-left: calc(50% - var(--nc-vw, 100vw) / 2);
  margin-top: -42px;
  margin-bottom: 64px;
  height: var(--nc-stage-h);
  min-height: 540px;
  background: var(--nc-bg);
  color: var(--nc-fg);
  font-family: var(--nc-display);
  /* style.css justifies every <p> with text-align-last:left. */
  text-align-last: auto;
}

@supports (height: 100svh) {
  #neural-core {
    --nc-stage-h: calc(100svh - var(--nc-nav, 0px));
  }
}

#neural-core.nc-story {
  height: 600vh;
}

/* Undo the site-wide justified <p> (style.css) inside the hero. */
#neural-core p {
  text-align: left;
  text-align-last: auto;
  line-height: 1.5;
}

#neural-core .nc-stage {
  position: sticky;
  top: var(--nc-nav, 0px);
  height: var(--nc-stage-h);
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
}

/* Vignette + top/bottom fades keep overlay text legible over the scene. */
#neural-core .nc-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 76%, rgba(0, 0, 0, 0.9) 100%),
    radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.65) 100%);
}

#neural-core .nc-viewport {
  position: absolute;
  inset: 0;
  outline: none;
}

#neural-core .nc-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#neural-core .nc-viewport:focus-visible::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(111, 178, 255, 0.45);
  pointer-events: none;
}

/* ------------------------------ static fallback --------------------------- */

#neural-core .nc-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16vh 4vw 14vh;
}

#neural-core .nc-schematic {
  width: min(1180px, 100%);
  height: auto;
  max-height: 100%;
}

#neural-core .nc-schematic-labels {
  font-family: var(--nc-mono);
}

#neural-core.nc-is-live .nc-fallback {
  display: none;
}

#neural-core:not(.nc-is-live) :is(.nc-viewport, .nc-boot, .nc-chapter, .nc-hud, .nc-map, .nc-controls, .nc-inspector, .nc-tooltip, .nc-scroll) {
  display: none;
}

/* --------------------------------- title ---------------------------------- */

#neural-core .nc-titleblock {
  position: absolute;
  z-index: 3;
  top: clamp(18px, 4.2vh, 44px);
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s var(--nc-ease), transform 0.6s var(--nc-ease);
}

#neural-core .nc-name {
  margin: 0;
  font-family: var(--nc-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 6.4vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-align: center;
  color: var(--nc-fg);
}

#neural-core .nc-keywords {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
  font-family: var(--nc-mono);
  font-size: clamp(0.6rem, 1.05vw, 0.74rem);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--nc-dim);
}

#neural-core .nc-keywords span + span::before {
  content: "\2022";
  margin: 0 0.9em;
  color: rgba(240, 240, 250, 0.28);
}

#neural-core .nc-kicker,
#neural-core .nc-handoff-label {
  margin: 0 0 14px;
  font-family: var(--nc-mono);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(240, 240, 250, 0.42);
}

#neural-core .nc-kicker b,
#neural-core .nc-handoff-label b {
  font-weight: 400;
  color: var(--nc-lime);
  margin-right: 0.9em;
}

#neural-core .nc-lede {
  margin: 16px auto 0;
  max-width: 34em;
  padding: 0 16px;
  font-family: var(--nc-display);
  font-size: clamp(0.88rem, 1.25vw, 1.02rem);
  line-height: 1.45;
  text-align: center;
  color: var(--nc-soft);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
}

/* ---------------------------------- CTA ----------------------------------- */

#neural-core .nc-cta {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(18px, 4.5vh, 46px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: opacity 0.6s var(--nc-ease), transform 0.6s var(--nc-ease);
}

#neural-core .nc-explore {
  display: inline-block;
  padding: 13px 26px;
  font-family: var(--nc-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nc-fg);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--nc-line-strong);
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}

#neural-core .nc-explore:hover,
#neural-core .nc-explore:focus-visible {
  color: var(--nc-lime);
  border-color: var(--nc-lime);
  outline: none;
}

#neural-core .nc-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--nc-mono);
  font-size: 0.58rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--nc-dim);
}

#neural-core .nc-scroll i {
  position: relative;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: var(--nc-line);
}

#neural-core .nc-scroll i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: var(--nc-fg);
  animation: nc-scroll-line 2s var(--nc-ease) infinite;
}

@keyframes nc-scroll-line {
  0% { top: -40%; }
  100% { top: 100%; }
}

#neural-core.nc-scrolled .nc-titleblock,
#neural-core.nc-has-selection .nc-titleblock,
#neural-core.nc-has-group .nc-titleblock,
#neural-core.nc-explore-mode .nc-titleblock {
  opacity: 0;
  transform: translateY(-14px);
}

#neural-core.nc-scrolled .nc-cta,
#neural-core.nc-has-selection .nc-cta,
#neural-core.nc-has-group .nc-cta,
#neural-core.nc-explore-mode .nc-cta {
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
}

/* ------------------------------ intro sequence ---------------------------- */

#neural-core .nc-boot {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--nc-mono);
  font-size: 0.64rem;
  letter-spacing: 0.32em;
  color: var(--nc-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

#neural-core .nc-boot-bar {
  width: 160px;
  height: 1px;
  background: var(--nc-line);
  overflow: hidden;
}

#neural-core .nc-boot-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--nc-fg);
  transform-origin: left;
  transform: scaleX(0);
}

#neural-core.nc-t-boot .nc-boot { opacity: 1; }
#neural-core.nc-t-boot .nc-boot-bar i { transform: scaleX(1); transition: transform 1.6s var(--nc-ease); }
#neural-core.nc-t-name .nc-boot,
#neural-core.nc-t-done .nc-boot { opacity: 0; }

#neural-core.nc-is-live .nc-kicker,
#neural-core.nc-is-live .nc-name,
#neural-core.nc-is-live .nc-keywords,
#neural-core.nc-is-live .nc-lede,
#neural-core.nc-is-live .nc-cta > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--nc-ease), transform 0.9s var(--nc-ease);
}

#neural-core.nc-t-name .nc-kicker,
#neural-core.nc-t-name .nc-name,
#neural-core.nc-t-tag .nc-keywords,
#neural-core.nc-t-tag .nc-lede,
#neural-core.nc-t-cta .nc-cta > * {
  opacity: 1;
  transform: none;
}

#neural-core.nc-is-live :is(.nc-map, .nc-controls, .nc-hud) {
  transition: opacity 0.8s var(--nc-ease);
}

#neural-core.nc-is-live:not(.nc-t-ui) :is(.nc-map, .nc-controls, .nc-hud) {
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------ shared controls --------------------------- */

#neural-core .nc-ctl,
#neural-core .nc-entry {
  font-family: var(--nc-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--nc-dim);
  background: var(--nc-panel);
  border: 1px solid var(--nc-line);
  border-radius: 0;
  padding: 9px 11px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

#neural-core .nc-ctl:hover,
#neural-core .nc-entry:hover,
#neural-core .nc-ctl:focus-visible,
#neural-core .nc-entry:focus-visible {
  color: var(--nc-fg);
  border-color: var(--nc-line-strong);
  outline: none;
}

#neural-core .nc-ctl:focus-visible,
#neural-core .nc-entry:focus-visible {
  box-shadow: 0 0 0 1px var(--nc-blue);
}

#neural-core .nc-ctl[aria-pressed="true"],
#neural-core .nc-ctl[aria-checked="true"],
#neural-core .nc-entry[aria-current="true"] {
  color: var(--nc-lime);
  border-color: rgba(198, 244, 50, 0.55);
}

#neural-core .nc-ctl-icon {
  min-width: 32px;
  font-size: 0.85rem;
  padding: 6px 8px;
}

/* ---------------------------------- HUD ----------------------------------- */

#neural-core .nc-hud {
  position: absolute;
  z-index: 3;
  top: clamp(18px, 4.2vh, 44px);
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--nc-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--nc-dim);
  pointer-events: none;
}

#neural-core .nc-hud b {
  display: inline-block;
  min-width: 64px;
  font-weight: 400;
  color: rgba(240, 240, 250, 0.32);
}

#neural-core .nc-hud [data-nc-hud="phase"] {
  color: var(--nc-lime);
}

/* ------------------------------ chapter caption --------------------------- */

#neural-core .nc-chapter {
  position: absolute;
  z-index: 3;
  left: clamp(20px, 4vw, 64px);
  top: 50%;
  width: min(340px, 80vw);
  transform: translateY(-40%);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.9);
  transition: opacity 0.6s var(--nc-ease), transform 0.6s var(--nc-ease);
}

/* Soft scrim so captions stay legible over bright parts of the scene. */
#neural-core .nc-chapter::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40px -60px -40px -120px;
  background: radial-gradient(ellipse at 35% 50%, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

#neural-core.nc-chapter-on .nc-chapter {
  opacity: 1;
  transform: translateY(-50%);
}

#neural-core.nc-has-selection .nc-chapter,
#neural-core.nc-has-group .nc-chapter {
  opacity: 0;
}

#neural-core .nc-chapter-index {
  font-family: var(--nc-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--nc-lime);
}

#neural-core .nc-chapter-title {
  margin: 10px 0 10px;
  font-family: var(--nc-display);
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  line-height: 1;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--nc-fg);
}

#neural-core .nc-chapter-body {
  margin: 0 0 16px;
  font-family: var(--nc-display);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--nc-soft);
}

#neural-core .nc-chapter-progress {
  display: block;
  height: 1px;
  background: var(--nc-line);
}

#neural-core .nc-chapter-progress i {
  display: block;
  height: 100%;
  background: var(--nc-fg);
  transform-origin: left;
  transform: scaleX(0);
}

/* ------------------------------- system map ------------------------------- */

#neural-core .nc-map {
  position: absolute;
  z-index: 4;
  left: 24px;
  bottom: 24px;
  width: 236px;
}

#neural-core .nc-map-title {
  margin: 0 0 8px;
  font-family: var(--nc-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(240, 240, 250, 0.38);
}

#neural-core .nc-map-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

#neural-core .nc-map-groups .nc-ctl {
  text-align: left;
}

#neural-core .nc-map-list {
  display: none;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 34vh;
  overflow: auto;
}

#neural-core.nc-has-group .nc-map-list {
  display: grid;
  gap: 3px;
}

#neural-core .nc-map-list li {
  margin: 0;
  padding: 0;
}

#neural-core .nc-map-list li[hidden] {
  display: none;
}

#neural-core .nc-entry {
  width: 100%;
  text-align: left;
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 0.68rem;
}

/* ------------------------------ view controls ----------------------------- */

#neural-core .nc-controls {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 420px;
}

#neural-core .nc-mode {
  display: inline-flex;
  gap: 4px;
}

#neural-core.nc-explore-mode .nc-controls::before {
  content: "Drag to orbit · pinch or ctrl + scroll to zoom · click a module";
  flex-basis: 100%;
  text-align: right;
  margin-bottom: 6px;
  font-family: var(--nc-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nc-dim);
}

/* -------------------------------- inspector ------------------------------- */

#neural-core .nc-inspector {
  --nc-holo: #4fb4ff;
  --nc-holo-soft: rgba(79, 180, 255, 0.32);
  position: absolute;
  z-index: 5;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: min(370px, calc(100% - 48px));
  max-height: calc(100% - 140px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--nc-holo-soft) transparent;
  padding: 22px 22px 18px;
  background:
    linear-gradient(180deg, rgba(79, 180, 255, 0.08), rgba(79, 180, 255, 0) 38%),
    repeating-linear-gradient(0deg, rgba(120, 190, 255, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(10, 22, 44, 0.9), rgba(3, 7, 16, 0.92));
  border: 1px solid var(--nc-holo-soft);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(47, 140, 255, 0.22),
    inset 0 0 32px rgba(47, 140, 255, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  animation: nc-panel-in 0.45s var(--nc-ease);
}

/* Corner brackets + a top beam, HUD style. */
#neural-core .nc-inspector::before,
#neural-core .nc-inspector::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 2px solid var(--nc-holo);
  filter: drop-shadow(0 0 4px var(--nc-holo));
}

#neural-core .nc-inspector::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 6px;
}

#neural-core .nc-inspector::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 6px;
}

#neural-core .nc-inspector[hidden] {
  display: none;
}

@keyframes nc-panel-in {
  from { opacity: 0; transform: translate(12px, -50%); }
  to { opacity: 1; transform: translate(0, -50%); }
}

#neural-core .nc-inspector-eyebrow,
#neural-core .nc-inspector-label {
  margin: 0;
  font-family: var(--nc-mono);
  font-size: 0.58rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: left;
  text-align-last: left;
  color: var(--nc-holo);
}

#neural-core .nc-inspector-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live status dot + rule after the group name. */
#neural-core .nc-inspector-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nc-holo);
  box-shadow: 0 0 8px var(--nc-holo);
  animation: nc-holo-blink 1.6s ease-in-out infinite;
}

#neural-core .nc-inspector-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--nc-holo-soft), transparent);
}

@keyframes nc-holo-blink {
  50% { opacity: 0.35; }
}

#neural-core .nc-inspector-label {
  margin-top: 18px;
  color: rgba(160, 205, 255, 0.55);
}

#neural-core .nc-inspector-name {
  margin: 10px 0 12px;
  padding: 0;
  border: 0;
  font-family: var(--nc-display);
  font-size: 1.65rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #d6ecff;
  text-shadow: 0 0 12px rgba(79, 180, 255, 0.75), 0 0 32px rgba(47, 140, 255, 0.35);
}

#neural-core .nc-inspector-desc {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--nc-holo-soft);
  font-family: var(--nc-display);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: left;
  text-align-last: left;
  color: rgba(220, 232, 250, 0.8);
}

#neural-core .nc-chips {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Tags cycle through the Q / K / V palette: blue, orange, purple. */
#neural-core .nc-chips li {
  --nc-tag: #4fb4ff;
  margin: 0;
  padding: 5px 9px;
  font-family: var(--nc-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: #eef6ff;
  border: 1px solid color-mix(in srgb, var(--nc-tag) 65%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--nc-tag) 12%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--nc-tag) 28%, transparent), inset 0 0 8px color-mix(in srgb, var(--nc-tag) 14%, transparent);
  text-shadow: 0 0 6px color-mix(in srgb, var(--nc-tag) 70%, transparent);
}

#neural-core .nc-chips li:nth-child(3n + 2) { --nc-tag: #ff9a2e; }
#neural-core .nc-chips li:nth-child(3n + 3) { --nc-tag: #a26bff; }

#neural-core .nc-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 0;
  margin: 18px 0 0;
  padding: 0;
  border: 1px solid rgba(79, 180, 255, 0.16);
  border-radius: 4px;
  background: rgba(79, 180, 255, 0.12);
  overflow: hidden;
}

#neural-core .nc-facts dt,
#neural-core .nc-facts dd {
  padding: 8px 10px;
  background: rgba(4, 10, 22, 0.92);
}

#neural-core .nc-facts dt {
  position: relative;
  padding-left: 16px;
  font-family: var(--nc-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(130, 195, 255, 0.85);
}

#neural-core .nc-facts dt::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--nc-holo);
  box-shadow: 0 0 6px var(--nc-holo);
}

#neural-core .nc-facts dd {
  margin: 0;
  font-family: var(--nc-display);
  font-size: 0.8rem;
  line-height: 1.4;
  color: #dbe9fb;
}

#neural-core .nc-inspector-nav {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

#neural-core .nc-inspector-nav .nc-ctl {
  color: rgba(200, 225, 255, 0.85);
  background: rgba(79, 180, 255, 0.06);
  border-color: rgba(79, 180, 255, 0.35);
  border-radius: 3px;
}

#neural-core .nc-inspector-nav .nc-ctl:hover,
#neural-core .nc-inspector-nav .nc-ctl:focus-visible {
  color: #fff;
  border-color: var(--nc-holo);
  box-shadow: 0 0 12px rgba(79, 180, 255, 0.45);
}

#neural-core .nc-inspector-nav [data-nc-close] {
  margin-left: auto;
}

/* --------------------------------- tooltip -------------------------------- */

#neural-core .nc-tooltip {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  white-space: nowrap;
  background: rgba(7, 7, 8, 0.85);
  border: 1px solid var(--nc-line-strong);
  border-left: 2px solid var(--nc-blue);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

#neural-core .nc-tooltip.is-visible {
  opacity: 1;
}

#neural-core .nc-tooltip b {
  font-family: var(--nc-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--nc-fg);
}

#neural-core .nc-tooltip span {
  font-family: var(--nc-mono);
  font-size: 0.54rem;
  letter-spacing: 0.24em;
  color: var(--nc-dim);
}

/* ------------------------- handoff: system → engineer ---------------------- */
/* main.js drives --nc-out (0 → 1) over the last stretch of the scroll story:
   the scene recedes and fades into black, then ENGINEER / BUILDER arrives and
   the profile section (index.md .hero) follows on the same black canvas. */

#neural-core.nc-is-live .nc-viewport {
  opacity: calc(1 - var(--nc-out, 0));
  transform: scale(calc(1 - 0.08 * var(--nc-out, 0)));
  transform-origin: 50% 45%;
}

#neural-core .nc-handoff {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#neural-core.nc-is-live.nc-story .nc-handoff {
  display: flex;
  --nc-in: clamp(0, calc((var(--nc-out, 0) - 0.55) / 0.45), 1);
  opacity: var(--nc-in);
  transform: translateY(calc((1 - var(--nc-in)) * 28px));
  filter: blur(calc((1 - var(--nc-in)) * 6px));
}

#neural-core .nc-handoff-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--nc-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 7.6rem);
  line-height: 0.86;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--nc-fg);
}

#neural-core .nc-handoff-title span + span {
  color: rgba(240, 240, 250, 0.38);
}

/* Overlay UI retires as the scene hands off. */
#neural-core.nc-handoff-on :is(.nc-chapter, .nc-hud, .nc-map, .nc-controls, .nc-inspector, .nc-tooltip) {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s var(--nc-ease);
}

/* --------------------------------- utility -------------------------------- */

#neural-core .nc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nc-end {
  display: block;
  height: 0;
}

/* --------------------------------- tablet --------------------------------- */

@media (max-width: 1100px) {
  #neural-core .nc-hud {
    display: none;
  }

  #neural-core .nc-chapter {
    top: auto;
    bottom: 130px;
    transform: translateY(10px);
  }

  #neural-core.nc-chapter-on .nc-chapter {
    transform: none;
  }
}

/* --------------------------------- mobile --------------------------------- */

@media (max-width: 760px) {
  #neural-core {
    margin-top: -42px;
  }

  #neural-core.nc-story {
    height: 500vh;
  }

  #neural-core .nc-fallback {
    padding: 22vh 2vw 20vh;
  }

  #neural-core .nc-keywords {
    letter-spacing: 0.18em;
    padding: 0 12px;
  }

  #neural-core .nc-chapter {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 112px;
  }

  #neural-core .nc-chapter-body {
    font-size: 0.82rem;
  }

  #neural-core .nc-map {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  #neural-core .nc-map-title {
    display: none;
  }

  #neural-core .nc-map-groups {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #neural-core .nc-map-groups .nc-ctl {
    flex: 0 0 auto;
  }

  #neural-core .nc-map-list {
    max-height: 24vh;
  }

  #neural-core .nc-controls {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: 52px;
    justify-content: flex-end;
  }

  #neural-core.nc-explore-mode .nc-controls::before {
    display: none;
  }

  /* Inspector becomes a bottom sheet. */
  #neural-core .nc-inspector {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 58%;
    transform: none;
    animation-name: nc-sheet-in;
    padding: 18px 18px 14px;
  }

  @keyframes nc-sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }

  #neural-core.nc-has-selection :is(.nc-map, .nc-controls) {
    opacity: 0;
    pointer-events: none;
  }

  /* While the title + CTA own the first screen, keep the bottom edge clear;
     the map and controls arrive once the visitor scrolls or explores. */
  #neural-core.nc-is-live:not(.nc-scrolled):not(.nc-explore-mode):not(.nc-has-group):not(.nc-has-selection) :is(.nc-map, .nc-controls) {
    opacity: 0;
    pointer-events: none;
  }

  #neural-core .nc-explore {
    white-space: nowrap;
    letter-spacing: 0.22em;
    padding: 12px 20px;
  }
}

/* ----------------------------- reduced motion ----------------------------- */

@media (prefers-reduced-motion: reduce) {
  #neural-core *,
  #neural-core *::before,
  #neural-core *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------------- text-only hero (no 3D model) ---------------------- */
/* _includes/hero-text.html + assets/js/hero-text.js. Same black stage and type
   as the 3D hero; the title block is centred (nothing sits under it now), the
   scroll story is shorter, and the handoff reveals four words in turn as
   --nc-words climbs 0 → 4 (each span carries its index in --i). */

#neural-core.nc-textonly.nc-story {
  height: 320vh;
}

#neural-core.nc-textonly .nc-titleblock {
  top: 50%;
  transform: translateY(-50%);
}

#neural-core.nc-textonly.nc-scrolled .nc-titleblock {
  opacity: 0;
  transform: translateY(calc(-50% - 14px));
}

#neural-core.nc-textonly .nc-name {
  font-size: clamp(2.4rem, 8vw, 7rem);
}

#neural-core.nc-textonly .nc-handoff-title span {
  --nc-a: clamp(0, calc(var(--nc-words, 0) - var(--i, 0)), 1);
  display: block;
  opacity: var(--nc-a);
  transform: translateY(calc((1 - var(--nc-a)) * 26px));
  filter: blur(calc((1 - var(--nc-a)) * 6px));
}

@media (max-width: 760px) {
  #neural-core.nc-textonly.nc-story {
    height: 300vh;
  }
}
