/* ============================================================
   Raven Tech v2 — Visual Language
   ------------------------------------------------------------
   v1 was a dense, Apple-flavored trading desk. v2 is an AI
   brain console: obsidian + electric cyan/violet, generous
   negative space, hairline borders that *glow*, and motion
   that suggests live thinking.

   Anyone glancing at this UI should know in <2s it is v2 tech.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Geist+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap");

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Base canvas */
  --v2-bg-0: #06070a;
  --v2-bg-1: #0a0c12;
  --v2-bg-2: #0f1219;
  --v2-bg-3: #151926;

  --v2-surface: rgba(20, 24, 36, 0.55);
  --v2-surface-solid: #11141d;
  --v2-surface-elevated: rgba(28, 33, 48, 0.65);

  /* Borders + glows */
  --v2-line: rgba(125, 142, 180, 0.10);
  --v2-line-strong: rgba(125, 142, 180, 0.20);
  --v2-line-glow: rgba(34, 211, 238, 0.45);

  /* Type */
  --v2-text: #e9ecf3;
  --v2-text-soft: #b6becd;
  --v2-text-mute: #7a8298;
  --v2-text-faint: #4d5468;

  /* Brand accents */
  --v2-cyan: #22d3ee;
  --v2-cyan-glow: rgba(34, 211, 238, 0.55);
  --v2-violet: #a855f7;
  --v2-violet-glow: rgba(168, 85, 247, 0.55);
  --v2-magenta: #ec4899;
  --v2-amber: #fbbf24;
  --v2-emerald: #34d399;
  --v2-coral: #fb7185;

  /* Semantic */
  --v2-go: #34d399;
  --v2-hold: #fbbf24;
  --v2-pass: #fb7185;
  --v2-stress: #ec4899;

  /* Geometry */
  --v2-radius-xl: 22px;
  --v2-radius-lg: 16px;
  --v2-radius-md: 12px;
  --v2-radius-sm: 8px;
  --v2-radius-pill: 999px;

  /* Effects */
  --v2-shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.45);
  --v2-shadow-2: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 80px rgba(0, 0, 0, 0.55);
  --v2-glow-cyan: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 24px -2px rgba(34, 211, 238, 0.45);
  --v2-glow-violet: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 0 24px -2px rgba(168, 85, 247, 0.45);

  /* Type stacks */
  --v2-font-display: "Instrument Serif", "Geist", ui-serif, Georgia, serif;
  --v2-font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --v2-font-mono: "Geist Mono", ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* ── Reset + base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--v2-bg-0);
  color: var(--v2-text);
  font-family: var(--v2-font-ui);
  font-size: 14px;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  /* Ambient brain-field: two soft radial gradients that slowly drift. */
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.08), transparent 38%),
    radial-gradient(circle at 82% 88%, rgba(168, 85, 247, 0.10), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.04), transparent 50%),
    var(--v2-bg-0);
  background-attachment: fixed;
}

/* Subtle starfield-style grid that signals "embedding space". */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.20) 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 70%, rgba(34, 211, 238, 0.18) 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, rgba(168, 85, 247, 0.16) 50%, transparent 51%),
    radial-gradient(1px 1px at 65% 20%, rgba(255, 255, 255, 0.10) 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 60%, rgba(255, 255, 255, 0.10) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 40%, rgba(34, 211, 238, 0.12) 50%, transparent 51%);
  background-size: 720px 720px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: v2-drift 60s linear infinite;
}

@keyframes v2-drift {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(-120px, -80px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

a { color: var(--v2-cyan); text-decoration: none; }
a:hover { text-shadow: 0 0 12px var(--v2-cyan-glow); }

::selection { background: rgba(34, 211, 238, 0.35); color: #fff; }

/* ── Top frame ──────────────────────────────────────────── */
.v2Shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  min-height: 100vh;
}

.v2Topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--v2-line);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  background: rgba(6, 7, 10, 0.60);
  position: sticky;
  top: 0;
  z-index: 50;
}

