/*
  lathe: developer tool landing page (Screenery template)
  A modern terminal session as a marketing page: panes framed on a character grid, one family (Martian Mono, using its width axis), four ANSI accents.
  Three themes share one set of tokens: lathe (default dark), phosphor (amber monochrome), paper (light). The script switches html[data-theme].

  Contents
   1. Tokens and themes
   2. Base and browser surfaces
   3. Pane frame (title set into the border, focus colour on the pane in view)
   4. Shared kit: buttons, copy, segmented radios, tabs, stepper, tags, code
   5. Top bar
   6. Hero and shell
   7. Features: tree + preview
   8. Bench bars
   9. Install
  10. Log graph
  11. Pricing table
  12. Cloud form and results
  13. FAQ tree, maintainers, footer
  14. Status bar, dialog, toast
  15. Motion
  16. Narrow screens
*/

/* ---------- 1. Tokens and themes ---------- */
:root {
  /* lathe: a cool near-black terminal with four ANSI accents */
  --bg: #0e1013;
  --panel: #12151a;
  --term-bg: #0a0c0f;
  --line: #2b3139;
  --line-strong: #46505c;
  --fg: #d9dee5;
  --fg-bright: #f4f6f8;
  --dim: #98a2ae;
  --green: #8fd18b;   /* focus, success, cache hits */
  --amber: #f0b65c;   /* hashes, warnings, work that ran */
  --cyan: #6fc8dc;    /* refs, branches, keys */
  --rose: #f08ca4;    /* errors, graph edges */
  --focus: var(--green);
  --on-accent: #0e1013;
  --sel-soft: #1a2420;
  --bar-other: #6f7b88;

  /* Type */
  --font: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --body-size: 0.9375rem;      /* 15px */
  --small-size: 0.84375rem;    /* 13.5px, labels only */
  --lh: 1.65;

  /* Space (multiples of a half line) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --gutter: 16px;
  --radius: 6px;
  --radius-sm: 3px;
  --statusbar-h: 38px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* phosphor: one warm amber gun, the accents become its brightness steps */
:root[data-theme="phosphor"] {
  --bg: #110c05;
  --panel: #150f07;
  --term-bg: #0c0803;
  --line: #3a2c16;
  --line-strong: #6a5025;
  --fg: #ffc46b;
  --fg-bright: #ffe0a8;
  --dim: #c4934a;
  --green: #ffd27f;
  --amber: #ffb347;
  --cyan: #ffe3ad;
  --rose: #ff9a5c;
  --on-accent: #110c05;
  --sel-soft: #22180a;
  --bar-other: #9a7236;
}

/* paper: a light terminal for daylight desks */
:root[data-theme="paper"] {
  --bg: #f3f0e8;
  --panel: #faf8f3;
  --term-bg: #fffdf8;
  --line: #d3cdbf;
  --line-strong: #a59d8b;
  --fg: #1e2126;
  --fg-bright: #0b0c0e;
  --dim: #565c66;
  --green: #2d6a29;
  --amber: #8a5800;
  --cyan: #1b6176;
  --rose: #a3304d;
  --on-accent: #fbfaf6;
  --sel-soft: #e6eee2;
  --bar-other: #8f8778;
  color-scheme: light;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  scrollbar-color: var(--line-strong) var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--body-size);
  font-stretch: 87.5%;
  font-weight: 400;
  line-height: var(--lh);
  font-variant-numeric: tabular-nums;
  caret-color: var(--green);
  accent-color: var(--green);
  padding-bottom: calc(var(--statusbar-h) + var(--s5));
  overflow-x: clip;
}
::selection { background: var(--amber); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
a { color: var(--cyan); text-underline-offset: 0.28em; text-decoration-thickness: 1px; }
a:hover { color: var(--fg-bright); }
h1, h2, h3 { margin: 0; color: var(--fg-bright); text-wrap: balance; font-stretch: 100%; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.85rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 1.125rem; line-height: 1.35; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
code, pre, kbd { font-family: inherit; }
kbd {
  display: inline-block; min-width: 2.2ch; padding: 0 0.6ch; text-align: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 0.92em; line-height: 1.5; color: var(--fg-bright); background: var(--term-bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.defs { position: absolute; }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -60px; z-index: 50; padding: var(--s2) var(--s3); background: var(--green); color: var(--on-accent); }
.skip:focus { top: var(--s2); }
.skip:hover { color: var(--on-accent); }

/* ANSI colour helpers used in terminal text */
.c-green { color: var(--green); }
.c-amber { color: var(--amber); }
.c-cyan { color: var(--cyan); }
.c-rose { color: var(--rose); }
.c-dim { color: var(--dim); }
.c-bright { color: var(--fg-bright); font-weight: 600; }
.dim { color: var(--dim); font-weight: 400; }

main {
  width: min(100% - 2 * var(--gutter), 1320px);
  margin: var(--s5) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6);
}

/* ---------- 3. Pane frame ---------- */
.pane {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: var(--s6) var(--s5) var(--s5);
  transition: border-color 0.35s var(--ease-out);
}
.pane.is-active, .pane:focus-within { border-color: var(--focus); }
.pane-frame {
  position: absolute; left: var(--s3); right: var(--s3); top: 0;
  transform: translateY(-50%);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  pointer-events: none;
}
.pane-title, .pane-tools {
  pointer-events: auto;
  /* The title straddles the border: top half on the page, bottom half on the pane */
  background: linear-gradient(to bottom, var(--bg) 50%, var(--panel) 50%);
  padding: 0 1ch;
  font-size: var(--small-size);
  line-height: 1.6;
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pane-title .dim { margin-left: 1ch; }
.pane.is-active .pane-title, .pane:focus-within .pane-title { color: var(--focus); }
.pane-title .k, .winlist .k {
  display: inline-block; margin-right: 1ch; padding: 0 0.6ch;
  border-radius: 2px; background: var(--line); color: var(--fg-bright); font-weight: 600;
}
.pane.is-active .pane-title .k, .pane:focus-within .pane-title .k { background: var(--focus); color: var(--on-accent); }
.pane-tools { display: flex; gap: 1ch; flex: none; }
.pane-group { display: grid; gap: var(--s6); min-width: 0; }
.pane h2 { margin-bottom: var(--s3); }
.pane-note { color: var(--dim); margin-bottom: var(--s4); }

/* ---------- 4. Shared kit ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 1ch; white-space: nowrap;
  min-height: 44px; padding: var(--s2) 2ch;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--fg-bright);
  text-decoration: none; font-weight: 600;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.btn::before { content: "["; color: var(--dim); }
.btn::after { content: "]"; color: var(--dim); }
.btn:not(.btn-primary):hover { border-color: var(--fg); color: var(--fg-bright); background: var(--sel-soft); }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.btn-primary::before, .btn-primary::after { color: var(--on-accent); opacity: 0.7; }
.btn-primary:hover { background: var(--green); border-color: var(--fg-bright); color: var(--on-accent); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.tool {
  min-height: 28px; padding: 0 1ch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--fg); font-size: var(--small-size); font-weight: 500;
}
.tool:hover { border-color: var(--green); color: var(--green); }

.copy {
  display: inline-flex; align-items: center; gap: 0.8ch; flex: none;
  min-height: 44px; min-width: 44px; padding: 0 1.4ch;
  border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--dim);
  font-size: var(--small-size); font-weight: 600;
}
.copy:hover { color: var(--fg-bright); background: var(--sel-soft); }
.copy.is-done { color: var(--green); }

/* Segmented radio group: the checked one is inverted, like a selected TUI row */
.seg { display: inline-flex; flex-wrap: wrap; gap: 1px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--line-strong); }
.seg button {
  flex: 1 1 auto; min-height: 40px; padding: 0 1.6ch; border: 0; background: var(--panel); color: var(--fg);
  font-weight: 500; white-space: nowrap; transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.seg button:not([aria-checked="true"]):hover { background: var(--sel-soft); color: var(--fg-bright); }
.seg button[aria-checked="true"], .seg button[aria-checked="true"]:hover { background: var(--fg-bright); color: var(--bg); font-weight: 700; }
.seg-small button { min-height: 36px; font-size: var(--small-size); }

.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); margin: var(--s4) 0 var(--s5); }
.tabs [role="tab"] {
  min-height: 44px; padding: 0 2ch; border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: transparent; color: var(--dim);
  font-weight: 600; margin-bottom: -1px;
}
.tabs [role="tab"]:hover { color: var(--fg-bright); }
.tabs [role="tab"][aria-selected="true"] { color: var(--fg-bright); border-color: var(--line); background: var(--panel); box-shadow: inset 0 2px 0 var(--green); }

.stepper { display: inline-flex; align-items: center; gap: 0; }
.stepper label { margin-right: 1.5ch; color: var(--dim); }
.step {
  width: 44px; height: 44px; border: 1px solid var(--line-strong); background: var(--term-bg); color: var(--fg-bright);
  font-weight: 700; font-size: 1.1rem;
}
.step:first-of-type { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-of-type { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.step:hover { color: var(--green); border-color: var(--green); }
.stepper input {
  width: 7ch; height: 44px; border: 1px solid var(--line-strong); border-left: 0; border-right: 0;
  background: var(--term-bg); text-align: center; font-weight: 700; color: var(--fg-bright);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Status tags inside terminal text */
.tag { display: inline-block; width: 4ch; text-align: center; border-radius: 2px; font-weight: 700; }
.t-hit { color: var(--green); }
.t-run { color: var(--amber); }
.t-err { color: var(--rose); }

.code {
  margin: var(--s4) 0 0; padding: var(--s4) 2ch;
  background: var(--term-bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 0.875rem; line-height: 1.7; color: var(--fg); tab-size: 2;
  font-stretch: 87.5%;
}
.ps { color: var(--green); font-weight: 600; }
p code, dd code, .bench-method code { color: var(--amber); font-size: 0.95em; }

/* ---------- 5. Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s4);
  min-height: 52px; padding: var(--s2) var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 1ch; color: var(--fg-bright); text-decoration: none; font-weight: 800; font-stretch: 112.5%; min-height: 44px; }
.brand-mark { width: 24px; height: 24px; fill: none; stroke: var(--green); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-ver { font-size: var(--small-size); font-weight: 500; color: var(--dim); font-stretch: 87.5%; }
.winlist { flex: 1; min-width: 0; }
.winlist ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5ch; }
.winlist a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.2ch;
  color: var(--fg); text-decoration: none; border-radius: var(--radius-sm); font-weight: 500;
}
.winlist a:hover { background: var(--sel-soft); color: var(--fg-bright); }
.winlist a[aria-current="true"] { color: var(--green); }
.winlist a[aria-current="true"] .k, .winlist a[aria-current="true"]:hover .k { background: var(--green); color: var(--on-accent); }
.repo { display: inline-flex; align-items: center; gap: 1ch; color: var(--fg); text-decoration: none; font-size: var(--small-size); min-height: 44px; white-space: nowrap; }
.repo:hover { color: var(--fg-bright); }
.repo-stars { color: var(--amber); }
.menu-btn { display: none; }

/* ---------- 6. Hero and shell ---------- */
.hero {
  display: grid; gap: var(--s6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-top: var(--s5);
}
.hero-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-content: start; padding-top: var(--s3); min-width: 0; }
.hero > *, .pane > *, .fctl > * { min-width: 0; }
.hero h1 {
  font-size: clamp(2.1rem, 1.2rem + 3vw, 3.6rem);
  font-stretch: 112.5%;
  font-weight: 780;
  line-height: 1.06;
  letter-spacing: -0.038em;
  max-width: 16ch;
}
.lede { font-size: 1.0625rem; max-width: 60ch; color: var(--fg); }
.oneliner {
  display: flex; align-items: stretch; max-width: 60ch;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--term-bg);
}
.oneliner code, .cmdline code { flex: 1; min-width: 0; padding: var(--s3) 2ch; overflow-x: auto; white-space: nowrap; color: var(--fg-bright); align-self: center; }
.oneliner code::before, .cmdline code::before { content: "$ "; color: var(--green); font-weight: 700; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); color: var(--fg); }
.facts li { display: grid; grid-template-columns: 10ch minmax(0, 1fr); }
.fk { color: var(--dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

.pane-shell { padding: var(--s5) 0 0; background: var(--term-bg); }
.pane-shell .pane-title, .pane-shell .pane-tools { background: linear-gradient(to bottom, var(--bg) 50%, var(--term-bg) 50%); }
.term {
  position: relative;
  height: clamp(380px, 58vh, 520px);
  display: flex; flex-direction: column;
  padding: var(--s2) 2ch 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  cursor: text;
}
.term-out {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}
.term-out .ln { min-height: 1.6em; white-space: pre-wrap; }
.term-out .ln.err { color: var(--rose); }
.term-out a { color: var(--cyan); }
.term-out button.lnk {
  border: 0; padding: 0; background: none; color: var(--cyan); text-decoration: underline; text-underline-offset: 0.28em; font: inherit; cursor: pointer;
}
.prompt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1ch; padding: var(--s2) 0 var(--s3); border-top: 1px dashed var(--line); margin-top: var(--s2); }
.prompt .ps { flex: none; }
.ps-path { color: var(--fg); font-weight: 500; }
.ps-sigil { color: var(--green); font-weight: 700; }
.prompt input {
  flex: 1 1 12ch; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--fg-bright); caret-color: var(--green); font-size: inherit;
}
.prompt input::placeholder { color: var(--dim); opacity: 1; }
.prompt:focus-within { border-top-color: var(--green); }
.term-nojs { color: var(--amber); padding-bottom: var(--s3); }
.no-js .prompt, .no-js .chips, .no-js .extrakeys, .no-js #replay-demo { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) 2ch var(--s4); border-top: 1px solid var(--line); }
.chip {
  min-height: 40px; padding: 0 1.4ch; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--panel); color: var(--fg); font-size: var(--small-size); font-weight: 500;
}
.chip:hover { border-color: var(--green); color: var(--fg-bright); }
.extrakeys { display: none; gap: var(--s2); padding: 0 2ch var(--s4); }
.xk { flex: 1; white-space: nowrap; font-size: var(--small-size); font-stretch: 75%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--fg-bright); font-weight: 600; }

/* Text spinner and blinking cursor inside the shell */
.typing::after { content: ""; display: inline-block; width: 0.6em; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--green); }

