/*
 * "Cosmic Precision Instrument" palette as CSS custom properties, repainted on
 * the Warp reference neutrals: a strict monochrome scale from obsidian to bone,
 * with hierarchy by luminance only. Depth levels run L0 obsidian to L4 slate
 * deep, and the text scale is warm rather than cool, so pure white is left to
 * the starlight accent alone.
 * Tokens marked "site-only" paint the starfield, the glass surfaces and the
 * code blocks. THIS IS THE ONLY FILE ALLOWED TO CONTAIN COLOUR LITERALS,
 * AND NONE OF THEM MAY CARRY A HUE (tests/html.test.ts enforces both).
 */
:root {
  color-scheme: dark;

  --bg: #000000;                          /* L0 obsidian: page background */
  --surface: #121212;                     /* L1 graphite: troughs, inset fields */
  --surface-card: #1e1e1d;                /* L2 onyx: cards and modules */
  --frame-surface: #333333;               /* L3 carbon: window chrome, active cards */
  --surface-raised: #40403f;              /* L4 slate deep: raised toggles, hover strata */
  --element-hover: rgb(255 255 255 / 0.06);   /* row hover: opacity adapts to the surface under it */
  --element-active: rgb(255 255 255 / 0.10);
  --border: #1e1e1d;                      /* onyx hairline */
  --border-strong: #333333;               /* carbon: interactive and structural edge */
  --border-hover: #b4b4b2;                /* ash mid: hovered edge */
  --text-full: #faf9f6;                   /* bone: headlines, primary data */
  --text: #b4b4b2;                        /* ash mid: body copy */
  --text-muted: #a0a0a0;                  /* ash mute: explanatory copy, where ash reads too dim */
  --text-faint: #666469;                  /* iron: units, timestamps, standby */
  --solid: #ffffff;                       /* primary actuator */
  --solid-hover: #e3e2e0;                 /* ash light: the actuator under the pointer */
  --on-solid: #080808;                    /* ink */
  --accent: #868684;
  --ring: #ffffff;                        /* focus: white, never coloured */
  --code-wash: rgb(255 255 255 / 0.08);
  /* Optical states, no chromatic coding: nominal is starlight with a halo
     (--dot-glow), alert is starlight that pulses, standby is --text-faint. */
  --success: #ffffff;
  --success-muted: #f0f0f0;
  --warning: #ffffff;
  --danger: #ffffff;
  --busy: #ffffff;
  --starlight: #ffffff;                   /* the one accent: pure luminous energy */
  --starlight-wash: color-mix(in srgb, var(--starlight) 7%, var(--surface));
  --starlight-border: color-mix(in srgb, var(--starlight) 28%, var(--border));
  --starlight-halo: color-mix(in srgb, var(--starlight) 16%, transparent);
  --terminal-surface: var(--surface);

  /* site-only: the starfield behind every page and the glass that sits on it */
  --star: rgb(255 255 255 / 0.9);         /* site-only, bright star */
  --star-dim: rgb(255 255 255 / 0.55);    /* site-only, faint star */
  --glow: rgb(255 255 255 / 0.045);       /* site-only, page glow */
  --glow-2: rgb(198 198 202 / 0.024);     /* site-only, cool page glow */
  --glass: rgb(0 0 0 / 0.85);             /* site-only, header and footer, over L0 */
  --glass-deep: rgb(18 18 18 / 0.9);      /* site-only, window chrome and rails, over L1 */
  --code-bg: #121212;                     /* site-only, code block body = L1 */
  --shadow-node: 0 0 14px 3px rgb(255 255 255 / 0.7), 0 0 28px 6px rgb(255 255 255 / 0.3); /* site-only */
  --shadow-node-dim: 0 0 8px 1px rgb(255 255 255 / 0.25);                             /* site-only */
  --shadow-glow: 0 0 12px rgb(255 255 255 / 0.04);                                    /* site-only */
  --spine-top: rgb(255 255 255 / 0.7);    /* site-only, timeline spine start */
  --spine-end: rgb(255 255 255 / 0.02);   /* site-only, timeline spine end */
  --dot-glow: 0 0 8px rgb(255 255 255 / 0.4);                                         /* site-only, nominal halo */
  --mask-keep: #000;                      /* site-only, opaque stop of a mask-image */
  --mask-fade: #0000;                     /* site-only, transparent stop of a mask-image */

  /* shiki "css-variables" theme, monochrome: hierarchy by value */
  --astro-code-foreground: var(--text);
  --astro-code-background: var(--code-bg);
  --astro-code-token-constant: var(--text-full);
  --astro-code-token-string: var(--text-full);
  --astro-code-token-comment: var(--text-faint);
  --astro-code-token-keyword: var(--text-full);
  --astro-code-token-parameter: var(--text);
  --astro-code-token-function: var(--text-full);
  --astro-code-token-string-expression: var(--text-full);
  --astro-code-token-punctuation: var(--text-muted);
  --astro-code-token-link: var(--text-full);

  /* Shape: sharp. Every corner is square; the tokens stay so components need no edit. */
  --radius: 0; --radius-chip: 0; --radius-control: 0; --radius-panel: 0;
  --radius-toast: 0; --radius-pill: 0; --radius-composer: 0;

  /* Rhythm: 4/8 modular base. The numbered tokens and the spec's names are one scale. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --space-2xs: 2px; --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-base: 16px;
  --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px; --space-3xl: 64px;
  --panel-gap: 1px;                       /* structural seam between abutting modules */
  --panel-pad-sm: 12px; --panel-pad-md: 24px; --panel-pad-lg: 32px;
  --container: 1120px;

  /* Type: Space Grotesk for display, Geist for body, JetBrains Mono for labels and readouts. */
  --font-display: 'Space Grotesk', 'Geist', system-ui, sans-serif;
  --font-sans: 'Geist', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('/fonts/Geist-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-display: swap; src: url('/fonts/Geist-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-display: swap; src: url('/fonts/Geist-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 300 700; font-display: swap; src: url('/fonts/SpaceGrotesk-Variable.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 100 800; font-display: swap; src: url('/fonts/JetBrainsMono-Variable.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;   /* body-md 14/18, the reference's compact interface */
  line-height: 1.29;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  /* The starfield behind every page: six tiled single-pixel stars and two
     soft glows, fixed so the content scrolls over a still sky. */
  background-color: var(--bg);
  background-image:
    radial-gradient(1px 1px at 20px 30px, var(--star), transparent),
    radial-gradient(1px 1px at 40px 70px, var(--star-dim), transparent),
    radial-gradient(1.5px 1.5px at 90px 40px, var(--star), transparent),
    radial-gradient(1px 1px at 160px 120px, var(--star-dim), transparent),
    radial-gradient(1.5px 1.5px at 230px 290px, var(--star), transparent),
    radial-gradient(1px 1px at 310px 180px, var(--star-dim), transparent),
    radial-gradient(800px 500px at 50% -100px, var(--glow), transparent),
    radial-gradient(600px 800px at 75% 300px, var(--glow-2), transparent);
  background-size: 550px 550px, 350px 350px, 250px 250px, 420px 420px, 600px 600px, 500px 500px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
/* Display type: Space Grotesk at one weight, on the spec's headline scale xl → sm. */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--text-full); }
h1 { font-size: 3rem; line-height: 3.25rem; letter-spacing: -0.04em; }          /* headline-xl 48/52 */
h2 { font-size: 2rem; line-height: 2.3125rem; letter-spacing: -0.02em; }        /* headline-lg 32/37 */
h3 { font-size: 1.375rem; line-height: 1.625rem; letter-spacing: -0.012em; }    /* headline-md 22/26 */
h4 { font-size: 1.125rem; line-height: 1.375rem; letter-spacing: -0.01em; }     /* headline-sm 18/22 */
@media (max-width: 767px) {
  h1 { font-size: 2rem; line-height: 2.3125rem; letter-spacing: -0.03em; }      /* headline-xl-mobile 32/37 */
  h2 { font-size: 1.5rem; line-height: 1.8125rem; letter-spacing: -0.012em; }   /* headline-lg-mobile 24/29 */
}
p { margin: 0; }
code, kbd, pre, .mono, .eyebrow { font-family: var(--font-mono); font-feature-settings: 'tnum' 1, 'zero' 1; }
code, kbd { font-size: 0.875em; }
code { padding: 0.1em 0.4em; border-radius: var(--radius-chip); background: var(--code-wash); color: var(--text-full); }
kbd { padding: 0.1em 0.45em; border-radius: var(--radius-chip); border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); font-size: 0.6875rem; }
pre { margin: 0; padding: var(--space-4); border-radius: var(--radius); background: var(--code-bg); border: 1px solid var(--border); overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; }
pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: min(100% - 2 * var(--space-4), var(--container)); margin-inline: auto; }
@media (min-width: 760px) { .container { width: min(100% - 2 * var(--space-6), var(--container)); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus-visible { position: fixed; top: var(--space-2); left: var(--space-2); width: auto; height: auto; clip: auto; overflow: visible; white-space: normal; padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); background: var(--surface); color: var(--text-full); border: 1px solid var(--border-strong); z-index: 20; }

/* glass: translucent surfaces that let the starfield through */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* eyebrow: the small mono label above a heading */
.eyebrow { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-family: var(--font-mono); font-size: 0.625rem; line-height: 1.2; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }

/* buttons */
.button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-4); height: 34px;
  border-radius: 0; border: 1px solid transparent;
  font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 0.875rem; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button svg { width: 16px; height: 16px; flex: none; }