.v2Brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Hamburger toggle - only visible on mobile (≤900px). */
.v2MenuToggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--v2-line);
  background: var(--v2-surface);
  color: var(--v2-text-soft);
  cursor: pointer;
  margin-right: 4px;
  transition: color 0.18s, border-color 0.18s;
}

.v2MenuToggle:hover { color: var(--v2-cyan); border-color: var(--v2-line-glow); }

.v2MenuToggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.v2BrandMark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.60), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.60), transparent 60%),
    #0a0c12;
  border: 1px solid var(--v2-line-strong);
  box-shadow: var(--v2-glow-cyan);
}

.v2BrandMark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 5px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, transparent 70%);
  filter: blur(2px);
  animation: v2-pulse 2.4s ease-in-out infinite;
}

@keyframes v2-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50%      { opacity: 1.00; transform: scale(1.05); }
}

.v2BrandText {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.v2BrandTitle {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--v2-cyan) 60%, var(--v2-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.v2BrandTag {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-text-mute);
}

.v2TopRight {
  display: flex;
  align-items: center;
  gap: 14px;
}

.v2RegimeChip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--v2-radius-pill);
  background: var(--v2-surface);
  border: 1px solid var(--v2-line);
  font-family: var(--v2-font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--v2-text-soft);
}

.v2RegimeDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v2-cyan);
  box-shadow: 0 0 12px var(--v2-cyan-glow);
  animation: v2-pulse 2.4s ease-in-out infinite;
}

.v2BackToV1 {
  font-family: var(--v2-font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--v2-text-mute);
  padding: 6px 12px;
  border-radius: var(--v2-radius-pill);
  border: 1px solid var(--v2-line);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.v2BackToV1:hover {
  color: var(--v2-cyan);
  border-color: var(--v2-line-glow);
  box-shadow: var(--v2-glow-cyan);
  text-shadow: none;
}

/* ── Sidebar ────────────────────────────────────────────── */
.v2Sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--v2-line);
  padding: 22px 12px;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.40), rgba(6, 7, 10, 0.20));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2SideLabel {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-text-faint);
  padding: 14px 10px 8px;
}

.v2NavLink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--v2-radius-md);
  color: var(--v2-text-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.v2NavLink > span:nth-child(2) {
  /* The label - keep it from overflowing the row even at narrow widths. */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2NavLink:hover {
  background: var(--v2-surface);
  color: var(--v2-text);
  text-shadow: none;
  border-color: var(--v2-line);
}

.v2NavLink.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(168, 85, 247, 0.10));
  border-color: rgba(34, 211, 238, 0.30);
  color: var(--v2-text);
}

.v2NavGlyph {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--v2-bg-3);
  border: 1px solid var(--v2-line-strong);
  display: grid;
  place-items: center;
  font-family: var(--v2-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--v2-text-mute);
  letter-spacing: 0;
}

.v2NavLink.is-active .v2NavGlyph {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(168, 85, 247, 0.25));
  color: #fff;
  border-color: rgba(34, 211, 238, 0.40);
}

.v2NavMeta {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--v2-font-mono);
  font-size: 9.5px;
  color: var(--v2-text-faint);
  letter-spacing: 0.3px;
}

/* Mobile drawer overlay (only rendered on mobile via media query). */
.v2NavOverlay {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

/* ── Main column ────────────────────────────────────────── */
.v2Main {
  grid-area: main;
  padding: 36px 40px 60px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* Hero on the landing page */
.v2Hero {
  position: relative;
  border-radius: var(--v2-radius-xl);
  border: 1px solid var(--v2-line);
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.14), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.14), transparent 50%),
    var(--v2-surface);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  padding: 56px 56px 48px;
  overflow: hidden;
  box-shadow: var(--v2-shadow-2);
}

.v2Hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.55), rgba(168, 85, 247, 0.55), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.v2HeroBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--v2-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-cyan);
  padding: 6px 12px;
  border-radius: var(--v2-radius-pill);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.30);
}

