/* ═══════════════════════════════════════════════════════
   ARGUS PANOPTES V2.0 — INSTITUTIONAL COMMAND CENTER
   Design System: Dark Institutional
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  /* Backgrounds */
  --bg-canvas: #0a0a0f;
  --bg-surface: #0f0f18;
  --bg-elevated: #141422;
  --bg-raised: #1a1a2e;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(14, 165, 160, 0.3);

  /* Text */
  --text-primary: #e4e4ec;
  --text-secondary: #8a8a9e;
  --text-muted: #5a5a6e;
  --text-inverse: #0a0a0f;

  /* Accent */
  --accent-teal: #0ea5a0;
  --accent-teal-dim: rgba(14, 165, 160, 0.12);
  --accent-teal-glow: rgba(14, 165, 160, 0.06);
  --accent-cyan: #06b6d4;

  /* Semantic */
  --success: #16a34a;
  --success-dim: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-dim: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-dim: rgba(217, 119, 6, 0.12);

  /* Neutral scale */
  --n-50: #fafafa;
  --n-100: #f0f0f2;
  --n-200: #d8d8de;
  --n-300: #b0b0bc;
  --n-400: #8a8a9e;
  --n-500: #6a6a7e;
  --n-600: #4a4a5e;
  --n-700: #2a2a3e;
  --n-800: #1a1a2e;
  --n-900: #0f0f18;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --max-width: 1320px;
  --header-height: 56px;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(20px);
  --glass-blur-sm: blur(12px);

  /* Glow effects */
  --glow-teal: 0 0 20px rgba(14, 165, 160, 0.15);
  --glow-teal-strong: 0 0 40px rgba(14, 165, 160, 0.25);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.15);
  --glow-green: 0 0 20px rgba(22, 163, 74, 0.15);
  --glow-red: 0 0 20px rgba(220, 38, 38, 0.12);
  --glow-yellow: 0 0 20px rgba(217, 119, 6, 0.12);

  /* Grid pattern */
  --grid-pattern: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                  linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-canvas);
  min-height: 100vh;
}

/* ─── Glassmorphism Utilities ─── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  transition: all var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.glow-teal { box-shadow: var(--glow-teal); }
.glow-teal:hover { box-shadow: var(--glow-teal-strong); }
.glow-purple { box-shadow: var(--glow-purple); }
.glow-green { box-shadow: var(--glow-green); }
.glow-red { box-shadow: var(--glow-red); }
.glow-yellow { box-shadow: var(--glow-yellow); }

.gradient-border {
  position: relative;
  border: none !important;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-teal), transparent, var(--accent-purple, #8b5cf6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ─── Background Grid Pattern ─── */
.bg-grid {
  background-image: var(--grid-pattern);
  background-size: 40px 40px;
}

.bg-glow {
  position: relative;
}

.bg-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14,165,160,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Status Indicators ─── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-dot.live {
  background: var(--success);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.5);
}

.status-dot.live::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: statusPulse 2s ease-out infinite;
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.5);
}

.status-dot.inactive {
  background: var(--text-muted);
  opacity: 0.4;
}

