:root {
  --bg: #0d0f14;
  --bg-raised: #14171e;
  --bg-card: #171a22;
  --border: #252a35;
  --text: #e6e9ef;
  --text-muted: #9aa3b2;
  --accent: #6f8bff;
  --accent-strong: #5a6dff;
  --accent-soft: rgba(111, 139, 255, 0.14);
  --gradient: linear-gradient(135deg, #7cc4ff 0%, #6f5bff 100%);
  --code-bg: #10131a;
  --ok: #5fcf8a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-raised: #ffffff;
    --bg-card: #ffffff;
    --border: #e1e5ee;
    --text: #151821;
    --text-muted: #5b6475;
    --accent: #4b5cf0;
    --accent-strong: #3a4ae0;
    --accent-soft: rgba(75, 92, 240, 0.1);
    --code-bg: #eef1f7;
    --shadow: 0 18px 50px rgba(20, 30, 60, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code, pre { font-family: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--code-bg); padding: 0.12em 0.4em; border-radius: 6px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header {
  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);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: 0.22em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text-muted); font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text); background: var(--bg-raised);
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--gradient); color: #fff; border: none; box-shadow: 0 8px 24px rgba(111, 91, 255, 0.35); }
.button.primary:hover { filter: brightness(1.08); }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero .eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.08; margin: 18px 0 14px; letter-spacing: -0.02em; }
.hero h1 span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 720px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.shot {
  margin: 48px auto 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* Sections */
section { padding: 56px 0; scroll-margin-top: 48px; }
section h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 10px; letter-spacing: -0.01em; }
section .sub { color: var(--text-muted); margin: 0 0 32px; max-width: 720px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.96rem; }
.card .icon { font-size: 1.4rem; margin-bottom: 10px; }
.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); }
.gallery figcaption { padding: 10px 14px; color: var(--text-muted); font-size: 0.9rem; }

.download { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.download .card { display: flex; flex-direction: column; gap: 12px; }
.download .card .button { align-self: flex-start; }
.note { color: var(--text-muted); font-size: 0.92rem; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ok); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 40px 0 72px; }
.toc { position: sticky; top: 88px; align-self: start; font-size: 0.94rem; max-height: calc(100vh - 104px); overflow-y: auto; }
.toc p { margin: 18px 0 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.toc a { display: block; padding: 4px 0; color: var(--text-muted); }
.toc a:hover { color: var(--text); text-decoration: none; }
.doc h1 { font-size: 2.2rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.doc h2 { font-size: 1.5rem; margin: 48px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 1.12rem; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc .lead { color: var(--text-muted); font-size: 1.08rem; }
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; }
kbd {
  font: 600 0.82em ui-monospace, monospace; padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--border); border-bottom-width: 2px; background: var(--bg-raised);
}
.callout { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 8px; margin: 16px 0; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px 12px; }
  .nav { gap: 12px; font-size: 0.92rem; }
  .site-header .wrap { height: auto; padding: 10px 0; flex-wrap: wrap; }
}