.v2HeroBadge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--v2-cyan);
  box-shadow: 0 0 10px var(--v2-cyan-glow);
}

.v2HeroTitle {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.5px;
  margin: 18px 0 14px;
  background: linear-gradient(180deg, #fff 0%, #c5cad6 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.v2HeroTitle em {
  font-style: italic;
  background: linear-gradient(135deg, var(--v2-cyan), var(--v2-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.v2HeroSub {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--v2-text-soft);
  margin: 0 0 32px;
}

.v2HeroCTA {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--v2-radius-pill);
  font-family: var(--v2-font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--v2-bg-0);
  background: linear-gradient(135deg, var(--v2-cyan), var(--v2-violet));
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.v2HeroCTA:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -10px var(--v2-cyan-glow), 0 12px 32px -10px var(--v2-violet-glow);
  text-shadow: none;
}

.v2HeroCTAGhost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 12px 18px;
  border-radius: var(--v2-radius-pill);
  border: 1px solid var(--v2-line-strong);
  color: var(--v2-text-soft);
  font-family: var(--v2-font-mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  cursor: pointer;
  background: transparent;
  transition: color 0.18s, border-color 0.18s;
}

.v2HeroCTAGhost:hover { color: var(--v2-cyan); border-color: var(--v2-line-glow); text-shadow: none; }

/* ── Section heading ────────────────────────────────────── */
.v2SectionHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 6px 18px;
}

.v2SectionTitle {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.2px;
  color: var(--v2-text);
  margin: 0;
}

.v2SectionLine {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--v2-line) 0%, transparent 100%);
}

.v2SectionTag {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-text-faint);
}

/* ── Engine cards grid ──────────────────────────────────── */
.v2Grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.v2Card {
  position: relative;
  border-radius: var(--v2-radius-lg);
  border: 1px solid var(--v2-line);
  background: var(--v2-surface);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  padding: 20px 22px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.v2Card:hover {
  border-color: rgba(34, 211, 238, 0.30);
  transform: translateY(-2px);
  box-shadow: 0 20px 60px -20px var(--v2-cyan-glow);
}

.v2Card::after {
  content: "";
  position: absolute;
  inset: auto -40% -60% auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--v2-violet-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  filter: blur(20px);
}

.v2CardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.v2CardCode {
  font-family: var(--v2-font-mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-cyan);
}

.v2CardStatus {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: var(--v2-radius-pill);
  border: 1px solid var(--v2-line-strong);
  color: var(--v2-text-mute);
  background: rgba(15, 18, 25, 0.55);
}

.v2CardStatus[data-state="phase0"]   { color: var(--v2-amber); border-color: rgba(251, 191, 36, 0.35); }
.v2CardStatus[data-state="training"] { color: var(--v2-violet); border-color: rgba(168, 85, 247, 0.35); }
.v2CardStatus[data-state="ready"]    { color: var(--v2-emerald); border-color: rgba(52, 211, 153, 0.35); }

.v2CardTitle {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.2px;
  color: var(--v2-text);
  margin: 0 0 8px;
}

.v2CardSub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--v2-text-soft);
  margin: 0 0 14px;
}

.v2CardFoot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.v2Pill {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: var(--v2-radius-pill);
  border: 1px solid var(--v2-line);
  color: var(--v2-text-mute);
  background: rgba(15, 18, 25, 0.55);
}

.v2Pill--cyan   { color: var(--v2-cyan);    border-color: rgba(34, 211, 238, 0.35);  background: rgba(34, 211, 238, 0.08); }
.v2Pill--violet { color: var(--v2-violet);  border-color: rgba(168, 85, 247, 0.35);  background: rgba(168, 85, 247, 0.08); }
.v2Pill--amber  { color: var(--v2-amber);   border-color: rgba(251, 191, 36, 0.35);  background: rgba(251, 191, 36, 0.08); }
.v2Pill--mag    { color: var(--v2-magenta); border-color: rgba(236, 72, 153, 0.35);  background: rgba(236, 72, 153, 0.08); }
.v2Pill--em     { color: var(--v2-emerald); border-color: rgba(52, 211, 153, 0.35);  background: rgba(52, 211, 153, 0.08); }

