/* Voisu site: one stylesheet for the landing page and the docs.

   Identity: an operator's manual for a small instrument. The page is a cool
   grey panel; anything that *is* Voisu (the capsule, the hero stage, commands
   you paste) sits on the logo's own ground, #17191D, in both themes. Colour is
   reserved for state: Recording #65D6A0, Processing #8FB4FF, Delivered
   #B8E986, Failure #FF8A8A: the Overlay tokens from DESIGN.md.

   Type: Archivo (variable width) for everything you read, run wide and heavy
   for headings like engraved panel labels; Martian Mono only where a machine
   is speaking (commands, keys, fingerprints).

   Light is the designed base; dark follows prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --font: "Archivo", "Segoe UI Variable Text", "Segoe UI", "Adwaita Sans", Cantarell,
    "Noto Sans", "Helvetica Neue", sans-serif;
  --mono: "Martian Mono", ui-monospace, "JetBrains Mono", "Cascadia Mono", "Adwaita Mono",
    Menlo, Consolas, monospace;

  /* Overlay tokens: the capsule and the plates look the same in both themes. */
  --capsule: #17191d;
  --capsule-line: #2a2e35;
  --rec: #65d6a0;
  --proc: #8fb4ff;
  --ok: #b8e986;
  --fail: #ff8a8a;

  /* Plate: the logo ground. Hero stage, code, primary buttons. */
  --plate: #17191d;
  --plate-2: #1f2227;
  --plate-line: #30343c;
  --plate-ink: #eceee8;
  --plate-ink-2: #a9aeb6;

  --bg: #e8eae5;
  --bg-2: #dfe2dc;
  --surface: #f3f4f0;
  --surface-2: #e2e5df;
  --line: #b9beb5;
  --line-2: #cfd3cb;
  --ink: #17191d;
  --ink-2: #41464e;
  --ink-3: #585e67;

  /* Text-safe state inks for the paper. */
  --rec-ink: #0f6a45;
  --proc-ink: #2a4bbf;
  --ok-ink: #3f6a0c;
  --fail-ink: #a82a2a;

  --accent: #65d6a0;
  --link: #2a4bbf;
  --focus: #2a4bbf;
  --code-bg: var(--plate);
  --code-ink: var(--plate-ink);
  --sel: rgba(101, 214, 160, 0.4);

  --radius: 6px;
  --radius-sm: 4px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plate: #0f1113;
    --plate-2: #181b1f;
    --plate-line: #2a2e35;

    --bg: #17191d;
    --bg-2: #1b1e22;
    --surface: #1f2226;
    --surface-2: #262a2f;
    --line: #3a3f47;
    --line-2: #2b2f35;
    --ink: #eceee8;
    --ink-2: #b4b9bf;
    --ink-3: #8f959d;

    --rec-ink: #65d6a0;
    --proc-ink: #8fb4ff;
    --ok-ink: #b8e986;
    --fail-ink: #ff8a8a;

    --link: #8fb4ff;
    --focus: #8fb4ff;
    --sel: rgba(101, 214, 160, 0.3);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--sel);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Headings run semi-expanded and heavy: panel lettering, not a magazine. */
h1,
h2,
h3,
h4 {
  font-stretch: 112%;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.84em;
  font-stretch: 87.5%;
}

:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0.06em 0.34em;
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.12em 0.5em 0.18em;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76em;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--plate);
  color: var(--plate-ink);
  border: 2px solid var(--rec);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The logo is shown as a rounded square whatever the source file's corners
   are (see assets/README.md). */
.mark {
  width: 32px;
  height: 32px;
  border-radius: 18%;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.6vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 6px 8px;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  border-radius: 8px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--surface-2);
}

