:root {
  --bg: #1b1b1b;
  --bg-raise: #202020;
  --bg-sunk: #0a0a0a;
  --widget: #3c3c3c;
  --widget-hover: #464646;
  --line: #2e2e2e;
  --line-strong: #3c3c3c;
  --text: #dcdcdc;
  --muted: #8c8c8c;
  --dim: #7f7f7f;
  --select: #005c80;
  --select-hover: #0a6a92;
  --select-ink: #c0deff;
  --warn: #ff8f00;
  --ok: #78c878;
  --danger: #ff6159;

  --mono: "Hack", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: "Ubuntu", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --radius: 3px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: currentColor; }

code {
  font: 0.86em/1 var(--mono);
  color: var(--text);
  background: var(--bg-sunk);
  border-radius: 2px;
  padding: 0.18em 0.4em;
  white-space: nowrap;
}

::selection { background: var(--select); color: var(--select-ink); }

:focus-visible { outline: 1px solid var(--select-ink); outline-offset: 2px; }

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

.skip {
  position: absolute; left: 12px; top: -40px; z-index: 10;
  background: var(--select); color: var(--select-ink); padding: 6px 10px; border-radius: var(--radius);
  font: 13px var(--sans);
}
.skip:focus { top: 12px; }

/* ── top bar ───────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 48px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font: 500 14px var(--sans); text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand.small { font-size: 13px; gap: 8px; }

.tag { font: 12px var(--mono); color: var(--dim); }

nav { display: flex; align-items: center; gap: 2px; }
nav a {
  font: 14px var(--sans); color: var(--muted); text-decoration: none;
  padding: 3px 8px; border-radius: var(--radius);
}
nav a:hover { color: var(--text); background: var(--widget); }
nav .gh { display: inline-flex; align-items: center; gap: 6px; color: var(--text); background: var(--widget); margin-left: 8px; }
nav .gh:hover { background: var(--widget-hover); color: #fff; }

/* ── hero ──────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 56px;
  align-items: center;
  padding: 56px 0 72px;
}

h1 {
  margin: 0;
  font: 500 clamp(32px, 4vw, 44px)/1.15 var(--sans);
  letter-spacing: -0.01em;
}

.lede { max-width: 34em; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.lede code { color: var(--text); }

.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

[hidden] { display: none !important; }

.installer { margin-top: 28px; max-width: 540px; }
.tabs { display: flex; gap: 2px; margin-bottom: 6px; }
.tabs button {
  height: 26px; padding: 0 10px; border: 0; border-radius: var(--radius); cursor: pointer;
  font: 13px var(--sans); color: var(--muted); background: transparent;
}
.tabs button:hover { color: var(--text); background: var(--widget); }
.tabs button[aria-selected="true"] { color: var(--select-ink); background: var(--select); }
.cmd-note { margin: 8px 0 0; color: var(--dim); font-size: 13px; line-height: 1.55; }
.cmd-note code { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  font: 14px var(--sans); text-decoration: none; cursor: pointer;
  background: var(--widget); color: var(--text);
  border: 1px solid transparent;
}
.btn:hover { background: var(--widget-hover); border-color: #969696; color: #fff; }
.btn.primary { background: var(--select); color: var(--select-ink); }
.btn.primary:hover { background: var(--select-hover); border-color: transparent; color: #fff; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }

.cmd {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 6px 6px 6px 12px;
  background: var(--bg-sunk); border-radius: var(--radius);
  font: 13px var(--mono);
}
.cmd code { all: unset; flex: 1; min-width: 0; overflow-wrap: anywhere; font: 13px/1.5 var(--mono); color: var(--text); }
.cmd .prompt { flex: none; color: var(--dim); }

.copy {
  flex: none; height: 26px; padding: 0 10px; border-radius: 2px; cursor: pointer;
  font: 12px var(--sans); color: var(--text); background: var(--widget); border: 0;
}
.copy:hover { background: var(--widget-hover); color: #fff; }
.copy.done { color: var(--ok); }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin: 40px 0 0; max-width: 520px;
  border-top: 1px solid var(--line-strong);
}
.facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 16px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 14px; color: var(--text); }

/* ── demo window ───────────────────────────────────────── */

.demo { margin: 0; scroll-margin-top: 72px; }

.window {
  position: relative;
  border: 1px solid #000;
  border-radius: 10px;
  background: #1b1b1b;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}

.titlebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 32px; padding: 0 12px;
  background: #2a2a2a; border-bottom: 1px solid #111;
  font: 13px var(--sans); color: var(--muted);
}
.title { color: var(--text); font-weight: 600; }
.badge { justify-self: end; font-size: 11.5px; color: var(--dim); white-space: nowrap; }