/* ---------- 7. Features ---------- */
.tree { font-size: 0.9375rem; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 2.5ch; }
.tree li { position: relative; }
/* Guides on the character grid: a vertical rule per level, an elbow per entry */
.tree li::before {
  content: ""; position: absolute; left: -1.75ch; top: 0; width: 1.25ch; height: 22px;
  border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.tree li:not(:last-child)::after {
  content: ""; position: absolute; left: -1.75ch; top: 22px; bottom: 0; border-left: 1px solid var(--line-strong);
}
.tree-dir { display: block; color: var(--cyan); font-weight: 700; min-height: 44px; line-height: 44px; }
.tree-sub > .tree-dir { padding-left: 1.4ch; }
.tree [role="tab"] {
  display: block; width: 100%; min-height: 44px; padding: 0 1.4ch; text-align: left;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg); font-weight: 500;
}
.tree [role="tab"]:not([aria-selected="true"]):hover { background: var(--sel-soft); color: var(--fg-bright); }
.tree [role="tab"][aria-selected="true"], .tree [role="tab"][aria-selected="true"]:hover { background: var(--green); color: var(--on-accent); font-weight: 700; }

.doc + .doc { margin-top: var(--s7); }
.js .doc + .doc { margin-top: 0; }
.doc[hidden] { display: none; }
.doc-path { color: var(--dim); font-size: var(--small-size); margin-bottom: var(--s2); }
.doc h3 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); letter-spacing: -0.025em; margin-bottom: var(--s3); }
.doc > p:not(.doc-path) { max-width: 66ch; }
.doc:focus-visible { outline-offset: 8px; }

