/* barhelp · landing
   Periwinkle on cool paper (and graphite at night). The product is the hero:
   the panel below is a working copy of the GTK one, same tokens, same keys. */

:root {
  --font: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* springs solved to linear(): k=380 c=30 (UI), k=500 c=40 (firm) */
  --spring: linear(0, 0.0139, 0.0509, 0.1044, 0.1693, 0.241, 0.316, 0.3916, 0.4657, 0.5365, 0.603, 0.6644, 0.7203, 0.7705, 0.815, 0.8539, 0.8876, 0.9163, 0.9405, 0.9605, 0.9769, 0.9901, 1.0004, 1.0083, 1.0141, 1.0181, 1.0207, 1.0222, 1.0227, 1.0225, 1.0217, 1.0206, 1.0191, 1.0175, 1.0158, 1.0141, 1.0124, 1.0108, 1.0093, 1.0078, 1.0066, 1.0054, 1.0044, 1.0035, 1.0027, 1.002, 1.0014, 1.001, 1.0006, 1);
  --spring-t: 430ms;
  --firm: linear(0, 0.0148, 0.0532, 0.1075, 0.1719, 0.2417, 0.3134, 0.3845, 0.4532, 0.5182, 0.5787, 0.6342, 0.6846, 0.7299, 0.7702, 0.8058, 0.837, 0.8641, 0.8875, 0.9076, 0.9247, 0.9391, 0.9513, 0.9615, 0.9699, 0.9768, 0.9825, 0.9871, 0.9907, 0.9936, 0.9959, 0.9977, 0.999, 1);
  --firm-t: 320ms;
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --maxw: 1160px;
  --gutter: clamp(18px, 4vw, 48px);

  /* page */
  --page: #f3f3f6;
  --page-2: #ebebf0;
  --ink: #18181b;
  --ink-2: #63636e;
  --ink-3: #9a9aa5;
  --line: rgba(24, 24, 40, 0.08);
  --line-2: rgba(24, 24, 40, 0.13);
  --accent: #5462f0;
  --accent-hover: #4654e2;
  --accent-soft: rgba(84, 98, 240, 0.12);
  --accent-ink: #3b47c9;
  --desk: #e4e5eb;
  --desk-grid: rgba(24, 24, 40, 0.045);
  --key-top: #ffffff;
  --key-side: #d3d4dc;
  --key-ink: #2b2b33;

  /* the app's own tokens (style.css) */
  --bh-surface: #fbfbfc;
  --bh-surface-2: #f3f3f6;
  --bh-surface-3: #eaeaef;
  --bh-ring: rgba(24, 24, 40, 0.09);
  --bh-hairline: rgba(24, 24, 40, 0.07);
  --bh-hover: rgba(24, 24, 40, 0.045);
  --bh-selected: rgba(84, 98, 240, 0.10);
  --bh-text: #18181b;
  --bh-text-2: #6c6c76;
  --bh-text-3: #9e9ea8;
  --bh-shadow: rgba(16, 16, 32, 0.22);
  --bh-diff: rgba(84, 98, 240, 0.16);

  --tint-blue: #3878f0;
  --tint-violet: #865cec;
  --tint-teal: #129e96;
  --tint-green: #2ea062;
  --tint-amber: #de9224;
  --tint-pink: #de5288;
  --tint-graphite: #70707c;
  --tint-accent: var(--accent);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --page: #141418;
  --page-2: #1a1a1f;
  --ink: #f4f4f6;
  --ink-2: #a4a4b0;
  --ink-3: #6e6e7a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --accent: #7c88ff;
  --accent-hover: #8c97ff;
  --accent-soft: rgba(124, 136, 255, 0.16);
  --accent-ink: #a3abff;
  --desk: #1b1b20;
  --desk-grid: rgba(255, 255, 255, 0.035);
  --key-top: #2c2c33;
  --key-side: #121216;
  --key-ink: #e4e4ea;

  --bh-surface: #202025;
  --bh-surface-2: #2a2a30;
  --bh-surface-3: #34343b;
  --bh-ring: rgba(255, 255, 255, 0.09);
  --bh-hairline: rgba(255, 255, 255, 0.07);
  --bh-hover: rgba(255, 255, 255, 0.045);
  --bh-selected: rgba(132, 142, 255, 0.16);
  --bh-text: #f4f4f6;
  --bh-text-2: #a4a4b0;
  --bh-text-3: #70707c;
  --bh-shadow: rgba(0, 0, 0, 0.55);
  --bh-diff: rgba(124, 136, 255, 0.24);

  --tint-blue: #649aff;
  --tint-violet: #a886ff;
  --tint-teal: #34c8bc;
  --tint-green: #54cc88;
  --tint-amber: #f4b652;
  --tint-pink: #ff7eac;
  --tint-graphite: #a0a0ac;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 300ms var(--out), color 300ms var(--out);
}
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
code { font: 500 0.88em var(--mono); padding: 0.1em 0.35em; border-radius: 5px; background: var(--page-2); }
.meta { color: var(--ink-3); font-size: 12px; font-feature-settings: "tnum"; }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic .fill, svg .fill { fill: currentColor; stroke: none; }