.button--primary { background: var(--solid); color: var(--on-solid); }
.button--primary:hover { background: var(--solid-hover); color: var(--on-solid); }
.button--secondary { background: transparent; color: var(--text-full); border-color: var(--border-strong); }
.button--secondary:hover { background: var(--element-hover); color: var(--text-full); border-color: var(--border-hover); }
.button--secondary svg { color: var(--text-muted); }
.button--ghost { background: var(--surface-card); color: var(--text-full); border-color: var(--border-strong); }
.button--ghost:hover { background: var(--element-hover); color: var(--text-full); }
.button--ghost svg { color: var(--text-muted); }

/* cards */
.card { position: relative; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-card); transition: border-color 0.15s; }
.card:hover { border-color: var(--border-strong); }
.card h3 { color: var(--text-full); }
.card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.29; }

/* section heads and grids shared by the landing sections */
.section-head { max-width: 640px; display: grid; gap: var(--space-3); margin-bottom: var(--space-7); }
.section-head p { color: var(--text); font-size: 1rem; line-height: 1.5; letter-spacing: -0.011em; }
.grid { display: grid; gap: var(--space-5); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid--4 { grid-template-columns: 1fr; } }

/* seam: modules abut on a 1px hairline like hardware panels; no gap, no shadow, no own border */
.seam { gap: var(--panel-gap); background: var(--border-strong); border: 1px solid var(--border); }
.seam > .card { border: 0; padding: var(--panel-pad-md); background: var(--surface-card); }