/* ---------- 8. Bench ---------- */
.bench-head, .log-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3) var(--s5); margin-bottom: var(--s3); }
.bench-head h2, .log-head h2 { margin: 0; }
.bench-caption { color: var(--dim); max-width: 70ch; margin-bottom: var(--s5); min-height: 3.3em; }
.bars { display: grid; gap: var(--s3); }
.bar-row, .bench-axis {
  display: grid; grid-template-columns: 22ch minmax(0, 1fr) 10ch; gap: 2ch; align-items: center;
}
.bar-label { color: var(--fg); }
.is-lathe .bar-label { color: var(--green); font-weight: 700; }
.bar-track {
  position: relative; height: 28px;
  /* the empty cells, drawn as a light-shade pattern */
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1.3px);
  background-size: 6px 6px;
  background-position: center;
}
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar-other); transition: width 0.7s var(--ease-out); }
.is-lathe .bar-fill { background: var(--green); }
.bar-val { text-align: right; color: var(--fg-bright); font-weight: 600; }
.is-lathe .bar-val { color: var(--green); }
.bench-axis { margin-top: var(--s2); color: var(--dim); }
.axis-scale { position: relative; height: 1.7em; border-top: 1px solid var(--line-strong); font-size: var(--small-size); }
.axis-scale span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.axis-scale span:first-child { transform: none; }
.bench-verdict { margin-top: var(--s5); font-size: 1.0625rem; color: var(--fg-bright); }
.bench-verdict strong { color: var(--green); }
.bench-method { margin-top: var(--s3); color: var(--dim); max-width: 75ch; }

