/* ==========================================================================
   DeskVNC hub, shared stylesheet.

   One design system, four pages. Every visual value below resolves to a token
   declared at the top of this file. If a page needs a colour, a space or a
   size that is not here, the token gets added here first.

   Color      Light and dark pairs from prefers-color-scheme. One ink with two
              muted steps, one accent used sparingly, one focus ring that stays
              visible in both themes, one signal colour for verified material.
   Type       System stacks only, so the pages make zero network requests.
              1.2 modular scale. Mono is reserved for code, labels and metrics.
   Space      4px base scale, --space-1 through --space-9.
   Shape      Tight radii and 1px rules. An instrument, not a poster.
   Texture    A faint 1px grid on the hero, drawn with a gradient rather than
              an image so it costs no request and scales cleanly.
   Motion     Colour transitions only, plus a short reveal. prefers-reduced-
              motion removes both.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* ---------------------------------------------------------------- type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.25rem;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-code: 1.55;

  --tracking-tight: -0.02em;
  --tracking-label: 0.09em;

  /* -------------------------------------------------------------- space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.75rem;
  --space-7: 2.5rem;
  --space-8: 3.5rem;
  --space-9: 5rem;

  /* -------------------------------------------------------------- shape */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --border-w: 1px;
  --rule-w: 2px;

  /* ----------------------------------------------------------- measures */
  --measure: 68ch;
  --page-max: 76rem;
  --prose-max: 46rem;

  /* ------------------------------------------------------------- colour */
  --bg: #fbfcfd;
  --bg-subtle: #f2f5f8;
  --bg-inset: #e9eef3;
  --bg-code: #f4f7fa;

  --fg: #12161c;
  --fg-muted: #414b57;
  --fg-faint: #5d6875;

  --border: #ccd5de;
  --border-strong: #9aa7b4;

  --accent: #0a58c2;
  --accent-hover: #074698;
  --accent-fg: #ffffff;
  --accent-soft: rgba(10, 88, 194, 0.09);
  --accent-line: rgba(10, 88, 194, 0.32);

  --focus: #b1450a;
  --signal: #1a6f42;
  --signal-soft: rgba(26, 111, 66, 0.1);
  --note-bg: rgba(10, 88, 194, 0.06);

  --grid-line: rgba(18, 22, 28, 0.055);
  --shadow-card: 0 1px 2px rgba(18, 22, 28, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f13;
    --bg-subtle: #131820;
    --bg-inset: #090c10;
    --bg-code: #10151c;

    --fg: #e6ecf3;
    --fg-muted: #b0bcc9;
    --fg-faint: #8e9baa;

    --border: #2c3641;
    --border-strong: #4a5764;

    --accent: #74b0ff;
    --accent-hover: #a2cdff;
    --accent-fg: #06121f;
    --accent-soft: rgba(116, 176, 255, 0.13);
    --accent-line: rgba(116, 176, 255, 0.34);

    --focus: #ffb057;
    --signal: #5fd39b;
    --signal-soft: rgba(95, 211, 155, 0.13);
    --note-bg: rgba(116, 176, 255, 0.09);

    --grid-line: rgba(230, 236, 243, 0.05);
    --shadow-card: none;
  }
}

/* ==========================================================================
   Reset and base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-7);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-weight: 660;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: clamp(var(--text-xl), 1.1rem + 2.4vw, var(--text-3xl));
}

h2 {
  font-size: clamp(var(--text-lg), 1rem + 1vw, var(--text-2xl));
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-md);
}

p,
ul,
ol,
dl,
figure,
table {
  margin: 0 0 var(--space-4);
}

p,
li {
  max-width: var(--measure);
}

li + li {
  margin-top: var(--space-2);
}

ul,
ol {
  padding-left: var(--space-5);
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 650;
}

hr {
  height: 0;
  margin: var(--space-7) 0;
  border: 0;
  border-top: var(--border-w) solid var(--border);
}

small {
  font-size: var(--text-sm);
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Focus is never removed, only restyled, and the ring is its own colour so it
   reads against the accent on every surface. */
