/* ════════════════════════════════
   Anonyma Docs — Design System
   Matches landing page design language
   ════════════════════════════════ */

:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface2: #27272a;
  --border: #27272a;
  --border2: #3f3f46;
  --text: #e4e4e7;
  --text2: #a1a1aa;
  --text3: #71717a;
  --text4: #52525b;
  --white: #fafafa;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --accent-bg: rgba(167,139,250,.08);
  --green: #22c55e;
  --green-bg: rgba(34,197,94,.1);
  --red: #ef4444;
  --yellow: #eab308;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--white); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

strong { color: var(--white); font-weight: 600; }

/* ════════════════════════════════
   Navbar
   ════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-docs-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  transition: all .15s;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--surface2); text-decoration: none; }

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--accent2);
  padding: 8px 20px;
  border-radius: var(--radius-xs);
  transition: background .15s;
  text-decoration: none;
}
.nav-cta:hover { background: var(--accent); text-decoration: none; }

/* ════════════════════════════════
   Hero
   ════════════════════════════════ */
.hero {
  padding: 140px 28px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 65%);
  pointer-events: none;
}

.hero-logo {
  margin: 0 auto 32px;
  opacity: 0.9;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text3);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent2);
  color: white;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); text-decoration: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text2);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  font-family: inherit;
}
.btn-ghost:hover { color: var(--white); border-color: var(--text3); text-decoration: none; }

/* ════════════════════════════════
   Table of Contents
   ════════════════════════════════ */
.toc-section {
  max-width: 1140px;
  margin: 0 auto 80px;
  padding: 0 28px;
}

.toc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.toc-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all .2s;
  text-decoration: none;
}
.toc-item:hover {
  border-color: var(--border2);
  background: var(--surface2);
  text-decoration: none;
}

.toc-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  min-width: 28px;
  line-height: 1.4;
}

.toc-item-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.toc-item-desc {
  display: block;
  font-size: 12px;
  color: var(--text3);
}

/* ════════════════════════════════
   Section Base
   ════════════════════════════════ */
section, .doc-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 16px;
  color: var(--text3);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-desc code {
  font-size: 0.9em;
}

/* ════════════════════════════════
   Steps (Getting Started)
   ════════════════════════════════ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  transition: all .25s;
}
.step-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.step-num {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent2);
  color: white;
  font-size: 16px;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: 18px;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13.5px;
  color: var(--text3);
  line-height: 1.6;
}

/* ════════════════════════════════
   Code Blocks
   ════════════════════════════════ */
.code-section {
  margin-bottom: 32px;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}

.code-lang {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.code-title {
  font-size: 12px;
  color: var(--text4);
  font-weight: 500;
}

.code-block {
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  tab-size: 2;
}

.code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

.code-block.code-sm {
  font-size: 12.5px;
  padding: 16px;
}

/* Code without header */
.api-card > .code-block,
.endpoint-card > .code-block {
  border-radius: var(--radius-xs);
  margin-top: 16px;
}

.api-card > .code-block.code-sm {
  margin-top: 12px;
}

/* Syntax highlighting */
.code-block .k { color: #c084fc; }      /* keywords */
.code-block .s { color: #86efac; }      /* strings */
.code-block .c { color: #52525b; }      /* comments */
.code-block .f { color: #93c5fd; }      /* functions */
.code-block .t { color: #fbbf24; }      /* types */
.code-block .p { color: #f9a8d4; }      /* params */

/* Split code (request/response) */
.code-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.code-split-half .code-header {
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  padding: 8px 14px;
}

.code-split-half .code-block {
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}

/* ════════════════════════════════
   API Reference Cards
   ════════════════════════════════ */
.api-group {
  margin-bottom: 48px;
}

.api-group-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.api-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color .2s;
}
.api-card:hover { border-color: var(--border2); }

.api-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.api-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 6px;
}

.api-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.api-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-badge.send {
  color: var(--yellow);
  background: rgba(234,179,8,.1);
}

.api-returns {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--mono);
}

.api-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-top: 12px;
}

.warning-text { color: var(--red); }

/* API Tables */
.api-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.api-table th {
  text-align: left;
  padding: 10px 16px;
  background: #0d0d0f;
  color: var(--text3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.api-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.api-table tr:last-child td { border-bottom: none; }
.api-table tr:hover td { background: rgba(255,255,255,.02); }

.api-table td code {
  font-size: 12px;
}

/* ════════════════════════════════
   Endpoint Card
   ════════════════════════════════ */
.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.endpoint-method {
  font-size: 11px;
  font-weight: 800;
  color: white;
  background: var(--green);
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.endpoint-method.ws {
  background: var(--accent2);
}

.endpoint-url {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--white);
  background: transparent;
  padding: 0;
}

.endpoint-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

/* ════════════════════════════════
   Callouts
   ════════════════════════════════ */
.callout {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-sm);
  margin-top: 24px;
  margin-bottom: 24px;
}

.callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.callout p {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
  margin-top: 4px;
}

.callout strong {
  font-size: 14px;
}

.callout-warn {
  background: rgba(234,179,8,.06);
  border: 1px solid rgba(234,179,8,.15);
}
.callout-warn .callout-icon { color: var(--yellow); }
.callout-warn strong { color: var(--yellow); }

.callout-info {
  background: var(--accent-bg);
  border: 1px solid rgba(167,139,250,.15);
}
.callout-info .callout-icon { color: var(--accent); }
.callout-info strong { color: var(--accent); }

/* ════════════════════════════════
   Architecture
   ════════════════════════════════ */
.specs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.spec-row:hover { background: var(--surface2); }
.spec-row:nth-child(odd) { border-right: 1px solid var(--border); }

.spec-key {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
}

.spec-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.accent-val { color: var(--accent) !important; }

.arch-group {
  margin-bottom: 48px;
}

.arch-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 14px;
}

.arch-title svg { color: var(--accent); flex-shrink: 0; }

.arch-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 20px;
}

.arch-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.arch-benefit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.arch-benefit strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.arch-benefit span {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
}

/* Crypto Cards */
.crypto-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.crypto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.crypto-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.crypto-card p {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
}

/* ════════════════════════════════
   Validation
   ════════════════════════════════ */
.validation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.val-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all .25s;
}
.val-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.val-icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.val-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.val-card p {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
}

/* ════════════════════════════════
   CTA Section
   ════════════════════════════════ */
.cta-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px 120px;
  text-align: center;
}

.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px 40px;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,.1) 0%, transparent 60%);
  pointer-events: none;
}

.cta-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.cta-desc {
  font-size: 16px;
  color: var(--text3);
  max-width: 460px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* ════════════════════════════════
   Footer
   ════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 28px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text4);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text4);
  transition: color .15s;
  text-decoration: none;
}
.footer-link:hover { color: var(--text2); text-decoration: none; }

/* ════════════════════════════════
   Fade-in Animations
   ════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════
   Responsive
   ════════════════════════════════ */
@media (max-width: 900px) {
  .steps-grid,
  .arch-benefits,
  .validation-grid { grid-template-columns: 1fr; }
  .toc-grid { grid-template-columns: 1fr; }
  .specs-grid { grid-template-columns: 1fr; }
  .spec-row:nth-child(odd) { border-right: none; }
  .crypto-cards { grid-template-columns: 1fr; }
  .code-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 120px 20px 60px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
  .links-row { flex-direction: column; gap: 10px; }
}