/* ---------- 9. Install ---------- */
.os-panel[hidden] { display: none; }
.os-panel + .os-panel { margin-top: var(--s6); }
.js .os-panel + .os-panel { margin-top: 0; }
.os-name { color: var(--fg-bright); font-weight: 600; margin-bottom: var(--s3); }
.cmdline {
  display: flex; align-items: stretch; margin-bottom: var(--s2); max-width: 78ch;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--term-bg);
}
.os-note { margin-top: var(--s3); color: var(--dim); max-width: 70ch; }
.verify { margin-top: var(--s5); max-width: 78ch; }
.verify > p { color: var(--dim); }

/* ---------- 10. Log graph ---------- */
.graph { overflow-x: auto; background: var(--term-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s4) 2ch; }
.graph pre { margin: 0; font-size: 0.875rem; line-height: 1.75; }
.gg { color: var(--rose); font-weight: 700; }
.gh { color: var(--amber); }
.gr { color: var(--cyan); font-weight: 700; }
.gl { transition: color 0.25s var(--ease-out); }
.gl.is-dim, .gl.is-dim .gh, .gl.is-dim .gr, .gl.is-dim .gg { color: var(--dim); font-weight: 400; }
.log-foot { margin-top: var(--s4); color: var(--dim); }

/* ---------- 11. Pricing ---------- */
.price-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s6); margin: var(--s4) 0 var(--s5); }
.tier-pick { display: none; margin-bottom: var(--s4); }
.table-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; min-width: 640px; }
.ptable th, .ptable td { padding: var(--s3) 2ch; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ptable thead th { color: var(--fg-bright); font-weight: 700; font-stretch: 100%; font-size: 1rem; border-bottom: 1px solid var(--line-strong); }
.ptable tbody th { color: var(--dim); font-weight: 500; width: 26%; }
.ptable [data-tier="team"] { background: var(--sel-soft); }
.ptable thead [data-tier="team"] { color: var(--green); }
.ptable .amt { font-size: 1.5rem; font-weight: 700; color: var(--fg-bright); font-stretch: 100%; }
.ptable .per { color: var(--dim); }
.row-total td { color: var(--fg-bright); font-weight: 600; }
.row-total .sub { display: block; color: var(--dim); font-weight: 400; font-size: var(--small-size); }
.row-total .sub:empty { display: none; }
.no { color: var(--dim); }
.row-cta td, .row-cta th { border-bottom: 0; padding-top: var(--s4); }
.price-foot { margin-top: var(--s4); color: var(--dim); max-width: 75ch; }
.amt.is-flip { animation: flip 0.45s var(--ease-out); }

/* ---------- 12. Cloud form ---------- */
.tform { display: grid; gap: var(--s4); }
.tform[hidden] { display: none; }
.frow { display: grid; grid-template-columns: 16ch minmax(0, 1fr); gap: var(--s1) 2ch; align-items: start; margin: 0; padding: 0; border: 0; min-width: 0; }
.frow > label, .frow > legend, .flabel { padding-top: 10px; color: var(--fg); font-weight: 600; }
.frow > legend { float: left; padding: 10px 0 0; }
.fctl { min-width: 0; display: grid; gap: var(--s1); }
.tform input[type="text"], .tform input[type="email"], .select select {
  width: 100%; height: 44px; padding: 0 1.4ch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--term-bg); color: var(--fg-bright); outline: 0;
  transition: border-color 0.2s var(--ease-out);
}
.tform input::placeholder { color: var(--dim); opacity: 1; }
.tform input:focus, .select select:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.tform [aria-invalid="true"] { border-color: var(--rose) !important; }
.slug { display: flex; align-items: stretch; }
.slug input { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.slug-suffix { display: flex; align-items: center; padding: 0 1.2ch; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--dim); background: var(--panel); white-space: nowrap; }
.fhint { color: var(--dim); font-size: var(--small-size); }
.ferr { color: var(--rose); font-size: var(--small-size); font-weight: 600; }
.ferr:empty { display: none; }
.ferr::before { content: "error: "; }
.ferr.ok { color: var(--green); }
.ferr.ok::before { content: "ok: "; }
.select { position: relative; }
.select select { appearance: none; padding-right: 5ch; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 2ch; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); transform: rotate(45deg); pointer-events: none;
}
.select option { background: var(--panel); color: var(--fg); }
/* Radios and checkbox drawn as text: ( ) (*) and [ ] [x] */
.radios { display: flex; flex-wrap: wrap; gap: 0 3ch; }
.radio, .check { position: relative; display: inline-flex; align-items: flex-start; min-height: 44px; padding-top: 10px; cursor: pointer; }
.radio input, .check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio span::before { content: "( ) "; white-space: pre; color: var(--dim); font-weight: 700; }
.radio input:checked + span { color: var(--fg-bright); }
.radio input:checked + span::before { content: "(*) "; color: var(--green); }
.check span { display: inline; }
.check span::before { content: "[ ] "; white-space: pre; color: var(--dim); font-weight: 700; }
.check input:checked + span::before { content: "[x] "; color: var(--green); }
.check input[aria-invalid="true"] + span::before { color: var(--rose); }
.radio input:focus-visible + span, .check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.stepper-inline { justify-self: start; }
.fsummary { padding: var(--s3) 2ch; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--fg-bright); }
.factions { display: flex; align-items: center; gap: 2ch; flex-wrap: wrap; }
.fkey { color: var(--dim); font-size: var(--small-size); }
.fresult { display: grid; gap: var(--s4); }
.fresult[hidden] { display: none; }
.fresult-log { background: var(--term-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s4) 2ch; min-height: 10em; font-size: 0.9375rem; line-height: 1.6; }
.fresult-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.fresult-actions .cmdline { width: 100%; }
.kv { margin: var(--s2) 0 0; display: grid; gap: var(--s3); }
.kv div { display: grid; grid-template-columns: 12ch minmax(0, 1fr); gap: 2ch; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--fg-bright); overflow-wrap: anywhere; }
.cloud-note { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px dashed var(--line); color: var(--dim); }

