:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --text: #fafafa;
  --muted: #9ca3af;
  --border: #2a2a2a;
  --rust: #e43717;
  --accent: #3b82f6;
  --ok: #10b981;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }
.rs { color: var(--rust); }

.site-header, .site-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
}
.site-footer { border-top: 1px solid var(--border); border-bottom: none; color: var(--muted); font-size: 13px; justify-content: center; gap: 6px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--text); }
.site-header nav { display: flex; gap: 18px; font-family: var(--mono); font-size: 13px; }

main { max-width: 1100px; margin: 0 auto; padding: 0 24px 64px; }

.hero { padding: 56px 0 28px; }
.hero h1 { font-size: 40px; line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.lede { font-size: 17px; color: var(--muted); max-width: 70ch; margin: 0 0 18px; }
.lede code { color: var(--text); }
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 999px;
}
.badge-ok { color: var(--ok); border-color: rgba(16,185,129,.35); }

.playground {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 18px;
}
@media (max-width: 820px) { .playground { grid-template-columns: 1fr; } }
.pane {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  min-height: 380px;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.pane-head label { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.controls { display: flex; gap: 8px; align-items: center; }
select, button {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--rust); border-color: var(--rust); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: default; }

textarea, .out {
  flex: 1; margin: 0; padding: 14px; border: none; resize: none;
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  background: transparent; color: var(--text); white-space: pre; overflow: auto;
}
textarea:focus { outline: none; }
.out code { display: block; color: #e6edf3; }
.out .err { color: #f87171; }
.diag { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; white-space: pre-wrap; font-family: var(--mono); font-size: 12px; }

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.stat.ok { color: var(--ok); border-color: rgba(16,185,129,.35); }

.how { margin: 36px 0 0; padding-left: 20px; color: var(--muted); max-width: 80ch; }
.how li { margin: 8px 0; }
.how code { color: var(--text); }