:focus-visible {
  outline: var(--rule-w) solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Code
   ========================================================================== */

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.88em;
  background: var(--bg-inset);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.08em 0.34em;
  overflow-wrap: break-word;
}

a code {
  color: inherit;
}

pre {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg-code);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-code);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

pre code {
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
}

/* A block with a label gets the label as a header strip, drawn with a
   gradient border so no extra element or image is needed. */
.code {
  margin-block: var(--space-4);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-code);
  overflow: hidden;
}

.code > figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-w) solid var(--border);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.code > figcaption::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.code > figcaption .tag {
  margin-left: auto;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}

.code > pre {
  border: 0;
  border-radius: 0;
  background: none;
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

kbd {
  font-size: 0.82em;
  background: var(--bg-subtle);
  border: var(--border-w) solid var(--border-strong);
  border-bottom-width: var(--rule-w);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.4em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: var(--space-6);
  }
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: 0;
  z-index: 20;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  border: var(--rule-w) solid var(--focus);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  /* Fully clear of the viewport until focused: a percentage of its own height
     keeps it hidden at any text size, unlike a hand-picked offset. */
  transform: translateY(-150%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(var(--space-3));
}

/* ==========================================================================
   Site header and navigation
   ========================================================================== */

.masthead {
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--border-w) solid var(--border);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-decoration: none;
}

.brand .brand-mark {
  color: var(--accent);
}

.brand .brand-sub {
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--fg-faint);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.nav li {
  margin: 0;
}

.nav a {
  display: inline-block;
  padding: var(--space-1) 0;
  color: var(--fg-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 620;
}

.nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: var(--rule-w);
  margin-top: 2px;
  background: var(--accent);
}

@media (max-width: 34rem) {
  .brand .brand-sub {
    display: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  border-bottom: var(--border-w) solid var(--border);
  padding-block: var(--space-7) var(--space-6);
  overflow: hidden;
}

/* Faint drafting grid, drawn rather than fetched. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--space-6) var(--space-6);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

@media (min-width: 62rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.85fr);
    align-items: start;
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.kicker::before {
  content: "";
  width: 1.25rem;
  height: var(--rule-w);
  background: var(--accent);
}

.hero h1 {
  max-width: 22ch;
  margin-bottom: var(--space-4);
}

.lede {
  max-width: 60ch;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--fg-muted);
}

.lede strong {
  color: var(--fg);
}

.plain-sentence {
  max-width: 60ch;
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-left: var(--rule-w) solid var(--accent);
  background: var(--note-bg);
  font-size: var(--text-base);
  color: var(--fg);
}

.plain-sentence .label {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

/* The instrument panel beside the pitch: the verified numbers, at rest. */
.readout {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-w) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.readout-head .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--signal);
}

.readout dl {
  margin: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.readout .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
  border-bottom: var(--border-w) solid var(--border);
}

.readout .row:last-child {
  border-bottom: 0;
}

.readout dt {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.readout dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
  text-align: right;
  white-space: nowrap;
}

.readout dd .unit {
  font-weight: 400;
  color: var(--fg-faint);
}

.hero-foot {
  margin: var(--space-3) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--fg-faint);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-5) 0;
  padding: 0;
  list-style: none;
}

.actions li {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  min-height: 2.5rem;
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 620;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease;
}