/* keycaps */
kbd {
  display: inline-grid; place-items: center;
  min-width: 1.75em; height: 1.75em; padding: 0 0.45em;
  font: 500 0.74em/1 var(--mono);
  color: var(--key-ink);
  background: var(--key-top);
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line-2), 0 1.5px 0 1px var(--key-side);
  transform: translateY(-1px);
  vertical-align: 0.1em;
  transition: transform 120ms var(--out), box-shadow 120ms var(--out), background-color 160ms, color 160ms;
}
kbd.down, kbd.lit {
  transform: translateY(0.5px);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 1px var(--key-side);
  background: var(--accent);
  color: #fff;
}
.kc-inline { display: inline-flex; gap: 3px; white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 0; border-radius: 11px;
  font-weight: 550; font-size: 15px;
  transition: background-color 160ms, transform var(--firm-t) var(--firm), color 160ms;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--line); }
.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  transition: background-color 160ms, color 160ms, transform var(--firm-t) var(--firm);
}
.icon-btn:hover { background: var(--line); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--page);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms, background-color 300ms var(--out);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.logo { width: 26px; height: 26px; }
.logo-bg { fill: var(--accent); }
.logo-card { fill: #fff; }
.logo-line { fill: color-mix(in srgb, var(--accent) 28%, #fff); }
.logo-spark { fill: #fff; stroke: var(--accent); stroke-width: 3.5; paint-order: stroke; }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a {
  padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2);
  transition: color 160ms, background-color 160ms;
}
.nav-links a:hover { color: var(--ink); background: var(--line); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- hero ---------- */

.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 8vh, 88px) var(--gutter) 40px; }
.hero-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--bh-surface); box-shadow: 0 0 0 1px var(--line);
  font-size: 13px; color: var(--ink-2);
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tint-green); }
h1 {
  margin-top: 22px;
  font-size: clamp(38px, 5.6vw, 62px); line-height: 1.03;
  font-weight: 650; letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  margin: 20px auto 0; max-width: 600px;
  font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); line-height: 1.55;
  text-wrap: pretty;
}
.lede kbd { font-size: 0.7em; }
.hero-cta { margin-top: 30px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.cmd {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 6px 0 14px; border: 0; border-radius: 11px;
  background: var(--ink); color: var(--page);
  font: 500 14px var(--mono);
  transition: transform var(--firm-t) var(--firm);
}
.cmd:active { transform: scale(0.97); }
.cmd-prompt { opacity: 0.5; }
.cmd-copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: color-mix(in srgb, var(--page) 14%, transparent);
  font: 500 12.5px var(--font);
}
.cmd-copy .ic { width: 14px; height: 14px; }

/* ---------- stage ---------- */

