/* AgentNow Design Tokens & Base Theme */
:root {
  --bg-primary: #07090e;
  --bg-secondary: #0c1017;
  --bg-card: rgba(16, 22, 34, 0.75);
  --bg-card-hover: rgba(22, 30, 48, 0.85);
  --bg-terminal: #090d15;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.4);
  --border-glow: rgba(0, 242, 254, 0.2);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;
  --accent-crimson: #f43f5e;
  --accent-amber: #f59e0b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

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

body.cyber-theme {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Grids & Ambient Glow */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.orb-1 {
  top: -200px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
}

.orb-2 {
  bottom: 10%;
  right: -150px;
  background: radial-gradient(circle, var(--accent-purple), transparent 70%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.1));
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-icon {
  font-size: 18px;
}

.logo-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  border: 1px solid var(--accent-cyan);
  animation: pulse-ring 2.5s infinite ease-out;
  opacity: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-domain {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  text-transform: lowercase;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.status-dot.pulsing {
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: blink 1.5s infinite;
}

.status-label {
  color: var(--accent-emerald);
  font-weight: 600;
}

.status-metric {
  color: var(--text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: #fff;
}

.badge-link {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
}

.badge-link:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--accent-cyan);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 64px 0 48px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.pill-spark {
  font-size: 12px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-subtitle strong {
  color: #fff;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.metric-icon {
  font-size: 24px;
}

.metric-data {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sections */
.section-container {
  margin-top: 72px;
}

.section-header {
  margin-bottom: 24px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 4px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
}

/* Preset Chips */
.preset-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: #fff;
}

.preset-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Terminal Card */
.terminal-card {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.terminal-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.terminal-body {
  padding: 20px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  transition: border-color 0.2s ease;
}

.input-row:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.15);
}

.prompt-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #fff;
  padding: 8px 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Diff Container */
.diff-container {
  border-top: 1px solid var(--border-subtle);
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
}

.diff-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.badge-match {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
}

.meta-sig {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.text-green { color: var(--accent-emerald); }

.explanation-box {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.code-diff-wrapper {
  background: #05070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.code-diff-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.copy-btn.mini {
  padding: 2px 8px;
}

.code-diff-pre {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: #e2e8f0;
}

/* Diff Line Colors */
.diff-added {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  display: block;
  padding: 0 4px;
  border-left: 2px solid #4ade80;
}

.diff-deleted {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  display: block;
  padding: 0 4px;
  border-left: 2px solid #f87171;
}

.cli-fix-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

.cli-icon { color: var(--accent-cyan); }
.cli-label { color: var(--text-secondary); font-weight: 500; }
.cli-code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

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

.feed-card, .nodes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(16px);
}

.feed-header, .nodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.feed-title, .nodes-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.feed-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.blink-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: blink 1.2s infinite;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  animation: fadeIn 0.3s ease;
}

.feed-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-item-title {
  font-weight: 600;
  color: #fff;
}

.feed-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.feed-item-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Nodes Card */
.nodes-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.node-map-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.node-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.node-region {
  width: 170px;
  color: var(--text-secondary);
}

.node-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.node-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: var(--radius-full);
}

.node-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 120px;
  text-align: right;
}

/* Leaderboard */
.leaderboard-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  backdrop-filter: blur(16px);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.leaderboard-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 20px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.leaderboard-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.rank-1 { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid #facc15; }
.rank-2 { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid #cbd5e1; }
.rank-3 { background: rgba(217, 119, 6, 0.15); color: #fb923c; border: 1px solid #fb923c; }

.model-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
  color: var(--text-muted);
}

.badge-pass {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Quickstart Tabs */
.quickstart-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.04);
}

.tab-content {
  display: none;
  padding: 24px;
}

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

.tab-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.tab-description code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.code-block-wrapper {
  background: #05070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}

.code-block-wrapper pre {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
  overflow-x: auto;
}

.code-block-wrapper .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Machine Hub Banner */
.machine-hub-card {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 80px;
}

.machine-hub-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.machine-hub-left h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  margin-bottom: 6px;
}

.machine-hub-left p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 580px;
}

.machine-hub-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 9, 14, 0.95);
  padding: 36px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-tagline {
  margin-top: 4px;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.footer-right a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-right a:hover {
  color: var(--accent-cyan);
}

.dot-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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