.btn:hover {
  border-color: var(--fg-faint);
  background: var(--bg-subtle);
  color: var(--fg);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.btn .arrow {
  font-family: var(--font-mono);
  opacity: 0.7;
}

/* ==========================================================================
   Page sections
   ========================================================================== */

main {
  display: block;
}

.section {
  padding-block: var(--space-6);
  border-bottom: var(--border-w) solid var(--border);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  margin-bottom: var(--space-5);
}

.section-head p {
  max-width: var(--measure);
  color: var(--fg-muted);
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

.page-head {
  padding-block: var(--space-6) var(--space-5);
  border-bottom: var(--rule-w) solid var(--accent);
}

.page-head h1 {
  max-width: 26ch;
}

.page-head .lede {
  margin-bottom: 0;
}

/* ==========================================================================
   Cards and grids
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

@media (min-width: 42rem) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 42rem) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  margin: 0;
  padding: var(--space-4);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-card);
}

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

.card h3 {
  margin-top: 0;
  font-size: var(--text-md);
}

.card p,
.card ul,
.card ol {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.card .code {
  background: var(--bg);
}

/* A card whose title carries a two digit number, as in the guides index. */
.num {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  color: var(--accent);
}

/* ==========================================================================
   Metric tiles
   ========================================================================== */

.metrics {
  display: grid;
  gap: var(--border-w);
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
  overflow: hidden;
}

@media (min-width: 38rem) {
  .metrics-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 58rem) {
  .metrics-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.metrics li {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg);
}

.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--fg);
}

.metric-value .unit {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--fg-faint);
  letter-spacing: 0;
}

.metric-label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* ==========================================================================
   Guides: sticky index beside the prose
   ========================================================================== */

.guide-layout {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 64rem) {
  .guide-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: var(--space-7);
  }
}

.toc {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: var(--space-3) var(--space-4) var(--space-4);
}

@media (min-width: 64rem) {
  .toc {
    position: sticky;
    top: calc(var(--space-9) + var(--space-2));
    max-height: calc(100vh - var(--space-9) - var(--space-5));
    overflow-y: auto;
  }
}

.toc h2 {
  margin: 0 0 var(--space-2);
  padding: 0;
  border: 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide;
}

.toc li {
  margin: 0;
}

.toc li + li {
  margin-top: 1px;
}

.toc a {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--fg-muted);
  text-decoration: none;
}

.toc a::before {
  counter-increment: guide;
  content: counter(guide, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-faint);
}

.toc a:hover {
  background: var(--bg);
  color: var(--fg);
}

/* ==========================================================================
   Guide sections
   ========================================================================== */

.guide {
  padding-block: var(--space-6);
  border-bottom: var(--border-w) solid var(--border);
}

.guide:first-child {
  padding-top: 0;
}

.guide:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.guide > h2 {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.guide > h2 .index {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  color: var(--accent);
}

.guide > h2 .index::after {
  content: " /";
  color: var(--fg-faint);
}

.guide .answer {
  font-size: var(--text-md);
  color: var(--fg-muted);
}

.subhead {
  margin-top: var(--space-5);
  padding-top: var(--space-1);
  font-size: var(--text-md);
  font-weight: 660;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}

.subhead::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: var(--rule-w);
  margin-right: var(--space-2);
  vertical-align: 0.2em;
  background: var(--accent);
}

/* The call list an MCP client receives, rendered as an ordered list of
   tools rather than prose. */
.call-list {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  border-top: var(--border-w) solid var(--border);
}

.call-list > li {
  margin: 0;
  padding: var(--space-3) 0;
  border-bottom: var(--border-w) solid var(--border);
}

.call-list > li:last-child {
  border-bottom: 0;
}

.call {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg);
  background: var(--bg-inset);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.4em;
}

.call-list p {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Definition rows for arguments: name, type, then the note. */
.args {
  margin: 0 0 var(--space-4);
  border-top: var(--border-w) solid var(--border);
}

.args > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  padding-block: var(--space-2);
  border-bottom: var(--border-w) solid var(--border);
}

@media (min-width: 48rem) {
  .args > div {
    grid-template-columns: minmax(9rem, 0.4fr) minmax(0, 1fr);
  }
}

.args dt {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg);
  overflow-wrap: break-word;
}

.args dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.args .type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--fg-faint);
}

/* ==========================================================================
   Notes and callouts
   ========================================================================== */

.note {
  margin-block: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: var(--border-w) solid var(--border);
  border-left: var(--rule-w) solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--note-bg);
  font-size: var(--text-sm);
}

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

