:root {
  --bg-void: #030407;
  --bg-surface: rgba(8, 12, 22, 0.54);
  --bg-surface-strong: rgba(10, 15, 28, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.22);

  --text-primary: #f4f7fb;
  --text-secondary: rgba(226, 232, 244, 0.62);
  --text-dim: rgba(203, 213, 225, 0.36);

  --accent-1: #00e5ff;
  --accent-2: #7c3aed;
  --accent-3: #e0f2fe;
  --accent-1-rgb: 0, 229, 255;
  --accent-2-rgb: 99, 102, 241;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Mode-reactive accent palettes */
body[data-mode='core'] {
  --accent-1: #00e5ff;
  --accent-2: #6366f1;
  --accent-1-rgb: 0, 229, 255;
  --accent-2-rgb: 99, 102, 241;
}
body[data-mode='helix'] {
  --accent-1: #a855f7;
  --accent-2: #06b6d4;
  --accent-1-rgb: 168, 85, 247;
  --accent-2-rgb: 6, 182, 212;
}
body[data-mode='lattice'] {
  --accent-1: #38bdf8;
  --accent-2: #34d399;
  --accent-1-rgb: 56, 189, 248;
  --accent-2-rgb: 52, 211, 153;
}
body[data-mode='vortex'] {
  --accent-1: #f472b6;
  --accent-2: #6366f1;
  --accent-1-rgb: 244, 114, 182;
  --accent-2-rgb: 99, 102, 241;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-display);
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-void);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

body.is-loading {
  overflow: hidden;
}

@media (hover: none), (pointer: coarse) {
  body {
    cursor: auto;
  }
  a,
  button {
    cursor: pointer !important;
  }
  .cursor-outer,
  .cursor-dot {
    display: none !important;
  }
}

/* Background Fixed Canvases & Atmospheric Overlays */
#shader-bg,
#neural-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#shader-bg {
  z-index: 0;
}

#neural-canvas {
  z-index: 1;
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 32%, rgba(3, 4, 7, 0.68) 100%),
    linear-gradient(to bottom, rgba(3, 4, 7, 0.5) 0%, transparent 18%, transparent 82%, rgba(3, 4, 7, 0.85) 100%);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 82%);
}

.noise-overlay {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.032;
  background-image: radial-gradient(rgba(255, 255, 255, 0.65) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  animation: grainDrift 8s steps(6) infinite;
}

@keyframes grainDrift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1.5%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* Custom Optical Cursor */
.cursor-outer {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-100px, -100px, 0);
  transition:
    width 0.3s var(--ease-out-expo),
    height 0.3s var(--ease-out-expo),
    border-color 0.3s ease,
    background-color 0.3s ease;
  will-change: transform;
  mix-blend-mode: screen;
}

.cursor-outer.is-hover {
  width: 58px;
  height: 58px;
  border-color: var(--accent-1);
  background-color: rgba(0, 229, 255, 0.06);
}

.cursor-outer.is-active {
  width: 28px;
  height: 28px;
  border-color: #ffffff;
}

.cursor-coords {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 12px var(--accent-1);
  pointer-events: none;
  z-index: 10000;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #030407;
  transition: opacity 0.85s var(--ease-out-expo), visibility 0.85s ease, transform 0.9s var(--ease-out-expo);
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  pointer-events: none;
}

.preloader-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.preloader-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}

.ring-progress {
  fill: none;
  stroke: var(--accent-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  filter: drop-shadow(0 0 8px var(--accent-1));
}

.ring-inner {
  fill: none;
  stroke: rgba(124, 58, 237, 0.4);
  stroke-width: 1;
  stroke-dasharray: 6 6;
  transform-origin: center;
  animation: spinSlow 6s linear infinite;
}

.preloader-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.pct-unit {
  font-size: 11px;
  color: var(--accent-1);
  margin-left: 2px;
}

.preloader-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--text-secondary);
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-slow {
  transform-origin: 18px 18px;
  animation: spinSlow 10s linear infinite;
}

/* Floating HUD Header */
.hud-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1240px, calc(100% - 32px));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(6, 9, 17, 0.52);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: border-color 0.4s ease, background-color 0.4s ease;
}

