/* DB-G site — one stylesheet, no build step. */

:root {
  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --bg-soft: #f2efe8;
  --text: #1b1a18;
  --muted: #6d6961;
  --border: #e3ded4;
  --border-strong: #cec7ba;
  --accent: #5146e5;
  --accent-strong: #3d31cc;
  --accent-soft: #e9e6ff;
  --on-accent: #ffffff;
  --code-bg: #f1ede5;
  --shadow: 0 1px 2px rgba(20, 18, 12, .05), 0 18px 50px -24px rgba(20, 18, 12, .25);
  --radius: 14px;
  --wrap: 1120px;
  --read: 760px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214;
    --bg-elev: #171a1d;
    --bg-soft: #1c2024;
    --text: #e9e7e2;
    --muted: #9b978e;
    --border: #2a2f34;
    --border-strong: #3b4148;
    --accent: #9aa6ff;
    --accent-strong: #b7c0ff;
    --accent-soft: #232743;
    --on-accent: #11131a;
    --code-bg: #1b1f23;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --bg: #101214;
  --bg-elev: #171a1d;
  --bg-soft: #1c2024;
  --text: #e9e7e2;
  --muted: #9b978e;
  --border: #2a2f34;
  --border-strong: #3b4148;
  --accent: #9aa6ff;
  --accent-strong: #b7c0ff;
  --accent-soft: #232743;
  --on-accent: #11131a;
  --code-bg: #1b1f23;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

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

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--bg-elev); color: var(--text); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 16px; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; font-size: 17px; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 20px; margin-left: 8px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.lang-link:hover { color: var(--text); }
.gh-link { color: var(--muted); display: inline-flex; }
.gh-link:hover { color: var(--text); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--text); background: var(--bg-soft); border-color: var(--border); }
.theme-icon { display: none; }
[data-theme-pref="system"] .i-system,
[data-theme-pref="light"] .i-light,
[data-theme-pref="dark"] .i-dark { display: block; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-row { gap: 12px; }
  .nav-actions { gap: 9px; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15.5px; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-small { padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

.link-arrow { color: var(--text); font-weight: 550; text-decoration: none; border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; }
.link-arrow:hover { color: var(--accent-strong); border-color: var(--accent-strong); }

/* ---------- type ---------- */

h1, h2, h3 { letter-spacing: -.025em; line-height: 1.15; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.9rem); margin: 0 0 20px; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0 0 16px; }
h3 { font-size: 1.12rem; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .09em; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.lead { font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.55; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.sep { color: var(--border-strong); margin: 0 8px; }

/* ---------- hero ---------- */

.hero { padding: 78px 0 40px; border-bottom: 1px solid var(--border); }
.hero-copy { max-width: 900px; }
.hero h1 { max-width: 940px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.032em; }
.hero h1 .hl { box-shadow: inset 0 -.24em 0 var(--accent-soft); }
.hero .lead { max-width: 60ch; }
.hero .lead { max-width: 64ch; }
.cta-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 30px 0 16px; }
.version-line { font-size: 14px; color: var(--muted); margin: 0 0 34px; }
.version-line a { color: var(--muted); }
.version-line a:hover { color: var(--text); }

.meta-row { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0 0 46px; padding: 0; }
.meta-row div { display: flex; flex-direction: column; gap: 3px; }
.meta-row dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meta-row dd { margin: 0; font-size: 14px; }

.hero-shot { margin: 0 0 34px; }
.shot, .hero-shot {
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shot img, .hero-shot img { display: block; width: 100%; }
.hero-shot figcaption { font-size: 13px; color: var(--muted); padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- features ---------- */

.features { padding: 64px 0 20px; }
.feature { padding: 44px 0; border-bottom: 1px solid var(--border); }
.feature:last-child { border-bottom: 0; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.feature-image .feature-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
.feature:not(.feature-image) .feature-grid { grid-template-columns: 1fr; }
.feature:not(.feature-image) .feature-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); column-gap: 64px; align-items: start; }
.feature:not(.feature-image) .feature-text .kicker,
.feature:not(.feature-image) .feature-text h2 { grid-column: 1 / -1; max-width: none; }
.feature:not(.feature-image) .feature-text p { margin: 0; max-width: 56ch; }
.feature:not(.feature-image) .feature-text .ticks { margin-top: 0; }
@media (max-width: 820px) {
  .feature:not(.feature-image) .feature-text { grid-template-columns: 1fr; }
}
.feature-text h2 { max-width: 30ch; }
.feature-text p { color: var(--muted); max-width: 52ch; }
.feature-text .kicker { display: block; margin-bottom: 12px; }
@media (max-width: 900px) {
  .feature-grid, .feature-image .feature-grid { grid-template-columns: 1fr; gap: 28px; }
}

.ticks { list-style: none; padding: 0; margin: 20px 0 0; }
.ticks li { position: relative; padding-left: 24px; margin: 9px 0; color: var(--muted); font-size: 15.5px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .58em;
  width: 9px; height: 5px; border-left: 1.7px solid var(--accent); border-bottom: 1.7px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- more ---------- */

.more { padding: 64px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.more > .wrap > h2 { margin-bottom: 34px; }
.more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 34px; }
.more-item h3 { font-size: 1rem; margin-bottom: 6px; }
.more-item p { font-size: 14.5px; color: var(--muted); margin: 0; }
@media (max-width: 900px) { .more-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .more-grid { grid-template-columns: 1fr; } }

/* ---------- release ---------- */

.release { padding: 64px 0; }
.release-inner { max-width: var(--read); }
.release-head h2 { margin-bottom: 20px; }
.release-head h2 a { text-decoration: none; color: var(--text); font-family: var(--mono); font-size: .9em; }
.release-notes ul { margin-bottom: 24px; }
.release-note { color: var(--muted); }

/* ---------- page head ---------- */

.page-head { padding: 64px 0 36px; }
.page-head h1 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
.page-head .lead { max-width: 66ch; }

/* ---------- download ---------- */

.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.platform-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; background: var(--bg-elev); }
.platform-card h2 { font-size: 1.25rem; }
.platform-card p { color: var(--muted); font-size: 15px; }
.file-name { display: block; margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
@media (max-width: 760px) { .platform-grid { grid-template-columns: 1fr; } }

.code-block { position: relative; margin: 18px 0 0; border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg); }
.code-block pre { margin: 0; padding: 14px 64px 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.code-block .copy {
  position: absolute; top: 8px; right: 8px; font: inherit; font-size: 12px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 4px 9px; cursor: pointer;
}
.code-block .copy:hover { color: var(--text); border-color: var(--border-strong); }

.files { padding: 56px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td code, .hash { font-family: var(--mono); font-size: 12px; }
.hash { word-break: break-all; color: var(--muted); }

.install { padding: 20px 0 72px; }
.install .prose h3 { margin-top: 30px; }

/* ---------- docs ---------- */

.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 12px; padding-bottom: 80px; align-items: start; }
.toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; border-left: 1px solid var(--border); padding-left: 18px; }
.toc-title { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.toc nav { display: flex; flex-direction: column; gap: 3px; }
.toc a { color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.45; padding: 3px 0; }
.toc a:hover { color: var(--text); }
.toc .toc-l3 { padding-left: 12px; font-size: 12.8px; }
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; max-height: 260px; border-left: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; }
}

.prose { max-width: var(--read); }
.prose h2 { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--border); font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.prose h3 { margin-top: 34px; font-size: 1.18rem; }
.prose h4 { font-size: 1.02rem; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text); }
.prose li { margin: 6px 0; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .16em .4em; border-radius: 5px; }
.prose pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: 13px; }
.prose blockquote { margin: 20px 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose table { margin: 22px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 14px; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--bg-soft); }
.prose img { border-radius: 10px; border: 1px solid var(--border); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.doc-source { margin-top: 56px; font-size: 14px; }

.changelog .version { padding: 10px 0 22px; border-bottom: 1px solid var(--border); margin-bottom: 44px; }
.changelog .version:last-child { border-bottom: 0; }
.changelog .version > h2 { font-family: var(--mono); font-size: 1.1rem; color: var(--muted); margin-bottom: 8px; }
.changelog .version .prose h3 { margin-top: 26px; font-size: 1rem; color: var(--accent-strong); }
.changelog .version .prose h2 { display: none; }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--border); padding: 48px 0 34px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-brand p { color: var(--muted); max-width: 34ch; margin-top: 12px; }
.foot-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.foot-grid a:not(.brand) { display: block; color: var(--text); text-decoration: none; padding: 3px 0; }
.foot-grid a:not(.brand):hover { color: var(--accent-strong); }
.foot-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.foot-legal p { margin: 4px 0; }
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

.notfound { padding: 100px 0 120px; max-width: 620px; }

/* ---------- admin ---------- */

.admin-wrap { padding: 48px 0 80px; }
.admin-head h1 { font-size: 2rem; margin-bottom: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 28px 0 40px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; background: var(--bg-elev); }
.stat span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat strong { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; }
.stat-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-bottom: 40px; }
.stat-columns table { border: 1px solid var(--border); border-radius: 8px; }
.stat-columns td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } .stat-columns { grid-template-columns: 1fr; } }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .nav-row { flex-wrap: wrap; height: auto; padding-top: 10px; row-gap: 6px; }
  .nav-links {
    display: flex; order: 3; width: 100%; margin: 0;
    gap: 18px; padding: 8px 0 10px; border-top: 1px solid var(--border);
  }
  .nav-links a { font-size: 14px; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(1.9rem, 7.4vw, 2.5rem); }
  .cta-row { gap: 14px; }
  .btn { padding: 11px 16px; }
  .meta-row { gap: 12px 24px; }
  .prose table { display: block; overflow-x: auto; }
  .doc-layout { padding-bottom: 48px; }
  .page-head { padding-top: 44px; }
}
.doc-layout > * { min-width: 0; }
.toc a { overflow-wrap: anywhere; }
.platform-grid > *, .feature-grid > *, .more-grid > *, .release-inner > * { min-width: 0; }
.platform-card { overflow-wrap: anywhere; }

/* ---------- admin journeys ---------- */

.journeys { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 44px; }
.journey { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; background: var(--bg-elev); }
.journey header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.journey header code { font-family: var(--mono); font-size: 12px; }
.journey header span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.path li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.path li + li::before { content: "→"; color: var(--border-strong); }
.path-label { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-family: var(--mono); }
.path li.click .path-label, .path li.download .path-label { color: var(--accent-strong); }
.path time { display: none; }