/* ─── Shimmer Loading ─── */
.shimmer {
  background: linear-gradient(90deg,
    var(--glass-bg) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ─── Count-Up Number ─── */
.count-value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ─── Typography Scale ─── */
.text-display {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.text-h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-h2 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.text-h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-size: 0.938rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-small {
  font-size: 0.813rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.813rem;
  letter-spacing: -0.01em;
}

.text-label {
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ─── Layout ─── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section {
  padding: var(--sp-8) 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.section-visible {
  opacity: 1;
  transform: translateY(0);
}

.section + .section {
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: var(--sp-8);
}

.section-header .text-label {
  margin-bottom: var(--sp-2);
  color: var(--accent-teal);
}

.section-header .text-h2 {
  color: var(--text-primary);
}

.section-header .text-body {
  margin-top: var(--sp-2);
  max-width: 640px;
}

/* ─── Header / Navigation ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-inverse);
  font-weight: 700;
}

.logo-text {
  font-weight: 700;
  font-size: 0.938rem;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: var(--sp-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
}

.nav-links a {
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* ─── Nav Dropdown ─── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.nav-arrow {
  font-size: 0.625rem;
  margin-left: 2px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  margin-top: var(--sp-2);
  padding: var(--sp-2) 0;
  background: rgba(15,15,24,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  list-style: none;
  z-index: 200;
}

.nav-dropdown-menu.open {
  display: block;
}

.nav-dropdown-menu li a {
  display: block;
  padding: var(--sp-1) var(--sp-4);
  font-size: 0.75rem;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

@media (hover: hover) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.813rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary {
  background: var(--accent-teal);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: #0cb8b3;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ─── Control Ribbon ─── */
.control-ribbon {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-3) 0;
}

.ribbon-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.ribbon-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ribbon-item strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.ribbon-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--success);
}

.ribbon-dot.warning {
  background: var(--warning);
}

.ribbon-dot.danger {
  background: var(--danger);
}

/* ─── Existing class overrides for Arkham-style ─── */
.hero-badge .status-dot.live {
  width: 6px;
  height: 6px;
}

.hero-badge .status-dot.live::after {
  animation-duration: 3s;
}

/* ─── Hero ─── */
.hero {
  padding: var(--sp-16) 0 var(--sp-12);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-teal-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Hero Two-Column Layout ─── */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}

.hero-content {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: var(--accent-teal-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: var(--sp-6);
}

.hero .text-display {
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .text-body {
  font-size: 1.063rem;
  max-width: 520px;
  margin-bottom: var(--sp-8);
}

/* ─── Hero Right Column ─── */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.hero-chart-card {
  padding: var(--sp-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.hero-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.hero-chart-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-chart-subtitle {
  font-size: 0.625rem;
  color: var(--text-muted);
}

.hero-chart-body {
  height: 140px;
  position: relative;
}

.hero-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.hero-quick-stats {
  display: flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.hero-stat {
  flex: 1;
  text-align: center;
}

.hero-stat-label {
  display: block;
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-default);
}

.hero-actions {
  display: flex;
  gap: var(--sp-3);
}

/* ─── Hero Metric Pillars ─── */
.hero-metrics {
  display: flex;
  gap: var(--sp-4);
  margin: var(--sp-6) 0 var(--sp-6);
}

.hero-metric {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}

.hero-metric-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}

.hero-metric-value.positive { color: var(--success); }
.hero-metric-value.wfa { color: var(--accent-teal); }

.hero-metric-label {
  font-size: 0.688rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-top: var(--sp-1);
}

.hero-metric-divider {
  width: 1px;
  background: var(--border-default);
  align-self: stretch;
}

@media (max-width: 1100px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-visual { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero-visual { grid-template-columns: 1fr; }
  .hero-metrics { flex-direction: column; gap: var(--sp-3); }
  .hero-metric-divider { display: none; }
}

/* ─── Ticker Bar (Arkham-style) ─── */
.ticker-bar {
  display: flex;
  gap: 0;
  overflow: hidden;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-3) 0;
  position: relative;
}

.ticker-track {
  display: flex;
  gap: var(--sp-8);
  animation: tickerScroll 60s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ticker-item .ticker-label {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
}

.ticker-item .ticker-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.813rem;
}

.ticker-item .ticker-value.positive { color: var(--success); }
.ticker-item .ticker-value.negative { color: var(--danger); }
.ticker-item .ticker-value.neutral { color: var(--accent-teal); }

.ticker-divider {
  width: 1px;
  background: var(--border-default);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .ticker-track {
    gap: var(--sp-6);
  }
  .ticker-item .ticker-label {
    display: none;
  }
}

/* ─── KPI Grid (Arkham-style glass cards) ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.kpi-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
  overflow: hidden;
}

.kpi-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-teal), transparent);
  opacity: 0.3;
}

.kpi-tile:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.kpi-tile .text-label {
  font-size: 0.688rem;
}

.kpi-tile-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color var(--duration-normal) var(--ease-out);
}

.kpi-value.positive { color: var(--success); text-shadow: 0 0 20px rgba(22, 163, 74, 0.3); }
.kpi-value.negative { color: var(--danger); text-shadow: 0 0 20px rgba(220, 38, 38, 0.3); }
.kpi-value.neutral { color: var(--text-primary); }

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.kpi-sparkline {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
}

.kpi-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.kpi-secondary .kpi-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  gap: var(--sp-2);
}

.kpi-secondary .kpi-tile::before {
  display: none;
}

.kpi-secondary .kpi-value {
  font-size: 1.125rem;
}

.kpi-secondary .kpi-sub {
  font-size: 0.688rem;
}

/* ─── Cards / Panels (Glass design) ─── */
.panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.panel:hover {
  border-color: var(--glass-border-hover);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.panel-header .text-h3 {
  color: var(--text-primary);
}

/* ─── Charts Row ─── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.chart-container {
  position: relative;
  height: 320px;
}

/* ─── Architecture Diagram ─── */
.arch-flow {
  display: flex;
  align-items: stretch;
  gap: var(--sp-3);
  overflow-x: auto;
  padding: var(--sp-2) 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.arch-node {
  flex: 1;
  min-width: 160px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  text-align: center;
  position: relative;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.arch-node:hover {
  border-color: var(--accent-teal);
}

.arch-node-icon {
  font-size: 1.5rem;
  margin-bottom: var(--sp-3);
}

.arch-node h4 {
  font-size: 0.813rem;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--text-primary);
}

.arch-node p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.arch-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Risk Governance Grid ─── */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.risk-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.risk-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

.risk-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.risk-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.risk-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.risk-card-icon.shield {
  background: var(--accent-teal-dim);
}

.risk-card-icon.alert {
  background: var(--warning-dim);
}

.risk-card-icon.correl {
  background: rgba(168, 85, 247, 0.12);
}

.risk-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.risk-card p {
  font-size: 0.813rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.risk-card .risk-badge {
  display: inline-block;
  margin-top: var(--sp-3);
  padding: var(--sp-1) var(--sp-2);
  background: var(--success-dim);
  color: var(--success);
  font-size: 0.688rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* ─── Risk Metrics Grid ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: all var(--duration-fast) var(--ease-out);
}

.metric-item:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.metric-item .text-label {
  font-size: 0.688rem;
}

.metric-item .metric-val {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── OOS Comparison Cards (Glass + Glow) ─── */
.oos-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.oos-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
}

.oos-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.oos-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.oos-card-header {
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.oos-card-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.oos-card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  position: relative;
}

.oos-card-badge.positive {
  background: var(--success-dim);
  color: var(--success);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.2);
}
.oos-card-badge.negative {
  background: var(--danger-dim);
  color: var(--danger);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.2);
}
.oos-card-badge.neutral {
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  box-shadow: 0 0 12px rgba(14, 165, 160, 0.2);
}

.oos-card-body {
  padding: var(--sp-4) var(--sp-6) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.oos-card-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.oos-card-metric:last-child {
  border-bottom: none;
}

.oos-card-metric .metric-label {
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.oos-card-metric .metric-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.oos-card-metric .metric-value.positive { color: var(--success); }
.oos-card-metric .metric-value.negative { color: var(--danger); }
.oos-card-metric .metric-value.neutral { color: var(--text-primary); }

.oos-card-bar {
  height: 3px;
  margin: 0 var(--sp-6) var(--sp-4);
  background: var(--border-subtle);
  overflow: hidden;
  border-radius: 2px;
}

.oos-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.5s var(--ease-out);
}

@media (max-width: 900px) {
  .oos-cards { grid-template-columns: 1fr; }
}

/* ─── WFA Heatmap ─── */
.wfa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.wfa-cell {
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.wfa-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.wfa-cell:hover {
  transform: translateY(-2px);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.wfa-cell-year {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.wfa-cell-pnl {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wfa-cell-pnl.positive { color: var(--success); }
.wfa-cell-pnl.negative { color: var(--danger); }

.wfa-cell-sub {
  font-size: 0.688rem;
  color: var(--text-muted);
}

.wfa-cell-sub .pf { color: var(--text-secondary); }

.wfa-total {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.wfa-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wfa-total-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
}

.wfa-total-value.positive { color: var(--success); }
.wfa-total-value.negative { color: var(--danger); }

@media (max-width: 640px) {
  .wfa-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Monte Carlo Distribution Cards ─── */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.mc-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
  overflow: hidden;
}

.mc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.mc-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.mc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-card-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
}

.mc-profitable {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mc-profitable.high { color: var(--success); }
.mc-profitable.mid { color: var(--warning); }
.mc-profitable.low { color: var(--text-muted); }

.mc-label {
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Distribution range bar */
.mc-range {
  position: relative;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  margin: var(--sp-2) 0;
}

.mc-range-track {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  top: 0;
}

.mc-range-track.positive { background: var(--success-dim); }
.mc-range-track.negative { background: var(--danger-dim); }

.mc-range-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
  z-index: 1;
}

.mc-range-marker.positive { background: var(--success); border-color: var(--success); }
.mc-range-marker.negative { background: var(--danger); border-color: var(--danger); }

.mc-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: var(--sp-1);
}

.mc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.mc-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mc-stat .stat-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.mc-stat .stat-value {
  font-family: var(--font-mono);
  font-size: 0.813rem;
  font-weight: 600;
}

.mc-stat .stat-value.positive { color: var(--success); }
.mc-stat .stat-value.negative { color: var(--danger); }
.mc-stat .stat-value.neutral { color: var(--text-primary); }

@media (max-width: 900px) {
  .mc-grid { grid-template-columns: 1fr; }
}
.strategy-filters {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.filter-chip {
  padding: var(--sp-1) var(--sp-3);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--accent-teal-dim);
  border-color: var(--border-accent);
  color: var(--accent-teal);
}

.table-wrapper {
  overflow-x: auto;
}

/* ─── Tabbed Panels ─── */
.tab-bar {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-2) var(--sp-4) 0;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-btn {
  padding: var(--sp-3) var(--sp-5);
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}

.tab-btn.active {
  color: var(--accent-teal);
  border-bottom-color: var(--accent-teal);
}

.tab-content {
  display: none;
  padding: var(--sp-4);
}

.tab-content.active {
  display: block;
}

.tab-content .panel {
  margin: 0;
}

.tab-content .panel-header {
  padding: 0 0 var(--sp-3);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.813rem;
}

.data-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.688rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}

.data-table th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.data-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table th {
  padding: var(--sp-2) var(--sp-3);
}

.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.strategy-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  font-size: 0.688rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ─── Trade Journal ─── */
.journal-table td.profit-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.journal-table td.profit-cell.positive { color: var(--success); }
.journal-table td.profit-cell.negative { color: var(--danger); }

.type-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  font-size: 0.688rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-badge.buy {
  background: var(--success-dim);
  color: var(--success);
}

.type-badge.sell {
  background: var(--danger-dim);
  color: var(--danger);
}

/* ─── Glossary ─── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-2) var(--sp-4);
}

.glossary-item {
  font-size: 0.813rem;
  color: var(--text-secondary);
}

.glossary-term {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  margin-right: var(--sp-1);
}

/* ─── Monthly Heatmap ─── */
.heatmap-table td,
.heatmap-table th {
  text-align: center;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.heatmap-positive {
  background: var(--success-dim);
  color: var(--success);
}

.heatmap-negative {
  background: var(--danger-dim);
  color: var(--danger);
}

.heatmap-empty {
  color: var(--text-muted);
  opacity: 0.3;
}

/* ─── Correlation Summary Insight Bar ─── */
.corr-summary {
  display: none;
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.corr-summary-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  font-size: 0.813rem;
  color: var(--text-secondary);
}

.corr-summary-item + .corr-summary-item {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
}

.corr-summary-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.corr-summary-warn .corr-summary-icon { color: var(--warning); background: var(--warning-dim); }
.corr-summary-safe .corr-summary-icon { color: var(--success); background: var(--success-dim); }
.corr-summary-info .corr-summary-icon { color: var(--accent-teal); background: var(--accent-teal-dim); }

.corr-summary-text { line-height: 1.5; }
.corr-summary-text strong { color: var(--text-primary); }

/* ─── Correlation Side-by-Side Grid ─── */
.corr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 900px) {
  .corr-grid { grid-template-columns: 1fr; }
}

/* ─── Network Graph Tooltip ─── */
.network-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.688rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: opacity 0.1s ease;
}

.network-tooltip strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Network Graph Container ─── */
.network-container {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(14,165,160,0.03) 0%, transparent 70%);
  border: 1px solid var(--glass-border);
}

#networkCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#networkCanvas:active { cursor: grabbing; }

.network-legend {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(8px);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.network-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.688rem;
  color: var(--text-muted);
}

.network-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── Correlation Heatmap ─── */
.corr-legend {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.corr-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.688rem;
  color: var(--text-muted);
}

.corr-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.heatmap-wrapper {
  overflow-x: auto;
  padding: var(--sp-1) 0;
}

.corr-heatmap {
  display: grid;
  gap: 3px;
}

.corr-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.688rem;
  border-radius: 4px;
  min-width: 34px;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
  cursor: default;
}

.corr-cell:hover {
  transform: scale(1.2);
  z-index: 2;
  position: relative;
  box-shadow: 0 0 12px rgba(14,165,160,0.2);
}

.corr-cell-label {
  font-family: var(--font-body);
  font-size: 0.688rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--sp-2);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.corr-cell-header {
  font-family: var(--font-body);
  font-size: 0.625rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 34px;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  height: 80px;
}

.corr-corner {
  width: 120px;
  flex-shrink: 0;
}

details summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.813rem;
}

/* ─── Correlation Table (hidden in details) ─── */
.corr-table td,
.corr-table th {
  text-align: center;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.688rem;
  transition: transform var(--duration-fast) var(--ease-out);
}

.corr-table td:hover {
  transform: scale(1.15);
  position: relative;
  z-index: 1;
}

.corr-header-cell span {
  display: inline-block;
  transform: rotate(-45deg);
  transform-origin: left center;
  white-space: nowrap;
  font-size: 0.625rem;
}

/* ─── Methodology ─── */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.method-card {
  padding: var(--sp-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.method-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.method-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

.method-card p,
.method-card ul {
  font-size: 0.813rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.method-card ul {
  list-style: none;
  padding: 0;
}

.method-card li {
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.method-card li:last-child {
  border-bottom: none;
}

/* ─── Parameter Grid ─── */
.param-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.param-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--sp-3);
}

.param-row:last-child {
  border-bottom: none;
}

.param-label {
  font-size: 0.813rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.param-value {
  font-family: var(--font-mono);
  font-size: 0.813rem;
  color: var(--text-primary);
  text-align: right;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-10) 0;
  background: var(--bg-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-8);
}

.footer-brand .text-body {
  margin-top: var(--sp-3);
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--sp-2);
}

.footer-col a {
  font-size: 0.813rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer-bottom .text-small {
  max-width: 480px;
}

/* ─── Strategy Cards Grid ─── */
.strategy-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

.strategy-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent-teal);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.strategy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

.strategy-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.strategy-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.strategy-rank {
  font-family: var(--font-mono);
  font-size: 0.688rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.strategy-card-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.strategy-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.sc-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sc-value {
  font-family: var(--font-mono);
  font-size: 0.813rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sc-value.positive { color: var(--success); }
.sc-value.negative { color: var(--danger); }
.sc-value.neutral { color: var(--text-primary); }

.strategy-card-params {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

/* ─── Charts Row: 1-1 split ─── */
.charts-row .panel:first-child {
  grid-column: 1;
}

.charts-row .panel:last-child:nth-child(2) {
  grid-column: 2;
}

/* ─── Profit cell color (journal) ─── */
.profit-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.profit-cell.positive { color: var(--success); }
.profit-cell.negative { color: var(--danger); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--n-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--n-600);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes statusPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(14,165,160,0.15); }
  50% { box-shadow: 0 0 20px rgba(14,165,160,0.3); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

.animate-scale {
  animation: fadeInScale 0.5s var(--ease-out) forwards;
  opacity: 0;
}

.animate-slide-right {
  animation: slideInRight 0.5s var(--ease-out) forwards;
  opacity: 0;
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2 — NARRATIVE FLOW & PREMIUM INTERACTIONS
   ═══════════════════════════════════════════════════════════ */

/* ─── Story Progress Tracker (Fixed Right Sidebar) ─── */
.story-tracker {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.story-tracker-line {
  width: 1px;
  flex: 1;
  min-height: 20px;
  background: linear-gradient(to bottom, var(--glass-border), var(--accent-teal), var(--glass-border));
  opacity: 0.3;
}

.story-tracker-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  padding: var(--sp-2) 0;
  position: relative;
  text-decoration: none;
  flex-direction: row-reverse;
}

.story-tracker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: var(--bg-canvas);
  transition: all var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
  position: relative;
}

.story-tracker-step:hover .story-tracker-dot,
.story-tracker-step.active .story-tracker-dot {
  border-color: var(--accent-teal);
  background: var(--accent-teal);
  box-shadow: 0 0 12px rgba(14,165,160,0.4);
}

.story-tracker-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--duration-normal) var(--ease-out);
  text-align: right;
}

.story-tracker-step:hover .story-tracker-label,
.story-tracker-step.active .story-tracker-label {
  opacity: 1;
  transform: translateX(0);
  color: var(--text-secondary);
}

.story-tracker-step.active .story-tracker-label {
  color: var(--accent-teal);
}

@media (max-width: 1200px) {
  .story-tracker { display: none; }
}

/* ─── 3D Card Tilt Container ─── */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.1s ease-out;
}

.tilt-card-inner {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.tilt-card:hover {
  z-index: 10;
}

/* ─── Mouse Glow Effect ─── */
.mouse-glow {
  position: relative;
  overflow: hidden;
}

.mouse-glow::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,160,0.08) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.mouse-glow:hover::after {
  opacity: 1;
}

.mouse-glow > * {
  position: relative;
  z-index: 2;
}

/* ─── Section Hero Number (narrative step) ─── */
.section-number {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(255,255,255,0.03);
  position: absolute;
  top: -12px;
  left: -8px;
  pointer-events: none;
  user-select: none;
}

.section-number.right {
  left: auto;
  right: -8px;
}

.section-header {
  position: relative;
}

/* ─── Gradient Animated Border ─── */
.gradient-border-anim {
  position: relative;
  border: none !important;
}

.gradient-border-anim::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-teal), transparent, var(--accent-purple, #8b5cf6), transparent, var(--accent-teal));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: gradientShift 4s ease-in-out infinite;
}

.gradient-border-anim:hover::before {
  animation-duration: 1.5s;
}

/* ─── Section Narrative Banner ─── */
.section-narrative {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
  padding: var(--sp-5) var(--sp-6);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent-teal);
}

.section-narrative-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent-teal);
  flex-shrink: 0;
  opacity: 0.6;
}

.section-narrative-content {
  flex: 1;
}

.section-narrative-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.section-narrative-content p {
  font-size: 0.813rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 640px;
}



/* ─── Transaction Timeline (Arkham-style feed) ─── */
.tx-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 480px;
  overflow-y: auto;
  padding-right: var(--sp-2);
}

.tx-feed-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast) var(--ease-out);
  cursor: default;
}