.note .note-label {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

.note-signal {
  border-left-color: var(--signal);
  background: var(--signal-soft);
}

.note-signal .note-label {
  color: var(--signal);
}

/* Numbered rules the plane enforces, shown as a fenced list. */
.rules {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rules > li {
  margin: 0;
  padding: var(--space-3) 0 var(--space-3) var(--space-6);
  position: relative;
  counter-increment: rule;
  border-top: var(--border-w) solid var(--border);
  font-size: var(--text-sm);
}

.rules > li:last-child {
  border-bottom: var(--border-w) solid var(--border);
}

.rules > li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: var(--space-3);
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-inset);
  border: var(--border-w) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--fg-muted);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-scroll {
  margin-block: var(--space-4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
}

table.spec {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

table.spec caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-w) solid var(--border);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

table.spec th,
table.spec td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-w) solid var(--border);
}

table.spec thead th {
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

table.spec tbody th {
  font-weight: 620;
  color: var(--fg);
}

table.spec tbody th code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 1em;
  font-weight: inherit;
}

table.spec td {
  color: var(--fg-muted);
}

table.spec tbody tr:last-child th,
table.spec tbody tr:last-child td {
  border-bottom: 0;
}

table.spec tbody tr:hover th,
table.spec tbody tr:hover td {
  background: var(--accent-soft);
}

table.spec .num-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}

/* The figure column carries the weight, so it is the one held in ink. */
table.spec .figure {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}

/* ==========================================================================
   Use cases
   ========================================================================== */

.case {
  padding-block: var(--space-6);
  border-bottom: var(--border-w) solid var(--border);
}

.case:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.case > h2 {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.case .case-index {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  color: var(--accent);
}

.case .case-index::after {
  content: " /";
  color: var(--fg-faint);
}

.case-lede {
  max-width: var(--measure);
  font-size: var(--text-md);
  color: var(--fg-muted);
}

.facts {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 var(--space-4);
}

@media (min-width: 58rem) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--border-w);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-md);
    background: var(--border);
    overflow: hidden;
  }
}

.facts > div {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg-subtle);
}

.facts dt {
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

.facts dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.facts dd p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: var(--rule-w) solid var(--accent);
  background: var(--bg-subtle);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  padding-block: var(--space-6);
}

@media (min-width: 52rem) {
  .site-footer .wrap {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

.site-footer h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.site-footer p {
  max-width: 52ch;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-1) var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  font-size: var(--text-sm);
}

.footer-links li {
  margin: 0;
}

.site-footer .colophon {
  grid-column: 1 / -1;
  padding-top: var(--space-4);
  border-top: var(--border-w) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-faint);
}

/* ==========================================================================
   Progressive reveal, motion and print
   ========================================================================== */

.reveal {
  animation: rise 320ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .skip-link {
    transition: none;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --bg-subtle: #ffffff;
    --bg-inset: #f4f4f4;
    --bg-code: #f7f7f7;
    --fg: #000000;
    --fg-muted: #333333;
    --fg-faint: #444444;
    --accent: #000000;
    --focus: #000000;
    --signal: #000000;
    --accent-soft: transparent;
    --note-bg: #ffffff;
    --signal-soft: #ffffff;
    --shadow-card: none;
  }

  .masthead,
  .actions,
  .toc,
  .skip-link {
    display: none;
  }

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

  .code,
  .card,
  .call-list,
  pre {
    break-inside: avoid;
  }
}
/* ============================================================ screenshots
   Real product screenshots. Same tokens as everything else: 1px rule, tight
   radius, mono uppercase caption. aspect-ratio reserves the box so nothing
   shifts while an image decodes, and loading=lazy keeps the first paint light.
   ====================================================================== */

.shot {
  margin: var(--space-6) 0;
}

.shot > img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  box-shadow: var(--shadow-card);
}

.shot > figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.shot > figcaption::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--signal);
}

.shot > figcaption .tag {
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.shot-wide > img {
  aspect-ratio: 1900 / 803;
  object-fit: cover;
  object-position: center;
}

/* Brand mark in the masthead, sized to sit on the text baseline. */
.brand-mark img,
.brand-mark svg {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-right: 0.4em;
}
