:root {
  --bg: #080c14;
  --bg-elev: #0f1624;
  --bg-card: #131c2e;
  --bg-code: #0a0f1a;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.3);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --cyan: #38bdf8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 1160px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 12, 20, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: #fff;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--cyan);
  background: #182338;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
}

/* Hero */
.hero {
  padding: 64px 0 42px;
  background: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(99, 102, 241, 0.18), transparent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  margin-bottom: 18px;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 820px;
}

.hero-sub {
  margin: 0 0 28px;
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 700px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Sections & Grids */
.section {
  padding: 52px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  max-width: 680px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card-highlight {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }
.mono { font-family: var(--mono); }

/* Tabs & Playground */
.playground-box {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 30px;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-code);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.tab-btn.active {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text);
}

.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }

/* Form controls */
label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.92rem;
}

textarea.mono {
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.form-field { flex: 1; min-width: 180px; }

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}

.preview-stage {
  margin-top: 16px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.preview-stage img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.preview-stage iframe {
  width: 100%;
  height: 440px;
  border: none;
  border-radius: 6px;
  background: #fff;
}

/* Code blocks */
pre {
  margin: 0;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.76rem;
}

/* Pricing */
.price-tag {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 10px 0 4px;
}

.price-tag span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
}

.feature-list li {
  padding: 5px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.feature-list li::before {
  content: "✓ ";
  color: var(--green);
  font-weight: 700;
}

/* Alerts & tables */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.alert-ok { border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.08); color: #bbf7d0; }
.alert-err { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.08); color: #fecaca; }

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

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

th { color: var(--text-muted); font-weight: 600; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

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

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

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

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