.hud-header.is-scrolled {
  background: rgba(6, 9, 17, 0.78);
  border-color: rgba(255, 255, 255, 0.13);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-emblem {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent-1);
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.brand-name .dim {
  color: var(--accent-1);
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-pill {
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.nav-pill span {
  color: var(--text-dim);
  margin-right: 4px;
}

.nav-pill:hover,
.nav-pill.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-pill.active span {
  color: var(--accent-1);
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  cursor: none;
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.audio-btn:hover,
.audio-btn[aria-pressed='true'] {
  color: var(--text-primary);
  border-color: var(--accent-1);
  box-shadow: 0 0 18px -6px var(--accent-1);
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-secondary);
  transition: background-color 0.3s ease;
}

.audio-btn[aria-pressed='true'] .eq-bars i {
  background: var(--accent-1);
  animation: eqBounce 0.9s ease-in-out infinite alternate;
}

.audio-btn[aria-pressed='true'] .eq-bars i:nth-child(2) { animation-delay: 0.15s; }
.audio-btn[aria-pressed='true'] .eq-bars i:nth-child(3) { animation-delay: 0.32s; }
.audio-btn[aria-pressed='true'] .eq-bars i:nth-child(4) { animation-delay: 0.48s; }

@keyframes eqBounce {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* Main Content Layout */
#app-main {
  position: relative;
  z-index: 10;
}

.stage {
  position: relative;
  min-height: 100vh;
  padding: 120px 24px 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stage-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

/* SECTION 01: HERO */
.stage-hero {
  min-height: 100vh;
  padding-top: 90px;
  padding-bottom: 44px;
  justify-content: center;
}

.hero-hud-corners {
  position: absolute;
  inset: 102px 36px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.hud-tag .sep {
  color: var(--text-dim);
}

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 10px var(--accent-1);
  animation: pulseGlow 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.38; transform: scale(0.75); }
}

.hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 960px;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--accent-1);
  text-transform: uppercase;
}

.eyebrow .line {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(3.1rem, 8.8vw, 7.6rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  user-select: none;
}

.title-row {
  display: block;
  text-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
}

.gradient-sheen {
  background: linear-gradient(
    110deg,
    #ffffff 10%,
    var(--accent-1) 38%,
    #e2e8f0 52%,
    var(--accent-2) 72%,
    #ffffff 92%
  );
  background-size: 240% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sheenFlow 7s linear infinite;
}

@keyframes sheenFlow {
  0% { background-position: 0% center; }
  100% { background-position: 240% center; }
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 6px;
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 16, 30, 0.72);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  backdrop-filter: blur(16px);
  overflow: hidden;
  cursor: none;
  transition: border-color 0.35s ease, transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease;
}

.btn-primary .btn-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.26), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.btn-primary:hover {
  border-color: var(--accent-1);
  box-shadow: 0 0 36px -10px var(--accent-1);
}

.btn-primary:hover .btn-glow {
  opacity: 1;
}

.btn-arrow {
  width: 20px;
  height: 20px;
  color: var(--accent-1);
  animation: spinSlow 8s linear infinite;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  backdrop-filter: blur(12px);
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.btn-ghost svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-out-expo);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover svg {
  transform: translateX(4px);
}

/* Mode Switcher Dock */
.mode-dock {
  position: absolute;
  bottom: 58px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(7, 10, 19, 0.65);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(18px);
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  cursor: none;
  transition: all 0.35s var(--ease-out-expo);
}

.mode-chip .chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.mode-chip:hover {
  color: var(--text-primary);
}

.mode-chip.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mode-chip.active .chip-dot {
  background: var(--accent-1);
  box-shadow: 0 0 10px var(--accent-1);
}

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 30px;
  display: grid;
  place-items: center;
}

.scroll-line {
  width: 1px;
  height: 26px;
  background: linear-gradient(to bottom, transparent, var(--accent-1), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% { transform: translateY(-6px) scaleY(0.4); opacity: 0; }
  50% { transform: translateY(0) scaleY(1); opacity: 1; }
  100% { transform: translateY(6px) scaleY(0.4); opacity: 0; }
}

/* Reveal Choreography */
.reveal-item {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition:
    opacity 0.9s var(--ease-out-expo),
    transform 0.9s var(--ease-out-expo),
    filter 0.9s var(--ease-out-expo);
}

body.is-ready .reveal-item {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

body.is-ready .reveal-item:nth-child(2) { transition-delay: 0.1s; }
body.is-ready .reveal-item:nth-child(3) { transition-delay: 0.2s; }
body.is-ready .mode-dock.reveal-item { transition-delay: 0.32s; }

/* Section Headers */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--accent-1);
}

