:root {
  --bg: #0b0f1a;
  --surface: #121829;
  --surface-2: #1a2236;
  --border: #2a3550;
  --text: #e8ecf4;
  --muted: #9aa8c4;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: #a78bfa; text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  background: linear-gradient(90deg, #c4b5fd, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
  font-size: 1.05rem;
}

.hero__actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}

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

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  color: #fff;
}

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--success {
  background: #166534;
  color: #dcfce7;
  border: 1px solid #22c55e44;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  padding-top: 0.5rem;
}

.section h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
  color: #c4b5fd;
}

.section p,
.section li { color: var(--muted); }

.section ul,
.section ol { padding-left: 1.25rem; }

.steps {
  display: grid;
  gap: 1rem;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
}

.step__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step h3 { margin: 0 0 0.35rem; color: var(--text); font-size: 1rem; }
.step p { margin: 0; font-size: 0.95rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card--highlight {
  border-color: #7c3aed55;
  background: linear-gradient(135deg, #1a1530, var(--surface));
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text); background: var(--surface-2); }
td code { font-size: 0.85em; }

.code-block {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0d1117;
  overflow: hidden;
}

.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e6edf3;
}

.copy-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.copy-btn:hover { color: var(--text); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child { border-bottom: none; }

.checklist input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

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

.example-card {
  display: block;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.example-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.example-card strong { display: block; margin-bottom: 0.35rem; }
.example-card span { color: var(--muted); font-size: 0.9rem; }

.faq dt {
  font-weight: 600;
  margin-top: 1rem;
  color: var(--text);
}

.faq dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

/* Builder */
.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.field label .req { color: #f87171; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

.field textarea {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 200px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #7c3aed33;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.builder-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.alert--info {
  background: #0c4a6e44;
  border: 1px solid #0891b255;
  color: #a5f3fc;
}

.alert--warn {
  background: #78350f44;
  border: 1px solid #f59e0b55;
  color: #fde68a;
}

.alert--error {
  background: #7f1d1d44;
  border: 1px solid #ef444455;
  color: #fecaca;
}

.preview-frame {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.tab.is-active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