.stage-wrap { margin-top: clamp(40px, 6vh, 64px); }

.steps {
  list-style: none; margin: 0 auto 16px; padding: 0;
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.steps li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  font-size: 13.5px; color: var(--ink-3);
  transition: color 200ms, background-color 240ms var(--out);
}
.step-n {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font: 600 11px var(--mono); background: var(--page-2); color: var(--ink-3);
  transition: background-color 240ms, color 240ms;
}
.steps li.on { color: var(--ink); background: var(--bh-surface); box-shadow: 0 0 0 1px var(--line); }
.steps li.on .step-n { background: var(--accent); color: #fff; }
.steps li.done { color: var(--ink-2); }
.steps li.done .step-n { background: var(--accent-soft); color: var(--accent-ink); }

.stage {
  position: relative;
  border-radius: 24px;
  background-color: var(--desk);
  background-image:
    linear-gradient(var(--desk-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--desk-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  height: calc(660px * var(--s, 1));
}
.stage-scale {
  position: absolute; left: 50%; top: 0;
  width: 1100px; height: 660px;
  transform: translateX(-50%) scale(var(--s, 1));
  transform-origin: top center;
}
.desk { position: absolute; inset: 0; }

.doc {
  position: absolute; left: 120px; top: 34px; width: 860px;
  background: var(--bh-surface);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.05), 0 20px 50px -18px var(--bh-shadow);
  transition: filter 300ms var(--out), opacity 300ms;
}
.doc-bar {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--bh-hairline);
  font-size: 13.5px;
}
.doc-title { font-weight: 600; }
.doc-sub { color: var(--bh-text-3); }
.doc-close {
  margin-left: auto; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bh-surface-2); color: var(--bh-text-2); font-size: 15px; line-height: 1;
}
.doc-body { padding: 8px 22px 26px; }
.doc-field {
  display: flex; gap: 12px; padding: 9px 0; font-size: 14px;
  border-bottom: 1px solid var(--bh-hairline); color: var(--bh-text);
}
.doc-field span { color: var(--bh-text-3); width: 56px; }
.doc-text { margin-top: 18px; font-size: 15.5px; line-height: 1.65; color: var(--bh-text); }
.doc-quiet { color: var(--bh-text-2); }
.sel {
  border-radius: 3px;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 900ms cubic-bezier(0.45, 0, 0.2, 1);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.sel.on { background-size: 100% 100%; }
.sel.instant { transition: none; }
.sel.flash { animation: flash 1.4s var(--out); }
@keyframes flash {
  0% { background-color: color-mix(in srgb, var(--tint-green) 26%, transparent); }
  100% { background-color: transparent; }
}

.keytoast {
  position: absolute; left: 50%; bottom: 36px;
  display: flex; gap: 6px; padding: 10px 12px;
  border-radius: 14px; background: var(--bh-surface);
  box-shadow: 0 0 0 1px var(--bh-ring), 0 14px 36px -10px var(--bh-shadow);
  font-size: 22px;
  transform: translate(-50%, 14px); opacity: 0;
  transition: transform var(--spring-t) var(--spring), opacity 180ms;
  pointer-events: none;
}
.keytoast.on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- the panel (mirrors barhelp/style.css) ---------- */

.bh-panel {
  width: 680px;
  background: var(--bh-surface); color: var(--bh-text);
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 50px -6px var(--bh-shadow);
  overflow: hidden;
  font-size: 14px; letter-spacing: 0;
}
#panel {
  position: absolute; left: 50%; top: 104px; z-index: 3;
  transform: translateX(-50%) translateY(10px) scale(0.97);
  opacity: 0; pointer-events: none;
  transition: transform var(--spring-t) var(--spring), opacity 160ms var(--out);
}
#panel.open { transform: translateX(-50%); opacity: 1; pointer-events: auto; }
#panel.closing { transition-duration: 160ms, 140ms; transition-timing-function: var(--out); }
.desk.dimmed .doc { filter: saturate(0.9); opacity: 0.86; }