.section-title {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Glass Panels & Cursor Spotlight Border */
.glass-panel {
  position: relative;
  border-radius: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
  box-shadow:
    0 24px 80px -20px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    420px circle at var(--card-x, 50%) var(--card-y, 50%),
    rgba(var(--accent-1-rgb), 0.58),
    rgba(var(--accent-2-rgb), 0.3) 38%,
    transparent 65%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 4;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    520px circle at var(--card-x, 50%) var(--card-y, 50%),
    rgba(var(--accent-1-rgb), 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
  opacity: 1;
}

/* SECTION 02: TOPOLOGY MATRIX */
.topology-frame {
  display: flex;
  flex-direction: column;
}

.topology-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.status-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
}

.topology-controls {
  display: flex;
  gap: 10px;
}

.micro-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  cursor: none;
  transition: all 0.3s ease;
}

.micro-btn:hover {
  border-color: var(--accent-1);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 18px -6px var(--accent-1);
}

.topology-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(320px, 46vh, 480px);
}

#network-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.topology-metrics {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-subtle);
}

.metric-ring-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-right: 1px solid var(--border-subtle);
}

.metric-ring-item:last-child {
  border-right: none;
}

.gauge-svg {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent, var(--accent-1));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  filter: drop-shadow(0 0 6px var(--accent, var(--accent-1)));
  transition: stroke-dashoffset 1.6s var(--ease-out-expo);
}

.stage-topology.is-visible .gauge-fill {
  stroke-dashoffset: calc(163.36 - (163.36 * var(--pct)) / 100);
}

.metric-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.metric-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* SECTION 03: BENTO VISUAL MODULES */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.bento-card {
  position: relative;
  height: clamp(240px, 32vh, 320px);
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease-out-expo), border-color 0.35s ease;
  will-change: transform;
}

.module-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.card-overlay {
  position: relative;
  z-index: 3;
  height: 100%;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  background: linear-gradient(to top, rgba(3, 4, 7, 0.78) 0%, transparent 48%);
}

.card-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--accent-1);
}

.card-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-secondary);
}

.card-title {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* SECTION 04: SINGULARITY INTERFACE */
.singularity-console {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 390px;
}

.console-visual-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-right: 1px solid var(--border-subtle);
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.05), transparent 72%);
}

#latent-radar {
  width: 260px;
  height: 260px;
}

.radar-caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent-1);
}

.console-io-pane {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 28px;
  gap: 18px;
}

.console-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.stream-line {
  display: flex;
  gap: 10px;
  animation: lineFadeIn 0.35s var(--ease-out-expo) both;
}

@keyframes lineFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stream-line .prefix {
  color: var(--accent-1);
  flex-shrink: 0;
}

.stream-line.user .prefix {
  color: #a78bfa;
}

.stream-line .msg {
  color: var(--text-primary);
}

.quick-vectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vector-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  cursor: none;
  transition: all 0.28s ease;
}

.vector-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent-1);
  background: rgba(0, 229, 255, 0.09);
  transform: translateY(-1px);
}

.command-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(3, 5, 11, 0.72);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.command-form:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 26px -10px var(--accent-1);
}

.prompt-chevron {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-1);
}

#command-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
}

#command-input::placeholder {
  color: var(--text-dim);
}

.send-btn {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(0, 229, 255, 0.14);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  cursor: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.send-btn:hover {
  background: rgba(0, 229, 255, 0.28);
  box-shadow: 0 0 20px -4px var(--accent-1);
}

/* Footer */
.hud-footer {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 36px;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  margin-bottom: 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

/* Scroll stage reveal */
.stage:not(.stage-hero) .stage-inner {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}

.stage.is-visible .stage-inner {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .hud-nav {
    display: none;
  }
  .topology-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-ring-item:nth-child(2) {
    border-right: none;
  }
  .metric-ring-item:nth-child(1),
  .metric-ring-item:nth-child(2) {
    border-bottom: 1px solid var(--border-subtle);
  }
  .singularity-console {
    grid-template-columns: 1fr;
  }
  .console-visual-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 680px) {
  .hero-hud-corners {
    inset: 92px 20px auto;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .mode-dock {
    bottom: 50px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  .mode-chip {
    padding: 8px 12px;
    font-size: 10px;
  }
}
