/* sophiaxt.com/mnema — clean, professional, dark mode default */

:root {
  /* Aligned to sophiaxt.com portal palette
     (Navigation.tsx: #060B14 bg, #00D4FF cyan, #0066FF blue, #FF6B35 orange) */
  --bg: #060B14;
  --bg-alt: #0A1628;
  --bg-card: #0F1A2E;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #d7dde6;
  --text-dim: #8b96a8;
  --text-bright: #ffffff;
  --accent: #00D4FF;
  --accent-hover: #5ce1ff;
  --accent-blue: #0066FF;
  --accent-orange: #FF6B35;
  --accent-yellow: #FFD93D;
  --gradient-brand: linear-gradient(135deg, #00D4FF, #0066FF);
  --success: #4ade80;
  --warning: #FFD93D;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 760px;
}

/* TOP NAV */
.topnav {
  position: sticky;
  top: 0;
  background: rgba(6, 11, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: filter 0.2s;
}
.logo-link:hover {
  filter: brightness(1.15);
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.25));
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .back-to-portal {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: all 0.2s;
}
.nav-links .back-to-portal:hover {
  color: var(--text-bright);
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.06);
}

/* HERO */
.hero {
  position: relative;
  padding: 110px 0 90px;
  background:
    radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.10), transparent 55%),
    radial-gradient(circle at 10% 100%, rgba(0, 102, 255, 0.08), transparent 55%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 212, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.5;
}
.hero > * { position: relative; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 24px;
}
.hero-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.2px;
  color: var(--text-bright);
  margin-bottom: 24px;
}
.accent {
  background-image: var(--gradient-brand);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-weight: 800;
}
.hero-sub {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #060B14;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 212, 255, 0.4);
}
.btn-primary:disabled {
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--accent);
}

/* HERO STATS */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  max-width: 700px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat strong {
  display: block;
  font-size: 1.8rem;
  color: var(--text-bright);
  font-weight: 700;
  margin-bottom: 4px;
}
.stat span {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* SECTIONS */
.section {
  padding: 80px 0;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--text-bright);
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.section h3 {
  color: var(--text-bright);
  margin-bottom: 16px;
  font-weight: 600;
}
.section p {
  margin-bottom: 16px;
  color: var(--text);
}
.section .lead {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.muted { color: var(--text-dim); }
.link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* PILLARS */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.pillar {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  font-size: 1.4rem;
  border-radius: 10px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent);
}
.pillar:nth-child(2) .pillar-icon {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
  color: var(--accent-blue);
}
.pillar:nth-child(3) .pillar-icon {
  background: rgba(255, 217, 61, 0.08);
  border-color: rgba(255, 217, 61, 0.3);
  color: var(--accent-yellow);
}
.pillar h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.pillar p {
  color: var(--text-dim);
  margin-bottom: 0;
}

/* DEMO */
.demo-video {
  margin: 32px 0;
}
.video-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  background:
    linear-gradient(135deg, rgba(110, 231, 255, 0.04), transparent),
    var(--bg-card);
}
.video-placeholder p { margin: 4px 0; }

