:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f5f7, #0f1115); --surface: light-dark(#fff, #181b22);
  --text: light-dark(#1c1f26, #e6e8ee); --muted: light-dark(#5d6472, #9aa1b0);
  --line: light-dark(#d9dce3, #2a2f3a); --accent: light-dark(#0b63ce, #5aa2ff);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.small { color: var(--muted); font-size: .9em; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; }
.brand .mark { width: 38px; height: 22px; background: currentColor; -webkit-mask: url(assets/mark.svg) center/contain no-repeat; mask: url(assets/mark.svg) center/contain no-repeat; }
.top nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--text); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--accent); }
#theme { font-size: 18px; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 4px 10px; cursor: pointer; }
main, footer { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
section { padding: 56px 0 8px; }
h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 30px; margin: 0 0 20px; }
h3 { margin: 0 0 6px; font-size: 19px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding-top: 48px; }
.lead { font-size: 20px; color: var(--muted); }
.hero-shot img { border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.button { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; margin: 0 8px 8px 0; }
.button.primary { background: var(--accent); border-color: var(--accent); color: light-dark(#fff, #0f1115); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.grid article, .card-link { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.grid p, .card-link p { margin: 0; color: var(--muted); }
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { border-color: var(--accent); }
.diagram { margin: 0 0 20px; }
.diagram img { width: 100%; border-radius: 14px; }
.downloads { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.downloads th, .downloads td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.coins figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.coins img { width: 150px; background: #fff; padding: 6px; border-radius: 8px; }
.coins code { word-break: break-all; font-size: 12px; }
footer { padding: 48px 24px; text-align: center; color: var(--muted); }
/* Markdown pages (FAQ, setup) */
.doc { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.doc table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc img { border-radius: 12px; }
.doc h1 { font-size: 34px; margin-top: 40px; }
.doc h2 { font-size: 22px; margin-top: 32px; }
.doc .toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .top nav { margin-left: 0; gap: 12px; width: 100%; order: 3; }
  main, footer { padding: 0 16px; }
}
