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

:root {
  --bg:       #080c10;
  --bg2:      #0d1117;
  --bg3:      #111820;
  --surface:  #141c26;
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.12);
  --text:     #e8edf2;
  --muted:    #6b7d8f;
  --faint:    #2a3542;
  --accent:   #00d4ff;
  --accent2:  #0099cc;
  --green:    #00e5a0;
  --amber:    #ffaa00;
  --red:      #ff4466;
  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-body:    'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: default;
}

/* ── Grid overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 2px; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
p { font-weight: 300; }
a { color: var(--accent); text-decoration: none; transition: all 0.2s; }
code { font-family: var(--font-mono); font-size: 0.8125rem; background: var(--surface); border: 1px solid var(--border2); padding: 0.125rem 0.4rem; border-radius: 3px; color: var(--text); }

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 64px;
  background: rgba(8,12,16,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.nav-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--accent); } 50% { opacity: 0.6; box-shadow: 0 0 4px var(--accent); } }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); text-decoration: none; letter-spacing: 0.02em; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-cta { font-family: var(--font-mono); font-size: 0.8125rem; padding: 0.5rem 1.25rem; background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; text-decoration: none; }
.nav-cta:hover { background: var(--accent); color: var(--bg); }

/* ── Common Components ── */
.section-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.section-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1rem; }
.section-sub { font-size: 1rem; color: var(--muted); max-width: 500px; line-height: 1.7; font-weight: 300; }

.btn-primary, .btn-secondary { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.875rem; padding: 0.875rem 2rem; border-radius: 4px; text-decoration: none; transition: all 0.2s; letter-spacing: 0.02em; }
.btn-primary { background: var(--accent); color: var(--bg); border: none; font-weight: 500; }
.btn-primary:hover { background: #33ddff; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,212,255,0.25); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--muted); background: var(--surface); }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Home Page ── */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 8rem 2rem 6rem; overflow: hidden; }
.hero-glow { position: absolute; top: 20%; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(ellipse, rgba(0,212,255,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 860px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.2); padding: 0.375rem 1rem; border-radius: 2px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2rem; animation: fadeUp 0.6s ease both; }
.hero-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.hero-title { font-family: var(--font-display); font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 800; line-height: 1.0; letter-spacing: -0.04em; color: var(--text); margin-bottom: 1.5rem; animation: fadeUp 0.6s 0.1s ease both; }
.hero-title span { color: transparent; -webkit-text-stroke: 1px rgba(0,212,255,0.5); }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: 1.125rem; color: var(--muted); max-width: 560px; margin: 0 auto 3rem; line-height: 1.7; font-weight: 300; animation: fadeUp 0.6s 0.2s ease both; }

.terminal-wrap { position: relative; max-width: 700px; margin: 5rem auto 0; animation: fadeUp 0.6s 0.4s ease both; }
.terminal { background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; font-family: var(--font-mono); font-size: 0.8125rem; box-shadow: 0 32px 64px rgba(0,0,0,0.5); }
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-red { background: #ff5f57; }
.t-amber { background: #febc2e; }
.t-green { background: #28c840; }
.terminal-title { flex: 1; text-align: center; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.05em; }
.terminal-body { padding: 1.5rem; line-height: 2; text-align: left; }
.t-comment { color: var(--muted); }
.t-cmd { color: var(--text); }
.t-cmd::before { content: '$ '; color: var(--accent); }
.t-out { color: var(--green); }
.t-key { color: var(--accent); }
.t-val { color: #ffcc88; }
.t-cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; max-width: 700px; margin: 0 auto; }
.stat { background: var(--bg2); padding: 2rem; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1; }
.stat-num span { color: var(--accent); }
.stat-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.5rem; }

section { position: relative; z-index: 1; padding: 6rem 2rem; max-width: 1100px; margin: 0 auto; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 4rem; }
.feature { background: var(--bg2); padding: 2.5rem; transition: background 0.2s; position: relative; overflow: hidden; }
.feature::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; transition: opacity 0.3s; }
.feature:hover { background: var(--bg3); }
.feature:hover::before { opacity: 1; }
.feature-icon { width: 40px; height: 40px; border: 1px solid var(--border2); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; margin-bottom: 1.25rem; background: var(--surface); }
.feature-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin-bottom: 0.625rem; letter-spacing: -0.01em; }
.feature-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.7; font-weight: 300; }