/* TRANSCRIPT */
.transcript {
  margin-top: 48px;
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.transcript h3 {
  margin-bottom: 8px;
}
.qa {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.qa:first-of-type {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}
.qa-prompt {
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.qa-prompt::before {
  content: "Q ";
  color: var(--accent);
  font-weight: 700;
}
.qa-routing {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
  border-left: 2px solid var(--accent);
}
.qa-routing strong {
  color: var(--accent);
}
.qa-answer {
  color: var(--text);
  line-height: 1.65;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

/* INTERACTIVE */
.interactive {
  margin-top: 48px;
  background: linear-gradient(180deg, var(--bg-card), rgba(7, 17, 31, 0.6));
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.interactive h3 { margin-bottom: 8px; }

/* Prominent variant — used when chat is at the top of the demo section */
.interactive-prominent {
  margin-top: 32px;
  padding: 36px 32px;
  background:
    radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.12), transparent 55%),
    radial-gradient(circle at 10% 100%, rgba(0, 102, 255, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-card), rgba(7, 17, 31, 0.85));
  border: 1px solid rgba(0, 212, 255, 0.25);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 80px rgba(0, 212, 255, 0.08);
}
.interactive-prominent h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.interactive-prominent .prompt-box {
  margin-top: 28px;
}
.interactive-prominent .prompt-box input {
  font-size: 1.05rem;
  padding: 16px 20px;
}
.interactive-prominent .prompt-box .btn {
  font-size: 1.0rem;
  padding: 16px 32px;
}

/* CHAT history + turn cards */
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0;
  /* No max-height: let the page scroll naturally. With the auto
   * scrollIntoView on send, the user always sees the new card top
   * regardless of how much history they have above. */
  scroll-behavior: smooth;
}
.chat-turn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Reserve some min-height so the card doesn't pop into existence and
   * cause a visible layout jump when tokens start streaming. */
  min-height: 120px;
  scroll-margin-top: 80px; /* offset for the sticky topnav when scrollIntoView lands */
}
/* Make the prompt + meta + pipeline stay visible at top of card while
 * the reply body streams in below. */
.chat-prompt, .chat-meta, .chat-pipeline {
  position: relative;
  z-index: 1;
}
.chat-prompt {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 1rem;
  line-height: 1.45;
}
.chat-prompt::first-letter { color: var(--accent); }
.chat-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.chat-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.chat-status[data-state="connecting"]::before { background: #fbbf24; animation: pulse 1s infinite; }
.chat-status[data-state="routing"]::before { background: var(--accent); animation: pulse 1s infinite; }
.chat-status[data-state="generating"]::before { background: var(--accent-blue); animation: pulse 1s infinite; }
.chat-status[data-state="done"]::before { background: #4ade80; }
.chat-status[data-state="error"]::before { background: #ef4444; }
.chat-status[data-state="done"] { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.chat-status[data-state="error"] { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.chat-elapsed, .chat-tokens {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.chat-route {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(0, 212, 255, 0.05);
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  transition: all 0.4s ease;
}
.chat-route strong, .chat-route .route-spec { color: var(--accent); }
.chat-route .route-arrow {
  color: var(--accent);
  margin-right: 6px;
}
.chat-route .scores {
  color: var(--text-dim);
  margin-left: 8px;
  font-size: 0.78rem;
}
.chat-route .route-time {
  color: #4ade80;
  margin-left: 6px;
  font-size: 0.78rem;
}
.chat-route.route-resolved {
  background: rgba(0, 212, 255, 0.10);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

/* Diffusion-style thinking grid (shown while waiting for first token) */
.chat-thinking {
  min-height: 0;
  transition: min-height 0.3s, opacity 0.3s;
}
.chat-thinking:not(:empty) {
  min-height: 56px;
  padding: 10px 0;
}
.thinking-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  max-width: 360px;
}
.thinking-cell {
  color: var(--accent);
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.95rem;
  text-align: center;
  opacity: 0;
  animation: think-pulse 1.6s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}
.thinking-cell:nth-child(1) { animation-delay: 0s; }
.thinking-cell:nth-child(2) { animation-delay: 0.05s; }
.thinking-cell:nth-child(3) { animation-delay: 0.1s; }
.thinking-cell:nth-child(4) { animation-delay: 0.15s; }
.thinking-cell:nth-child(5) { animation-delay: 0.2s; }
.thinking-cell:nth-child(6) { animation-delay: 0.25s; }
.thinking-cell:nth-child(7) { animation-delay: 0.3s; }
.thinking-cell:nth-child(8) { animation-delay: 0.35s; }
.thinking-cell:nth-child(9) { animation-delay: 0.4s; }
.thinking-cell:nth-child(10) { animation-delay: 0.45s; }
.thinking-cell:nth-child(11) { animation-delay: 0.5s; }
.thinking-cell:nth-child(12) { animation-delay: 0.55s; }
.thinking-cell:nth-child(13) { animation-delay: 0.6s; }
.thinking-cell:nth-child(14) { animation-delay: 0.65s; }
.thinking-cell:nth-child(15) { animation-delay: 0.7s; }
.thinking-cell:nth-child(16) { animation-delay: 0.75s; }
@keyframes think-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Diffuse-token animation: each streamed token starts as noise glyphs and
 * settles into its real characters. The animation is JS-driven (see demo.js
 * diffuseTokenInto); this CSS just styles the transient noise + final state. */
.diffuse-token {
  display: inline;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.diffuse-token.settled {
  color: var(--text);
  text-shadow: none;
}

/* Session memory control bar */
.chat-memory-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
  padding: 8px 14px;
  background: rgba(74, 222, 128, 0.04);
  border: 1px solid rgba(74, 222, 128, 0.18);
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  flex-wrap: wrap;
}
.memory-badge {
  color: #4ade80;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.memory-hint {
  color: var(--text-dim);
  flex: 1;
  min-width: 200px;
}
.memory-clear {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.memory-clear:hover {
  color: var(--text-bright);
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.06);
}
/* ─── HERO-DEMO (demo-as-hero pattern) ──────────────────────────── */
.hero-with-demo {
  padding-top: 40px;
  padding-bottom: 32px;
}
.hero-title-tight {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 8px;
  line-height: 1.15;
}
.hero-sub-tight {
  font-size: 1rem;
  margin-bottom: 22px;
  max-width: 720px;
}
.interactive-hero {
  margin-top: 8px;
  margin-bottom: 24px;
  /* Stronger framing so the demo is unambiguous as the page's hero */
  border: 2px solid rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.18),
              inset 0 0 60px rgba(0, 102, 255, 0.04);
}
.hero-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
}
.hero-demo-meta {
  color: var(--text-dim);
  letter-spacing: 0.4px;
}
.prompt-box-hero {
  margin-bottom: 12px;
}
.prompt-box-hero input {
  font-size: 1.05rem;
  padding: 14px 18px;
}
.prompt-box-hero button {
  padding: 14px 24px;
  font-size: 1rem;
}
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.quick-prompt {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 100px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.quick-prompt:hover {
  background: rgba(0, 212, 255, 0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}
.quick-prompt:active {
  transform: translateY(0);
}
.quick-prompt.fired {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.hero-stats-compact {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.hero-stats-compact .stat strong {
  font-size: 1.4rem;
}

/* ─── Inference pipeline visualization (Send → Queue → Route → ...) ─ */
.chat-pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: rgba(6, 11, 20, 0.6);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
}
.pipe-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.pipe-icon {
  font-size: 0.85rem;
  line-height: 1;
}
.pipe-label {
  letter-spacing: 0.5px;
  font-weight: 500;
}
.pipe-arrow {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
}
.pipe-step.done {
  background: rgba(74, 222, 128, 0.08);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.25);
}
.pipe-step.done .pipe-icon { color: #4ade80; }
.pipe-step.active {
  background: rgba(0, 212, 255, 0.18);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.35);
  animation: pipe-pulse 1.2s ease-in-out infinite;
}
.pipe-step.active .pipe-icon {
  color: var(--accent);
  animation: pipe-spin 1.5s linear infinite;
  display: inline-block;
}
@keyframes pipe-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 24px rgba(0, 212, 255, 0.7); }
}
@keyframes pipe-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (max-width: 720px) {
  .chat-pipeline { font-size: 0.7rem; gap: 4px 6px; padding: 10px; }
  .pipe-step { padding: 3px 8px; }
  .pipe-label { display: none; }  /* mobile: icons only */
  .pipe-arrow { display: none; }
}

/* ─── Black-box panel — live model internals ─────────────────────── */
/* Two-column layout: reply column on left, black-box sidebar on right.
 * Stacks on mobile. */
.chat-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 18px;
  align-items: start;
}
.chat-reply-col { min-width: 0; }
@media (max-width: 720px) {
  .chat-body { grid-template-columns: 1fr; }
}

.chat-blackbox {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.04), rgba(0, 102, 255, 0.02));
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 10px;
  padding: 14px 14px 12px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.chat-blackbox::before {
  /* scan-line shimmer */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 212, 255, 0.04) 50%, transparent 100%);
  background-size: 100% 8px;
  pointer-events: none;
  opacity: 0.5;
}
.bb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}
.bb-header-label {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}
.bb-activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
}
.bb-activity-dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}
.bb-activity-dot.pulse {
  animation: bb-pulse 0.18s ease-out;
}
@keyframes bb-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.6); box-shadow: 0 0 16px rgba(0, 212, 255, 0.9); }
  100% { transform: scale(1); }
}
.bb-section { display: flex; flex-direction: column; gap: 6px; }
.bb-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.bb-specialist-name {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
}
.bb-specialist-name.resolved {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}
.bb-specialist-score {
  color: var(--text-dim);
  font-size: 0.7rem;
}
.bb-capsules {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bb-capsule {
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s;
}
.bb-capsule.chosen {
  background: rgba(0, 212, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.35);
}
.bb-capsule-name {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
}
.bb-capsule.chosen .bb-capsule-name { color: var(--accent); }
.bb-capsule-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}
.bb-capsule-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 102, 255, 0.5), rgba(0, 212, 255, 0.5));
  transition: width 0.4s ease;
}
.bb-capsule.chosen .bb-capsule-bar {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent));
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}
.bb-capsule-score {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-align: right;
}
.bb-noise-stream {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.08);
  min-height: 64px;
}
.bb-noise-cell {
  color: rgba(0, 212, 255, 0.5);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1;
  transition: color 0.15s, text-shadow 0.15s, transform 0.15s;
}
.bb-noise-cell.flash {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.8);
  transform: scale(1.15);
}
.bb-progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2.5px;
  overflow: hidden;
}
.bb-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent));
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
  transition: width 0.25s ease;
}
.bb-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.bb-stat {
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 8px;
  border-radius: 4px;
  text-align: center;
}
.bb-stat-label {
  color: var(--text-dim);
  font-size: 0.6rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bb-stat-value {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 2px;
}

.chat-reply {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.95rem;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 1.5em;
}
.chat-reply:empty::before {
  content: "generating...";
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85rem;
}
.chat-error {
  font-size: 0.85rem;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #fca5a5;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.badge.live {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}
.prompt-box {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.prompt-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.prompt-box input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* RESEARCH */
.research-card {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.research-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.research-card p { margin-bottom: 8px; }

/* COMPARE TABLE */
.compare-table {
  overflow-x: auto;
  margin-top: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.compare-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 700px;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.compare-table thead {
  background: var(--bg-card);
}
.compare-table th {
  color: var(--text-bright);
  font-weight: 600;
  font-size: 0.9rem;
}
.compare-table th small {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.78rem;
}
.compare-table td {
  color: var(--text-dim);
}
.compare-table tr td:last-child {
  color: var(--text);
}
.compare-table tbody tr:hover {
  background: var(--bg-card);
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.contact-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.contact-card h4 {
  color: var(--text-bright);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.contact-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.55;
}

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-alt);
}
.footer p {
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
}
.footer a {
  margin: 0 4px;
}

/* MOBILE */
@media (max-width: 768px) {
  .nav-links { gap: 14px; font-size: 0.84rem; }
  .nav-links a { font-size: 0.84rem; }
  .hero { padding: 60px 0 40px; }
  .section { padding: 60px 0; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .prompt-box { flex-direction: column; }
  .prompt-box .btn { width: 100%; }
}
