:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #2a3750;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #3b82f6;
  --accent-3: #ef4444;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

a { color: var(--accent-2); }
a:hover { color: var(--accent); }

code, pre {
  font-family: var(--mono);
  font-size: 0.85em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

pre code { font-size: 0.85rem; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.badges img { height: 20px; margin: 0 4px 4px 0; }

.hero {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.hero h1 {
  font-size: 2.75rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.tagline {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.install {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-family: var(--mono);
  color: var(--text);
  margin-bottom: 1.5rem;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

section { padding: 3rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

h2 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

h2 + p.lead {
  color: var(--muted);
  margin-top: 0.25rem;
  max-width: 720px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .frame-wrap {
  aspect-ratio: 16 / 10;
  background: #0f172a;
  border-bottom: 1px solid var(--border);
}

.card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.card-body { padding: 1rem 1.1rem 1.2rem; }

.card-body h3 { margin: 0 0 0.35rem; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.card-body p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; }

.tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.card-links { display: flex; gap: 1rem; font-size: 0.85rem; }

.api-grid {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.api-block h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.api-block h3 .tag { font-family: var(--sans); }

.api-block p { color: var(--muted); margin: 0.4rem 0 0.6rem; }

footer {
  padding: 2.5rem 0 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── standalone example pages ── */

.example-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.example-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.example-header h1 { font-size: 1.1rem; margin: 0; }
.example-header .back { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.example-header .back:hover { color: var(--text); }

.stage {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.controls {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.controls button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.controls button:hover { border-color: var(--accent-2); }

.source-toggle {
  margin-left: auto;
}

details.source {
  border-top: 1px solid var(--border);
}

details.source summary {
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

details.source .source-body {
  padding: 0 1.5rem 1.5rem;
}
