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

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --bg-4: #222222;
  --border: #2a2a2a;
  --border-2: #333333;
  --text: #e8e8e8;
  --text-2: #a0a0a0;
  --text-3: #666666;
  --accent: #7c6aff;
  --accent-dim: rgba(124, 106, 255, 0.12);
  --accent-border: rgba(124, 106, 255, 0.3);
  --code-bg: #0f0f0f;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg: #f8f8f8;
  --bg-2: #ffffff;
  --bg-3: #f0f0f0;
  --bg-4: #e8e8e8;
  --border: #e0e0e0;
  --border-2: #d0d0d0;
  --text: #111111;
  --text-2: #555555;
  --text-3: #999999;
  --accent: #5b47e8;
  --accent-dim: rgba(91, 71, 232, 0.08);
  --accent-border: rgba(91, 71, 232, 0.25);
  --code-bg: #f4f4f5;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

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

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

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-3);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--text);
}

/* ─── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Navigation ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }

.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

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

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-2); }

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 300;
  color: var(--text-2);
  margin-bottom: 20px;
}

.hero-desc {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

/* Hero Code */
.hero-code {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-lg);
}

.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.code-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  font-family: var(--font);
}
.code-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.code-tab:hover { color: var(--text); }

.code-panel { display: none; }
.code-panel.active { display: block; }

.code-panel pre {
  padding: 24px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  font-family: var(--mono);
}

/* ─── Syntax highlighting (manual) ─────────────────────────────── */
.kw { color: #c792ea; }
.str { color: #c3e88d; }
.num { color: #f78c6c; }
.cm { color: #546e7a; }
.fn { color: #82aaff; }

[data-theme="light"] .kw { color: #7c3aed; }
[data-theme="light"] .str { color: #16a34a; }
[data-theme="light"] .num { color: #c2410c; }
[data-theme="light"] .cm { color: #94a3b8; }
[data-theme="light"] .fn { color: #2563eb; }

/* ─── Features ──────────────────────────────────────────────────── */
.features {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-card {
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ─── Getting Started ───────────────────────────────────────────── */
.getting-started {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 56px;
}
.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.section-header p {
  color: var(--text-2);
  font-size: 16px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
}

.step-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  padding-top: 4px;
}

.step-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content > p {
  color: var(--text-2);
  margin-bottom: 16px;
  font-size: 14px;
}

.install-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Code Blocks ───────────────────────────────────────────────── */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}

.copy-btn {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--font);
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-2); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  font-family: var(--mono);
  color: var(--text);
}

.code-block code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ─── API page specific ─────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}

.sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg);
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 0 20px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-link:hover { color: var(--text); text-decoration: none; }
.sidebar-link.active { color: var(--accent); }

.method-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  flex-shrink: 0;
}
.method-get { background: rgba(34,197,94,0.15); color: #22c55e; }
.method-post { background: rgba(124,106,255,0.15); color: #7c6aff; }
.method-delete { background: rgba(239,68,68,0.15); color: #ef4444; }
.method-all { background: rgba(245,158,11,0.15); color: #f59e0b; }

.docs-content {
  padding: 48px 56px;
  max-width: 860px;
}

/* Endpoint cards */
.endpoint-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.endpoint-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-left: auto;
}

.endpoint-body {
  padding: 20px;
}

.endpoint-section {
  margin-bottom: 20px;
}

.endpoint-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 10px;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.param-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.param-table tr:last-child td { border-bottom: none; }

.param-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.param-type {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}

.param-required {
  font-size: 11px;
  color: var(--warning);
  font-weight: 600;
}

.param-optional {
  font-size: 11px;
  color: var(--text-3);
}

.param-desc {
  color: var(--text-2);
  line-height: 1.5;
}

/* Auth badge */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.auth-badge.required { border-color: var(--warning); color: var(--warning); background: rgba(245,158,11,0.08); }
.auth-badge.none { border-color: var(--success); color: var(--success); background: rgba(34,197,94,0.08); }

/* Error codes */
.error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.error-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.error-table tr:last-child td { border-bottom: none; }
.error-code { font-family: var(--mono); color: var(--error); }

/* ─── CTA ───────────────────────────────────────────────────────── */
.cta-section {
  padding: 80px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.cta-section h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.cta-section p {
  color: var(--text-2);
  margin-bottom: 28px;
  font-size: 16px;
}
.cta-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Footer ────────────────────────────────────────────────────── */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
  font-size: 15px;
}

.footer-copy {
  color: var(--text-3);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.footer-links a {
  color: var(--text-3);
  font-size: 13px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--text-2); }

/* ─── Docs Page Headers ─────────────────────────────────────────── */
.docs-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.docs-header h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.docs-header p {
  color: var(--text-2);
  font-size: 16px;
}

.docs-section {
  margin-bottom: 56px;
}

.docs-section h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-top: 8px;
}

.docs-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 24px;
}

.docs-section p {
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 14px;
}

.docs-section ul, .docs-section ol {
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

/* Inline alert/note boxes */
.note-box {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.note-box.info { border-color: var(--accent); background: var(--accent-dim); color: var(--text-2); }
.note-box.warning { border-color: var(--warning); background: rgba(245,158,11,0.08); color: var(--text-2); }
.note-box.success { border-color: var(--success); background: rgba(34,197,94,0.08); color: var(--text-2); }

/* SDK method signatures */
.method-sig {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  color: var(--text);
}

/* Transaction type pills */
.tx-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
}
.tx-internal { background: rgba(124,106,255,0.15); color: #7c6aff; }
.tx-lightning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.tx-withdraw { background: rgba(34,197,94,0.15); color: #22c55e; }
.tx-mint { background: rgba(16,185,129,0.15); color: #10b981; }

/* ─── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 48px 0 40px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .features { padding: 48px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; }
  .step-num { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .docs-content { padding: 24px; }
  .footer-links { display: none; }
}
