:root {
  --bg: #16171b;
  --bg-2: #1b1c20;
  --panel: #212227;
  --panel-2: #2a2b31;
  --border: #2e2f35;
  --border-strong: #3c3d45;
  --text: #e3e5ea;
  --text-muted: #a0a3b0;
  --text-faint: #6c7080;
  --accent: #5b8def;
  --accent-strong: #7ea3f7;
  --accent-bg: rgba(91, 141, 239, 0.14);
  --bird: #ff9a4a;
  --success: #5cc38a;

  /* The app mock always stays dark, like dbird's default theme. */
  --app-bg: #1b1c20;
  --app-side: #1f2024;
  --app-panel: #25262b;
  --app-line: #2a2b31;
  --app-odd: #202126;
  --app-text: #dcdee4;
  --app-muted: #9a9dab;
  --app-faint: #666a78;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Cantarell", "Noto Sans", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 14px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-2: #eef0f4;
    --panel: #ffffff;
    --panel-2: #f1f3f7;
    --border: #e0e3ea;
    --border-strong: #cdd2dc;
    --text: #1a1c22;
    --text-muted: #555a68;
    --text-faint: #8a8f9c;
    --accent: #2f63d3;
    --accent-strong: #2553b8;
    --accent-bg: rgba(47, 99, 211, 0.1);
    --bird: #e0671f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.88em; background: var(--accent-bg); padding: 0.1em 0.35em; border-radius: 5px; }
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.1em 0.45em;
  font-size: 0.8em;
  text-align: center;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a { color: var(--text-muted); font-size: 0.95rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.gh { display: inline-flex; align-items: center; gap: 6px; }

main > section { max-width: 1180px; margin: 0 auto; padding: 88px 24px; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center;
  padding-top: 72px !important;
}
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 4px 12px;
  font-size: 0.82rem; font-weight: 600; color: var(--accent-strong);
  background: var(--accent-bg); border-radius: 999px;
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 800; }
.accent {
  background: linear-gradient(95deg, var(--accent) 0%, var(--accent-strong) 45%, var(--bird) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.15rem; color: var(--text-muted); margin: 22px 0 30px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: 12px; font-weight: 600;
  border: 1px solid transparent; transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn span { display: flex; flex-direction: column; line-height: 1.25; }
.btn small { font-weight: 400; font-size: 0.8rem; opacity: 0.85; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 24px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { color: var(--text); border-color: var(--border-strong); align-self: stretch; }
.btn.ghost:hover { background: var(--panel); }
.btn.wide { width: 100%; }
.engines { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 28px 0 0; }
.engines li {
  font-size: 0.82rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
}

/* App mock */
.hero-art { position: relative; }
.hero-art::before {
  content: ""; position: absolute; inset: -12% -8% -8% 4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(91, 141, 239, 0.28), transparent 70%),
              radial-gradient(closest-side at 80% 85%, rgba(255, 138, 61, 0.2), transparent 70%);
  filter: blur(20px);
}
.window {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  height: 440px; overflow: hidden;
  background: var(--app-bg); color: var(--app-text);
  border: 1px solid #34353c; border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  font-size: 12px; line-height: 1.5;
}
.side { background: var(--app-side); border-right: 1px solid var(--app-line); padding: 10px 8px; overflow: hidden; }
.side .filter { color: var(--app-faint); background: #1a1b1f; border: 1px solid var(--app-line); border-radius: 6px; padding: 3px 8px; margin-bottom: 10px; }
.side .conn { display: flex; align-items: center; gap: 6px; padding: 3px 6px; font-weight: 600; white-space: nowrap; }
.side small { color: var(--app-faint); font-weight: 400; margin-left: auto; font-size: 10.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.tree { margin: 2px 0 8px; }
.tree p { margin: 0; padding: 1px 6px; color: var(--app-muted); white-space: nowrap; display: flex; gap: 4px; border-radius: 5px; }
.tree .t1 { padding-left: 14px; } .tree .t2 { padding-left: 24px; } .tree .t3 { padding-left: 34px; } .tree .t4 { padding-left: 48px; font-size: 11.5px; }
.tree .t4 b { font-size: 9px; }
.tree .on { background: rgba(91, 141, 239, 0.16); color: var(--app-text); }

.work { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.tabs { display: flex; align-items: stretch; background: var(--app-side); border-bottom: 1px solid var(--app-line); overflow: hidden; }
.tab { display: flex; align-items: center; gap: 6px; padding: 7px 12px; color: var(--app-muted); border-right: 1px solid var(--app-line); white-space: nowrap; }
.tab.on { background: var(--app-bg); color: var(--app-text); box-shadow: inset 0 2px 0 #5b8def; }
.tab em { font-style: normal; color: var(--app-muted); }
.plus { padding: 7px 10px; color: var(--app-faint); }

.editor {
  position: relative; margin: 0; padding: 12px 14px; overflow: hidden;
  font-size: 12.5px; line-height: 1.75; color: #e6c07b; white-space: pre;
}
.editor .ln { display: inline-block; width: 2.2em; color: #4d5160; user-select: none; }
.editor .k { color: #cf8ef0; } .editor .f { color: #6ec3d6; } .editor .s { color: #9fd28a; }
.caret { color: #e6c07b; box-shadow: 1.5px 0 0 #dcdee4; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { box-shadow: none; } }
.ac {
  position: absolute; left: min(318px, calc(100% - 206px)); top: 102px; width: 196px;
  background: #25262b; border: 1px solid #3c3d45; border-radius: 8px; padding: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); font-family: var(--sans); line-height: 1.4;
}
.ac p { margin: 0; padding: 4px 8px; border-radius: 5px; display: flex; justify-content: space-between; gap: 8px; color: var(--app-text); }
.ac p.on { background: rgba(91, 141, 239, 0.3); }
.ac b { font-weight: 500; font-family: var(--mono); font-size: 11.5px; }
.ac small { color: var(--app-muted); font-size: 10.5px; }

.results { border-top: 1px solid var(--app-line); background: var(--app-bg); }
.rbar { display: flex; align-items: center; gap: 14px; padding: 5px 12px; background: var(--app-side); border-bottom: 1px solid var(--app-line); }
.rbar .on { color: var(--app-text); font-weight: 600; }
.rbar small { color: var(--app-muted); }
.rbar .exp { margin-left: auto; }
.results table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.results th, .results td { text-align: left; padding: 3px 12px; border-right: 1px solid var(--app-line); white-space: nowrap; }
.results th { color: var(--app-muted); font-weight: 500; font-family: var(--sans); border-bottom: 1px solid var(--app-line); }
.results td:first-child, .results th:first-child { color: var(--app-faint); width: 1%; }
.results tbody tr:nth-child(odd) { background: var(--app-odd); }
.results tr.sel { background: #26303f !important; }
.results .n { text-align: right; color: #f0a869; }
.results .null { color: var(--app-faint); font-style: italic; }

/* Sections */
h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; }
.section-lede { color: var(--text-muted); font-size: 1.1rem; margin: 12px 0 40px; max-width: 40em; }

.features-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin: 0; }
.features-list > div {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 20px; transition: border-color 0.15s;
}
.features-list > div:hover { border-color: var(--border-strong); }
.features-list dt { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.features-list dd { margin: 8px 0 0; color: var(--text-muted); font-size: 0.95rem; }
.ico {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 8px; background: var(--accent-bg); color: var(--accent-strong); font-size: 15px;
}

.shortcuts { padding-top: 24px !important; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.keys-grid p {
  margin: 0; padding: 12px 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: 0.95rem;
}
.keys-grid p span { display: inline-flex; gap: 4px; align-items: center; min-width: 124px; color: var(--text-faint); }

/* Download */
.download { border-top: 1px solid var(--border); }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.platform {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.platform.recommended { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.platform > header { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.platform .logo { width: 34px; height: 34px; color: var(--text); flex: none; }
.platform h3 { font-size: 1.3rem; }
.platform header small { color: var(--text-faint); font-size: 0.82rem; }
.label { margin: 8px 0 0; font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 0.72rem; font-weight: 600; color: var(--success); background: rgba(92, 195, 138, 0.12); padding: 1px 8px; border-radius: 999px; }
.code {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 12px;
}
.code code { background: none; padding: 0; font-size: 0.8rem; overflow-x: auto; white-space: nowrap; flex: 1; scrollbar-width: none; }
.copy {
  font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; flex: none;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 7px; padding: 4px 10px;
}
.copy:hover { border-color: var(--accent); }
.copy.done { color: var(--success); border-color: var(--success); }
.hint { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.pkgs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.pkgs a {
  display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-size: 0.92rem;
}
.pkgs a:hover { border-color: var(--accent); text-decoration: none; }
.pkgs b { font-weight: 600; }
.pkgs span { color: var(--text-faint); font-family: var(--mono); font-size: 0.82rem; }
.arch { display: inline-flex; align-self: flex-start; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.arch button { font: inherit; font-size: 0.8rem; background: none; color: var(--text-muted); border: 0; padding: 4px 12px; cursor: pointer; }
.arch button.on { background: var(--accent-bg); color: var(--accent-strong); font-weight: 600; }
details { font-size: 0.9rem; color: var(--text-muted); }
summary { cursor: pointer; color: var(--text); font-weight: 500; }
details[open] summary { margin-bottom: 8px; }
details dl { margin: 0; }
details dt { font-weight: 600; color: var(--text); margin-top: 6px; }
details dd { margin: 2px 0 0; }
details code, details p code { word-break: break-all; }
details p { margin: 6px 0 0; }

/* Closing */
.closing { text-align: center; max-width: 720px !important; }
.closing img { filter: drop-shadow(0 12px 30px rgba(91, 141, 239, 0.35)); }
.closing h2 { margin-top: 18px; }
.closing p { color: var(--text-muted); font-size: 1.05rem; margin: 16px 0 28px; }

footer {
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.9rem;
}
footer p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
footer a { color: var(--text-muted); margin-left: 16px; }
footer p:last-child a:first-child { margin-left: 0; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .platforms { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 640px) {
  main > section { padding: 64px 16px; }
  .nav-inner { padding: 10px 16px; }
  .nav nav { gap: 14px; }
  .nav nav a:not(.gh) { display: none; }
  .window { grid-template-columns: minmax(0, 1fr); height: 380px; }
  .side { display: none; }
  .keys-grid p span { min-width: 108px; }
  footer { padding: 24px 16px 32px; }
  footer a { margin-left: 0; margin-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .btn { transition: none; }
}

/* Why */
.why { max-width: 760px !important; padding-bottom: 24px !important; }
.why p { color: var(--text-muted); font-size: 1.1rem; margin: 16px 0 0; }
.why h2 { margin-bottom: 4px; }