.protocols { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 4rem; justify-content: center; }
.proto-badge { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.5rem 1.25rem; border: 1px solid var(--border2); border-radius: 2px; color: var(--muted); letter-spacing: 0.05em; transition: all 0.2s; }
.proto-badge:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,212,255,0.05); }

.flow { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 4rem; flex-wrap: wrap; }
.flow-node { background: var(--surface); border: 1px solid var(--border2); border-radius: 6px; padding: 1rem 1.5rem; text-align: center; min-width: 130px; }
.flow-node-label { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.25rem; }
.flow-node-name { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.flow-node.accent { border-color: var(--accent); background: rgba(0,212,255,0.06); }
.flow-node.accent .flow-node-name { color: var(--accent); }
.flow-arrow { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); padding: 0 0.25rem; white-space: nowrap; }

/* ── Docs Page ── */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; padding-top: 64px; position: relative; z-index: 1; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; border-right: 1px solid var(--border); padding: 2rem 0; background: var(--bg2); }
.sidebar-section { margin-bottom: 2rem; padding: 0 1.5rem; }
.sidebar-heading { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.sidebar-links { list-style: none; }
.sidebar-links a { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); text-decoration: none; padding: 0.375rem 0.75rem; border-radius: 4px; transition: all 0.15s; letter-spacing: 0.02em; }
.sidebar-links a:hover { color: var(--text); background: var(--surface); }
.sidebar-links a.active { color: var(--accent); background: rgba(0,212,255,0.08); }
.sidebar-links a .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); flex-shrink: 0; transition: background 0.15s; }
.sidebar-links a.active .dot, .sidebar-links a:hover .dot { background: var(--accent); }

.docs-content { padding: 3rem 4rem 6rem; max-width: 820px; }
.doc-section { margin-bottom: 4rem; }
.doc-section:not(:last-child) { padding-bottom: 4rem; border-bottom: 1px solid var(--border); }
.doc-label { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.75rem; }

.docs-content h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.docs-content h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.docs-content h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.docs-content h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; margin-top: 2rem; }
.docs-content p { font-size: 0.9375rem; color: var(--muted); line-height: 1.75; margin-bottom: 1rem; }

pre { background: var(--bg2); border: 1px solid var(--border2); border-radius: 6px; padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1.25rem 0; position: relative; }
pre code { background: none; border: none; padding: 0; font-size: 0.8125rem; line-height: 1.8; color: var(--text); }
.pre-label { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; }

.hl-key { color: var(--accent); }
.hl-val { color: #ffcc88; }
.hl-str { color: var(--green); }
.hl-cmt { color: var(--muted); font-style: italic; }
.hl-kw  { color: #cc99ff; }

.steps { margin: 1.5rem 0; }
.step-item { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.3); color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.step-content h4 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.375rem; color: var(--text); }

.callout { border-radius: 4px; padding: 1rem 1.25rem; margin: 1.25rem 0; font-size: 0.875rem; line-height: 1.6; border-left: 2px solid; }
.callout.info { background: rgba(0,212,255,0.05); border-color: var(--accent); }
.callout.warn { background: rgba(255,170,0,0.06); border-color: var(--amber); }
.callout.danger { background: rgba(255,68,102,0.06); border-color: var(--red); }
.callout-label { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.375rem; }
.callout.info .callout-label { color: var(--accent); }
.callout.warn .callout-label { color: var(--amber); }

table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.875rem; }
th { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; text-align: left; padding: 0.625rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border2); }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
td:first-child { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text); }