/* ---------- 13. FAQ, maintainers, footer ---------- */
.ftree { max-width: 82ch; margin-top: var(--s5); }
.ftree .tree-dir { min-height: 0; line-height: 1.6; margin: var(--s4) 0 var(--s1); }
.ftree .tree-dir:first-child { margin-top: 0; }
.ftree details { position: relative; margin-left: 2.5ch; padding-left: 2ch; border-left: 1px solid var(--line-strong); }
.ftree summary {
  position: relative; list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center;
  padding: var(--s1) 1ch; border-radius: var(--radius-sm); color: var(--fg); font-weight: 600;
}
.ftree summary::-webkit-details-marker { display: none; }
.ftree summary::before { content: "[+]"; flex: none; margin-right: 1.5ch; color: var(--cyan); font-weight: 700; }
.ftree details[open] > summary::before { content: "[-]"; color: var(--green); }
.ftree summary::after { content: ""; position: absolute; left: -2ch; top: 50%; width: 1.5ch; border-top: 1px solid var(--line-strong); }
.ftree summary:hover { background: var(--sel-soft); color: var(--fg-bright); }
.ftree details > p { padding: var(--s1) 1ch var(--s4) 5.5ch; max-width: 72ch; color: var(--fg); }

.team-wrap { overflow-x: auto; }
.team { border-collapse: collapse; min-width: 560px; width: 100%; max-width: 900px; }
.team th, .team td { text-align: left; padding: var(--s2) 3ch var(--s2) 0; border-bottom: 1px solid var(--line); }
.team th { color: var(--dim); font-weight: 500; }
.team-foot { margin-top: var(--s4); color: var(--dim); max-width: 75ch; }