/* dots: the only status→hue mapping on the site */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 0; flex: none; background: var(--text-faint); }
/* Optical states, no colour coding: nominal is steady starlight with a halo,
   alert pulses (faster when critical), standby is dim and still. */
.dot--running { background: var(--success); box-shadow: var(--dot-glow); }
.dot--needs-input { background: var(--warning); animation: pulse 1.6s ease-in-out infinite; }
.dot--error { background: var(--danger); animation: pulse 0.8s ease-in-out infinite; }
.dot--done, .dot--idle { background: var(--text-faint); }
.dot--brand { background: var(--starlight); box-shadow: var(--dot-glow); }
.dot--solid { background: var(--solid); box-shadow: var(--dot-glow); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* prose: rendered markdown in docs and release notes */
.prose { color: var(--text); font-size: 1rem; line-height: 1.5; letter-spacing: -0.011em; }   /* body-lg 16/24 */
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.375rem; line-height: 1.625rem; letter-spacing: -0.012em; margin-top: 2.5em; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.125rem; line-height: 1.375rem; letter-spacing: -0.01em; margin-top: 2em; scroll-margin-top: 96px; }
.prose h4 { margin-top: 1.5em; scroll-margin-top: 96px; }
.prose a { color: var(--text-full); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.prose a:hover { color: var(--starlight); text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--text-muted); }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-card); }
.prose thead, .prose tbody, .prose tr { width: 100%; }
.prose tr { display: table-row; }
.prose th, .prose td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.prose tbody tr:last-child td { border-bottom: none; }
.prose th { color: var(--text-muted); font-weight: 500; font-family: var(--font-mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--glass-deep); }
.prose blockquote { margin: 0; padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-left: 2px solid var(--solid); border-radius: var(--radius); background: var(--surface-card); color: var(--text); }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }

/* code blocks: a header with the language, a body from shiki, a copy button added by the page script */
.codeblock { border-radius: var(--radius); border: 1px solid var(--border); background: var(--code-bg); overflow: hidden; }
.codeblock__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); height: 36px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border); background: var(--glass-deep); }
.codeblock__lang { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.codeblock__copy { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-chip); border: 1px solid transparent; background: none; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.6875rem; cursor: pointer; }
.codeblock__copy:hover { color: var(--text-full); background: var(--element-hover); border-color: var(--border); }
.codeblock pre { border: 0; border-radius: 0; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .dot--needs-input, .dot--error { animation: none; }
}
.nav[data-astro-cid-wpvy4v7s] {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.row[data-astro-cid-wpvy4v7s] {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 72px;
}

.brand[data-astro-cid-wpvy4v7s] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.04em;
  color: var(--text-full);
}

.brand[data-astro-cid-wpvy4v7s] img[data-astro-cid-wpvy4v7s] {
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
}

ul[data-astro-cid-wpvy4v7s] {
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

nav[data-astro-cid-wpvy4v7s] a[data-astro-cid-wpvy4v7s] {
  color: var(--text);
  font-size: .8125rem;
  font-weight: 500;
  transition: color .15s;
}

nav[data-astro-cid-wpvy4v7s] a[data-astro-cid-wpvy4v7s]:hover {
  color: var(--text-full);
}

.right[data-astro-cid-wpvy4v7s] {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.version[data-astro-cid-wpvy4v7s] {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.version[data-astro-cid-wpvy4v7s]:hover {
  color: var(--text-full);
  border-color: var(--border-strong);
}

@media (width <= 640px) {
  .version[data-astro-cid-wpvy4v7s] {
    display: none;
  }

  .row[data-astro-cid-wpvy4v7s], ul[data-astro-cid-wpvy4v7s] {
    gap: var(--space-4);
  }
}
.footer[data-astro-cid-jo6i4kqk] {
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
  margin-top: var(--space-9);
  font-family: var(--font-mono);
  font-size: .6875rem;
  color: var(--text-muted);
}

.row[data-astro-cid-jo6i4kqk] {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-5);
  align-items: center;
  justify-content: space-between;
}

.left[data-astro-cid-jo6i4kqk] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.brand[data-astro-cid-jo6i4kqk] {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.brand[data-astro-cid-jo6i4kqk] img[data-astro-cid-jo6i4kqk] {
  border-radius: var(--radius-chip);
  border: 1px solid var(--border-strong);
}

i[data-astro-cid-jo6i4kqk] {
  font-style: normal;
}

.licence[data-astro-cid-jo6i4kqk] {
  padding: 2px var(--space-2);
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--glass-deep);
}

ul[data-astro-cid-jo6i4kqk] {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

a[data-astro-cid-jo6i4kqk]:hover {
  color: var(--text-full);
}