/* ── Pricing Page ── */
.page-hero { text-align: center; padding: 6rem 2rem 4rem; position: relative; }
.page-hero::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 600px; height: 1px; background: linear-gradient(90deg, transparent, var(--border2), transparent); }
.page-hero-glow { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 500px; height: 300px; background: radial-gradient(ellipse, rgba(0,212,255,0.06) 0%, transparent 70%); pointer-events: none; }

.pricing-section { max-width: 1100px; margin: 0 auto; padding: 5rem 2rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.plan { background: var(--bg2); padding: 2.5rem; display: flex; flex-direction: column; position: relative; transition: background 0.2s; }
.plan:hover { background: var(--bg3); }
.plan.featured { background: var(--bg3); border-top: 2px solid var(--accent); }
.plan-badge { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-mono); font-size: 0.6875rem; color: var(--bg); background: var(--accent); padding: 0.25rem 0.875rem; border-radius: 2px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.plan-name { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.plan-price { font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--text); margin-bottom: 0.25rem; }
.plan-price span { font-size: 1.25rem; font-weight: 400; color: var(--muted); font-family: var(--font-body); letter-spacing: 0; }
.plan-price .currency { font-size: 1.5rem; font-weight: 600; vertical-align: top; margin-top: 0.5rem; display: inline-block; }
.plan-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; margin-bottom: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.plan-features { list-style: none; flex: 1; margin-bottom: 2rem; }
.plan-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.875rem; color: var(--muted); padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.plan-features li::before { content: '✓'; color: var(--green); font-size: 0.75rem; font-family: var(--font-mono); flex-shrink: 0; margin-top: 2px; }
.plan-features li.dim { color: var(--faint); }
.plan-features li.dim::before { color: var(--faint); content: '—'; }
.btn-plan { display: block; text-align: center; font-family: var(--font-mono); font-size: 0.8125rem; padding: 0.875rem; border-radius: 4px; text-decoration: none; transition: all 0.2s; letter-spacing: 0.03em; }
.btn-plan.outline { border: 1px solid var(--border2); color: var(--text); }
.btn-plan.filled { border: 1px solid var(--accent); color: var(--bg); background: var(--accent); }

.compare-section { max-width: 1100px; margin: 0 auto; padding: 0 2rem 6rem; }
.compare-header { margin-bottom: 3rem; }
.compare-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.compare-table th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 1.25rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border2); }
.compare-table th.featured-col { color: var(--accent); background: rgba(0,212,255,0.05); border-top: 2px solid var(--accent); }
.compare-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; text-align: center; color: var(--muted); }
.compare-table td:first-child { text-align: left; color: var(--text); }
.compare-table td.featured-col { background: rgba(0,212,255,0.02); }
.category-row td { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg3) !important; padding: 0.625rem 1rem; border-bottom: 1px solid var(--border2); }

.faq-section { max-width: 720px; margin: 0 auto; padding: 0 2rem 6rem; }
.faq-header { margin-bottom: 3rem; text-align: center; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; cursor: pointer; gap: 1rem; user-select: none; }
.faq-q-text { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text); }
.faq-icon { font-family: var(--font-mono); font-size: 1rem; color: var(--muted); transition: transform 0.2s; }
.faq-icon.open { transform: rotate(45deg); color: var(--accent); }
.faq-a { font-size: 0.9375rem; color: var(--muted); line-height: 1.75; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s; }
.faq-a.open { max-height: 200px; padding-bottom: 1.25rem; }

/* ── Global Utility ── */
.cta-section { text-align: center; padding: 6rem 2rem; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.cta-section::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 400px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }

footer { border-top: 1px solid var(--border); padding: 2rem 2.5rem; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; flex-wrap: wrap; gap: 1rem; }
.footer-left { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 992px) {
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .docs-content { padding: 2rem; }
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .stats { grid-template-columns: 1fr; }
}
