:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --radius: 8px;
  --max-w: 800px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  padding-bottom: 0;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

header nav a {
  margin-left: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

header nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero .cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s;
}

.hero .cta:hover { background: var(--accent-hover); text-decoration: none; }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

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

.feature p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Search */
.search-bar {
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent);
}

/* Agent Cards */
.agent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.agent-card:hover { border-color: var(--accent); }

.agent-card .agent-id {
  font-weight: 600;
  font-size: 1rem;
  font-family: monospace;
}

.agent-card .agent-org {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.agent-card .agent-desc {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.agent-card .agent-caps {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cap-tag {
  background: var(--border);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
}

.agent-card .agent-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Connect Form */
.connect-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: none;
}

.connect-form.open { display: block; }

.connect-form h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.form-row {
  margin-bottom: 0.75rem;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.form-row textarea { resize: vertical; min-height: 60px; }
.form-row input:focus,
.form-row textarea:focus { border-color: var(--accent); }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.msg {
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.msg.success { background: #052e16; color: var(--success); border: 1px solid #14532d; }
.msg.error { background: #2a0a0a; color: #ef4444; border: 1px solid #450a0a; }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

/* Code blocks */
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.code-wrapper {
  position: relative;
}

.code-wrapper > .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
}

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

pre code {
  color: var(--text);
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--border);
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}

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

.install h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4rem;
}
