:root {
  --bg: #0a0b0d;
  --bg-soft: #0f1114;
  --panel: #15181d;
  --panel-2: #1b1f25;
  --field: #101317;
  --border: #232830;
  --border-soft: #1b2027;
  --text: #eceef1;
  --muted: #8b95a3;
  --faint: #5b6470;
  --accent: #25c79a;
  --accent-soft: #1d9c79;
  --warn-bg: #221c0e;
  --warn-bd: #4d3f12;
  --warn-fg: #e7c873;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  --radius: 12px;
}

/* Light theme overrides */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --field: #f6f8fa;
  --border: #d8dee4;
  --border-soft: #e6eaef;
  --text: #1f2328;
  --muted: #57606a;
  --faint: #8b949e;
  --accent: #1a7f64;
  --accent-soft: #15705a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; }
code {
  font-family: var(--mono);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .88em;
  color: #cfd6df;
}
h1, h2, h3 { letter-spacing: -.02em; }

/* ---- Header ---- */
header.site {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10,11,13,.72);
  backdrop-filter: saturate(140%) blur(10px);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 650; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color .15s; }
nav a:hover { color: var(--text); }
nav a.gh {
  color: var(--text); border: 1px solid var(--border); padding: 6px 13px;
  border-radius: 8px; font-size: 13px;
}
nav a.gh:hover { border-color: var(--accent); }
.theme-toggle {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--text);
}
.theme-toggle:hover { border-color: var(--accent); }
.head-actions { display: inline-flex; gap: 6px; }
.hint { color: var(--faint); font-weight: 400; }
textarea#input.dragover { border-color: var(--accent); background: var(--panel-2); }

/* ---- Hero ---- */
.hero { position: relative; padding: 88px 0 56px; overflow: hidden; }
.hero .glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 760px; height: 480px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(37,199,154,.16), transparent 70%);
  filter: blur(8px);
}
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  letter-spacing: .04em; margin: 0 0 18px; text-transform: none;
}
.hero h1 { font-size: clamp(34px, 5.2vw, 52px); line-height: 1.07; margin: 0 0 20px; font-weight: 680; }
.sub { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0; }
.sub code { color: #d8dee6; }

.terminal {
  margin: 32px 0 26px; max-width: 600px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 50px -28px rgba(0,0,0,.8);
}
.terminal .bar { display: flex; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
.terminal .bar span { width: 11px; height: 11px; border-radius: 50%; background: #2b313a; }
.terminal .line { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; }
.terminal .prompt { color: var(--accent); }
.terminal code { background: none; border: none; padding: 0; color: #e3e8ee; font-size: 13.5px; }
.copy-cmd {
  margin-left: auto; background: transparent; color: var(--faint);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px;
  font-size: 11px; cursor: pointer; font-family: var(--sans);
}
.copy-cmd:hover { color: var(--text); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border-soft);
  padding: 5px 11px; border-radius: 999px;
}

/* ---- Section heads ---- */
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: 24px; margin: 0 0 4px; }
.section-head p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---- Playground ---- */
.playground { padding: 56px 0; border-top: 1px solid var(--border-soft); }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 24px 60px -40px rgba(0,0,0,.9);
}
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 18px; }
.tab {
  background: transparent; color: var(--muted); border: none;
  padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 14px; font-family: var(--sans);
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--panel-2); box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; }
.panel.hidden { display: none; }

.controls { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.controls label, .gen-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.arrow { color: var(--accent); font-size: 18px; padding-bottom: 8px; }
.controls .ghost { margin-left: auto; }

select, input, textarea {
  background: var(--field); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; font-family: var(--sans);
  transition: border-color .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.io { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.col { display: flex; flex-direction: column; min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; height: 24px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.fname { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }

textarea#input, .output {
  min-height: 400px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
textarea#input { resize: vertical; }
.output {
  margin: 0; padding: 14px 16px;
  background: var(--field); border: 1px solid var(--border);
  border-radius: 8px; white-space: pre-wrap; word-break: break-word;
  overflow: auto; color: #c9e9df;
}

.warnings { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.warnings div {
  background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-fg);
  padding: 9px 13px; border-radius: 8px; font-size: 13px;
}

.gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.gen-grid label.full { grid-column: 1 / -1; }
.gen-grid input, .gen-grid textarea { width: 100%; }

.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 13px; cursor: pointer; font-size: 13px; font-family: var(--sans);
  transition: all .15s;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }
.ghost.sm { padding: 4px 11px; font-size: 12px; }

/* ---- How ---- */
.how { padding: 56px 0; border-top: 1px solid var(--border-soft); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; }
.step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(37,199,154,.12); color: var(--accent);
  font-family: var(--mono); font-size: 14px; margin-bottom: 14px;
}
.step h3 { font-size: 16px; margin: 0 0 6px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 26px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; color: var(--faint); font-size: 13.5px; }

@media (max-width: 760px) {
  .io, .gen-grid, .steps { grid-template-columns: 1fr; }
  nav a:not(.gh) { display: none; }
  .controls .ghost { margin-left: 0; }
  .site-footer .wrap { flex-direction: column; gap: 4px; }
}
