/* atelier-libs — minimal dark theme inspired by Linear / Vercel docs */

:root {
  --bg: #0a0b0d;
  --bg-soft: #14161a;
  --bg-card: rgba(255, 255, 255, 0.025);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7e9ee;
  --text-dim: #9095a0;
  --text-mute: #6b7280;
  --accent: #6bd0a4;
  --accent-soft: rgba(107, 208, 164, 0.15);
  --warn: #f6c25b;
  --warn-soft: rgba(246, 194, 91, 0.12);
  --danger: #ef6679;
  --code-bg: rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 80px 0 60px;
  background: radial-gradient(circle at 30% 0%, rgba(107, 208, 164, 0.08), transparent 50%);
  border-bottom: 1px solid var(--border);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--text-mute);
  margin: 0 0 12px;
}

h1 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.1;
}

.tagline {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 0 24px;
}

.meta {
  font-size: 13px;
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.meta .dot { opacity: 0.4; }
.meta-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.meta-link:hover { border-bottom-color: var(--accent); }

/* ── For agents ─────────────────────────────────────────────────────────── */

.for-agents {
  padding: 50px 0 30px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 70% 50%, rgba(246, 194, 91, 0.04), transparent 50%);
}

.for-agents h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.for-agents-intro {
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 650px;
}

.agent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.agent-tab {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}
.agent-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.agent-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.agent-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.panel-desc {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 14px;
}
.panel-desc code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
}
.panel-foot {
  margin: 14px 0 0;
  color: var(--text-mute);
  font-size: 13px;
}
.panel-foot code {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

.snippet {
  position: relative;
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  padding-right: 80px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
  color: var(--text);
}
.snippet code {
  background: none;
  padding: 0;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.copy-btn.copied {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Search ─────────────────────────────────────────────────────────────── */

.search-section {
  padding: 40px 0 16px;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  z-index: 10;
}

#search {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}
#search:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.filter-chips button {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filter-chips button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.filter-chips button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Catalog cards ──────────────────────────────────────────────────────── */

.catalog {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0 80px;
}

.lib {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  transition: border-color 0.15s, transform 0.15s;
}
.lib:hover {
  border-color: var(--border-strong);
}

.lib-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.lib-name {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.lib-title {
  font-size: 15px;
  color: var(--text);
}
.lib-status {
  margin-left: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 9px;
  border-radius: 999px;
}
.lib-status.stable {
  background: var(--accent-soft);
  color: var(--accent);
}
.lib-status.experimental {
  background: var(--warn-soft);
  color: var(--warn);
}
.lib-status.deprecated {
  background: rgba(239, 102, 121, 0.12);
  color: var(--danger);
}

.lib-category {
  display: inline-block;
  font-size: 11px;
  color: var(--text-mute);
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-transform: lowercase;
}

.lib-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin: 12px 0;
  white-space: pre-line;
}

.lib-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.lib-keywords code {
  font-size: 11px;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.lib-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.lib-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 8px;
}

.lib-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 14px;
}
.lib-section ul li { margin-bottom: 4px; }

.lib-section pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  margin: 0;
}

.lib-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 0;
  margin-top: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lib-toggle:hover { color: var(--text); }

.hidden { display: none; }

.empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-mute);
}

.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-mute);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-mute);
  font-size: 13px;
}
footer p { margin: 6px 0; }
footer a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
footer a:hover { border-bottom-color: var(--text-dim); }
footer code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

@media (max-width: 640px) {
  h1 { font-size: 36px; }
  .hero { padding: 60px 0 40px; }
  .container { padding: 0 18px; }
  .lib { padding: 18px 20px; }
}