/* ── Foundation Brain status panel ──────────────────────── */
.v2BrainPanel {
  display: grid;
  gap: 14px;
  /* Hard cap at 3 columns so 6 tiles always render as a balanced 3x2,
     never a wide 5+1 orphan row. Steps down at smaller viewports. */
  grid-template-columns: repeat(3, 1fr);
}

.v2BrainTile {
  position: relative;
  border-radius: var(--v2-radius-md);
  border: 1px solid var(--v2-line);
  background: rgba(11, 14, 22, 0.65);
  padding: 16px 18px 18px;
  overflow: hidden;
}

.v2BrainTileLabel {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-text-faint);
}

.v2BrainTileName {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  margin: 6px 0 4px;
  color: var(--v2-text);
}

.v2BrainTileNote {
  font-size: 12px;
  line-height: 1.5;
  color: var(--v2-text-soft);
}

.v2BrainBar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 14px;
  overflow: hidden;
  /* Subtle inner shadow so the empty trough reads as a real bar even
     before the fill animates in. */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.v2BrainBarFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--v2-cyan), var(--v2-violet));
  box-shadow: 0 0 14px var(--v2-cyan-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tiny chip showing the numeric % to the right of the bar — confirms
   "phase 0, barely begun" rather than "render bug." */
.v2BrainBarRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.v2BrainBarRow .v2BrainBar {
  flex: 1 1 auto;
  margin-top: 0;
}

.v2BrainBarPct {
  font-family: var(--v2-font-mono);
  font-size: 10px;
  color: var(--v2-text-mute);
  letter-spacing: 0.4px;
  min-width: 32px;
  text-align: right;
}

/* Live caption + the "this tile is wired to a real endpoint" dot. */
.v2BrainTileLive {
  margin-top: 10px;
  font-family: var(--v2-font-mono);
  font-size: 10px;
  letter-spacing: 0.3px;
  color: var(--v2-text-faint);
  line-height: 1.5;
}

.v2BrainLiveDot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--v2-text-faint);
  vertical-align: middle;
}

.v2BrainTile.is-live .v2BrainLiveDot {
  background: var(--v2-emerald);
  box-shadow: 0 0 8px var(--v2-emerald);
  animation: v2LivePulse 1.8s ease-in-out infinite;
}

.v2BrainTile.is-live .v2BrainTileLive { color: var(--v2-emerald); }

@keyframes v2LivePulse {
  0%, 100% { opacity: 1.0; }
  50%      { opacity: 0.45; }
}

/* ── Counterfactual ticker (footer) ─────────────────────── */
.v2Ticker {
  margin-top: 56px;
  border: 1px dashed var(--v2-line-strong);
  border-radius: var(--v2-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--v2-font-mono);
  font-size: 12px;
  color: var(--v2-text-soft);
  background: rgba(11, 14, 22, 0.4);
  overflow: hidden;
}

.v2TickerLabel {
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--v2-text-faint);
  white-space: nowrap;
}

.v2TickerBody {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.v2TickerInner {
  display: inline-flex;
  gap: 28px;
  animation: v2-ticker 60s linear infinite;
}

@keyframes v2-ticker {
  from { transform: translateX(0%); }
  to   { transform: translateX(-50%); }
}

.v2TickerItem { display: inline-flex; gap: 6px; align-items: baseline; }
.v2TickerItem .v2TickerKind         { color: var(--v2-cyan); }
.v2TickerItem .v2TickerKind--mag    { color: var(--v2-magenta); }
.v2TickerItem .v2TickerKind--em     { color: var(--v2-emerald); }
.v2TickerItem .v2TickerEng          { color: var(--v2-violet); }
.v2TickerItem .v2TickerNote         { color: var(--v2-text-mute); font-style: italic; }

/* ── Streaming text effect (for agent output) ───────────── */
.v2StreamCaret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--v2-cyan);
  margin-left: 2px;
  vertical-align: -2px;
  animation: v2-blink 1s steps(2, end) infinite;
  box-shadow: 0 0 8px var(--v2-cyan-glow);
}

