/* ================================================
   MEMP — AI Memory Interop Broker
   Design System & Styles
   ================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --bg-primary: #0A0E17;
  --bg-surface: #111827;
  --bg-elevated: #1C2333;
  --bg-card: #141B2D;
  --accent: #00E5CC;
  --accent-dim: rgba(0, 229, 204, 0.12);
  --accent-glow: rgba(0, 229, 204, 0.25);
  --accent-2: #6366F1;
  --accent-2-dim: rgba(99, 102, 241, 0.12);
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: #1E293B;
  --border-light: #273549;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 32px rgba(0, 229, 204, 0.15);
  --transition: 150ms ease-out;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1rem; }
p { color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }
code, pre { font-family: var(--font-mono); font-size: 0.875em; }

code {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,229,204,0.2);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  position: relative;
  font-size: 0.85rem;
  line-height: 1.7;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #0A0E17;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: #00cbb5;
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
  opacity: 1;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,229,204,0.3);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(0,229,204,0.2);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  opacity: 1;
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border-color: rgba(0,229,204,0.4);
}
.btn-outline-accent:hover:not(:disabled) {
  background: var(--accent-dim);
  opacity: 1;
}

.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all var(--transition);
}
.navbar.scrolled {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.nav-logo:hover { opacity: 1; }
.nav-logo svg { flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }
}

/* ---------- Section Labels ---------- */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-title {
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-sub {
  font-size: 1.1rem;
  max-width: 640px;
  margin-bottom: 3rem;
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(0,229,204,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 60%, rgba(99,102,241,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-proof { justify-content: center; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,204,0.25);
  border-radius: 100px;
  padding: 0.3rem 0.875rem;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.hero-headline {
  margin-bottom: 1.25rem;
  line-height: 1.1;
}
.hero-headline .accent { color: var(--accent); }
.hero-sub {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 520px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.hero-proof {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.hero-proof strong { color: var(--text-secondary); }
.proof-avatars {
  display: flex;
  margin-right: 0.25rem;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  border: 2px solid var(--bg-primary);
  margin-left: -6px;
}
.avatar:first-child { margin-left: 0; }

/* ---------- Network Diagram ---------- */
.network-diagram {
  position: relative;
  width: 100%;
  max-width: 540px;
}
.network-svg {
  width: 100%;
  height: auto;
}

.node-agent {
  cursor: pointer;
  transition: all var(--transition);
}
.node-agent:hover .node-ring { stroke-opacity: 1; }
.node-ring {
  stroke: var(--accent);
  stroke-opacity: 0.3;
  stroke-width: 2;
  fill: none;
  transition: all var(--transition);
}
.node-core {
  transition: all var(--transition);
}
.node-label {
  font-size: 11px;
  fill: var(--text-muted);
  font-family: var(--font-mono);
}
.node-status {
  font-size: 9px;
  fill: var(--success);
}
@keyframes node-pulse {
  0%, 100% { r: 10; opacity: 0.8; }
  50% { r: 14; opacity: 0.3; }
}
@keyframes flow-line {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}
.flow-line {
  stroke-dasharray: 8 4;
  animation: flow-line 1.5s linear infinite;
}

/* ---------- Problem Section ---------- */
.section-pain {
  padding: 6rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 768px) { .pain-grid { grid-template-columns: 1fr; } }
.pain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}
.pain-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pain-icon {
  width: 48px;
  height: 48px;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.pain-card h3 { margin-bottom: 0.625rem; font-size: 1.1rem; }
.pain-card p { font-size: 0.9rem; }

/* ---------- Solution Section ---------- */
.section-solution { padding: 6rem 0; }
.how-it-works {
  margin-top: 3rem;
}
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.how-step:last-child { border-bottom: none; }
.step-num {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,204,0.25);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}
.step-content h3 { margin-bottom: 0.375rem; font-size: 1rem; }
.step-content p { font-size: 0.9rem; }
.step-code {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

/* ---------- Demo Section ---------- */
.section-demo {
  padding: 6rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 2.5rem;
}
.demo-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.demo-tab {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.demo-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0,229,204,0.05);
}
.demo-tab:hover:not(.active) { color: var(--text-secondary); }
.demo-body { padding: 2rem; }

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) { .demo-grid { grid-template-columns: 1fr; } }

.agent-console {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.console-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}
.console-dots { display: flex; gap: 5px; }
.console-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.console-dot:nth-child(1) { background: #EF4444; }
.console-dot:nth-child(2) { background: #F59E0B; }
.console-dot:nth-child(3) { background: #10B981; }
.console-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: auto;
}
.console-body { padding: 1.25rem; }

.console-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}
.console-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.console-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.console-actions {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.subscribe-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-2);
  background: var(--accent-2-dim);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 100px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
}

.memory-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}
.memory-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  animation: memory-in 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@keyframes memory-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.memory-item-key { color: var(--accent); font-weight: 600; }
.memory-item-val { color: var(--text-secondary); }
.memory-item-meta { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); }
.memory-item-source {
  font-size: 0.65rem;
  color: var(--accent-2);
  background: var(--accent-2-dim);
  padding: 1px 5px;
  border-radius: 3px;
}
.memory-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.memory-empty svg { display: block; margin: 0 auto 0.5rem; opacity: 0.3; }

.demo-status-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 0.875rem 1.25rem;
  background: rgba(0,229,204,0.05);
  border: 1px solid rgba(0,229,204,0.15);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}
.status-item strong { color: var(--text-secondary); }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

/* ---------- SDKs Section ---------- */
.section-sdks { padding: 6rem 0; }
.sdk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
@media (max-width: 768px) { .sdk-grid { grid-template-columns: 1fr; } }
.sdk-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.sdk-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}
.sdk-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.sdk-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,204,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sdk-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.sdk-lang {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,204,0.2);
  padding: 1px 6px;
  border-radius: 100px;
}
.sdk-snippet {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}
.sdk-snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.sdk-snippet-lang { font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-muted); }
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }
.sdk-snippet pre { padding: 0.875rem; font-size: 0.78rem; border: none; border-radius: 0; }
.sdk-footer {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Protocol Spec ---------- */
.spec-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding-top: 5rem;
  min-height: 100vh;
}
@media (max-width: 768px) { .spec-layout { grid-template-columns: 1fr; } }