.src { margin: 14px 14px 0; padding: 10px 8px 8px 12px; border-radius: 14px; background: var(--bh-surface-2); }
.src-text {
  color: var(--bh-text-2); font-size: 13.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 3.1em; outline: none; border-radius: 6px;
}
.src-text[contenteditable="true"] { -webkit-line-clamp: unset; display: block; color: var(--bh-text); caret-color: var(--accent); }
.src-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.src-meta .meta { flex: 1; color: var(--bh-text-3); font-size: 11.5px; }
.seg { display: flex; padding: 2px; border-radius: 8px; background: var(--bh-surface-3); }
.seg button {
  border: 0; background: none; padding: 2px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--bh-text-2);
  transition: background-color 160ms, color 160ms, box-shadow 160ms;
}
.seg button.on { background: var(--bh-surface); color: var(--bh-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--bh-hairline); }

.q-row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 12px 6px 20px; }
.lead { position: relative; width: 18px; height: 28px; display: grid; place-items: center; }
.lead-spark { width: 18px; height: 18px; color: var(--accent); transition: opacity 160ms, transform 220ms var(--out); }
.lead-back {
  position: absolute; left: -5px; top: 0; width: 28px; height: 28px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--bh-text-2);
  opacity: 0; pointer-events: none; transition: opacity 160ms, background-color 140ms;
}
.lead-back:hover { background: var(--bh-hover); color: var(--bh-text); }
.bh-panel[data-view="result"] .lead-spark,
.bh-panel[data-view="picker"] .lead-spark { opacity: 0; transform: scale(0.6); }
.bh-panel[data-view="result"] .lead-back,
.bh-panel[data-view="picker"] .lead-back { opacity: 1; pointer-events: auto; }
.q {
  flex: 1; min-width: 0; height: 40px; padding: 0 4px;
  border: 0; outline: 0; background: none;
  font-size: 18px; color: var(--bh-text); caret-color: var(--accent);
}
.q::placeholder { color: var(--bh-text-3); }
.prov {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border: 0; border-radius: 999px;
  background: var(--bh-surface-2); color: var(--bh-text-2);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background-color 160ms, color 160ms;
}
button.prov:hover, .bh-panel[data-view="picker"] .prov { background: var(--bh-surface-3); color: var(--bh-text); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tint-green); flex: none; }
.dot.off { background: var(--tint-amber); }
.hair { height: 1px; background: var(--bh-hairline); }

.body { position: relative; height: 330px; }
.view {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 180ms var(--out), visibility 0s 180ms;
}
.bh-panel[data-view="list"] .v-list,
.bh-panel[data-view="result"] .v-result,
.bh-panel[data-view="picker"] .v-picker { opacity: 1; visibility: visible; transition: opacity 180ms var(--out); }

.v-list { overflow-y: auto; padding: 4px 8px 8px; scrollbar-width: thin; scroll-behavior: smooth; }
.g-head { padding: 12px 12px 4px; color: var(--bh-text-3); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; margin: 1px 0; border-radius: 11px;
  cursor: default; transition: background-color 120ms;
}
.row:hover { background: var(--bh-hover); }
.row.sel-row { background: var(--bh-selected); }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.row .hint { color: var(--bh-text-3); font-size: 12px; }
.row .enter { color: var(--accent); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 140ms; }
.row.sel-row .enter { opacity: 1; }
.row .nth { font: 500 11px var(--mono); color: var(--bh-text-3); opacity: 0; transition: opacity 140ms; }
.v-list.ctrl .row .nth { opacity: 1; }
.empty { padding: 40px; text-align: center; color: var(--bh-text-3); font-size: 13px; }

