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

:root {
  --bg: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  --border: #2a2a3a;
  --border-light: #333348;
  --accent: #7c6ef5;
  --accent-hover: #8f83f7;
  --accent-dim: rgba(124, 110, 245, 0.15);
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #e8e8f0;
  --text-muted: #888899;
  --text-dim: #555566;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

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

/* ── Header ────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
}

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

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo-z { color: var(--accent); }

nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.15s; }
nav a:hover, nav a.active { color: var(--text); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding: 5rem 0 4rem; text-align: center; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* ── Install Box ───────────────────────────────────────────── */
.install-box {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 3rem;
  text-align: left;
}

.install-command {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.install-command code {
  font-size: 1rem;
  background: transparent;
  color: var(--green);
  padding: 0;
}

.install-command button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.install-command button:hover { border-color: var(--accent); color: var(--accent); }

.install-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Options Grid ──────────────────────────────────────────── */
.install-options { text-align: left; }
.install-options h3 { text-align: center; margin-bottom: 1.5rem; color: var(--text-muted); font-weight: 500; }

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.option-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.option-card:hover { border-color: var(--border-light); }
.option-card.featured { border-color: var(--accent); background: linear-gradient(135deg, var(--bg-card), rgba(124,110,245,0.05)); }

.option-icon { font-size: 2rem; }
.option-card h4 { font-size: 1rem; font-weight: 600; }
.option-card p { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.option-card code { font-size: 0.8rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.feature {
  text-align: center;
  padding: 1.5rem 1rem;
}
.feature span { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.feature h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature p { font-size: 0.825rem; color: var(--text-muted); }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Builder Layout ────────────────────────────────────────── */
.builder-main { padding: 2rem 0 4rem; }

.builder-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .builder-layout { grid-template-columns: 1fr; }
}

.builder-config {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.builder-config h2 { font-size: 1.1rem; margin-bottom: 1.5rem; }

.config-group { margin-bottom: 1.5rem; }
.config-group > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.config-group select, .config-group input[type="text"] {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.config-group select:focus, .config-group input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-item { cursor: pointer; }
.radio-item input { display: none; }
.radio-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  transition: all 0.15s;
}
.radio-card span { font-size: 0.775rem; color: var(--text-muted); }
.radio-item input:checked + .radio-card { border-color: var(--accent); background: var(--accent-dim); }

/* Component items */
.component-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 0.5rem;
}
.component-item:last-child { border-bottom: none; }
.component-info { display: flex; align-items: center; gap: 0.4rem; flex: 1; }

.badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.required { background: var(--accent-dim); color: var(--accent); }

.component-port {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.component-port input[type="number"] {
  width: 60px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  text-align: center;
}

/* Extensions grid */
.extensions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}
.ext-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0;
}
.ext-item:hover { color: var(--accent); }

.full-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  font-family: var(--mono);
}
.full-input:focus { outline: none; border-color: var(--accent); }

/* Builder preview */
.builder-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.preview-header h2 { font-size: 1rem; }

.preview-tabs { display: flex; gap: 0.25rem; }
.tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--mono);
  transition: all 0.15s;
}
.tab-btn.active { border-color: var(--border); color: var(--text); background: var(--bg-surface); }
.tab-btn:hover:not(.active) { color: var(--text); }

.preview-content { flex: 1; overflow: hidden; }

.code-preview {
  background: var(--bg-surface);
  color: #cdd6f4;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 1.25rem 1.5rem;
  overflow: auto;
  max-height: 520px;
  white-space: pre;
}

.preview-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Install Page ───────────────────────────────────────────── */
.install-page { max-width: 800px; padding-top: 3rem; padding-bottom: 4rem; }
.install-page h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.install-page .subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.install-steps { display: flex; flex-direction: column; gap: 1rem; }

.step-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.step-card.featured { border-color: var(--accent); }

.step-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.step-body { flex: 1; }
.step-body h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.step-body p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.75rem; }

.prereq-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.prereq-list li { font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.link-small { font-size: 0.8rem; }

.code-block {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.code-block code {
  flex: 1;
  background: none;
  padding: 0;
  color: var(--green);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.code-block button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: all 0.15s;
}
.code-block button:hover { border-color: var(--accent); color: var(--accent); }
.code-block button.copied { color: var(--green); border-color: var(--green); }

.inline-code {
  background: var(--bg-surface);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85em;
  color: #a8d8a8;
}

.option-variants { margin-top: 1rem; }
.option-variants h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.variant { margin-bottom: 0.75rem; }
.variant-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