.foot { width: min(100% - 2 * var(--gutter), 1320px); margin: var(--s7) auto 0; padding-top: var(--s5); border-top: 1px solid var(--line); }
.foot-cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); }
.foot-brand { display: flex; align-items: flex-start; gap: 1ch; color: var(--dim); }
.foot-brand .brand-mark { width: 20px; height: 20px; flex: none; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2ch; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }

/* ---------- 14. Status bar, dialog, toast ---------- */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch; gap: 0;
  height: var(--statusbar-h);
  background: var(--panel); border-top: 1px solid var(--line);
  font-size: var(--small-size); white-space: nowrap;
}
.statusbar > span { display: flex; align-items: center; padding: 0 1.5ch; }
/* Room for the Screenery gallery badge (bottom right) while it is on the page; gone once the badge script is removed */
body:has(> a[aria-label="Back to the Screenery gallery"]) .statusbar { padding-right: 120px; }
.sb-mode { background: var(--green); color: var(--on-accent); font-weight: 800; letter-spacing: 0.04em; }
.sb-mode.is-insert { background: var(--amber); }
.sb-pane { background: var(--line); color: var(--fg-bright); font-weight: 600; }
.sb-hints { gap: 2.5ch; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; }
.sb-key { display: inline-flex; align-items: center; gap: 0.8ch; height: 100%; padding: 0; border: 0; background: none; color: var(--fg); font-size: inherit; }
.sb-key:hover { color: var(--fg-bright); }
.sb-hint { display: inline-flex; align-items: center; gap: 0.8ch; }
.statusbar kbd { font-size: 0.85em; padding: 0 0.5ch; line-height: 1.4; }
#sb-theme { color: var(--amber); }
.sb-right { color: var(--green); }

