:root {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-elevated: #f8f9fb;
  --bg-hover: #eef0f4;
  --text: #1a1d23;
  --text-secondary: #5a6072;
  --text-muted: #9198a8;
  --accent: #6366f1;
  --accent-hover: #5558e6;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --border: #e2e5eb;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --bg-card: #1a1d28;
    --bg-elevated: #222633;
    --bg-hover: #282d3a;
    --text: #ecedee;
    --text-secondary: #9ca3b4;
    --text-muted: #696e80;
    --accent: #818cf8;
    --accent-hover: #939cf9;
    --accent-glow: rgba(129, 140, 248, 0.25);
    --border: #2d3140;
    --success: #4ade80;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

@media (prefers-color-scheme: dark) {
  .nav { background: rgba(15, 17, 23, 0.8); }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent) !important;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 6px 16px !important;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.85rem !important;
}

.nav-cta:hover { background: var(--accent-hover) !important; }

/* Hero */
.hero {
  padding: 80px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; }

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-logo { margin-bottom: 24px; }

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.hero-stat { display: flex; flex-direction: column; align-items: center; }

.hero-stat-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-stat-num.accent { color: var(--accent); }

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary) !important;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text) !important;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-alt { background: var(--bg-card); }

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Comparison table */
.compare-table-wrapper {
  max-width: 700px;
  margin: 0 auto;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-table tr.highlight {
  background: var(--accent-glow);
}

.compare-table tr.highlight td { border-bottom-color: transparent; }
.compare-table tr:last-child td { border-bottom: none; }

.compare-table .bad { color: var(--danger); font-weight: 600; }
.compare-table .good { color: var(--success); font-weight: 600; }

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--bg-card);
}

.detail-term {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.detail-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tech grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--bg-card);
}

.tech-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.tech-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Installation */
.install-prereqs {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.install-prereqs h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.install-prereqs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-prereqs li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.install-prereqs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* Code tabs */
.code-tabs {
  max-width: 700px;
  margin: 0 auto;
}

.code-tab-headers {
  display: flex;
  gap: 0;
  border-bottom: none;
}

.code-tab-btn {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.code-tab-btn:not(:first-child) { margin-left: -1px; }

.code-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  position: relative;
}

.code-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg-card);
}

.code-tab-content {
  display: none;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}

.code-tab-content.active { display: block; }

pre {
  background: #1a1d28;
  color: #ecedee;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  padding: 24px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

pre .c { color: #6b7280; font-style: italic; }

.cli-help {
  max-width: 700px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

/* Tree */
.tree {
  max-width: 560px;
  margin: 0 auto;
}

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

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-links a:hover { color: var(--text); }

.footer-license p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.step-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.2s;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Legal blocks */
.legal-block {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.legal-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.legal-block h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.legal-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-block p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-block ul {
  list-style: none;
  margin-bottom: 12px;
}

.legal-block li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
  line-height: 1.6;
}

.legal-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"] {
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-stats { flex-direction: column; gap: 24px; }
  .hero-stat-num { font-size: 1.6rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.6rem; }
  .steps-grid { grid-template-columns: 1fr; }
}