.chip {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--t) 14%, transparent); color: var(--t);
  transition: background-color 140ms, color 140ms;
}
.chip .ic { width: 15px; height: 15px; }
.blue { --t: var(--tint-blue); } .violet { --t: var(--tint-violet); } .teal { --t: var(--tint-teal); }
.green { --t: var(--tint-green); } .amber { --t: var(--tint-amber); } .pink { --t: var(--tint-pink); }
.graphite { --t: var(--tint-graphite); } .accent { --t: var(--tint-accent); }
.row.sel-row .chip { background: var(--t); color: #fff; }

.v-result { display: flex; flex-direction: column; }
.r-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 6px; }
.r-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-head .meta { color: var(--bh-text-3); font-size: 11.5px; }
.spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--bh-surface-3); border-top-color: var(--accent);
  animation: spin 700ms linear infinite; display: none;
}
.spin.on { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.r-text {
  flex: 1; overflow-y: auto; padding: 4px 20px 12px;
  font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; color: var(--bh-text);
  scrollbar-width: thin;
}
.r-text .d { background: var(--bh-diff); border-radius: 3px; box-shadow: 0 0 0 1.5px var(--bh-diff); }
.r-text .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.r-text .md-tbl { font-family: var(--mono); font-size: 12.5px; }
.r-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px 14px; }
.grow { flex: 1; }
.pbtn {
  height: 32px; padding: 0 14px; border: 0; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  background: var(--bh-surface-2); color: var(--bh-text);
  transition: background-color 140ms, transform var(--firm-t) var(--firm), opacity 140ms;
}
.pbtn:hover { background: var(--bh-surface-3); }
.pbtn:active, .pbtn.press { transform: scale(0.95); }
.pbtn.primary { background: var(--accent); color: #fff; }
.pbtn.primary:hover { background: var(--accent-hover); }
.pbtn:disabled { opacity: 0.45; pointer-events: none; }
.pbtn.icon { width: 32px; padding: 0; display: grid; place-items: center; }

.foot {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 18px;
  background: color-mix(in srgb, var(--bh-surface-2) 60%, transparent);
  border-top: 1px solid var(--bh-hairline);
  min-height: 41px;
}
.hints { flex: 1; display: flex; gap: 12px; align-items: center; font-size: 11.5px; color: var(--bh-text-3); white-space: nowrap; }
.hints span.h { display: inline-flex; gap: 5px; align-items: center; }
.hints b {
  min-width: 18px; padding: 1px 5px; border-radius: 5px;
  background: var(--bh-surface-3); color: var(--bh-text-2);
  font-size: 10.5px; font-weight: 600; text-align: center;
}
.hints.swap { animation: swap 220ms var(--out); }
@keyframes swap { from { opacity: 0; transform: translateY(3px); } }
.foot-gear { display: grid; place-items: center; width: 26px; height: 26px; color: var(--bh-text-3); }

/* picker */
.picker { display: flex; height: 330px; }
.v-picker .picker { height: 100%; }
.pk-col { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.pk-col:first-child { flex: 0 0 47%; }
.pk-col:first-child .row .sub { font-size: 11.5px; }
.pk-vline { width: 1px; margin: 10px 0; background: var(--bh-hairline); }
.pk-col .row { gap: 10px; }
.pk-col .row .sub { color: var(--bh-text-3); font-size: 12px; white-space: nowrap; }
.pk-col .row .check { color: var(--accent); width: 16px; height: 16px; opacity: 0; }
.pk-col .row.chosen .check { opacity: 1; }
.pk-col.inactive .row.sel-row { background: var(--bh-hover); }
.pk-col.inactive .row.sel-row .chip { background: color-mix(in srgb, var(--t) 14%, transparent); color: var(--t); }
.pk-col .row .dot { margin: 0 2px 0 4px; }

.stage-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 0 6px;
}
.stage-key {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 7px 14px 7px 9px; border: 0; border-radius: 12px;
  background: var(--bh-surface); box-shadow: 0 0 0 1px var(--line);
  font-size: 14px; color: var(--ink);
  transition: transform var(--firm-t) var(--firm), box-shadow 200ms;
}
.stage-key:hover { box-shadow: 0 0 0 1px var(--accent); }
.stage-key:active { transform: scale(0.97); }
.stage-key kbd { font-size: 12px; }
.stage-key.nudge { animation: nudge 1.6s var(--out) 2; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 1px var(--line); } 40% { box-shadow: 0 0 0 2px var(--accent); } }
.stage-note { font-size: 13px; color: var(--ink-3); margin-left: auto; }

