:root {
  --bg: #f7f8fb; --surface: #ffffff; --surface-2: #eef1f7; --text: #141a29; --muted: #55607a;
  --line: #dde2ee; --accent: #7c3aed; --accent-2: #db2777; --accent-text: #ffffff;
  --code-bg: #0f1422; --code-text: #e6eaf5; --good: #15803d; --warn: #b45309; --warn-bg: #fff4e0;
  --shadow: 0 1px 2px rgba(20,26,41,.06), 0 8px 24px rgba(20,26,41,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19; --surface: #131a2a; --surface-2: #1a2235; --text: #e7ebf5; --muted: #9aa6c2;
    --line: #26304a; --accent: #a78bfa; --accent-2: #f472b6; --accent-text: #0b0f19;
    --code-bg: #070a12; --code-text: #e6eaf5; --good: #4ade80; --warn: #fbbf24; --warn-bg: #2a2111;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f19; --surface: #131a2a; --surface-2: #1a2235; --text: #e7ebf5; --muted: #9aa6c2;
  --line: #26304a; --accent: #a78bfa; --accent-2: #f472b6; --accent-text: #0b0f19;
  --code-bg: #070a12; --code-text: #e6eaf5; --good: #4ade80; --warn: #fbbf24; --warn-bg: #2a2111; --shadow: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
img, svg { max-width: 100%; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { overflow-wrap: anywhere; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 100; }

/* header */
header.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
nav.main { margin-left: auto; display: flex; gap: 4px; align-items: center; overflow-x: auto; min-width: 0; scrollbar-width: none; }
nav.main a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: .95rem; }
nav.main a:hover { background: var(--surface-2); color: var(--text); }
#theme { flex: none; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 5px 9px; cursor: pointer; }

/* hero */
.hero { padding: 72px 0 48px; text-align: center;
  background: radial-gradient(900px 340px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.hero img.logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; margin: 18px 0 12px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 1.2rem; max-width: 720px; margin: 0 auto 26px; }
.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: var(--accent-text); border: 0; }
.btn:hover { filter: brightness(1.06); }
.badges { margin-top: 26px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge { font-size: .85rem; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 3px 12px; border-radius: 999px; }

/* sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section.alt { background: var(--surface-2); }
h2 { font-size: 1.8rem; margin: 0 0 6px; letter-spacing: -.01em; }
h2 + p.sub { color: var(--muted); margin: 0 0 28px; max-width: 760px; }
h3 { margin: 28px 0 8px; font-size: 1.15rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; display: flex; gap: 10px; align-items: center; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); font-size: 1rem; }
ul.ticks { padding-left: 0; list-style: none; } ul.ticks li { padding-left: 26px; position: relative; margin: 6px 0; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.two > * { min-width: 0; }
.two { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }

/* preview mock */
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.mock .bar { display: flex; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mock .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.mock .tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.mock .tabs span { padding: 6px 12px; border-radius: 8px 8px 0 0; color: var(--muted); }
.mock .tabs span.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.mock .rows { padding: 12px; display: grid; gap: 10px; font-size: .85rem; }
.mock .row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.mock .row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock .row .sz { color: var(--muted); }
.mock .prog { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.mock .prog b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.mock .sum { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.mock .sum strong { color: var(--good); }
.cap { color: var(--muted); font-size: .8rem; margin-top: 8px; }

/* code, tabs, callouts */
pre { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 10px 0 16px; position: relative; line-height: 1.5; }
pre code { background: none; padding: 0; }
pre .cp { position: absolute; top: 8px; right: 8px; font: 12px system-ui; background: #ffffff1c; color: #cfd6ea; border: 1px solid #ffffff24; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
pre .cm { color: #8b97b7; }
.tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 0; border-bottom: 1px solid var(--line); }
.tabbar button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabbar button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel[hidden] { display: none; }
.js .panel { padding-top: 8px; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout h4 { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 12px 0 20px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); white-space: nowrap; }
td.ok { color: var(--good); font-weight: 600; } td.no { color: var(--warn); font-weight: 600; }
.steps { counter-reset: s; padding: 0; list-style: none; }
.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 18px 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.dl { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.dl .meta { color: var(--muted); font-size: .9rem; }
.small { font-size: .88rem; color: var(--muted); }
details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 10px 0; padding: 0 16px; }
details summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* nav: current page */
nav.main a.on { color: var(--text); background: var(--surface-2); font-weight: 600; }

/* plain pages (Features, Download) */
section.pagebody { border-top: 0; padding-top: 40px; }
section.pagebody h1 { font-size: 2.2rem; margin: 0 0 6px; letter-spacing: -.02em; }
section.pagebody h1 + p.sub { color: var(--muted); max-width: 760px; margin: 0 0 28px; }

/* documentation: sidebar + article */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 56px; }
.side nav { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.side h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.side h2:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .95rem; }
.side a:hover { background: var(--surface-2); }
.side a.on { background: var(--surface-2); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.doc { min-width: 0; }
.doc h1 { font-size: 2.1rem; margin: 0 0 8px; letter-spacing: -.02em; line-height: 1.2; }
.doc h1 + p.sub { color: var(--muted); font-size: 1.08rem; margin: 0 0 20px; max-width: 760px; }
.doc h2 { font-size: 1.4rem; margin: 40px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 1.1rem; margin: 26px 0 6px; }
.doc > h1 + p + .callout + h2, .doc > h1 + p.sub + h2 { border-top: 0; margin-top: 28px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; text-decoration: none; background: var(--surface); color: var(--text); font-weight: 600; min-width: 140px; }
.pager a small { display: block; color: var(--muted); font-weight: 400; }
.pager a.next { text-align: right; margin-left: auto; }
.pager a:hover { border-color: var(--accent); }
a.linkcard { text-decoration: none; color: inherit; display: block; }
a.linkcard:hover { border-color: var(--accent); }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 8px; }
  .side nav { position: static; max-height: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
  .side ul { display: flex; flex-wrap: wrap; gap: 2px 4px; }
  .side h2 { margin: 8px 0 2px; }
}
.brand { white-space: nowrap; }
@media (max-width: 520px) { .brand span { display: none; } }