@keyframes v2-blink {
  50% { opacity: 0; }
}

/* ── Mono numbers (everywhere it matters) ──────────────── */
.mono { font-family: var(--v2-font-mono); }

/* ── Responsive ────────────────────────────────────────── */

/* Tablet: brain grid drops from 3 cols to 2; engine cards stay flexible. */
@media (max-width: 1100px) {
  .v2BrainPanel { grid-template-columns: repeat(2, 1fr); }
  .v2Main { padding: 28px 28px 50px; }
}

/* Small tablet / large phone: drawer-style sidebar, single-col grids. */
@media (max-width: 900px) {
  .v2Shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }

  .v2MenuToggle { display: inline-flex; }

  .v2Sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 60;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    background: linear-gradient(180deg, rgba(10, 12, 18, 0.96), rgba(6, 7, 10, 0.92));
    overflow-y: auto;
    padding-bottom: 32px;
  }

  body.v2NavOpen .v2Sidebar     { transform: translateX(0); }
  body.v2NavOpen .v2NavOverlay  { display: block; opacity: 1; pointer-events: auto; }

  .v2NavOverlay { display: block; }

  .v2BrainPanel { grid-template-columns: 1fr; }
  .v2Grid       { grid-template-columns: 1fr; }

  .v2Topbar      { padding: 0 14px; }
  .v2Main        { padding: 22px 16px 60px; max-width: 100%; }
  .v2Hero        { padding: 32px 22px; }
  .v2HeroTitle   { font-size: clamp(28px, 7vw, 44px); margin: 14px 0 12px; }
  .v2HeroSub     { font-size: 14.5px; margin-bottom: 22px; }
  .v2HeroCTA     { padding: 11px 18px; font-size: 13px; }
  .v2HeroCTAGhost { display: none; } /* keep the primary CTA prominent */

  .v2SectionHead { margin: 36px 4px 14px; }
  .v2SectionTitle { font-size: 22px; }

  .v2Card        { padding: 18px 18px; }
  .v2CardTitle   { font-size: 21px; }

  .v2BrandTitle  { font-size: 19px; }
  .v2BrandTag    { font-size: 9px; }
}

/* Phone portrait: hide the regime chip's expanded text + "v1 desk" link
   only stays compact. Keep tap targets ≥44px. */
@media (max-width: 540px) {
  .v2RegimeChip { padding: 5px 9px 5px 7px; font-size: 10px; }
  .v2RegimeChip span:last-child { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .v2BackToV1   { padding: 8px 11px; font-size: 10.5px; }
  .v2Hero        { padding: 26px 18px; }
  .v2Main        { padding: 18px 14px 60px; }
  .v2Ticker      { padding: 12px 14px; gap: 10px; }
  .v2TickerLabel { font-size: 9px; }
  .v2BrandText   { display: none; } /* on phones, mark + tag is enough */
}

/* Tap-target / accessibility: ensure all interactive controls are ≥44px high
   on touch devices, regardless of viewport width. */
@media (hover: none) and (pointer: coarse) {
  .v2NavLink     { padding: 12px 12px; }
  .v2HeroCTA,
  .v2HeroCTAGhost,
  .v2BackToV1    { min-height: 44px; }
}

/* Reduced-motion: kill the ambient drift + ticker for users who ask for it. */
@media (prefers-reduced-motion: reduce) {
  body::before          { animation: none; }
  .v2BrandMark::after   { animation: none; opacity: 0.85; }
  .v2RegimeDot          { animation: none; }
  .v2TickerInner        { animation: none; }
  .v2StreamCaret        { animation: none; opacity: 0.85; }
  .v2BrainBarFill       { transition: none; }
}