/* ---------- sections ---------- */

.sec { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vh, 140px) var(--gutter) 0; }
.sec-head { max-width: 640px; }
.sec-head h2 {
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1;
  font-weight: 650; letter-spacing: -0.03em; text-wrap: balance;
}
.sec-head p { margin-top: 16px; font-size: 17px; color: var(--ink-2); text-wrap: pretty; }
.sec-head kbd { font-size: 0.72em; }
.sec-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.sec-flip > .sec-head { order: 2; }

.facts { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.facts kbd { font-size: 11px; }

/* catalogue */
.catalog {
  margin-top: 44px;
  background: var(--bh-surface); border-radius: 20px;
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}
.cat-search {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 60px;
  border-bottom: 1px solid var(--line);
}
.cat-search .ic { width: 18px; height: 18px; color: var(--accent); }
.cat-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; }
.cat-search input::placeholder { color: var(--ink-3); }
.cat-groups { columns: 3 260px; column-gap: 8px; padding: 8px 12px 14px; }
.cat-group { break-inside: avoid; padding-bottom: 6px; }
.cat-group .g-head { padding: 12px 10px 4px; }
.cat-group .row { padding: 6px 10px; }
.cat-group .row .tag { font: 500 10.5px var(--mono); color: var(--ink-3); padding: 2px 6px; border-radius: 5px; background: var(--page-2); }
.cat-row { transition: opacity 200ms var(--out), transform var(--spring-t) var(--spring); }
.cat-row.hidden { display: none; }
.cat-group.hidden { display: none; }
.cat-row.match .title mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }
.cat-empty { padding: 28px 22px; color: var(--ink-3); font-size: 14px; }
.cat-empty b { color: var(--ink); font-weight: 500; }

.instant {
  margin-top: 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px;
  padding: 28px; border-radius: 20px;
  background: var(--bh-surface); box-shadow: 0 0 0 1px var(--line);
}
.instant h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.instant-copy p { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.instant-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.ibtn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px 0 8px; border: 0; border-radius: 9px;
  background: var(--page-2); font-size: 13px; color: var(--ink);
  transition: background-color 140ms, transform var(--firm-t) var(--firm);
}
.ibtn .ic { width: 14px; height: 14px; color: var(--tint-graphite); }
.ibtn:hover { background: var(--line-2); }
.ibtn:active { transform: scale(0.95); }
.ibtn.ok .ic { color: var(--tint-green); }
.ibtn.err { box-shadow: 0 0 0 1px var(--tint-pink); }
.instant-pad { display: flex; flex-direction: column; border-radius: 14px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pad-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.link-btn { border: 0; background: none; font-size: 12.5px; color: var(--accent-ink); padding: 2px 4px; border-radius: 5px; }
.link-btn:hover { background: var(--accent-soft); }
#pad {
  flex: 1; min-height: 210px; resize: none; border: 0; outline: 0; background: none;
  padding: 12px 14px; font: 13.5px/1.6 var(--mono); color: var(--ink);
  transition: background-color 600ms var(--out);
}
#pad.flash { background: color-mix(in srgb, var(--tint-green) 9%, transparent); transition: none; }

