:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f6f7f9;
  --btn: #111827;
  --btn-fg: #ffffff;
  --accent: #16a34a;
  --link: #15803d;
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --fg: #f3f4f6;
    --muted: #9ca3af;
    --line: #262b36;
    --soft: #181c24;
    --btn: #f3f4f6;
    --btn-fg: #111827;
    --accent: #22c55e;
    --link: #4ade80;
    --focus: #60a5fa;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Ubuntu, Cantarell, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}
.nav nav { display: flex; gap: 20px; align-items: center; font-size: 15px; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover { color: var(--fg); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.link:hover { color: var(--fg); }

.hero { padding-top: 56px; padding-bottom: 32px; text-align: center; }
.logo { display: block; margin: 0 auto 24px; }
h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead {
  max-width: 34em;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 19px;
  text-wrap: balance;
}

.download { margin-top: 32px; }
.download p { margin: 10px 0 0; }
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-fg);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }

.demo { position: relative; max-width: 640px; margin: 48px auto 0; }
.demo img, .demo canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
#demo-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.9;
}
#demo-toggle:hover { color: var(--fg); opacity: 1; }

section + section { margin-top: 72px; }
h2 { margin: 0 0 24px; font-size: 26px; letter-spacing: -0.01em; }

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features strong { display: block; margin-bottom: 4px; }
.features strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 10px 2px 0;
  border-radius: 50%;
  background: var(--accent);
}
.features span { color: var(--muted); }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--soft);
}
.tabs button {
  padding: 6px 16px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.pane { padding-top: 8px; }
.pane-title { margin: 24px 0 0; font-size: 18px; }
.js .pane-title { display: none; }
.note { color: var(--muted); font-size: 15px; }

pre {
  position: relative;
  margin: 0 0 16px;
  padding: 14px 16px;
  padding-right: 72px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.5;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.copy {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.copy:hover { color: var(--fg); }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
}
details p { margin: 0 0 18px; color: var(--muted); }

footer { margin-top: 88px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); }
footer a { color: inherit; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding-top: 32px; }
  .lead { font-size: 17px; }
  .features { grid-template-columns: 1fr; gap: 20px; }
  section + section { margin-top: 56px; }
}
