/* SPDX-License-Identifier: LicenseRef-LeonsDB-Proprietary */
/* Copyright (c) 2026 Leoon-X */

/* ---------- Tokens ---------- */

:root {
  --bg: #0b0f0d;
  --bg-alt: #101613;
  --surface: #141c18;
  --surface-2: #1a241f;
  --border: #24312a;
  --text: #e8efe9;
  --muted: #9aaba0;
  --accent: #4ade80;
  --accent-strong: #22c55e;
  --accent-ink: #052e16;
  --danger: #f87171;
  --code-bg: #0e1411;
  --t-kw: #c4a7ff;
  --t-str: #fcd58a;
  --t-an: #4ade80;
  --t-ty: #7dd3fc;
  --t-cm: #6b7f72;
  --radius: 12px;
  --wrap: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8f6;
    --bg-alt: #edf2ee;
    --surface: #ffffff;
    --surface-2: #f2f6f3;
    --border: #d6e0d9;
    --text: #0f1a14;
    --muted: #4d5f54;
    --accent: #15803d;
    --accent-strong: #166534;
    --accent-ink: #ffffff;
    --danger: #b91c1c;
    --code-bg: #0e1411;
    color-scheme: light;
  }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

img { max-width: 100%; height: auto; }

code, pre { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 10;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand:hover { color: var(--text); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 0.95rem; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.nav a.nav-cta { color: var(--accent-ink); background: var(--accent); font-weight: 600; margin-left: 4px; }
.nav a.nav-cta:hover { background: var(--accent-strong); color: var(--accent-ink); }
@media (max-width: 520px) {
  .nav .hide-sm { display: none; }
  .nav a { padding: 6px 7px; font-size: 0.9rem; }
}
@media (max-width: 380px) { .brand span { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 48px;
  background:
    radial-gradient(800px 400px at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(600px 300px at 95% 10%, color-mix(in srgb, var(--t-ty) 10%, transparent), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 96px 0 80px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; }
}

.status {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 0.85rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

.hero h1 {
  text-wrap: balance;
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 800;
}
.lead { margin: 0 0 28px; color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.2rem); max-width: 36em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.code-card {
  margin: 0; min-width: 0;
  background: var(--code-bg); border: 1px solid #24312a; border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.code-card figcaption {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid #24312a; background: #121a16;
}
.code-card figcaption::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: #f87171; box-shadow: 16px 0 0 #fbbf24, 32px 0 0 #4ade80; margin-right: 36px;
}
.code-card .file { color: #9aaba0; font: 0.8rem var(--mono); }
.code-card pre { margin: 0; padding: 18px; overflow-x: auto; color: #e8efe9; font-size: 0.84rem; line-height: 1.7; }
@media (min-width: 720px) { .code-card pre { font-size: 0.85rem; } }
.t-kw { color: var(--t-kw); }
.t-str { color: var(--t-str); }
.t-an { color: var(--t-an); }
.t-ty { color: var(--t-ty); }
.t-cm { color: var(--t-cm); font-style: italic; }

/* ---------- Band ---------- */

.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; padding-top: 18px; padding-bottom: 18px; color: var(--muted); font-size: 0.95rem; }
.pill-row span::before { content: "✓"; color: var(--accent); margin-right: 8px; font-weight: 700; }

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 960px) { .section { padding: 96px 0; } }

.section-title { text-wrap: balance; margin: 0 0 12px; font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.15; letter-spacing: -0.025em; }
.section-lead { margin: 0 0 36px; color: var(--muted); font-size: 1.08rem; max-width: 40em; }
.note { margin: 24px 0 0; color: var(--muted); font-size: 0.95rem; }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3, .card h2 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card code { font-size: 0.88em; color: var(--accent); }
.card .license { margin-bottom: 10px; color: var(--accent); font: 600 0.82rem var(--mono); }
.card-link { display: block; text-decoration: none; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.card-link:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; } }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative;
  padding: 18px 18px 18px 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted);
}
.steps li strong { display: block; color: var(--text); margin-bottom: 2px; }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 700;
}
.steps code { color: var(--accent); font-size: 0.9em; }

.switch { display: grid; gap: 10px; }
.switch-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted);
}
.switch-row .tag { font: 600 0.82rem var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; text-align: center; }
.switch-reject { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.switch-reject strong { color: var(--danger); }
@media (max-width: 480px) { .switch-row { grid-template-columns: 1fr; gap: 8px; } .switch-row .tag { justify-self: start; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; background: var(--surface-2); }
.compare tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }
.compare td { color: var(--muted); }
.compare td:last-child { color: var(--text); }
.compare thead th:last-child { color: var(--accent); }

.cta { text-align: center; }
.cta-inner { max-width: 720px; }
.cta h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 3.6vw, 2.2rem); letter-spacing: -0.025em; }
.cta p { margin: 0 0 24px; color: var(--muted); font-size: 1.08rem; }

/* ---------- Content pages ---------- */

.page { padding-top: 40px; padding-bottom: 72px; }
.page-docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .page-docs { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; } }

.docs-nav { display: flex; flex-wrap: wrap; gap: 6px; align-self: start; }
@media (min-width: 900px) { .docs-nav { flex-direction: column; position: sticky; top: 84px; } }
.docs-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 0.95rem; }
.docs-nav a:hover { color: var(--text); background: var(--surface); }
.docs-nav a[aria-current="page"] { color: var(--accent); background: var(--surface); font-weight: 600; }

.prose { max-width: 760px; min-width: 0; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 20px; }
.prose h2 { font-size: 1.45rem; letter-spacing: -0.02em; margin: 44px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 1.12rem; margin: 30px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 20px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
.prose blockquote p { margin: 0; }
.prose :not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 0.88em; overflow-wrap: anywhere; }
.prose pre { background: var(--code-bg); color: #e8efe9; border: 1px solid #24312a; border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 0.86rem; line-height: 1.6; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.doc-cards { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 640px) { .doc-cards { grid-template-columns: repeat(2, 1fr); } }
.doc-cards .card h2 { margin: 0 0 6px; padding: 0; font-size: 1.1rem; }

.notfound { text-align: center; padding-top: 96px; padding-bottom: 120px; }
.notfound h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.notfound p { color: var(--muted); }
.code-404 { font: 800 4.5rem/1 var(--mono); color: var(--accent); margin: 0 0 12px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 48px 0 24px; }
.footer-inner { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 1fr 2fr; } }
.footer-brand p { color: var(--muted); margin: 10px 0 0; }
.footer-links { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.footer-links h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.footer-links a { display: block; color: var(--text); text-decoration: none; padding: 4px 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
.footer-legal p { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Draft and preview banners ---------- */

.banner { padding: 10px 0; font-size: 0.92rem; border-bottom: 1px solid var(--border); }
.banner-draft { background: #fef3c7; color: #78350f; }
.banner-preview { background: #dbeafe; color: #1e3a8a; }

/* ---------- Pricing (unreleased) ---------- */

.tiers { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
@media (min-width: 720px) { .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tier { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.tier-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tier h2 { margin: 0; font-size: 1.15rem; }
.tier .price { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.tier .price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier .for { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tier ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.95rem; }
.tier li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 8px; }
.tier .btn { margin-top: auto; }
.callout { padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--surface); }