/* refine */
.refine-card {
  background: var(--bh-surface); border-radius: 20px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.05), 0 24px 60px -24px var(--bh-shadow);
  overflow: hidden;
}
.refine-card .r-text { min-height: 156px; font-size: 16px; padding: 8px 22px 18px; }
.refine-card .r-head { padding: 18px 22px 6px; }
.refine-row { display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 54px; border-top: 1px solid var(--bh-hairline); }
.refine-row .ic { color: var(--accent); width: 17px; height: 17px; }
.refine-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; caret-color: var(--accent); }
.refine-row input::placeholder { color: var(--bh-text-3); }
.refine-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 16px; }
.refine-chips button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 9px;
  background: var(--bh-surface-2); font-size: 13px; color: var(--bh-text);
  transition: background-color 140ms, color 140ms, transform var(--firm-t) var(--firm);
}
.refine-chips button:hover { background: var(--bh-surface-3); }
.refine-chips button:active { transform: scale(0.95); }
.refine-chips button.on { background: var(--accent-soft); color: var(--accent-ink); }
.refine-chips .ghost { background: none; color: var(--bh-text-3); }

/* mini toolbar */
.mini-stage {
  position: relative; margin-top: 44px;
  min-height: 460px; padding: 56px clamp(18px, 6vw, 80px) 220px;
  border-radius: 24px;
  background-color: var(--desk);
  background-image:
    linear-gradient(var(--desk-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--desk-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.note {
  max-width: 640px;
  background: var(--bh-surface); border-radius: 14px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 18px 44px -20px var(--bh-shadow);
  padding: 18px 24px 26px;
}
.note-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--bh-hairline); }
.note-title { font-weight: 600; font-size: 15px; }
.note-text { font-size: 17px; line-height: 1.7; color: var(--bh-text); cursor: text; }
.sent { border-radius: 3px; transition: background-color 200ms var(--out); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sent:hover { background: var(--bh-hover); }
.sent.picked { background: var(--accent-soft); }
.sent.flash { animation: flash 1.4s var(--out); }

.mini {
  position: absolute; z-index: 4; width: 460px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translateY(6px) scale(0.96); opacity: 0; pointer-events: none;
  transition: transform var(--spring-t) var(--spring), opacity 160ms var(--out), left 360ms var(--out), top 360ms var(--out);
}
.mini.open { transform: none; opacity: 1; pointer-events: auto; }
.mini-pill {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; background: var(--bh-surface);
  box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -6px var(--bh-shadow);
}
.mbtn {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: none; color: var(--bh-text-2);
  transition: background-color 140ms, color 140ms, transform 160ms var(--firm);
}
.mbtn:hover { background: var(--bh-hover); color: var(--t); }
.mbtn:active, .mbtn.press { transform: scale(0.88); }
.mbtn.current { background: var(--bh-selected); color: var(--t); }
.mbtn.more { color: var(--accent); }
.mini-sep { width: 1px; height: 16px; margin: 0 3px; background: var(--bh-hairline); }
.mini-caption {
  padding: 4px 10px; border-radius: 8px; background: var(--bh-surface); color: var(--bh-text-2); font-size: 12px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 6px 16px -6px var(--bh-shadow);
  opacity: 0; transform: translateY(-3px); transition: opacity 140ms, transform 200ms var(--out);
  white-space: nowrap; pointer-events: none; height: 0; padding-block: 0; overflow: hidden;
}
.mini-caption.on { opacity: 1; transform: none; height: auto; padding-block: 4px; }
.mini-caption i { font-style: normal; opacity: 0.55; margin-left: 10px; font-family: var(--mono); }
.mini-card {
  width: 100%;
  background: var(--bh-surface); color: var(--bh-text); border-radius: 18px;
  box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.06), 0 16px 40px -8px var(--bh-shadow);
  max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 240ms var(--out), opacity 140ms, transform 240ms var(--out);
}
.mini-card.on { max-height: 320px; opacity: 1; transform: none; transition: max-height 380ms var(--out), opacity 180ms, transform var(--spring-t) var(--spring); }
.mini-card .r-head { padding: 12px 16px 4px; }
.mini-card .r-text { padding: 2px 16px 6px; font-size: 14px; max-height: 200px; }
.mini-card .r-actions { padding: 6px 10px 10px; }
.mini-card .pbtn { height: 28px; padding: 0 12px; border-radius: 9px; }
.mini-card .pbtn.icon { width: 28px; padding: 0; }
.mini-card .meta { font-size: 11.5px; color: var(--bh-text-3); padding-left: 6px; }

/* picker demo */
.picker-demo { display: flex; justify-content: center; }
.bh-panel-static { width: 100%; max-width: 560px; box-shadow: 0 0 0 1px var(--bh-ring), 0 1px 2px rgba(0, 0, 0, 0.05), 0 24px 60px -24px var(--bh-shadow); }
.bh-panel-static .picker { height: 300px; }
.bh-panel-static .q-row { padding-left: 18px; }
.bh-panel-static .q { font-size: 16px; }
.engine-table { margin: 26px 0 0; border-top: 1px solid var(--line); }
.engine-table div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.engine-table dt { font-weight: 550; }
.engine-table dd { margin: 0; color: var(--ink-2); }

/* keys */
.keymap { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.keycol { padding: 22px 24px 12px; border-radius: 20px; background: var(--bh-surface); box-shadow: 0 0 0 1px var(--line); }
.keycol h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.keycol ul { list-style: none; margin: 0; padding: 0; }
.keycol li {
  display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2);
  transition: color 200ms;
}
.keycol li:first-child { border-top: 0; }
.keycol li.hit { color: var(--ink); }
.keys { display: inline-flex; gap: 4px; }
.keys kbd { font-size: 12.5px; }
.keys kbd.wide { padding: 0 0.8em; font-family: var(--font); font-weight: 500; }

/* install */
.term { border-radius: 18px; background: #16161a; color: #e9e9ee; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 24px 60px -28px rgba(0, 0, 0, 0.45); }
.term-head { padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.term-head .meta { color: #7b7b88; }
.term-body { padding: 14px 8px 16px; font: 14px/1.5 var(--mono); }
.term-line { display: flex; align-items: center; width: 100%; padding: 4px 10px; border: 0; background: none; text-align: left; border-radius: 8px; color: inherit; font: inherit; }
.term-line .c { color: #7b7b88; }
.term-line .p { color: #8c97ff; margin-right: 10px; }
.cmdline { margin-bottom: 8px; transition: background-color 140ms; }
.cmdline:hover { background: rgba(255, 255, 255, 0.05); }
.t-copy { margin-left: auto; font: 500 12px var(--font); color: #7b7b88; opacity: 0; transition: opacity 140ms; }
.cmdline:hover .t-copy, .cmdline.done .t-copy { opacity: 1; }
.cmdline.done .t-copy { color: var(--tint-green); }

/* footer */
.foot-site { margin-top: clamp(80px, 12vh, 140px); border-top: 1px solid var(--line); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 40px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-inner .logo { width: 22px; height: 22px; }
.foot-inner .brand { font-size: 15px; }
.foot-by { margin-left: auto; font-size: 14px; color: var(--ink-2); }
.foot-by:hover { color: var(--accent-ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  padding: 9px 14px; border-radius: 11px;
  background: var(--ink); color: var(--page); font-size: 14px; font-weight: 500;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: transform var(--spring-t) var(--spring), opacity 160ms;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--out), transform 700ms var(--spring); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .sec-split { grid-template-columns: minmax(0, 1fr); }
  .sec-flip > .sec-head { order: 0; }
  .instant { grid-template-columns: 1fr; padding: 20px; }
  .keymap { grid-template-columns: minmax(0, 1fr); }
  .stage-key { width: 100%; }
  .stage-note { margin-left: 0; width: 100%; }
}
@media (max-width: 600px) {
  .mini { width: calc(100% - 24px); left: 12px !important; }
  .keycol li { grid-template-columns: 1fr; gap: 6px; }
  .engine-table div { grid-template-columns: 1fr; gap: 2px; }
  .mini-stage { padding: 28px 14px 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 80ms !important; animation-duration: 80ms !important; scroll-behavior: auto !important; }
}