.lights { display: inline-flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #3c3c3c; }
.window .lights i:nth-child(1) { background: #ff5f57; }
.window .lights i:nth-child(2) { background: #febc2e; }
.window .lights i:nth-child(3) { background: #28c840; }

.stage { position: relative; height: 760px; background: #1b1b1b; }
.stage canvas { display: block; width: 100%; height: 100%; outline: none; }

.boot {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  padding: 24px;
  background: var(--bg);
  transition: opacity 200ms ease;
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot-log {
  margin: 0; min-height: 9em;
  font: 12.5px/1.75 var(--mono); color: var(--muted); white-space: pre-wrap;
}
.boot-log .p, .term .p { color: var(--dim); }
.boot-log .ok { color: var(--ok); }
.boot-log .err { color: var(--danger); }
.meter { height: 4px; background: var(--bg-sunk); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--select); transition: width 120ms linear; }
.boot .btn { align-self: flex-start; }
.boot.running .btn { display: none; }

.demo-note { max-width: 520px; margin: 24px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.demo-note strong { color: var(--text); font-weight: 500; }

/* ── sections ──────────────────────────────────────────── */

.section { padding: 72px 0; }

.section-head { margin-bottom: 32px; }
.section-head h2 {
  margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong);
  font: 400 clamp(22px, 2.4vw, 27px)/1.25 var(--sans);
}
.section-head p { margin: 14px 0 0; color: var(--muted); font-size: 15.5px; max-width: 42em; }

/* gates */

.gates {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  counter-reset: gate;
}
.gates li {
  padding: 16px 16px 18px; counter-increment: gate;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 6px;
}
.gate-id { display: block; font: 12px var(--mono); color: var(--dim); }
.gate-id::before { content: counter(gate) ". "; }
.gates h3 { margin: 8px 0 6px; font: 500 15px var(--sans); }
.gates p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.gates code { white-space: normal; }

/* spec sheet */

.spec { border-top: 1px solid var(--line-strong); }
.spec .row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 24px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.spec .k { font-size: 14px; color: var(--text); }
.spec .v { color: var(--muted); font-size: 14.5px; }
.spec .s { justify-self: end; font: 12px var(--mono); color: var(--dim); }

/* cli */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.split .section-head { margin-bottom: 0; }

.term { background: var(--bg-sunk); border-radius: 6px; overflow: hidden; }
.term-bar {
  display: flex; align-items: center; gap: 14px; height: 30px; padding: 0 12px;
  border-bottom: 1px solid var(--line); font: 12px var(--sans); color: var(--dim);
}
.term pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 13px/1.75 var(--mono); color: var(--text); }
.term .o { color: var(--muted); }
.term .c { color: var(--dim); }

/* install */

.installs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card {
  display: flex; flex-direction: column;
  padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raise);
}
.card.current { border-color: var(--line-strong); }
.card h3 { margin: 0; font: 500 16px var(--sans); }
.card.current h3::after { content: " (your system)"; color: var(--dim); font-weight: 400; font-size: 13px; }
.card .note { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.card .note code { white-space: normal; overflow-wrap: anywhere; }
.dl { list-style: none; margin: auto 0 0; padding: 16px 0 0; display: grid; gap: 6px; }
.dl a {
  display: flex; justify-content: space-between; align-items: center;
  height: 32px; padding: 0 12px; border-radius: var(--radius); background: var(--widget);
  font: 13px var(--mono); text-decoration: none;
}
.dl a span { font: 13px var(--sans); color: var(--muted); }
.dl a:hover { background: var(--widget-hover); color: #fff; }
.dl a:hover span { color: var(--text); }
.source-note { margin: 20px 0 0; color: var(--muted); font-size: 14px; }

.warning { margin-bottom: 40px; }
.warning p {
  margin: 0; padding: 12px 16px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--bg-raise); color: var(--muted); font-size: 14px;
}
.warning strong { color: var(--warn); font-weight: 500; }

/* footer */

.foot {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center;
  padding: 24px 0 36px; border-top: 1px solid var(--line-strong);
  font-size: 13px;
}
.foot > div { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.foot .credit { margin: 0; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.muted { color: var(--dim); }

/* ── responsive ────────────────────────────────────────── */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .demo { max-width: 560px; }
  .gates { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 32px, var(--wrap)); }
  nav a:not(.gh) { display: none; }
  .section { padding: 56px 0; }
  .spec .row { grid-template-columns: 1fr; gap: 2px; }
  .spec .s { display: none; }
  .installs { grid-template-columns: 1fr; }
  .stage { height: 680px; }
  .badge { display: none; }
  .titlebar { grid-template-columns: auto 1fr; gap: 12px; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(odd) { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