.site-nav .gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-nav .gh svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 420px) {
  .site-nav .gh span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  font-stretch: 106%;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn:hover {
  border-color: var(--ink-3);
}

.btn:active {
  transform: translateY(1px);
}

/* The primary button is the logo capsule: dark ground, green outline. */
.btn.primary {
  background: var(--plate);
  border: 2px solid var(--rec);
  color: var(--plate-ink);
}

.btn.primary:hover {
  background: var(--plate-2);
  border-color: var(--rec);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn small {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

/* ---------- Landing: hero ---------- */

.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

/* One face, two voices: the instruction runs wide and black like a panel
   label; the promise drops to text width. */
.hero h1 {
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.hero h1 .land {
  display: block;
  margin-top: 0.3em;
  font-size: 0.6em;
  font-weight: 650;
  font-stretch: 100%;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.lede {
  max-width: 34em;
  margin: 24px 0 32px;
  color: var(--ink-2);
  font-size: clamp(1.04rem, 1.3vw, 1.15rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cta-note {
  margin: 18px 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* ---------- Landing: the stage (hero demo) ---------- */

.hero-demo {
  margin: 0;
  min-width: 0;
}

.stage-wrap {
  position: relative;
}

/* The stage is a plate of the logo ground in both themes, so the capsule on
   it reads exactly like the mark. */
.stage {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 10px;
  border: 1px solid var(--plate-line);
  background: var(--plate);
  overflow: hidden;
  isolation: isolate;
}

.win {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 8%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 0.8rem;
  color: var(--ink-3);
}

.win-title {
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-ctl {
  display: flex;
  gap: 12px;
  flex: none;
}

.win-ctl i {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink-3);
  border-radius: 2px;
  opacity: 0.7;
}

.win-ctl i:first-child {
  height: 0;
  border-width: 0 0 1.5px;
  align-self: center;
  border-radius: 0;
}

.win-body {
  min-height: 9.5em;
  padding: 16px 18px 20px;
  font-size: clamp(0.88rem, 1.35vw, 1.02rem);
  line-height: 1.55;
  color: var(--ink);
}

.win-body .ctx {
  color: var(--ink-3);
  margin: 0 0 0.6em;
}

.win-body.term {
  font-family: var(--mono);
  font-size: clamp(0.74rem, 1.1vw, 0.86rem);
  font-stretch: 87.5%;
  background: var(--plate-2);
  color: var(--plate-ink);
}

.win-body.term .ctx {
  color: var(--plate-ink-2);
}

.win-body.term .ps {
  color: var(--rec);
}

.win-body.term .caret {
  background: var(--plate-ink);
}

.typed {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--ink);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.capsule {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: min(280px, 72%);
  aspect-ratio: 280 / 64;
  transform: translateX(-50%) translateY(10px) scale(0.96);
  opacity: 0;
  border-radius: 999px;
  background: var(--capsule);
  /* Matches the logo: green outline, blue bars. */
  border: 2px solid var(--rec);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.capsule.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.capsule canvas {
  position: absolute;
  inset: 18.75% 2.86%;
  width: 94.28%;
  height: 62.5%;
}

/* Below the stage: the keys and the state indicator. */
.stage-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 16px;
}

.keys {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.keys kbd {
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
}

.keys.down kbd {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--line);
  background: color-mix(in srgb, var(--rec) 28%, var(--surface));
}

/* A three-cell indicator, like a hardware status strip. Each state has its
   own mark (solid, dashed, tick) so it reads without colour. */
.rail {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 650;
  font-stretch: 110%;
}

.rail li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: var(--ink-3);
  transition: color 0.2s, background-color 0.2s;
}

.rail li + li {
  border-left: 1px solid var(--line);
}

.rail li::before,
.beats .num::before {
  content: "";
  flex: none;
  width: 14px;
  height: 3px;
  background: currentColor;
}

.rail li[data-s="proc"]::before,
.beats li:nth-child(2) .num::before {
  background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 5.5px);
}

.rail li[data-s="ok"]::before,
.beats li:nth-child(3) .num::before {
  width: 10px;
  height: 5px;
  margin: 0 2px 3px;
  background: none;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.rail li.on {
  background: var(--surface);
}

.rail li.on[data-s="rec"] {
  color: var(--rec-ink);
}

.rail li.on[data-s="proc"] {
  color: var(--proc-ink);
}

.rail li.on[data-s="ok"] {
  color: var(--ok-ink);
}

.stage-pause {
  position: absolute;
  top: auto;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--plate-line);
  background: var(--plate-2);
  color: var(--plate-ink-2);
  cursor: pointer;
}

.stage-pause:hover {
  color: var(--plate-ink);
}

.stage-pause svg {
  width: 14px;
  height: 14px;
}

.stage-pause[hidden] {
  display: none;
}

/* ---------- Landing: sections ---------- */

.section {
  padding: clamp(64px, 9vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section.alt {
  background: var(--bg-2);
}

/* Side heads, as in a manual: the heading owns the left column. */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 48px;
  align-items: start;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  font-weight: 850;
  font-stretch: 115%;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0.35em 0 0;
  color: var(--ink-2);
  max-width: 36em;
}

/* How it works: three beats under one heavy rule. */
.beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.beats li {
  padding: 22px 28px 8px 0;
}

.beats li + li {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.beats .num {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 650;
}

.beats li:nth-child(1) .num {
  color: var(--rec-ink);
}

.beats li:nth-child(2) .num {
  color: var(--proc-ink);
}

.beats li:nth-child(3) .num {
  color: var(--ok-ink);
}

.beats .num::before {
  width: 22px;
  height: 4px;
}

.beats h3 {
  margin: 10px 0 10px;
  font-size: 1.3rem;
}

.beats p {
  color: var(--ink-2);
  margin: 0 0 0.6em;
}

/* Why: a ruled spec sheet, two columns of entries. */
.why {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(28px, 5vw, 64px);
}

.card {
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 750;
  font-stretch: 110%;
  margin-bottom: 8px;
}

.card p {
  margin: 0;
  color: var(--ink-2);
  max-width: 36em;
}

.card p + p {
  margin-top: 0.7em;
}

.card.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-rows: auto 1fr;
  gap: 0 clamp(28px, 5vw, 64px);
  padding-bottom: 40px;
  border-top: 2px solid var(--ink);
}

.card.wide > h3,
.card.wide > p {
  grid-column: 1;
}

/* Two-provider timing diagram, drawn on a plate. */
.flow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  align-items: end;
  padding: 22px 22px 14px;
  border-radius: 8px;
  background: var(--plate);
}

.card.wide > .flow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

.flow .who {
  font-size: 0.8rem;
  font-weight: 650;
  font-stretch: 112%;
  line-height: 1;
  color: var(--plate-ink);
}

.flow .lane {
  position: relative;
  height: 14px;
  border-bottom: 1px solid var(--plate-line);
}

.flow .lane span {
  position: absolute;
  bottom: 3px;
  height: 9px;
}

.flow .lane.dg span {
  left: 0;
  right: 22%;
  background: repeating-linear-gradient(90deg, var(--rec) 0 2px, transparent 2px 6px);
}

.flow .lane.gq span {
  left: 78%;
  right: 0;
  background: var(--proc);
}

.flow .lane.out span {
  left: 86%;
  right: 0;
  background: var(--ok);
}

.flow .axis {
  grid-column: 2;
  position: relative;
  height: 1.6em;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--plate-ink-2);
}

.flow .axis span {
  position: absolute;
  top: 2px;
  left: 0;
}

.flow .axis .stop {
  left: 78%;
  transform: translateX(-50%);
}

/* Install: one selector, then a numbered procedure. The tabs carry the
   channel, so nothing beside them repeats the list. */
.tabs {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.tablist {
  display: none;
}

/* One row of equal tabs, however many systems a page lists. */
.js .tablist {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.tablist button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 48px;
  padding: 14px 18px 12px;
  border: 0;
  border-radius: 0;
  background: var(--bg-2);
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.tablist .os {
  font-size: 0.98rem;
  font-weight: 750;
  font-stretch: 110%;
  line-height: 1.2;
}

.tablist .via {
  font-size: 0.78rem;
  color: var(--ink-3);
}

.tablist button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tablist button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--ink);
}

.tabpanel {
  padding: 24px clamp(16px, 3vw, 30px) 30px;
}

.tabpanel + .tabpanel {
  border-top: 1px solid var(--line);
}

.js .tabpanel + .tabpanel {
  border-top: 0;
}

.tabpanel[hidden] {
  display: none;
}

.tabpanel > h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.js .tabpanel > h3.panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.meta {
  margin: 0 0 22px;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.procedure {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px clamp(24px, 4vw, 48px);
}

.procedure.stacked {
  grid-template-columns: minmax(0, 1fr);
}

.step {
  min-width: 0;
}

.step > :last-child {
  margin-bottom: 0;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-weight: 750;
  font-stretch: 110%;
  font-size: 1rem;
}

.step-label .n {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.74rem;
  font-weight: 800;
  font-stretch: 100%;
}

.agent-install {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px clamp(24px, 4vw, 48px);
  align-items: start;
  margin-top: 36px;
}

.agent-install h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.agent-install .small {
  margin: 0;
}

.agent-install .code {
  margin: 0;
}

.install-notes {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

.small {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.fp {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.fp b {
  color: var(--ink-2);
  font-weight: 600;
}

details.more {
  margin-top: 14px;
  margin-bottom: 1em;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}

details.more > summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-2);
}

details.more[open] > summary {
  color: var(--ink);
}

details.more > :last-child {
  margin-bottom: 14px;
}

.dl-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 4px 0 18px;
}

/* Code blocks */
.code {
  position: relative;
  margin: 0 0 12px;
  border: 1px solid var(--plate-line);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
}

.code pre {
  margin: 0;
  padding: 14px 16px;
  padding-right: 64px;
  overflow-x: auto;
  color: var(--code-ink);
  font-size: 0.84rem;
  line-height: 1.7;
  tab-size: 2;
}

.code .p {
  color: var(--rec);
  user-select: none;
}

.code .c {
  color: var(--plate-ink-2);
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--plate-line);
  border-radius: 999px;
  background: var(--plate-2);
  color: var(--plate-ink-2);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
}

.js .copy {
  display: inline-block;
}

.copy:hover {
  color: var(--plate-ink);
}

.copy.ok {
  color: var(--rec);
  border-color: color-mix(in srgb, var(--rec) 50%, transparent);
}

/* Copy sits in its own strip above the commands, so a long command that
   scrolls sideways never slides under it. */
.js .code pre {
  padding-top: 42px;
  padding-right: 16px;
}

/* A prompt you paste into a coding agent: prose, so it wraps and reads in the
   text face. Copy still takes the text verbatim (site.js). */
.code.prompt pre,
.js .code.prompt pre {
  padding-top: 14px;
  padding-right: 92px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-stretch: 100%;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-label {
  margin: 20px 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  font-stretch: 112%;
  color: var(--ink-2);
}

/* Keys strip */
.byok {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.byok p {
  color: var(--ink-2);
}

.provider-list {
  display: grid;
  gap: 0;
  border-top: 2px solid var(--ink);
  margin: 0;
  padding: 0;
  list-style: none;
}

.byok-body {
  margin-top: 18px;
}

.sw-rec {
  background: var(--rec);
}

.sw-proc {
  background: var(--proc);
}

.sw-ok {
  background: var(--ok);
}

.sw-fail {
  background: var(--fail);
}

.sw-idle {
  background: var(--ink-3);
}

.provider-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

/* Same marks as the state strip: Deepgram streams, Groq finishes. */
.provider-list .sw {
  grid-row: span 2;
  width: 22px;
  height: 4px;
  margin-top: 11px;
}

.provider-list .sw-rec {
  background: repeating-linear-gradient(90deg, var(--rec) 0 2px, transparent 2px 5px);
}

.provider-list strong {
  font-size: 1.02rem;
}

.provider-list span:last-child {
  color: var(--ink-2);
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--line-2);
  color: var(--ink-3);
  font-size: 0.9rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.foot-grid h2 {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 750;
  font-stretch: 118%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.foot-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-grid li {
  padding: 3px 0;
}

.foot-grid a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot-grid a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.foot-brand p {
  margin: 14px 0 0;
  max-width: 30em;
}

.foot-key {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

/* ---------- Docs ---------- */

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: 40px;
  padding-bottom: 80px;
}

.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.docs-nav h2 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 750;
  font-stretch: 118%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.docs-nav ul + h2 {
  margin-top: 22px;
}

.docs-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.docs-nav a {
  display: block;
  margin-left: -1px;
  padding: 7px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 0.95rem;
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--ink);
}

.docs-nav a[aria-current="page"] {
  border-left-color: var(--ink);
  color: var(--ink);
  font-weight: 650;
}

.doc {
  max-width: 46rem;
  min-width: 0;
}

.doc h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 850;
  font-stretch: 115%;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

/* Prose stops near 75 characters; code and tables keep the full column. */
.doc p {
  max-width: 40rem;
}

.doc .lead {
  font-size: 1.15rem;
  color: var(--ink-2);
  margin-bottom: 1.6em;
}

/* Each section opens under a rule, like a chapter of a manual. */
.doc h2 {
  margin: 2.2em 0 0.6em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  font-size: 1.55rem;
  font-weight: 800;
  font-stretch: 112%;
}

.doc h3 {
  margin: 1.7em 0 0.5em;
  font-size: 1.15rem;
  font-weight: 750;
  font-stretch: 108%;
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

.doc li {
  margin: 0.3em 0;
}

.doc li::marker {
  color: var(--ink-3);
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 2.4em 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.94rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.2em;
}

.table-scroll table {
  margin: 0;
  min-width: 34rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}

.doc th {
  font-size: 0.74rem;
  font-weight: 750;
  font-stretch: 118%;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
}

.doc td:first-child {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  vertical-align: 0.2em;
}

.badge.soon {
  color: var(--proc-ink);
  border-color: color-mix(in srgb, var(--proc) 45%, transparent);
}

/* A note is a tinted panel with a hairline in its state colour: blue for a
   note, green for a tip, red for a warning. */
.callout {
  --tone: var(--proc);
  margin: 1.2em 0 1.4em;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--tone) 45%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--tone) 9%, var(--surface));
  font-size: 0.97rem;
}

.callout p:last-child {
  margin: 0;
}

.callout strong:first-child {
  color: var(--ink);
}

.callout.tip {
  --tone: var(--rec);
}

.callout.warn {
  --tone: var(--fail);
}

.doc figure.shot {
  margin: 1.2em 0 1.8em;
}

.doc figure.shot img {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17191d;
}

.doc figure.shot figcaption {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 0.92rem;
}

ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

/* A numbered procedure: ink badges joined by a hairline, the same badge as
   the install steps on the landing page. */
ol.steps > li {
  position: relative;
  margin: 0;
  padding: 0 0 1.1em 44px;
  counter-increment: step;
}

ol.steps > li > :last-child {
  margin-bottom: 0;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 800;
}

ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12.5px;
  top: 33px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

ol.steps > li > h3:first-child {
  margin-top: 0;
  line-height: 28px;
}

.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin: 1.5em 0;
  padding: 0;
  list-style: none;
}

/* The docs index: ruled entries, not boxed cards. */
.doc-cards a {
  display: block;
  height: 100%;
  padding: 14px 0 16px;
  border-top: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}

.doc-cards a:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-cards strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 750;
  font-stretch: 108%;
}

.doc-cards span {
  color: var(--ink-2);
  font-size: 0.93rem;
}

.state-list {
  display: grid;
  gap: 0;
  margin: 1em 0 1.4em;
  border-top: 1px solid var(--line);
  padding: 0;
  list-style: none;
}

/* Ruled rows with the landing page's state marks: solid, dashed, tick. */
.state-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 16px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.state-list .sw {
  grid-row: span 2;
  width: 22px;
  height: 4px;
  margin-top: 11px;
}

.state-list .sw-proc {
  background: repeating-linear-gradient(90deg, var(--proc) 0 3px, transparent 3px 5.5px);
}

.state-list .sw-ok {
  width: 12px;
  height: 6px;
  margin: 7px 0 0 4px;
  background: none;
  border: solid var(--ok);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.state-list span:last-child {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.pager a {
  display: flex;
  flex-direction: column;
  max-width: 48%;
  padding: 4px 0;
  color: var(--ink);
  font-weight: 700;
  font-stretch: 108%;
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pager small {
  color: var(--ink-3);
  font-size: 0.74rem;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

.doc [id] {
  scroll-margin-top: 88px;
}

.doc ul.doc-cards,
.doc ul.state-list {
  padding-left: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 2em;
}

.toc a {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.88rem;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.terms {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 22px;
  margin: 0 0 1.4em;
}

.terms dt {
  font-weight: 750;
  font-stretch: 108%;
}

.terms dd {
  margin: 0;
  color: var(--ink-2);
}

.doc ol.steps .btn {
  margin: 4px 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero .wrap,
  .procedure,
  .agent-install,
  .byok,
  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .card.wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .card.wide > .flow {
    grid-column: 1;
    grid-row: auto;
    margin-top: 22px;
  }

  .foot-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .foot-brand {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 24px;
  }

  .docs-nav {
    position: static;
    max-height: none;
    overflow: visible;
  }

  /* One run of chips across all groups; the group labels drop out. */
  .docs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .docs-nav h2 {
    display: none;
  }

  .docs-nav ul,
  .docs-nav li {
    display: contents;
  }

  .docs-nav a {
    margin: 0;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
  }

  .docs-nav a[aria-current="page"] {
    border-color: var(--rec);
    background: color-mix(in srgb, var(--rec) 12%, transparent);
  }
}

@media (max-width: 640px) {
  /* Under the nav chips, the page's own contents read as a plain link row. */
  .toc {
    gap: 4px 16px;
  }

  .toc a {
    padding: 2px 0;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .js .code.prompt pre {
    padding-top: 42px;
    padding-right: 16px;
  }

  body {
    font-size: 1rem;
  }

  .js .tablist {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* An odd last tab takes the whole row instead of leaving a gap. */
  .tablist button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .tablist button {
    padding: 10px 14px 9px;
  }

  .beats {
    grid-template-columns: minmax(0, 1fr);
  }

  .beats li,
  .beats li + li {
    padding: 20px 0 14px;
    border-left: 0;
  }

  .beats li + li {
    border-top: 1px solid var(--line);
  }

  .why {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail li {
    padding: 6px 9px;
  }

  .stage {
    aspect-ratio: 4 / 4.1;
  }

  .win {
    left: 5%;
    right: 5%;
    top: 6%;
  }

  .doc-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .terms {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .terms dd {
    margin-bottom: 10px;
  }

  /* Tables stack into one card per row; the first cell is the row's title. */
  .table-scroll {
    overflow: visible;
  }

  .doc .table-scroll table {
    min-width: 0;
  }

  .doc .table-scroll thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .doc .table-scroll table,
  .doc .table-scroll tbody,
  .doc .table-scroll tr,
  .doc .table-scroll td {
    display: block;
  }

  .doc .table-scroll tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-2);
  }

  .doc .table-scroll td {
    padding: 2px 0;
    border: 0;
    white-space: normal;
  }

  .doc .table-scroll td:first-child {
    font-weight: 650;
    white-space: normal;
  }

  .doc .table-scroll td + td {
    color: var(--ink-2);
  }

  .doc .table-scroll table:has(th:nth-child(3)) td + td::before {
    content: attr(data-label) " · ";
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-3);
  }

  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-brand {
    grid-column: span 1;
  }

  .pager {
    flex-direction: column;
  }

  .pager a,
  .pager .next {
    max-width: none;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .caret {
    animation: none;
  }
}
