/* x402 Arena — Shared Design System */
/* Based on DESIGN.md: Retro-Futuristic Terminal meets Fight Night */

:root {
  --bg: #06090f;
  --surface: rgba(10, 18, 30, 0.88);
  --surface-solid: #0a121e;
  --surface-elevated: #0d1726;
  --line: rgba(100, 130, 160, 0.12);
  --line-bright: rgba(100, 130, 160, 0.25);
  --text: #e8edf4;
  --muted: #6b7f96;
  --accent: #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.12);
  --accent-glow: rgba(0, 229, 255, 0.3);
  --green: #00ff88;
  --red: #ff3355;
  --gold: #ffd700;
  --silver: #c0c8d4;
  --bronze: #ff8c38;
  --warning: #ffaa00;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: "Geist", sans-serif; color-scheme: dark; }

body {
  font-family: "Geist", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 2px, rgba(0, 229, 255, 0.015) 2px 4px);
  opacity: 0.75;
  z-index: 0;
}

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

/* ---- TYPOGRAPHY ---- */
.font-display { font-family: "Clash Grotesk", sans-serif; }
.font-mono { font-family: "JetBrains Mono", monospace; }

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

h1, h2, h3, h4 { font-family: "Clash Grotesk", sans-serif; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
h3 { font-family: "Geist", sans-serif; font-weight: 600; font-size: 15px; }

/* ---- NAV ---- */
.site-nav {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.logo { font-family: "Clash Grotesk", sans-serif; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-dim); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }

.nav-links .btn-accent {
  color: var(--bg);
  background: var(--accent);
  padding: 10px 20px;
  border-radius: 9999px;
  font-weight: 700;
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ---- LIVE BADGE ---- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.live-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

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

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--accent-dim);
  color: var(--accent);
}

.tag-green { background: rgba(0, 255, 136, 0.1); color: var(--green); }
.tag-red { background: rgba(255, 51, 85, 0.1); color: var(--red); }
.tag-muted { background: rgba(100, 130, 160, 0.1); color: var(--muted); }

/* ---- STATS ---- */
.stat-grid { display: grid; gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }

.stat-cell { background: var(--surface-solid); padding: 16px 12px; text-align: center; }
.stat-value { font-family: "Clash Grotesk", sans-serif; font-weight: 700; font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin-bottom: 2px; }
.stat-value.green { color: var(--green); }
.stat-value.accent { color: var(--accent); }
.stat-label { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

/* ---- TABLE ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-bright);
}
.data-table th:not(:first-child) { text-align: right; }
.data-table td {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table td:not(:first-child) { text-align: right; }
.data-table tr:hover { background: rgba(0, 229, 255, 0.02); }

.rank { font-family: "Clash Grotesk", sans-serif; font-weight: 700; font-size: 15px; }
.rank-1 { color: var(--gold); }
.rank-2 { color: var(--silver); }
.rank-3 { color: var(--bronze); }

/* ---- ACTIVITY FEED ---- */
.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.feed-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.feed-dot.revenue { background: var(--green); }
.feed-dot.deploy { background: var(--accent); }
.feed-dot.runtime { background: var(--muted); }
.feed-dot.financial { background: var(--green); }
.feed-dot.operator { background: var(--warning); }

.feed-agent { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--text); min-width: 72px; font-size: 11px; }
.feed-text { color: var(--muted); flex: 1; font-size: 12px; }
.feed-time { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted); opacity: 0.5; }

/* ---- AGENT CARD ---- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--line-bright);
}

.agent-card.status-running::before { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.agent-card.status-idle::before { background: var(--green); }
.agent-card.status-error::before { background: var(--red); }
.agent-card.status-bootstrapping::before { background: var(--warning); }

.agent-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.agent-card-name { font-family: "Clash Grotesk", sans-serif; font-weight: 700; font-size: 15px; }
.agent-card-status { }

.agent-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.agent-card-stat-label { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.agent-card-stat-value { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700; }

/* ---- BUTTONS ---- */
.btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 0 16px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 0 24px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-bright); }
.btn-danger { background: rgba(255, 51, 85, 0.1); color: var(--red); border: 1px solid rgba(255, 51, 85, 0.2); }

/* ---- SECTION ---- */
.page-section { padding: 48px 0; border-top: 1px solid var(--line); }
.page-section:first-of-type { border-top: none; }

.section-header { margin-bottom: 24px; }
.section-header .eyebrow { margin-bottom: 8px; }
.section-header p { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 600px; line-height: 1.5; }

/* ---- SPLIT LAYOUT ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ---- CODE ---- */
.code-block {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--muted);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}
.code-block .accent { color: var(--accent); }
.code-block .green { color: var(--green); }
.code-block .dim { color: #3a4558; }

.code-inline {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---- FOOTER ---- */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer span { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.site-footer a {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 4px;
}
.site-footer a:hover { color: var(--accent); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .stat-grid-4, .stat-grid-5, .stat-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .split, .split-wide { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.btn-accent) { display: none; }
}

@media (max-width: 480px) {
  .stat-grid-4, .stat-grid-5, .stat-grid-6 { grid-template-columns: 1fr 1fr; }
}
