/* ============================================
   TorchTrade.io — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties (Dark Mode Default) --- */
:root {
  --bg: #0a0a0f;
  --bg-surface: #12121a;
  --bg-surface-hover: #1a1a25;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #e4e4e7;
  --text-secondary: #71717a;
  --text-tertiary: #52525b;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.15);
  --code-bg: #0d0d14;
  --nav-bg: rgba(10, 10, 15, 0.85);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;

  /* Agent Colors */
  --agent-blue: #60a5fa;
  --agent-purple: #a78bfa;
  --agent-green: #34d399;
  --agent-pink: #f472b6;
  --agent-orange: #fb923c;
  --agent-teal: #2dd4bf;
  --agent-indigo: #818cf8;
  --agent-gold: #facc15;
}

/* --- Light Mode --- */
[data-theme="light"] {
  --bg: #fafafa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f4f4f5;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --accent: #ea580c;
  --accent-dim: rgba(234, 88, 12, 0.1);
  --code-bg: #f4f4f5;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Section --- */
.section {
  padding: 6rem 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo-img {
  height: 48px;
  width: auto;
}

.nav-logo-dark { display: block; }
.nav-logo-light { display: none; }

[data-theme="light"] .nav-logo-dark { display: none; }
[data-theme="light"] .nav-logo-light { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.github-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
}

.github-nav:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  text-decoration: none;
}

.github-nav-stats {
  display: flex;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.github-nav-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.github-nav-stat svg {
  opacity: 0.6;
}

/* Mobile nav */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

/* --- Hero --- */
.hero {
  padding: 10rem 0 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  height: 280px;
  width: auto;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
}

/* Dark mode: show dark variant, hide light */
.hero-logo-dark { display: block; }
.hero-logo-light { display: none; }

[data-theme="light"] .hero-logo-dark { display: none; }
[data-theme="light"] .hero-logo-light { display: block; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  background: var(--bg-surface);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 50%, #facc15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.btn-buy {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}

.btn-buy:hover {
  background: #ea580c;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- How It Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.step-connector {
  display: none;
}

/* --- Code Block --- */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.7;
}

.code-block code {
  white-space: pre;
  display: block;
}

.code-block .comment { color: var(--text-tertiary); }
.code-block .keyword { color: #c084fc; }
.code-block .string { color: #34d399; }
.code-block .function { color: #f97316; }
.code-block .number { color: #fb923c; }

/* --- Agents Marketplace --- */
.agents-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* --- Agent Network Visualization --- */
.agent-network {
  margin: 3rem 0;
  overflow-x: auto;
}

.agent-network-svg {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
  height: auto;
}

.net-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1.5;
}

[data-theme="light"] .net-line {
  stroke: rgba(0, 0, 0, 0.12);
}

.node-bg {
  fill: var(--bg-surface);
  stroke-width: 1.5;
}

.node-orange { stroke: var(--agent-orange); }
.node-purple { stroke: var(--agent-purple); }
.node-teal { stroke: var(--agent-teal); }
.node-green { stroke: var(--agent-green); }
.node-pink { stroke: var(--agent-pink); }
.node-blue { stroke: var(--agent-blue); }
.node-indigo { stroke: var(--agent-indigo); }
.node-accent { stroke: var(--accent); fill: var(--accent-dim); }

.node-label {
  fill: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
  font-family: 'Inter', -apple-system, sans-serif;
}

.node-label-bold {
  font-weight: 700;
}

.energy-dot {
  opacity: 0.9;
}

.dot-orange { fill: var(--agent-orange); }
.dot-purple { fill: var(--agent-purple); }
.dot-teal { fill: var(--agent-teal); }
.dot-green { fill: var(--agent-green); }
.dot-pink { fill: var(--agent-pink); }
.dot-blue { fill: var(--agent-blue); }
.dot-indigo { fill: var(--agent-indigo); }

.agents-disclaimer {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  max-width: 700px;
  margin-bottom: 3rem;
  font-style: italic;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.agent-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background-color: var(--bg-surface);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  -webkit-appearance: none;
}

.agent-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.agent-card.bundle {
  border-color: rgba(250, 204, 21, 0.25);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(250, 204, 21, 0.03) 100%);
}

.agent-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.agent-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.agent-filename {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.75rem;
}

.agent-card > p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.agent-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.agent-card .btn-buy {
  margin-top: 1rem;
}

/* Agent color variants */
.agent-card[data-color="blue"] h3 { color: var(--agent-blue); }
.agent-card[data-color="blue"] .agent-tag { background: rgba(96, 165, 250, 0.12); color: var(--agent-blue); }

.agent-card[data-color="purple"] h3 { color: var(--agent-purple); }
.agent-card[data-color="purple"] .agent-tag { background: rgba(167, 139, 250, 0.12); color: var(--agent-purple); }

.agent-card[data-color="green"] h3 { color: var(--agent-green); }
.agent-card[data-color="green"] .agent-tag { background: rgba(52, 211, 153, 0.12); color: var(--agent-green); }

.agent-card[data-color="pink"] h3 { color: var(--agent-pink); }
.agent-card[data-color="pink"] .agent-tag { background: rgba(244, 114, 182, 0.12); color: var(--agent-pink); }

.agent-card[data-color="orange"] h3 { color: var(--agent-orange); }
.agent-card[data-color="orange"] .agent-tag { background: rgba(251, 146, 60, 0.12); color: var(--agent-orange); }

.agent-card[data-color="teal"] h3 { color: var(--agent-teal); }
.agent-card[data-color="teal"] .agent-tag { background: rgba(45, 212, 191, 0.12); color: var(--agent-teal); }

.agent-card[data-color="indigo"] h3 { color: var(--agent-indigo); }
.agent-card[data-color="indigo"] .agent-tag { background: rgba(129, 140, 248, 0.12); color: var(--agent-indigo); }

.agent-card[data-color="gold"] h3 { color: var(--agent-gold); }
.agent-card[data-color="gold"] .agent-tag { background: rgba(250, 204, 21, 0.12); color: var(--agent-gold); }

/* --- Research --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.research-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  transition: all 0.3s;
}

.research-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.research-preview {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.research-preview-blur {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    rgba(249, 115, 22, 0.15) 0%,
    rgba(239, 68, 68, 0.1) 30%,
    rgba(168, 85, 247, 0.1) 60%,
    rgba(59, 130, 246, 0.1) 100%
  );
  filter: blur(0);
  position: relative;
}

/* Fake chart lines for the blurry preview */
.research-preview-blur::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 5%;
  right: 5%;
  height: 60%;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,0.03) 18px, rgba(255,255,255,0.03) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255,255,255,0.03) 30px, rgba(255,255,255,0.03) 31px);
}