.keys {
  width: min(100% - 32px, 760px); max-height: calc(100vh - 64px);
  padding: var(--s6) var(--s5) var(--s5); border: 1px solid var(--focus); border-radius: var(--radius);
  background: var(--panel); color: var(--fg); overflow: visible;
  box-shadow: 0 24px 60px -12px rgb(0 0 0 / 0.55);
}
.keys::backdrop { background: rgb(5 6 8 / 0.62); }
.keys .pane-title { color: var(--focus); }
.keys-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s3) var(--s6); max-height: calc(100vh - 140px); overflow-y: auto; }
.keys dl { margin: 0; display: grid; gap: var(--s2); }
.keys dl div { display: grid; grid-template-columns: 14ch minmax(0, 1fr); gap: 2ch; align-items: center; }
.keys dd { margin: 0; }
.keys[open] { animation: rise 0.35s var(--ease-out); }

.toast {
  position: fixed; right: var(--gutter); bottom: calc(var(--statusbar-h) + var(--s3)); z-index: 40;
  max-width: min(100% - 32px, 420px); padding: var(--s2) 2ch;
  border: 1px solid var(--green); border-radius: var(--radius-sm); background: var(--panel); color: var(--fg-bright);
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.45);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: none; }

/* ---------- 15. Motion ---------- */
@keyframes flip { from { opacity: 0.2; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .typing::after { animation: blink 1s steps(1) infinite; }
  /* Panes settle into place as they scroll in: visible from the first frame, only a small lift */
  @supports (animation-timeline: view()) {
    .pane:not(.pane-shell) { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    @keyframes settle { from { transform: translateY(14px); } to { transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- 16. Layout by width ---------- */
@media (max-width: 1079px) {
  /* Narrower screens: the shell comes straight after the pitch, the install line and facts follow it */
  .hero { gap: var(--s5); }
  .hero-intro { display: contents; }
  .hero h1 { order: 1; padding-top: var(--s2); }
  .lede { order: 2; }
  .pane-shell { order: 3; margin-top: var(--s3); }
  .oneliner { order: 4; }
  .facts { order: 5; }
  .hero-actions { order: 6; }
}
@media (min-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6) var(--s7); }
  .hero-intro { padding-top: var(--s6); }
}
@media (min-width: 900px) {
  .features { grid-template-columns: minmax(260px, 4fr) minmax(0, 8fr); align-items: stretch; }
  .cloud { grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); align-items: start; }
}
@media (max-width: 1180px) {
  .repo-stars { display: none; }
}
@media (max-width: 980px) {
  .repo { display: none; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .js .menu-btn {
    display: inline-flex; align-items: center; gap: 1ch; margin-left: auto; min-height: 44px; padding: 0 1.6ch;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; color: var(--fg); font-weight: 600;
  }
  .winlist { flex-basis: 100%; }
  .no-js .topbar { position: static; }
  .js .winlist { display: none; }
  .js .winlist.is-open { display: block; }
  .winlist ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; padding-bottom: var(--s2); }
  .winlist a { min-height: 44px; width: 100%; }
  .js .tier-pick { display: inline-flex; }
  .js .ptable { min-width: 0; }
  .js .table-wrap:not([data-show="oss"]) [data-tier="oss"],
  .js .table-wrap:not([data-show="team"]) [data-tier="team"],
  .js .table-wrap:not([data-show="business"]) [data-tier="business"] { display: none; }
  .sb-right { display: none !important; }
}
@media (max-width: 760px) {
  :root { --statusbar-h: 0px; }
  main { gap: var(--s6); margin-top: var(--s3); }
  .pane { padding: var(--s5) var(--s4) var(--s4); }
  .pane-shell { padding: var(--s5) 0 0; }
  .pane-frame { left: var(--s2); right: var(--s2); }
  .pane-title .dim { display: none; }
  .term { height: 62vh; min-height: 340px; max-height: 520px; padding: var(--s2) 1.4ch 0; font-stretch: 75%; font-size: 0.9375rem; }
  .chips { padding: var(--s3) 1.4ch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chip { flex: none; min-height: 44px; }
  .js .extrakeys { display: flex; padding: 0 1.4ch var(--s3); }
  .ps-path { display: none; }
  .bar-row, .bench-axis { grid-template-columns: minmax(0, 1fr) 9ch; gap: var(--s1) 1.5ch; }
  .bar-label { grid-column: 1 / -1; }
  .bench-axis > span:first-child { display: none; }
  .bench-caption { min-height: 0; }
  .ptable th, .ptable td { padding: var(--s3) 1.2ch; }
  .ptable tbody th { width: 42%; }
  .frow { grid-template-columns: minmax(0, 1fr); }
  .frow > label, .frow > legend, .flabel { padding-top: 0; }
  .flabel { display: none; }
  .frow > legend { float: none; }
  .kv div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ftree details { margin-left: 1ch; padding-left: 1.2ch; }
  .ftree summary::after { left: -1.2ch; width: 1ch; }
  .ftree details > p { padding-left: 1ch; }
  .keys dl div { grid-template-columns: 11ch minmax(0, 1fr); }
  .statusbar { position: static; height: auto; min-height: 44px; flex-wrap: wrap; margin-top: var(--s5); }
  .sb-hint, .sb-right, .sb-mode { display: none !important; }
  .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs [role="tab"] { padding: 0 0.5ch; }
  .team thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .team, .team tbody { display: block; min-width: 0; }
  .team tr { display: grid; grid-template-columns: 10ch minmax(0, 1fr); gap: 0 1.5ch; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  .team td:first-child { grid-row: span 3; }
  .team td { border: 0; padding: 0; }
  .team td:nth-child(3), .team td:nth-child(4) { color: var(--dim); }
  .team td:nth-child(4)::before { content: "in "; }
  .sb-hints { flex: 1; justify-content: flex-end; }
  .sb-key { min-height: 44px; }
  .toast { bottom: var(--s4); }
}
@media (pointer: coarse) {
  .js .extrakeys { display: flex; }
}
