/* HQ World Docs — shared styles */
:root {
  --bg: #09090b;
  --bg-subtle: #111113;
  --bg-card: #18181b;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --emerald: #10b981;
  --emerald-dim: #065f46;
  --blue: #3b82f6;
  --blue-dim: #1e3a5f;
  --amber: #f59e0b;
  --red: #ef4444;
  --indigo: #6366f1;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text); }

/* ─── Nav ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
nav .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
nav .logo {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
nav .logo span { color: var(--text-dim); font-weight: 400; }
nav .links { display: flex; gap: 1.5rem; }
nav .links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
nav .links a:hover, nav .links a.active { color: var(--text); }

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.hero .subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 2rem;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.hero .badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}
.hero .cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--text);
  color: var(--bg) !important;
}
.btn-primary:hover { background: #d4d4d8; color: var(--bg) !important; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text) !important;
}
.btn-secondary:hover { border-color: var(--border-hover); }

/* ─── Content ─── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}
section { padding: 4rem 0; }
section + section { border-top: 1px solid var(--border); }
h2 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text);
}
p { color: var(--text-muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ─── Feature Grid ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-hover); }
.card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}
.card h3 { font-size: 0.9375rem; margin-bottom: 0.375rem; }
.card p { font-size: 0.8125rem; line-height: 1.6; }

/* ─── Code blocks ─── */
pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
code {
  font-family: var(--mono);
  font-size: 0.8125rem;
}
:not(pre) > code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
}

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}
th, td {
  text-align: left;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--text-dim); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
td { color: var(--text-muted); }
td:first-child { color: var(--text); font-weight: 400; }

/* ─── Architecture Diagram ─── */
.arch-diagram {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 1.5rem;
}

/* ─── Protocol list ─── */
.protocol-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.protocol-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
}
.protocol-row .label {
  color: var(--text-dim);
  font-size: 0.75rem;
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.protocol-row .value { color: var(--text); }

/* ─── Steps ─── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.step-content h3 { font-size: 0.875rem; margin-bottom: 0.25rem; }
.step-content p { font-size: 0.8125rem; }

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero { padding: 4rem 1.5rem 3rem; }
  .container { padding: 0 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  nav { padding: 0 1rem; }
  .protocol-row { flex-direction: column; gap: 0.25rem; }
  .protocol-row .label { min-width: auto; }
}