.research-preview-blur::after {
  content: '';
  position: absolute;
  top: 25%;
  left: 8%;
  right: 8%;
  height: 50%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(249, 115, 22, 0.3) 10%,
    rgba(249, 115, 22, 0.15) 20%,
    rgba(239, 68, 68, 0.3) 35%,
    rgba(52, 211, 153, 0.2) 50%,
    rgba(52, 211, 153, 0.35) 65%,
    rgba(249, 115, 22, 0.2) 80%,
    rgba(239, 68, 68, 0.25) 95%,
    transparent 100%
  );
  clip-path: polygon(
    0% 60%, 5% 55%, 10% 50%, 15% 65%, 20% 45%, 25% 40%, 30% 55%,
    35% 35%, 40% 30%, 45% 45%, 50% 35%, 55% 25%, 60% 40%, 65% 30%,
    70% 20%, 75% 35%, 80% 25%, 85% 40%, 90% 30%, 95% 45%, 100% 35%,
    100% 100%, 0% 100%
  );
  filter: blur(8px);
}

.research-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.research-body {
  padding: 1.25rem;
}

.research-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.research-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.research-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.research-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.research-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.research-footer .btn-buy {
  flex: 1;
}

/* --- Datasets --- */
.datasets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.dataset-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  background: var(--bg-surface);
  text-align: center;
  transition: all 0.2s;
}

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

.dataset-pair {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.dataset-tags {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.dataset-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dataset-tag.spot {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.dataset-tag.perp {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}

.dataset-tag.basis {
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
}

.dataset-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.dataset-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dataset-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.dataset-more-link:hover {
  text-decoration: none;
  opacity: 0.8;
}

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

/* --- Brokers --- */
.brokers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.broker-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-surface);
  text-align: center;
  transition: all 0.2s;
}

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

.broker-logo {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.broker-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.broker-card .broker-type {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.broker-specs {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.broker-specs li {
  padding: 0.2rem 0;
}

/* --- Ecosystem --- */
.ecosystem-visual {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.eco-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.eco-node {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  min-width: 160px;
}

.eco-node.core {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

.eco-node .eco-desc {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  font-weight: 400;
}

.eco-arrow {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 1.2rem;
}

/* --- Quick Start --- */
.quickstart-block {
  max-width: 700px;
  margin-top: 3rem;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 440px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.modal p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .brokers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-mobile-toggle {
    display: block;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  .section {
    padding: 4rem 0;
  }
  .section-title {
    font-size: 1.75rem;
  }
  .features-grid,
  .steps,
  .brokers-grid {
    grid-template-columns: 1fr;
  }
  .agents-grid {
    grid-template-columns: 1fr;
  }
  /* Disable hover effects on touch devices */
  .agent-card:hover,
  .feature-card:hover,
  .research-card:hover,
  .broker-card:hover,
  .dataset-card:hover {
    transform: none;
    box-shadow: none;
  }
}