.tx-feed-item:hover {
  background: var(--glass-bg-hover);
}

.tx-feed-item:last-child {
  border-bottom: none;
}

.tx-feed-time {
  font-family: var(--font-mono);
  font-size: 0.688rem;
  color: var(--text-muted);
  min-width: 80px;
  flex-shrink: 0;
}

.tx-feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.688rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-feed-icon.buy { background: var(--success-dim); color: var(--success); }
.tx-feed-icon.sell { background: var(--danger-dim); color: var(--danger); }

.tx-feed-info {
  flex: 1;
  min-width: 0;
}

.tx-feed-pair {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tx-feed-strategy {
  font-size: 0.625rem;
  color: var(--text-muted);
}

.tx-feed-amount {
  font-family: var(--font-mono);
  font-size: 0.813rem;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.tx-feed-amount.positive { color: var(--success); }
.tx-feed-amount.negative { color: var(--danger); }

.tx-feed-status {
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.tx-feed-status.tp { background: var(--success-dim); color: var(--success); }
.tx-feed-status.sl { background: var(--danger-dim); color: var(--danger); }
.tx-feed-status.trailing { background: rgba(14,165,160,0.12); color: var(--accent-teal); }
.tx-feed-status.manual { background: rgba(139,92,246,0.12); color: #8b5cf6; }

/* ─── Chart Draw-on-Scroll ─── */
.chart-draw {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.chart-draw.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Scroll Progress Indicator ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
  z-index: 300;
  transition: width 0.1s linear;
  width: 0%;
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-secondary { grid-template-columns: repeat(3, 1fr); }
  .risk-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .arch-flow { flex-direction: column; }
  .arch-arrow { transform: rotate(90deg); justify-content: center; }
  .kpi-secondary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-secondary { grid-template-columns: repeat(2, 1fr); }
  .risk-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: var(--sp-10) 0 var(--sp-8); }
  .section { padding: var(--sp-6) 0; }
  .hero-actions { flex-direction: column; }
  .ribbon-inner { gap: var(--sp-3); }
}

/* ─── Release Banner (Arkham-style) ─── */
.release-banner {
  background: linear-gradient(135deg, rgba(14,165,160,0.08), rgba(10,10,15,0.95), rgba(139,92,246,0.06));
  color: var(--text-secondary);
  text-align: center;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  line-height: 1.5;
  font-family: var(--font-mono);
}
.release-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success-dim);
  color: var(--success);
  font-size: 11px;
  flex-shrink: 0;
}