.spec-sidebar {
  position: sticky;
  top: 5rem;
  height: calc(100vh - 5rem);
  overflow-y: auto;
  padding-right: 1rem;
  border-right: 1px solid var(--border);
}
.spec-sidebar-section { margin-bottom: 1.5rem; }
.spec-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.spec-nav-item {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}
.spec-nav-item:hover { color: var(--text-secondary); background: var(--bg-elevated); opacity: 1; }
.spec-nav-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }

.spec-content { padding-bottom: 4rem; }
.spec-section { margin-bottom: 3rem; scroll-margin-top: 6rem; }
.spec-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.spec-section h3 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; color: var(--text-primary); }
.spec-section p { margin-bottom: 1rem; font-size: 0.95rem; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}
.spec-table th {
  background: var(--bg-elevated);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.spec-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
.spec-table code { font-size: 0.8rem; }
.spec-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-get { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-post { background: rgba(99,102,241,0.15); color: var(--accent-2); }
.badge-delete { background: rgba(239,68,68,0.15); color: var(--error); }

/* ---------- Playground ---------- */
.playground-layout {
  padding-top: 5rem;
  min-height: 100vh;
}
.playground-header { padding: 2rem 0; border-bottom: 1px solid var(--border); }
.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
}
@media (max-width: 768px) { .playground-grid { grid-template-columns: 1fr; } }

.playground-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.panel-title { font-size: 0.875rem; font-weight: 600; }
.panel-body { padding: 1.25rem; }

.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-select { appearance: none; cursor: pointer; }

.json-editor {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
  color: var(--text-primary);
}

.response-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.response-meta {
  display: flex;
  gap: 1rem;
  padding: 0.625rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}
.response-status {
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
}
.status-200 { background: rgba(16,185,129,0.15); color: var(--success); }
.status-400 { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-401 { background: rgba(239,68,68,0.15); color: var(--error); }
.response-time { color: var(--text-muted); margin-left: auto; }
.response-content {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre;
}
.json-key { color: #60A5FA; }
.json-string { color: #34D399; }
.json-number { color: #FBBF24; }
.json-boolean { color: #F472B6; }
.json-null { color: var(--text-muted); }

/* ---------- Dashboard ---------- */
.dashboard-layout {
  padding-top: 5rem;
  min-height: 100vh;
}
.dashboard-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 2rem 0;
}
@media (max-width: 768px) { .dashboard-stats { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.stat-change {
  font-size: 0.8rem;
  font-weight: 500;
}
.stat-change.up { color: var(--success); }
.stat-change.neutral { color: var(--text-muted); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  padding: 2rem 0;
}
@media (max-width: 1024px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dashboard-card-header {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dashboard-card-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.dashboard-card-body { padding: 1.25rem; }

.agent-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.agent-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
}
.agent-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(30,41,59,0.5);
  color: var(--text-secondary);
}
.agent-table tr:last-child td { border-bottom: none; }
.agent-table tr:hover td { background: var(--bg-elevated); }
.agent-name { font-weight: 600; color: var(--text-primary); }
.agent-framework {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: var(--accent-2-dim);
  color: var(--accent-2);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 1px 6px;
  border-radius: 4px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
}
.status-active {
  background: rgba(16,185,129,0.12);
  color: var(--success);
}
.status-idle {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
}
.status-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.usage-meter {
  margin-top: 1rem;
}
.usage-bar-bg {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.usage-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease-out;
}
.usage-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #f97316); }
.usage-bar-fill.danger { background: linear-gradient(90deg, var(--error), #dc2626); }
.usage-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.api-key-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.api-key-value { color: var(--accent); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-key-value.masked { color: var(--text-muted); }
.key-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }

/* ---------- Pricing ---------- */
.section-pricing { padding: 6rem 0; }
.pricing-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}
.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.toggle-label.active { color: var(--text-primary); }
.toggle-switch {
  width: 44px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch.on .toggle-thumb { transform: translateX(20px); }
.save-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
  padding: 2px 8px;
  border-radius: 100px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }
.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: all var(--transition);
}
.pricing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pricing-card.popular {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(0,229,204,0.05) 0%, var(--bg-surface) 60%);
  box-shadow: var(--shadow-accent);
}
.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0A0E17;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.pricing-tier { font-size: 0.875rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.5rem; }
.pricing-price { font-size: 2.75rem; font-weight: 800; line-height: 1; margin-bottom: 0.25rem; font-family: var(--font-mono); }
.pricing-price sup { font-size: 1.25rem; font-weight: 600; vertical-align: top; margin-top: 0.5rem; }
.pricing-period { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pricing-divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.75rem; }
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.pricing-features li svg { flex-shrink: 0; margin-top: 2px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  background: var(--bg-surface);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-brand p { font-size: 0.875rem; margin-top: 0.75rem; max-width: 300px; }
.footer-col-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--text-secondary); opacity: 1; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ---------- CTA Section ---------- */
.section-cta {
  padding: 6rem 0;
  text-align: center;
  position: relative;
}
.cta-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(0,229,204,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.cta-title { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1rem; }
.cta-sub { font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.page { min-height: 100vh; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success svg { color: var(--success); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fade-in 0.15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-size: 1.1rem; margin-bottom: 0.75rem; }
.modal-body { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ---------- Animations ---------- */
.fade-in {
  animation: fade-in 0.3s ease-out;
}
.stagger-in > * {
  opacity: 0;
  animation: stagger-item 0.4s ease-out forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 80ms; }
.stagger-in > *:nth-child(3) { animation-delay: 160ms; }
.stagger-in > *:nth-child(4) { animation-delay: 240ms; }
.stagger-in > *:nth-child(5) { animation-delay: 320ms; }
.stagger-in > *:nth-child(6) { animation-delay: 400ms; }
@keyframes stagger-item {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Search Input ---------- */
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding-left: 2.5rem !important;
}

/* ---------- Tabs ---------- */
.tab-list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Highlight.js overrides ---------- */
.hljs { background: transparent !important; }

/* ---------- Responsive helpers ---------- */
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .section-pain, .section-solution, .section-sdks, .section-pricing, .section-cta { padding: 4rem 0; }
  .hero { padding-top: 4rem; }
  .hero-inner { padding: 2rem 0; }
}
