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

:root {
  --bg:               #06060f;
  --glass-bg:         rgba(255, 255, 255, 0.04);
  --glass-border:     rgba(255, 255, 255, 0.08);
  --glass-border-hi:  rgba(255, 255, 255, 0.16);
  --accent:           #7c3aed;
  --accent-2:         #4f46e5;
  --accent-light:     #a78bfa;
  --blue:             #60a5fa;
  --text:             #f0f0ff;
  --text-muted:       rgba(255, 255, 255, 0.45);
  --text-dim:         rgba(255, 255, 255, 0.22);
  --nav-h:            60px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Stars ─────────────────────────────────────────────────────────────────── */
#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min-op, 0.1);  transform: scale(1); }
  50%       { opacity: var(--max-op, 0.85); transform: scale(var(--peak-scale, 1.8));
              box-shadow: 0 0 3px 1px var(--star-color, #fff); }
}

/* ── Navigation ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(6, 6, 15, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-logo img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.nav-links { display: flex; gap: 2px; }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover  { color: var(--text); background: var(--glass-bg); }
.nav-link.active { color: var(--text); background: rgba(124, 58, 237, 0.18); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 64px) 32px 80px;
  z-index: 1;
}

.hero-glow {
  position: absolute;
  width: 760px;
  height: 760px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.13) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  pointer-events: none;
  animation: glow-pulse 7s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8;  transform: translate(-50%, -54%) scale(1);    }
  50%       { opacity: 1;    transform: translate(-50%, -54%) scale(1.1); }
}

.hero-icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.45), 0 0 100px rgba(124, 58, 237, 0.1);
  margin-bottom: 32px;
  position: relative;
}

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2.5px;
  margin-bottom: 20px;
  position: relative;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 45%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 36px;
  line-height: 1.65;
  position: relative;
}

/* ── Demo box ──────────────────────────────────────────────────────────────── */
#demo-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 13px 20px;
  min-width: 320px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

#demo-wrapper::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(96,165,250,0.25), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent-light);
  flex-shrink: 0;
}

#demo-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-style: italic;
  flex: 1;
  text-align: left;
  min-width: 200px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent-light);
  box-shadow: 0 0 6px var(--accent-light);
  animation: blink 1s step-start infinite;
  flex-shrink: 0;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s;
  position: relative;
}

.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35), 0 2px 8px rgba(0,0,0,0.3);
}

.btn-primary:hover { box-shadow: 0 0 40px rgba(124, 58, 237, 0.55), 0 2px 12px rgba(0,0,0,0.3); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  transform: none !important;
}

.version-badge {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ── Section commons ───────────────────────────────────────────────────────── */
section { position: relative; z-index: 1; }

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-light);
  margin-bottom: 12px;
  font-weight: 600;
}

/* ── Features ──────────────────────────────────────────────────────────────── */
.features {
  padding: 80px 32px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.features-heading {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: left;
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--glass-border-hi);
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}

.feature-icon { font-size: 26px; margin-bottom: 14px; }

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

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

/* ── Tip ───────────────────────────────────────────────────────────────────── */
.tip-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 28px;
}

.tip-box strong { color: var(--text); }

/* ── CTA section ───────────────────────────────────────────────────────────── */
.cta-section {
  padding: 80px 32px;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.cta-section h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.cta-section p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--glass-border);
  padding: 24px 32px;
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 13px;
  color: var(--text-dim);
}

footer a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--accent-light); }

/* ── kbd ───────────────────────────────────────────────────────────────────── */
kbd {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
}

/* ── Docs layout ───────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  max-width: 1020px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 52px) 32px 100px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.docs-sidebar-section { margin-bottom: 28px; }

.docs-sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
  padding: 0 10px;
}

.docs-sidebar a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 7px;
  transition: color 0.2s, background 0.2s;
  line-height: 1.45;
}

.docs-sidebar a:hover { color: var(--text); background: var(--glass-bg); }
.docs-sidebar a.active { color: var(--accent-light); background: rgba(167,139,250,0.09); }

/* ── Docs content ──────────────────────────────────────────────────────────── */
.docs-content > h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.docs-lead {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 52px;
  line-height: 1.7;
  max-width: 560px;
}

.docs-section {
  margin-bottom: 60px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--glass-border);
}

.docs-section:last-child { border-bottom: none; margin-bottom: 0; }

.docs-section h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-section h2 .section-icon { font-size: 20px; }

.docs-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}

.docs-section p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

.docs-section ul, .docs-section ol {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 2.1;
}

.docs-section li strong { color: var(--text); }

/* Install steps */
.install-steps { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.install-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.install-step-body { font-size: 14px; color: var(--text-muted); line-height: 1.65; }
.install-step-body strong { color: var(--text); }
.install-step-body a { color: var(--accent-light); text-decoration: none; }
.install-step-body a:hover { text-decoration: underline; }

/* Keyboard table */
.key-table { width: 100%; border-collapse: collapse; margin: 16px 0; }

.key-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.key-table td {
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.key-table tr:last-child td { border-bottom: none; }
.key-table td:first-child { white-space: nowrap; }

/* Code block */
.code-block {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: #a5f3fc;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.75;
}

.code-block .comment { color: rgba(255,255,255,0.25); }
.code-block .kw      { color: #c4b5fd; }
.code-block .str     { color: #86efac; }

/* Architecture diagram */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.arch-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 18px;
}

.arch-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 8px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.arch-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Changelog */
.changelog-entry { margin-bottom: 24px; }

.changelog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.changelog-tag {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.changelog-date { font-size: 12px; color: var(--text-dim); }

.changelog-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 4px;
}

/* Callout box */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.callout-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.callout strong { color: var(--text); }
.callout a { color: var(--accent-light); text-decoration: none; }
.callout a:hover { text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .features-grid     { grid-template-columns: 1fr; }
  .arch-grid         { grid-template-columns: 1fr; }
  .docs-layout       { grid-template-columns: 1fr; gap: 32px; }
  .docs-sidebar      { position: static; }
}

@media (max-width: 480px) {
  .btn-row           { flex-direction: column; align-items: center; }
  .hero-title        { font-size: 38px; letter-spacing: -1.5px; }
  .nav-inner         { padding: 0 20px; }
}
