/* ============================================================
   structam.sh: shared stylesheet (every page).
   Structam brand kit v1: a Parchment page (#F5F1E9) with white
   cards, Midnight (#232836) bands and panels for the contrast
   moments, Instrument Sans for display and text, IBM Plex Mono for
   machine values (the kit names no mono face). The palette and its
   derived values are the product's (Structam web/src/styles/
   tokens.css), so the site and the app read as one. Light is the
   only page theme: the Midnight zones below redeclare the tokens
   with the kit's dark values, so every component works inside them.
   Status is never colour alone: glyph + word. The Moon haze
   gradient and the film grain are for decorative bands with no text
   and no small logo on them (kit rule); the logos are the kit's
   outlined SVGs in assets/logo/, never animated or recoloured.
   ============================================================ */

/* ---------- Fonts (self-hosted, OFL; see assets/fonts/LICENSE-*.txt) ---------- */
/* Instrument Sans: one variable file, wght 400-700 at wdth 100, Latin subset (the product's file). */
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/InstrumentSans-Variable-latin.woff2") format("woff2-variations"),
       url("../assets/fonts/InstrumentSans-Variable-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-500-latin.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ----------
   "kit" = the kit's semantic token, used exactly. Every other colour is derived from the five brand colours (Slate
   #3A404E, Stone #A19D98, Parchment #E2D8C7, Alloy #747883, Midnight #232836) and the kit's values; most are the
   product's derived values, the site-only ones say how they were made. Contrast is WCAG 2.x, checked for every text
   tier against bg, band, surface, raised and stage (text 4.5:1, control edges and focus rings 3:1). */
:root {
  color-scheme: light;
  --gutter: 28px;               /* the containers' side padding; 20px under 760px, 16px under 520px */

  /* Page palette, light (the kit's :root) */
  --bg: #f5f1e9;                /* kit background */
  --band: #efeadf;              /* site: alternate section band, bg 70% + Parchment 30% */
  --surface: #ffffff;           /* kit surface: cards and panels */
  --surface-raised: #fcfbf8;    /* site: raised insets; surface 70% + bg 30% */
  --surface-overlay: #ede7db;   /* product: chips, tracks, badges; bg 60% + Parchment 40% */
  --stage-bg: #f5f1e9;          /* site: insets inside cards (feature panels, diagrams) = bg */
  --line: #d3cdc2;              /* kit border: card edges and dividers (decorative) */
  --line-soft: #e4dfd6;         /* site: hairlines inside cards, line 50% + bg 50% (decorative) */
  --line-hover: #b6b4af;        /* site: hovered card edge, line 70% + Alloy 30% (decorative) */
  --line-strong: #747883;       /* product: control edges, Alloy. 3.92 on bg, 3.68 on band, 4.41 on surface */
  --ink: #232836;               /* kit text: 13.05 on bg, 12.26 on band, 14.70 on surface */
  --ink-muted: #555b67;         /* kit muted: 6.06 on bg, 5.69 on band, 6.82 on surface */
  --ink-subtle: #5e646f;        /* product: kit muted 70% + Alloy 30%. 5.28 on bg, 4.96 on band, 4.83 on overlay */
  --accent: #3a404e;            /* kit primary (Slate): 9.21 on bg, 8.65 on band, 10.38 on surface */
  --accent-hover: #232836;      /* product: Midnight, one step darker */
  --on-accent: #ffffff;         /* kit on-primary: 10.38 on accent */
  --focus-ring: #3a404e;        /* product: Slate. 9.21 on bg, 10.38 on surface */

  /* Status (glyph + word, never colour alone). Kit success/warning/danger; info and major are the product's. */
  --ok: #286749;                /* kit success: 5.96 on bg, 5.60 on band */
  --warn: #805018;              /* kit warning: 6.06 on bg, 5.69 on band */
  --crit: #a33339;              /* kit danger: 6.03 on bg, 5.67 on band */
  --info: #314981;              /* product: Slate's hue, HSL 222/45/35. 7.77 on bg */
  --maj: #924228;               /* product: kit warning and danger 50/50. 6.15 on bg */
  /* Soft tints (8% alpha): each status colour on its tint is 5.3:1 or more over bg, surface or band. */
  --ok-soft: #28674914; --warn-soft: #80501814; --crit-soft: #a3333914; --info-soft: #31498114; --maj-soft: #92422814;
  --ok-line: #28674959; --warn-line: #80501859; --crit-line: #a3333959; --info-line: #31498159; --maj-line: #92422859;
  /* Diff lines (12% alpha): ink on each over bg is 10.8:1 or more. */
  --diff-add: #2867491f; --diff-del: #a333391f;

  /* Site-only shades */
  --header-bg: #f5f1e9e6;       /* bg at 90%: muted nav text stays 5.0:1 or more, even over a Midnight band */
  --tint: #23283610;            /* ink at 6%: hover wash under ink text (12.3:1) */
  --link-line: #3a404e73;       /* Slate at 45%: link underlines (decorative; the underline is the cue) */
  --selection: #e2d8c7;         /* Parchment: ink on it 10.4:1 */

  --shadow-sm: 0 1px 2px #2328361a;
  --shadow-md: 0 8px 24px #23283624;
  --shadow-lg: 0 24px 64px #2328362e;

  /* The brand gradient in the kit's order and positions (never reordered), and the kit's film grain (a 128 px crop
     of textures/film-grain-512.png as lossless WebP; its pixels are independent, so the crop tiles without a seam). */
  --gradient-moon-haze: linear-gradient(180deg, #3a404e 0%, #a19d98 25%, #e2d8c7 50%, #747883 75%, #232836 100%);
  --film-grain: url("../assets/textures/film-grain-128.webp");
  /* The grain as one background layer, drawn over a surface's own colour and under everything on it, so it never
     covers a logo or text (the kit's rule). Every large surface takes it: the page, bands, the trust strip, the
     Midnight zones and the hero painting. Cards, screenshots and the product screens in the demos stay clean,
     because they show the product. */
  --grain-layer: var(--film-grain) 0 0 / 128px 128px repeat;

  --font-display: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 64px;
}

/* ---------- Midnight zones ----------
   The kit's dark semantic tokens, declared again on every dark surface so the same components work inside it:
   .midnight (a section band or panel), the closing CTA, the footer, the end-of-page panels, code blocks, terminals
   and the screenshot viewer. Values are the product's dark theme. */
.midnight, .cta-band, .site-footer, .docs-end, .code-block, .docs-body pre, .doc-section pre, .prose pre,
.inner-body pre, .stage-window.is-term, .lightbox {
  color-scheme: dark;
  --bg: #232836;                /* kit background (Midnight) */
  --band: #2a2f3d;              /* site: Midnight 70% + Slate 30%, an inset a step up from the page (the dark theme
                                   lifts, it does not darken). Ink 9.46:1, muted 7.58:1, subtle 6.37:1,
                                   line-strong 4.46:1 on it */
  --surface: #303644;           /* kit surface */
  --surface-raised: #353b49;    /* product: kit surface 50% + Slate 50% */
  --surface-overlay: #3e4351;   /* product: kit surface 80% + Alloy 20% */
  --stage-bg: #232836;          /* kit background (Midnight): code blocks and terminals are Midnight panels */
  --line: #555b67;              /* kit border (decorative) */
  --line-soft: #3e4351;         /* site: = overlay (decorative) */
  --line-hover: #747883;        /* site: Alloy (decorative) */
  --line-strong: #9195a0;       /* product: control edges. 4.91 on bg, 4.04 on surface */
  --ink: #e2d8c7;               /* kit text: 10.42 on bg, 8.57 on surface, 11.38 on band */
  --ink-muted: #c1c3ca;         /* kit muted: 8.35 on bg, 6.87 on surface */
  --ink-subtle: #b0b3bc;        /* product: 7.02 on bg, 5.77 on surface, 4.71 on overlay */
  --accent: #e2d8c7;            /* kit primary (Parchment) */
  --accent-hover: #efe7d8;      /* product: Parchment lightened; on-accent 11.97 on it */
  --on-accent: #232836;         /* kit on-primary: 10.42 on accent */
  --focus-ring: #e2d8c7;
  --ok: #9bd6b2; --warn: #f2c47d; --crit: #ffadb0;   /* kit */
  --info: #acbfec; --maj: #f8b896;                   /* product: 7.99 and 8.60 on bg */
  /* 14% tints: each status colour on its tint over surface is 4.5:1 or more. */
  --ok-soft: #9bd6b224; --warn-soft: #f2c47d24; --crit-soft: #ffadb024; --info-soft: #acbfec24; --maj-soft: #f8b89624;
  --ok-line: #9bd6b259; --warn-line: #f2c47d59; --crit-line: #ffadb059; --info-line: #acbfec59; --maj-line: #f8b89659;
  --diff-add: #9bd6b21f; --diff-del: #ffadb01f;
  --tint: #e2d8c70f;            /* Parchment at 6% */
  --link-line: #e2d8c773;       /* Parchment at 45% */
  --selection: #e2d8c740;
  /* Shadows are the product's dark-theme shadows (tokens.css): a shadow has to be darker than the Midnight it falls
     on, so these are black at 32-50% alpha, not a palette colour. */
  --shadow-sm: 0 1px 2px #00000052;
  --shadow-md: 0 8px 24px #00000066;
  --shadow-lg: 0 24px 64px #00000080;
  color: var(--ink);
}
.midnight { background: var(--grain-layer), var(--bg); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--grain-layer), var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); }
/* The accent sits close to --ink, so links in running text always carry an underline (never colour alone). */
p a, li a, dd a, td a, .faq a, .note a {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--link-line); text-underline-offset: 3px;
}
p a:hover, li a:hover, dd a:hover, td a:hover, .faq a:hover, .note a:hover { text-decoration-color: currentColor; }
a.text-link, a.btn, .footer-col a, .nav-links a, .docs-nav a, .toc-list a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
/* Code blocks scroll, so the browser makes them focusable. Their ring is the Midnight zone's Parchment, which outside
   the block would fall on the light page (1.25:1); drawn inside the Midnight block it is 10.42:1. */
.doc-section pre:focus-visible, .prose pre:focus-visible, .inner-body pre:focus-visible, .code-block pre:focus-visible { outline-offset: -4px; }
::selection { background: var(--selection); color: var(--ink); }

/* Kit type: Display and H1 Bold, H2 and H3 SemiBold (sizes are scaled up for the marketing pages). */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.14; letter-spacing: -0.012em; color: var(--ink); }
h1 { font-weight: 700; }
code, kbd, pre, samp { font-family: var(--font-mono); font-weight: 400; }
strong, b { font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: 1320px; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* Status glyphs, as in the product (ui.tsx StatusGlyph): circle, triangle, diamond, ring */
.glyph { display: inline-block; width: 9px; height: 9px; flex: none; vertical-align: 0; fill: currentColor; }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-crit { color: var(--crit); }
.t-info { color: var(--info); }
.t-maj { color: var(--maj); }

/* A badge outside the app kit (feature tiles, 404, docs): soft tint + glyph + word */
.fx-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 6px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500; line-height: 16px; white-space: nowrap;
  background: var(--surface-overlay); color: var(--ink-muted);
}
.fx-badge.ok { background: var(--ok-soft); color: var(--ok); }
.fx-badge.warn { background: var(--warn-soft); color: var(--warn); }
.fx-badge.crit { background: var(--crit-soft); color: var(--crit); }
.fx-badge.info { background: var(--info-soft); color: var(--info); }
.fx-badge.maj { background: var(--maj-soft); color: var(--maj); }

/* ---------- Scroll reveal (only once JS has run; boot.js adds .js) ---------- */
.js .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out) var(--d, 0ms), transform 0.8s var(--ease-out) var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  /* The blur smooths the page's grain under the bar, so the bar carries its own. */
  background: var(--grain-layer), var(--header-bg);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
/* The kit's horizontal lockup (light variant on the light header): 28 px high = 134 px wide, over the kit's 120 px
   minimum, with at least 7 px (a quarter of the symbol's height) clear on every side. */
.logo { display: inline-flex; align-items: center; flex: none; min-height: 42px; padding: 7px 0; border-radius: 6px; }
.logo img { height: 28px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links > a {
  padding: 8px 12px; border-radius: 8px;
  color: var(--ink-muted); font-size: 15px; font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links > a:hover, .nav-links > a[aria-current="page"] { color: var(--ink); background: var(--tint); }
.nav-links > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 2px 2px; }
.nav-links > a.cta {
  margin-left: 12px; padding: 8px 18px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-links > a.cta:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--ink); }
.btn-ghost { color: var(--ink-muted); padding: 0 12px; }
.btn-ghost:hover { color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--accent); }
.text-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.text-link:hover svg { transform: translateX(3px); }

/* ---------- Sections ---------- */
section { position: relative; padding: 112px 0; }
.band { background: var(--grain-layer), var(--band); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
/* A kit brand icon (assets/icons, 24 px outline) at the start of a kicker, in place of the rule. */
.kicker.has-icon::before { display: none; }
.kicker img { width: 24px; height: 24px; flex: none; }
.kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }
.section-head { max-width: 760px; margin: 0 auto 64px; text-align: center; }
.section-head .kicker::after, .page-hero .kicker::after { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }
.section-head h2 { font-size: clamp(32px, 4.2vw, 48px); margin-bottom: 18px; text-wrap: balance; }
.section-head p { color: var(--ink-muted); font-size: 18px; line-height: 1.6; text-wrap: pretty; }
.section-head .section-note { margin-top: 14px; color: var(--ink-subtle); font-size: 14px; line-height: 1.6; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head.left .kicker::after { display: none; }
/* Headline accent: the second half of a headline in the muted ink (6.06:1 on bg). No gradient: the kit keeps the
   haze off text. */
.grad { color: var(--ink-muted); }
.fine { color: var(--ink-subtle); font-size: 13px; line-height: 1.5; }
.fine code, .section-note code { font-size: 0.92em; color: var(--ink-muted); }
.status-note { color: var(--ink-subtle); font-size: 13.5px; line-height: 1.6; }
.status-note strong { color: var(--ink-muted); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 80px 0 88px; overflow: hidden; text-align: center; isolation: isolate; }
/* The brand kit's watercolour scene (the approved concept's banner, painted again without lettering:
   assets/art/hero-painting-*.webp) behind the statement, as the kit's concept shows the signature over it. It is
   decoration only (no alt text, no grain on top: the kit keeps grain off logos and text). It fades into the
   Parchment page before the demo, and a veil of the page colour sits behind the words so the headline, lede and
   buttons keep their contrast over the mountains. */
.hero::before, .hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: -1; pointer-events: none;
}
.hero::before {
  height: clamp(640px, 62vw, 1000px);
  background: url("../assets/art/hero-painting-2560.webp") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%);
}
.hero::after {
  height: clamp(640px, 62vw, 1000px);
  background: var(--grain-layer), radial-gradient(ellipse 54% 46% at 50% 48%, rgba(245, 241, 233, 0.84) 0%, rgba(245, 241, 233, 0.58) 58%, rgba(245, 241, 233, 0) 100%);
}
/* The kit's signature lockup (symbol, wordmark and "Every asset. Connected."), light variant on the flat page
   background, as the kit's light lockup shows it: no glow, halo or gradient behind it (the kit allows no effects on
   the master logo).
   440 px wide on desktop and never under the kit's 240 px minimum; the margins keep more than a quarter of the
   symbol's height clear around it. It has no reveal: the kit allows no animation of the master logo. */
.hero-sig { display: block; width: clamp(260px, 32vw, 440px); height: auto; margin: 0 auto 36px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  margin-bottom: 30px; padding: 6px 14px 6px 8px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--ink-muted); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a.hero-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.hero-pill .pill-tag {
  flex: none; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-overlay); color: var(--accent);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
}
.hero-pill .pill-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-pill .pill-short { display: none; }
.hero-pill svg { width: 14px; height: 14px; flex: none; transition: transform 0.2s ease; }
a.hero-pill:hover svg { transform: translateX(2px); }
.hero h1 {
  max-width: 900px; margin: 0 auto 24px;
  font-size: clamp(36px, 4.8vw, 60px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero .lede {
  max-width: 790px; margin: 0 auto 40px;
  color: var(--ink-muted); font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.6; text-wrap: pretty;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* Plain-language labels are Instrument Sans (kit Label: 13/18 Medium); IBM Plex Mono is kept for code, hashes,
   paths and versions only, so the version chip carries .mono in the markup. */
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 28px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; line-height: 18px; color: var(--ink-subtle);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 18px; }
.hero-meta li + li::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); margin-left: -9px; margin-right: -9px; }
.hero-demo { position: relative; margin-top: 48px; max-width: 1240px; scroll-margin-top: calc(var(--header-h) + 12px); }


/* Smaller hero for the inner pages (features, integrations, security, legal) */
.page-hero { padding: 88px 0 64px; overflow: hidden; isolation: isolate; text-align: center; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 880px; margin: 0 auto 20px; font-size: clamp(36px, 4.6vw, 54px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.page-hero .lede { max-width: 720px; margin: 0 auto; color: var(--ink-muted); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; text-wrap: pretty; }
.page-hero .hero-actions { margin-top: 32px; }
.page-toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }
.page-toc a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted); font-size: 14px; font-weight: 500;
}
.page-toc a:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- Trust strip ---------- */
.trust { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--grain-layer), var(--surface); }
.trust-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 30px 24px;
  border-left: 1px solid var(--line-soft);
}
.trust-item:first-child { border-left: 0; padding-left: 0; }
.trust-item img, .trust-item svg { width: 24px; height: 24px; flex: none; margin-top: 1px; color: var(--accent); }
.trust-item b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.trust-item span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-subtle); line-height: 1.45; }
.trust-item code { font-size: 0.95em; color: var(--ink-muted); }

/* ---------- How it works: a demo beside each explanation ---------- */
.how-rows { display: grid; gap: 120px; }
.how-row { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 64px; align-items: center; }
.how-row.flip { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.how-row.flip .how-copy { order: 2; }
.how-copy .step-no {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums;
}
.how-copy .step-no i { width: 28px; height: 1px; background: var(--line-strong); }
.how-copy h3 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; margin-bottom: 16px; text-wrap: balance; }
.how-copy > p { color: var(--ink-muted); font-size: 16.5px; line-height: 1.65; }
.how-points { display: grid; gap: 10px; margin: 22px 0 24px; }
.how-points li { position: relative; padding-left: 26px; color: var(--ink-muted); font-size: 15px; line-height: 1.55; }
/* The list marker: a small Slate square. */
.how-points li::before {
  content: ""; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 1.5px;
  background: var(--accent);
}
.how-points code, .how-copy p code { font-size: 0.9em; color: var(--accent); }
.how-copy .fine { margin: -8px 0 22px; }
.how-stage { min-width: 0; }

/* ---------- Metrics band (only numbers backed by the product's code or docs) ---------- */
.metrics { padding: 0; }
.metrics-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 52px 28px 48px; border-left: 1px solid var(--line-soft); }
.metric:first-child { border-left: 0; }
.metric-num {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-family: var(--font-display); font-size: clamp(34px, 3.6vw, 46px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.metric-num small { font-family: var(--font-sans); font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--ink-subtle); }
.metric-label { margin-top: 12px; color: var(--ink-muted); font-size: 14.5px; line-height: 1.5; max-width: 260px; }
.metric-label em { font-style: normal; color: var(--ink-subtle); }
.metric-label code { font-size: 0.92em; color: var(--ink-muted); }

/* ---------- Features: bento with micro-animations ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 18px; }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  padding: 20px 20px 24px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--tint), transparent 45%);
  transition: opacity 0.3s ease;
}
.tile:hover { border-color: var(--line-hover); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tile:hover::before { opacity: 1; }
.tile-lg { grid-column: span 2; }
.tile > h3 { margin: 20px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.tile > p { color: var(--ink-muted); font-size: 14.5px; line-height: 1.6; }
.tile > p code { font-size: 0.92em; color: var(--accent); }

/* The animated panel at the top of each tile. Its loops run only while the tile is on screen
   (home.js toggles .is-live) and never under reduced motion (see the end of this file). */
.fx {
  position: relative; height: 172px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--stage-bg);
  font-size: 12.5px; line-height: 1.4; color: var(--ink-muted);
}
/* `*` never matches pseudo-elements: list ::before and ::after so loops on them (.fx-sp i::after) pause too. */
.fx, .fx *, .fx *::before, .fx *::after { animation-play-state: paused !important; }
.tile.is-live .fx, .tile.is-live .fx *, .tile.is-live .fx *::before, .tile.is-live .fx *::after { animation-play-state: running !important; }
.fx .mono, .fx code { font-family: var(--font-mono); font-size: 11.5px; }
.fx-swap { position: relative; display: block; height: 18px; width: 100%; }
.fx-swap > span { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes show-a { 0%, 44% { opacity: 1; transform: none; } 48%, 94% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; transform: none; } }
@keyframes show-b { 0%, 49% { opacity: 0; transform: translateY(6px); } 54%, 89% { opacity: 1; transform: none; } 93%, 100% { opacity: 0; } }
.fx-swap > span:first-child { animation: show-a 7s var(--ease) infinite; }
.fx-swap > span:last-child { animation: show-b 7s var(--ease) infinite; }

/* ---------- Integrations strip (static; no marquee) ---------- */
.integ-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.integ {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.integ:hover { border-color: var(--line-strong); transform: translateY(-2px); color: var(--ink); }
.integ-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.integ-head svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.integ p { color: var(--ink-muted); font-size: 14.5px; line-height: 1.55; }
.integ code { font-size: 0.92em; color: var(--accent); }
.integ .integ-dir { margin-left: auto; font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--ink-subtle); white-space: nowrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.chip small { color: var(--ink-subtle); font-size: 12.5px; font-weight: 400; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--accent); }

/* ---------- Architecture diagram (deployment and HA sections) ---------- */
.arch { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.25fr) 64px minmax(0, 1fr); align-items: stretch; }
.arch-col, .arch-core {
  padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface);
}
.arch-core { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.arch-h { margin-bottom: 14px; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.arch-h small { display: block; margin-top: 4px; font-family: var(--font-sans); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-subtle); }
.arch-list { display: grid; gap: 10px; }
.arch-list li { padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg); }
.arch-list b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.arch-list span { display: block; font-size: 12.5px; color: var(--ink-subtle); line-height: 1.45; }
.arch-list li.is-dashed, .arch-out .arch-list li { border-style: dashed; }
.arch-layers { display: grid; gap: 10px; }
.arch-layer { position: relative; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.arch-layer b { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.arch-layer b code { font-size: 13px; font-weight: 500; }
.arch-layer b em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-subtle); font-weight: 400; }
.arch-layer span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-subtle); line-height: 1.5; }
.arch-layer.is-core { border-color: var(--line-strong); background: var(--surface-overlay); }
.arch-layer.is-core b { color: var(--accent); }
.arch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.arch-chips span { display: inline-block; margin: 0; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-muted); font-size: 11.5px; line-height: 1.5; }
.arch-link { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 46px; padding: 0 6px; }
.arch-link i { position: relative; display: block; height: 1px; background: linear-gradient(90deg, var(--line), var(--line-strong), var(--line)); }
.arch-link i::after {
  content: ""; position: absolute; top: -2.5px; left: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: arch-dot 2.4s var(--ease) infinite;
}
.arch-link i:nth-child(2)::after { animation-delay: -0.8s; }
.arch-link i:nth-child(3)::after { animation-delay: -1.6s; }
.arch-link.out i { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.arch-link.out i::after { animation-duration: 3.2s; }
@keyframes arch-dot { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
@keyframes arch-dot-v { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 6px); opacity: 0; } }
/* !important: the `animation` shorthand on .arch-link i::after is more specific and would reset the play state. */
.arch, .arch *, .arch *::after { animation-play-state: paused !important; }
.arch.is-live, .arch.is-live *, .arch.is-live *::after { animation-play-state: running !important; }

/* HA and scale: stateless nodes over one PostgreSQL primary with a standby */
.ha { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }

.deploy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.deploy-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  padding: 28px 28px 30px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.panel h3 { font-size: 20px; margin-bottom: 8px; }
.panel > p { color: var(--ink-muted); font-size: 15px; line-height: 1.6; }
.panel > p + p { margin-top: 10px; }
.panel .eyebrow { margin-bottom: 10px; }
.panel code { font-size: 0.9em; color: var(--accent); }
.eyebrow { display: block; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }

.checks { display: grid; gap: 14px; margin-top: 18px; }
.checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; color: var(--ink-muted); font-size: 14.5px; line-height: 1.55; }
.checks li svg { width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }
.checks li b { color: var(--ink); font-weight: 600; }
.checks code { font-size: 0.9em; color: var(--accent); }

.sec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.sec-grid .panel h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.sec-grid .panel h3 svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* ---------- Screenshots gallery ---------- */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.shot { margin: 0; min-width: 0; }
.shot.wide { grid-column: 1 / -1; }
.shot-link { display: block; border-radius: 14px; text-decoration: none; }
.shot-link:focus-visible { outline-offset: 6px; border-radius: 16px; }
.shot-frame {
  position: relative; display: block; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s ease, transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
.shot-bar { display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-overlay); }
.shot-bar span { margin: 0 auto; padding: 1px 12px; border-radius: 6px; background: var(--bg); color: var(--ink-subtle); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 140px); }
.shot-bar::after { content: ""; width: 45px; flex: none; }
.shot-frame img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
/* Until a screenshot exists: a quiet panel of the same proportions */
.shot-pending {
  display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 24px;
  background: var(--stage-bg);
  color: var(--ink-subtle); font-size: 14px; text-align: center;
}
.shot-zoom {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: var(--ink); font-size: 12.5px; font-weight: 500; opacity: 0; transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
}
.shot-zoom svg { width: 14px; height: 14px; }
.shot-link:hover .shot-frame, .shot-link:focus-visible .shot-frame { border-color: var(--line-hover); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.shot-link:hover .shot-zoom, .shot-link:focus-visible .shot-zoom { opacity: 1; transform: none; }
.shot figcaption { margin-top: 16px; padding: 0 2px; }
.shot figcaption strong { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.shot figcaption span { color: var(--ink-muted); font-size: 14.5px; line-height: 1.55; }
.shots-note { margin-top: 36px; text-align: center; }

/* Lightbox (home.js; links open the image directly without JS) */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
}
.lightbox[open] { display: grid; place-items: center; }
/* Midnight at 90%: over the light page it comes out near #383c48, where the caption's muted text is 6.25:1 and the
   counter's subtle text 5.25:1. */
.lightbox::backdrop { background: #232836e6; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lb-inner { position: relative; display: grid; gap: 14px; width: min(1440px, calc(100vw - 120px)); max-height: calc(100vh - 48px); padding: 24px 0; }
.lb-inner img { width: 100%; height: auto; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.lb-cap { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: center; text-align: center; font-size: 14.5px; color: var(--ink-muted); }
.lb-cap strong { font-family: var(--font-display); color: var(--ink); font-weight: 600; }
.lb-btn {
  position: fixed; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lb-btn:hover { background: var(--surface-raised); border-color: var(--accent); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color 0.2s ease, background 0.2s ease; }
.faq details[open] { border-color: var(--line-hover); background: var(--surface); box-shadow: var(--shadow-sm); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 24px; cursor: pointer; list-style: none; border-radius: 14px;
  font-family: var(--font-sans); font-size: 16.5px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 10px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 1.5px 10px no-repeat;
  border: 1px solid var(--line-strong); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 24px 22px; color: var(--ink-muted); font-size: 15px; line-height: 1.65; }
.faq .faq-body p + p { margin-top: 10px; }
.faq code { font-size: 0.9em; color: var(--accent); }
:root { interpolate-size: allow-keywords; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.35s var(--ease), content-visibility 0.35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }

/* ---------- CTA band: the closing section, Midnight, with the signature lockup (dark variant) ---------- */
.cta-band { overflow: hidden; text-align: center; padding: 112px 0 120px; isolation: isolate; background: var(--grain-layer), var(--bg); }
/* 360 px wide (75 px high): over the kit's 240 px minimum, with more than 19 px clear around it. */
.cta-sig { display: block; width: clamp(260px, 30vw, 360px); height: auto; margin: 0 auto 44px; }
.cta-band h2 { font-size: clamp(32px, 4.2vw, 48px); max-width: 760px; margin: 0 auto 18px; text-wrap: balance; }
.cta-band p { max-width: 600px; margin: 0 auto 36px; color: var(--ink-muted); font-size: 18px; text-wrap: pretty; }

/* ---------- Footer (Midnight, horizontal lockup dark variant) ---------- */
.site-footer { padding: 72px 0 40px; background: var(--grain-layer), var(--bg); }
.footer-grid { display: grid; grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 48px; }
.footer-brand img.footer-logo { height: 28px; width: auto; margin-bottom: 16px; }
.footer-brand p { max-width: 300px; color: var(--ink-subtle); font-size: 14px; line-height: 1.6; }
.by-kazlabs { display: inline-flex; align-items: center; margin-top: 12px; padding: 10px 0; color: var(--ink-subtle); font-size: 12.5px; text-decoration: none; }
.by-kazlabs img { height: 20px; width: auto; opacity: 0.85; transition: opacity 0.2s ease; }
.by-kazlabs:hover { color: var(--ink-muted); }
.by-kazlabs:hover img { opacity: 1; }
.footer-col h2 { margin-bottom: 14px; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.footer-col a { display: block; width: fit-content; padding: 5px 0; color: var(--ink-subtle); font-size: 14.5px; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-soft);
  color: var(--ink-subtle); font-size: 13px;
}
.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom a { color: var(--ink-subtle); }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- Docs ---------- */
.docs-main { padding: 56px 0 96px; }
.docs-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 64px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.docs-nav-label { margin: 22px 0 6px; font-family: var(--font-display); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-subtle); }
.docs-nav-label:first-child { margin-top: 0; }
.docs-nav a {
  display: block; padding: 5px 0 5px 14px; margin-left: 1px; border-left: 1px solid var(--line);
  color: var(--ink-subtle); font-size: 14px; line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.docs-nav a:hover { color: var(--ink); }
.docs-nav a.is-active { color: var(--ink); border-left-color: var(--accent); }
.docs-toc-mobile { display: none; }
.docs-content { min-width: 0; max-width: 820px; }
.docs-title { font-size: clamp(34px, 4vw, 46px); margin-bottom: 14px; }
.docs-lede { color: var(--ink-muted); font-size: 18px; line-height: 1.6; max-width: 66ch; margin-bottom: 18px; }
.docs-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.docs-meta span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; color: var(--ink-subtle); }
.docs-meta span.mono { font-family: var(--font-mono); font-size: 12px; font-weight: 400; }
.doc-section { padding: 40px 0 0; margin-top: 40px; border-top: 1px solid var(--line-soft); scroll-margin-top: calc(var(--header-h) + 12px); }
.doc-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.doc-section .kicker { margin-bottom: 10px; font-size: 11px; }
.doc-section h2 { font-size: 28px; margin-bottom: 16px; letter-spacing: -0.015em; }
.doc-section h3 { margin: 28px 0 10px; font-family: var(--font-sans); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.doc-section p, .doc-section li, .doc-section dd { color: var(--ink-muted); font-size: 15.5px; line-height: 1.7; }
.doc-section p + p { margin-top: 12px; }
.doc-section ul, .doc-section ol { margin: 12px 0; padding-left: 4px; display: grid; gap: 6px; }
.doc-section ul > li { position: relative; padding-left: 20px; }
.doc-section ul > li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 1.5px; background: var(--ink-subtle); }
.doc-section ol { counter-reset: n; }
.doc-section ol > li { position: relative; padding-left: 30px; counter-increment: n; }
.doc-section ol > li::before { content: counter(n); position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-overlay); color: var(--ink-muted); font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; }
.doc-section strong { color: var(--ink); }
.doc-section :not(pre) > code, .prose :not(pre) > code {
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface);
  color: var(--ink); font-size: 0.86em; white-space: nowrap;
}
.doc-section table.wrap-first td:first-child { white-space: normal; width: 55%; }
.code-block { position: relative; margin: 16px 0; }
.doc-section pre, .prose pre {
  margin: 16px 0; padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--stage-bg);
  color: var(--ink); font-size: 13.5px; line-height: 1.7; tab-size: 2;
}
/* The copy button gets its own row: lines wider than the pre scroll, so right padding alone would let a long first
   line run under the button. */
/* div.code-block: one type selector more than .inner-body pre, which comes later and sets its own padding.
   Code blocks are Midnight panels (tokens above), so the copy button over them takes the dark values too. */
div.code-block pre { margin: 0; padding-top: 48px; }
.doc-section pre code { font-size: inherit; }
.doc-section pre .c { color: var(--ink-subtle); }
.copy-btn {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-muted);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { background: var(--surface-raised); color: var(--ink); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok-line); }
@media (max-width: 860px) {
  div.code-block pre { padding-top: 54px; padding-right: 18px; }
  .copy-btn { top: 8px; right: 8px; height: 40px; padding: 0 12px; }
}
/* The wrapper is the white card (the product's tables are white throughout), so header and body share one surface.
   Wide tables scroll sideways inside it; the two "local" white layers scroll with the content and cover the two
   "scroll" shadows (Midnight at 16%) only while that edge is reached, so an edge with more columns past it shows a
   shadow and the overflow reads as intentional. The table and its header cells stay transparent above it. */
.table-wrap {
  margin: 16px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background:
    linear-gradient(90deg, var(--surface) 30%, #ffffff00) left center / 40px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 30%, #ffffff00) right center / 40px 100% no-repeat local,
    linear-gradient(90deg, #23283629, #23283600) left center / 14px 100% no-repeat scroll,
    linear-gradient(270deg, #23283629, #23283600) right center / 14px 100% no-repeat scroll,
    var(--surface);
}
.doc-section table, .prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-section th, .doc-section td, .prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; color: var(--ink-muted); line-height: 1.55; }
.doc-section tr:last-child td, .prose tr:last-child td { border-bottom: 0; }
.doc-section th, .prose th { background: transparent; color: var(--ink-muted); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.doc-section td:first-child { color: var(--ink); white-space: nowrap; }
.note {
  margin: 18px 0; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--info);
  border-radius: 0 10px 10px 0; background: var(--surface); color: var(--ink-muted); font-size: 14.5px; line-height: 1.65;
}
.note strong { color: var(--ink); }
.note code { font-size: 0.9em; color: var(--ink); }
.note.status { border-left-color: var(--warn); }
.doc-section dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 18px; margin: 14px 0; }
.doc-section dt { color: var(--ink); font-size: 14.5px; font-weight: 500; }
.doc-section dd { margin: 0; }
/* The end-of-page panel: a Midnight panel (tokens above), the contrast moment of the inner pages and the docs. */
.docs-end { margin-top: 64px; padding: 32px; border: 1px solid var(--bg); border-radius: 16px; background: var(--grain-layer), var(--bg); box-shadow: var(--shadow-md); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.docs-end h2 { font-size: 22px; margin-bottom: 4px; }
.docs-end p { color: var(--ink-muted); font-size: 15px; }

/* ---------- Prose pages (legal, security): one readable column ---------- */
.prose-main { padding: 64px 0 96px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 44px; font-size: 26px; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { margin-top: 28px; font-family: var(--font-sans); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.prose p, .prose li, .prose dd { color: var(--ink-muted); font-size: 16px; line-height: 1.7; }
.prose ul { display: grid; gap: 6px; padding-left: 4px; }
.prose ul > li { position: relative; padding-left: 20px; }
.prose ul > li::before { content: ""; position: absolute; left: 2px; top: 0.66em; width: 6px; height: 6px; border-radius: 1.5px; background: var(--ink-subtle); }
.prose strong { color: var(--ink); }
.prose .updated { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--ink-subtle); }

/* Placeholder blocks the writers replace (visible on purpose until then) */
.todo {
  padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: 12px;
  background: var(--surface-overlay); color: var(--ink-subtle); font-size: 14.5px; line-height: 1.6;
}
.todo strong { color: var(--ink-muted); }

/* ---------- 404 ---------- */
.err { min-height: calc(100vh - var(--header-h) - 160px); display: grid; place-items: center; padding: 96px 0; overflow: hidden; isolation: isolate; text-align: center; }
.err-row {
  display: inline-grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; max-width: 100%;
  margin-bottom: 30px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 14px; text-align: left; box-shadow: var(--shadow-md);
}
.err-row .mono { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.err-row .fx-badge { font-size: 12px; }
.err h1 { font-size: clamp(76px, 14vw, 156px); line-height: 0.95; letter-spacing: -0.04em; margin-bottom: 18px; }
.err p.lede { max-width: 560px; margin: 0 auto 34px; color: var(--ink-muted); font-size: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .how-row, .how-row.flip { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .how-row.flip .how-copy { order: 0; }
  .how-copy { max-width: 720px; }
  .how-rows { gap: 96px; }
  .sec-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .arch { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .arch-link { flex-direction: row; justify-content: center; gap: 54px; height: 54px; padding: 0; }
  .arch-link i { width: 1px; height: 100%; background: linear-gradient(180deg, var(--line), var(--line-strong), var(--line)); }
  .arch-link.out i { background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px); }
  .arch-link i::after { left: -2.5px; top: 0; animation-name: arch-dot-v; }
  .arch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ha { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integ-grid, .deploy-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-row, .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-item:nth-child(3) { border-left: 0; padding-left: 0; }
  .trust-item:nth-child(n + 3), .metric:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .metric:nth-child(3) { border-left: 0; }
  .deploy-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-nav { display: none; }
  .docs-toc-mobile { display: block; margin-bottom: 36px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .docs-toc-mobile summary { padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
  .docs-toc-mobile summary::-webkit-details-marker { display: none; }
  .docs-toc-mobile summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
  .docs-toc-mobile[open] summary::after { content: "\2212"; }
  .docs-toc-mobile .toc-list { padding: 0 18px 16px; columns: 2; column-gap: 20px; }
  .docs-toc-mobile .toc-list a { display: block; padding: 4px 0; font-size: 14px; color: var(--ink-muted); break-inside: avoid; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    padding: 12px 20px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open > a { padding: 12px 8px; font-size: 16px; }
  .nav-links.open > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 2px 8px 8px 2px; }
  .nav-links.open > a.cta { margin: 10px 0 0; text-align: center; padding: 12px 18px; }
}
@media (max-width: 760px) {
  section { padding: 76px 0; }
  :root { --gutter: 20px; }
  .hero { padding: 64px 0 56px; }
  .hero::before { background-image: url("../assets/art/hero-painting-1440.webp"); background-position: 30% top; height: 620px; }
  .hero::after { height: 620px; background: var(--grain-layer), radial-gradient(ellipse 70% 46% at 50% 46%, rgba(245, 241, 233, 0.86) 0%, rgba(245, 241, 233, 0.6) 60%, rgba(245, 241, 233, 0) 100%); }
  .page-hero { padding: 64px 0 48px; }
  .hero-pill { margin-bottom: 24px; min-height: 40px; font-size: 13px; }
  .nav-toggle { min-height: 44px; }
  .text-link { padding: 10px 0; margin: -10px 0; } /* a 40px target, same spacing */
  .footer-col a { min-width: 40px; padding: 10px 0; }
  .footer-bottom nav { gap: 8px; margin-left: -6px; }
  .footer-bottom nav a { padding: 10px 6px; }
  .page-toc a { min-height: 44px; }
  .hero h1 { font-size: clamp(36px, 10.2vw, 52px); margin-bottom: 20px; }
  .hero .lede { margin-bottom: 30px; }
  .hero-actions .btn { flex: 1 1 200px; }
  .hero-demo { margin-top: 44px; padding: 0 10px; }
  .section-head { margin-bottom: 44px; }
  .section-head p { font-size: 16.5px; }
  .how-rows { gap: 80px; }
  .bento, .integ-grid, .deploy-grid.three { grid-template-columns: minmax(0, 1fr); }
  .tile-lg { grid-column: auto; }
  .shots { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .shot.wide { grid-column: auto; }
  .shot-zoom { opacity: 1; transform: none; right: 10px; bottom: 10px; padding: 4px 10px; font-size: 12px; }
  .metric { padding: 36px 16px 32px; }
  .metric:nth-child(odd) { padding-left: 0; }
  .metric-label { font-size: 13.5px; }
  .trust-item { padding: 22px 14px; }
  .trust-item:nth-child(odd) { padding-left: 0; }
  .panel { padding: 22px 20px 24px; }
  .arch-list { grid-template-columns: minmax(0, 1fr); }
  .faq summary { padding: 18px 18px; font-size: 15.5px; }
  .faq .faq-body { padding: 0 18px 20px; }
  .cta-band { padding: 80px 0 88px; }
  .site-footer { padding-top: 56px; }
  .cta-band p { font-size: 16.5px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .lb-inner { width: calc(100vw - 24px); }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .doc-section h2, .prose h2 { font-size: 24px; }
  .doc-section dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc-section dd { margin-bottom: 10px; }
  .doc-section td:first-child { white-space: normal; }
  .doc-section th, .doc-section td { padding: 9px 10px; font-size: 13.5px; }
  .docs-toc-mobile .toc-list { columns: 1; }
  .docs-toc-mobile .toc-list a { padding-block: 10px; }
  .docs-toc-mobile summary { min-height: 48px; }
}
@media (max-width: 520px) {
  :root { --gutter: 16px; }
  .trust-row, .metrics-row { grid-template-columns: minmax(0, 1fr); }
  .trust-item, .trust-item:nth-child(odd) { border-left: 0; padding: 20px 0; }
  .trust-item + .trust-item { border-top: 1px solid var(--line-soft); }
  .metric, .metric:nth-child(odd) { border-left: 0; padding: 30px 0 28px; }
  .metric + .metric { border-top: 1px solid var(--line-soft); }
  .metric-label { max-width: none; }
  .hero-meta { gap: 4px 14px; font-size: 12px; }
  .hero-pill .pill-long { display: none; }
  .hero-pill .pill-short { display: inline; }
  .hero-meta li + li::before { display: none; }
  .hero-demo { padding: 0; }
  .fx { font-size: 12px; }
  .tile { padding: 16px 16px 20px; }
  .err-row { grid-template-columns: auto minmax(0, 1fr); }
  .err-row .err-what { display: none; }
}

/* iOS safe areas: the page gutter, or the inset where that is wider, so the logo and the nav line up with the content
   below them at every width. */
@supports (padding: max(0px)) {
  .site-header .nav, .site-footer .container { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
}

/* ---------- Reduced motion: still frames, no loops ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .fx *, .fx *::before, .fx *::after, .arch-link i::after { animation: none !important; }
  .faq details::details-content { transition: none; }
  .tile, .btn, .shot-frame, .integ, .skip-link { transition: none; }
  .tile:hover, .btn:hover, a.integ:hover, .shot-link:hover .shot-frame { transform: none; }
  /* Show each fx in its most telling state (writers: add a line here for every new fx) */
  .fx-swap > span:first-child { opacity: 0; }
  .fx-swap > span:last-child { opacity: 1; }
}

/* ---------- Inner-page sections (features, integrations, security) ---------- */
.lede-sm { max-width: 760px; margin-bottom: 16px; color: var(--ink-muted); font-size: 17px; line-height: 1.65; text-wrap: pretty; }
.lede-sm code { font-size: 0.9em; color: var(--ink); }

/* Section body beside a "Limits" card. Long names (STRUCTAM_*, change kinds) wrap anywhere so 360 px never scrolls. */
section.inner { padding: 88px 0; }
.inner .section-head { margin-bottom: 40px; }
.inner .section-head code { font-size: 0.9em; color: var(--ink); }
.inner-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.inner-body { min-width: 0; }
.inner-body > h3, .limits > h3 { font-family: var(--font-sans); letter-spacing: 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.inner-body > h3 { margin: 32px 0 10px; font-size: 18px; font-weight: 600; }
.inner-body > h3:first-child { margin-top: 0; }
.inner-body p, .inner-body li, .limits p, .limits li { color: var(--ink-muted); font-size: 15.5px; line-height: 1.7; }
.inner-body > p + p { margin-top: 12px; }
.inner-body ul, .inner-body ol, .limits ul { display: grid; gap: 6px; margin: 12px 0; padding-left: 4px; }
.inner-body ul > li, .limits ul > li { position: relative; padding-left: 20px; }
.inner-body ul > li::before, .limits ul > li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 1.5px;
  background: var(--ink-subtle);
}
.inner-body ol { counter-reset: n; }
.inner-body ol > li { position: relative; padding-left: 30px; counter-increment: n; }
.inner-body ol > li::before {
  content: counter(n); position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-overlay); color: var(--ink-muted); font-family: var(--font-sans); font-size: 11.5px; font-weight: 600;
}
.inner-body strong, .limits strong { color: var(--ink); }
.inner-body :not(pre) > code, .limits code {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface);
  color: var(--ink); font-size: 0.86em; overflow-wrap: anywhere;
}
.inner-body pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--stage-bg);
  color: var(--ink); font-size: 13.5px; line-height: 1.7; tab-size: 2;
}
.inner-body .code-block { margin: 14px 0 16px; }
.inner-body pre .c { color: var(--ink-subtle); }
.inner-body .code-label { margin: 18px 0 -6px; color: var(--ink-subtle); font-size: 13px; }
.inner-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.inner-body th, .inner-body td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; color: var(--ink-muted); line-height: 1.55; }
.inner-body tr:last-child td { border-bottom: 0; }
.inner-body th { background: transparent; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.inner-body td:first-child { color: var(--ink); }
.inner-body td { font-size: 14px; }
.inner-body td code, .inner-body th code { white-space: nowrap; overflow-wrap: normal; }
/* Header cells are 12px: code inside them keeps that size rather than 0.86em of it (10.3px, under the 11px floor). */
.prose th code, .doc-section th code, .inner-body th code { font-size: 1em; }
.limits {
  position: sticky; top: calc(var(--header-h) + 24px);
  padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm);
}
.band .limits { background: var(--grain-layer), var(--surface); }
.limits > h3 {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-subtle);
}
.limits > h3::before { content: ""; width: 7px; height: 7px; border-radius: 1.5px; background: var(--warn); }
.limits li, .limits p { font-size: 14.5px; line-height: 1.6; }
.limits .note { margin: 16px 0 0; font-size: 13.5px; }
.doc-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.doc-links a { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.doc-links a:hover { text-decoration-color: currentColor; }
.inner-end { padding: 72px 0 96px; }
.inner-end .docs-end { margin-top: 0; }
@media (max-width: 980px) {
  .inner-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .limits { position: static; }
}
@media (max-width: 760px) {
  section.inner { padding: 64px 0; }
  .inner-body th, .inner-body td { padding: 9px 10px; font-size: 13.5px; }
  .inner-body pre { font-size: 13px; padding: 14px; }
  .inner-end { padding: 56px 0 64px; }
}

/* ---------- Home: feature tile animations, HA diagram, deployment notes (home writer) ----------
   Every .fx loop below is paused unless its tile is on screen (.tile.is-live, above), and under
   reduced motion .fx * loses its animation: each element's own style is its still, telling state,
   and the keyframes only move away from it and back. */
.fx-inv, .fx-diff, .fx-spread, .fx-review, .fx-pool, .fx-scope, .fx-chain, .fx-ask, .fx-swapbox, .fx-sweep { flex-direction: column; gap: 8px; padding: 14px 16px; }
.fx .fx-sub { font-size: 11.5px; color: var(--ink-subtle); }
/* Inventory: one host's sections, counted in turn */
.fx-inv { align-items: stretch; justify-content: center; }
.fx-inv-host { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); }
.fx-inv-host b { font-weight: 500; font-size: 12.5px; }
.fx-inv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fx-inv-grid > span { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); animation: fx-inv 6s var(--ease) infinite; }
.fx-inv-grid > span:nth-child(2) { animation-delay: .5s; } .fx-inv-grid > span:nth-child(3) { animation-delay: 1s; }
.fx-inv-grid > span:nth-child(4) { animation-delay: 1.5s; } .fx-inv-grid > span:nth-child(5) { animation-delay: 2s; } .fx-inv-grid > span:nth-child(6) { animation-delay: 2.5s; }
.fx-inv-grid i { font-style: normal; font-size: 11.5px; color: var(--ink-subtle); }
.fx-inv-grid b { font-size: 15px; font-weight: 500; color: var(--ink); }
@keyframes fx-inv { 0%, 8% { border-color: var(--line-soft); } 12%, 22% { border-color: var(--line-strong); background: var(--surface-raised); } 30%, 100% { border-color: var(--line-soft); } }
/* Configuration diff: the changed lines come in */
.fx-diff { align-items: stretch; justify-content: center; gap: 3px; }
.fx-diff-head { margin-bottom: 4px; color: var(--ink-muted); }
.fx-dl { display: block; padding: 2px 8px; border-radius: 4px; white-space: pre; overflow: hidden; text-overflow: ellipsis; color: var(--ink-muted); }
.fx-dl.del { background: var(--diff-del); color: var(--ink); animation: fx-line 5s var(--ease) infinite; }
.fx-dl.add { background: var(--diff-add); color: var(--ink); animation: fx-line 5s var(--ease) infinite .3s; }
.fx-dl.add + .fx-dl.add { animation-delay: .6s; }
@keyframes fx-line { 0%, 6% { opacity: .15; transform: translateX(-6px); } 16%, 88% { opacity: 1; transform: none; } 100% { opacity: .15; } }
/* Version spread: three bars fill */
.fx-spread { align-items: stretch; justify-content: center; }
/* max-content: the version labels keep their full width and the bar takes what is left (an auto track gave the
   free space to the bar first and cut "1.22.1-9+deb12u2" short in the four-column bento). */
.fx-sp { display: grid; grid-template-columns: max-content minmax(36px, 1fr) 30px; align-items: center; gap: 8px; }
.fx-sp > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-sp i { position: relative; display: block; height: 7px; border-radius: 99px; background: var(--surface-overlay); overflow: hidden; }
.fx-sp i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--ink-subtle); transform-origin: left; animation: fx-grow 6s var(--ease-out) infinite; }
.fx-sp b { font-weight: 500; text-align: right; color: var(--ink); }
.fx-spread .fx-badge { align-self: flex-start; margin-top: 4px; animation: fx-pop 6s var(--ease) infinite; }
@keyframes fx-grow { 0%, 4% { transform: scaleX(0); } 30%, 90% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: .4; } }
@keyframes fx-pop { 0%, 34% { opacity: 0; transform: translateY(4px); } 42%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* Change review: three events, one turns from pending to approved */
.fx-review { align-items: stretch; justify-content: center; gap: 6px; }
.fx-ev { display: grid; grid-template-columns: 74px minmax(0, 1fr) 118px; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); }
.fx-ev .fx-badge { justify-self: start; }
.fx-ev-t { display: flex; flex-direction: column; min-width: 0; }
/* The change kinds and their subjects wrap where the tile is narrow (phones, and the four-column bento between 981
   and 1180px) instead of ending in an ellipsis; the panel grows to fit them. */
.fx-review { height: auto; min-height: 172px; }
.fx-ev-t b { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.fx-ev-t .mono { color: var(--ink-subtle); overflow-wrap: anywhere; }
.fx-ev-s { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.fx-ev-s.fx-swap { height: 18px; }
.fx-ev-s.fx-swap > span { display: inline-flex; align-items: center; gap: 5px; }
/* The rule row is de-emphasised with the subtle ink (5.95:1 on white), not opacity: its text stays AA and its badge
   keeps full strength. */
.fx-ev.is-rule .fx-ev-t b, .fx-ev.is-rule .fx-ev-s { color: var(--ink-subtle); }
.fx-ev-s.t-warn { color: var(--warn); }
/* Agent: frames sealed and sent out to the server */
.fx-agent { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 10px 0; padding: 14px; }
.fx-ag-box { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.fx-ag-box.is-srv { border-color: var(--line-strong); }
.fx-ag-wire { position: relative; width: 70px; height: 1px; background: linear-gradient(90deg, var(--line), var(--line-strong), var(--line)); }
.fx-ag-wire i { position: absolute; top: -3px; left: 0; width: 10px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0; animation: fx-frame 2.4s linear infinite; }
.fx-ag-wire i:nth-child(2) { animation-delay: .8s; } .fx-ag-wire i:nth-child(3) { animation-delay: 1.6s; }
.fx-ag-cap { flex-basis: 100%; text-align: center; color: var(--ink-subtle); }
@keyframes fx-frame { 0% { left: 0; opacity: 0; } 15%, 80% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }
/* Discovery: a sweep across a range, one new address found */
.fx-sweep { justify-content: center; }
.fx-sw-grid { display: grid; grid-template-columns: repeat(8, 14px); gap: 5px; }
.fx-sw-grid i { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-overlay); animation: fx-probe 4.8s steps(1) infinite; }
.fx-sw-grid i.is-on { background: var(--ink-subtle); }
/* The found address: Slate with an Alloy ring (decorative; --info stays for status chips that carry a word). */
.fx-sw-grid i.is-new { background: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line-strong); }
.fx-sw-grid i:nth-child(8n + 2) { animation-delay: .2s; } .fx-sw-grid i:nth-child(8n + 3) { animation-delay: .4s; } .fx-sw-grid i:nth-child(8n + 4) { animation-delay: .6s; }
.fx-sw-grid i:nth-child(8n + 5) { animation-delay: .8s; } .fx-sw-grid i:nth-child(8n + 6) { animation-delay: 1s; } .fx-sw-grid i:nth-child(8n + 7) { animation-delay: 1.2s; } .fx-sw-grid i:nth-child(8n) { animation-delay: 1.4s; }
.fx-sw-cap { color: var(--ink-subtle); }
@keyframes fx-probe { 0% { outline: 1px solid var(--accent); outline-offset: 1px; } 6%, 100% { outline: 0 solid transparent; } }
/* NetBox: hosts read in, Structam's own fields written back (dashed: optional) */
.fx-nb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 140px) minmax(0, 1fr); align-items: center; gap: 0; padding: 14px 16px; }
.fx-nb-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.fx-nb-box b { font-family: var(--font-display); font-size: 14px; color: var(--ink); }
.fx-nb-box > span { color: var(--ink-subtle); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-nb-box.is-sx { border-color: var(--line-strong); }
.fx-nb-wires { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 30px; align-self: stretch; padding: 0 8px; }
.fx-nb-in, .fx-nb-out { position: relative; display: block; height: 1px; background: var(--line-strong); }
.fx-nb-out { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.fx-nb-in i, .fx-nb-out i { position: absolute; top: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: fx-ltr 2.6s var(--ease) infinite; }
.fx-nb-out i { animation: fx-rtl 3.4s var(--ease) infinite 1s; }
.fx-nb-lbl { position: absolute; left: 8px; right: 8px; top: calc(50% - 31px); text-align: center; color: var(--ink-subtle); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-nb-lbl.is-out { top: calc(50% + 21px); }
@keyframes fx-ltr { 0% { left: 0; opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
@keyframes fx-rtl { 0% { left: calc(100% - 6px); opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
/* InfraDB: a change rule becomes an alarm */
.fx-swapbox { justify-content: center; }
.fx-swap-2 { width: auto; min-width: 200px; text-align: center; height: 22px; }
.fx-swap-2 > span { display: flex; justify-content: center; }
/* Worker pools: workers come and go with the queue */
.fx-pool { align-items: stretch; justify-content: center; gap: 8px; }
.fx-pool-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 10px; }
.fx-pool-w { display: flex; gap: 5px; }
.fx-pool-w i { width: 18px; height: 12px; border-radius: 3px; background: var(--ink-subtle); }
.fx-pool-row:first-child .fx-pool-w i:nth-child(n + 3) { animation: fx-worker 5s var(--ease) infinite; }
.fx-pool-row:first-child .fx-pool-w i:nth-child(4) { animation-delay: .4s; }
.fx-pool-row:nth-child(2) .fx-pool-w i:nth-child(2) { animation: fx-worker 5s var(--ease) infinite 1.5s; }
@keyframes fx-worker { 0%, 10% { opacity: .15; transform: scale(.7); } 22%, 70% { opacity: 1; transform: none; } 84%, 100% { opacity: .15; transform: scale(.7); } }
/* Scoped access: a host outside the grant is not there for this user */
.fx-scope { align-items: stretch; justify-content: center; gap: 5px; }
.fx-grant { align-self: flex-start; margin-bottom: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-overlay); color: var(--accent); }
.fx-sc-row { display: flex; white-space: nowrap; justify-content: space-between; gap: 8px; padding: 5px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface); color: var(--ink); }
.fx-sc-row em { font-style: normal; color: var(--ink-subtle); }
.fx-sc-row.is-out { opacity: .3; text-decoration: line-through; text-decoration-color: var(--ink-subtle); animation: fx-out 5s var(--ease) infinite; }
@keyframes fx-out { 0%, 20% { opacity: 1; text-decoration-color: transparent; } 40%, 100% { opacity: .3; text-decoration-color: var(--ink-subtle); } }
/* Audit: a hash chain, then a signed checkpoint */
.fx-chain { justify-content: center; }
.fx-ch-row { display: flex; align-items: center; }
.fx-ch-row i { font-style: normal; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-muted); animation: fx-link 4.4s var(--ease) infinite; }
.fx-ch-row i:nth-child(3) { animation-delay: .3s; } .fx-ch-row i:nth-child(5) { animation-delay: .6s; } .fx-ch-row i:nth-child(7) { animation-delay: .9s; }
.fx-ch-row b { width: 12px; height: 1px; background: var(--line-strong); }
.fx-ch-ok { animation: fx-pop 4.4s var(--ease) infinite; }
/* The bento's three-column widths make this tile narrow: shorter links and tighter hashes keep all four in view. */
@media (max-width: 1180px) and (min-width: 721px) {
  .fx-ch-row b { width: 6px; }
  .fx-ch-row i { padding: 3px 4px; }
  /* The same narrow tile holds the config diff: tighter insets and 11px (the floor) keep "- PermitRootLogin yes"
     whole down to 981px. */
  .fx-diff { padding-left: 10px; padding-right: 10px; }
  .fx .fx-dl { padding: 2px 6px; font-size: 11px; }
}
@keyframes fx-link { 0%, 4% { border-color: var(--line); } 10%, 24% { border-color: var(--line-strong); color: var(--ink); } 34%, 100% { border-color: var(--line); } }
/* Ask AI: a question, two read-only tool calls, an answer */
.fx-ask { align-items: stretch; justify-content: center; gap: 5px; text-align: left; }
.fx-ask-q { align-self: flex-end; max-width: 88%; padding: 6px 10px; border-radius: 10px 10px 2px 10px; background: var(--surface-overlay); color: var(--ink); }
.fx-ask-tool { display: flex; gap: 8px; align-items: baseline; color: var(--ink-muted); animation: fx-pop 7s var(--ease) infinite; }
.fx-ask-tool + .fx-ask-tool { animation-delay: .5s; }
.fx-ask-tool i { font-style: normal; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-subtle); }
.fx-ask-tool em { font-style: normal; color: var(--ink-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-ask-a { max-width: 92%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; background: var(--surface); color: var(--ink-muted); animation: fx-pop 7s var(--ease) infinite 1.1s; }
@media (max-width: 520px) {
  .fx-nb-lbl { display: none; }
  /* Phones: the two boxes need the width for the word "Structam". */
  .fx-nb { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); padding: 14px 12px; }
  .fx-nb-box { padding: 8px 10px; }
  .fx-nb-box b { font-size: 13px; }
  .fx-ev { grid-template-columns: 70px minmax(0, 1fr); }
  .fx-ev .fx-ev-s { display: none; }
  .fx-inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-inv-grid > span:nth-child(n + 5) { display: none; }
}

/* HA and scale: the topology as an inline SVG. Text is at least 18 viewBox units, so it stays
   11px or more down to a 296px-wide figure (a 360px phone). The flows run only on screen. */
.ha-fig { margin: 0; padding: 20px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--band); }
.ha-svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; overflow: visible; }
.ha-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.2; }
.ha-hosts { fill: var(--bg); stroke-dasharray: 5 4; }
.ha-node { stroke: var(--line-strong); }
.ha-pg { fill: var(--surface-raised); stroke: var(--accent); }
.ha-standby { stroke-dasharray: 6 4; }
.ha-extra { opacity: .7; stroke-dasharray: 6 4; }
.ha-t { fill: var(--ink-subtle); font-family: var(--font-sans); font-size: 18px; }
.ha-b { fill: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.ha-m { fill: var(--accent); font-family: var(--font-mono); font-weight: 500; font-size: 18px; }
.ha-note { font-size: 18px; }
.ha-w { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.ha-flow { stroke: var(--accent); stroke-dasharray: 3 7; animation: ha-dash 1.1s linear infinite; }
.ha-db { stroke: var(--ink-subtle); stroke-dasharray: 3 7; animation: ha-dash 1.6s linear infinite; }
.ha-up { animation-direction: reverse; }
.ha-rep { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 4; animation: ha-dash 1.2s linear infinite; }
@keyframes ha-dash { to { stroke-dashoffset: -20; } }
.ha-fig .ha-w { animation-play-state: paused; }
.ha-fig.is-live .ha-w { animation-play-state: running; }
.ha .panel .checks { margin-bottom: 18px; }
.ha .panel .status-note a { color: var(--accent); }

/* Deployment routes */
.deploy-files { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ink-subtle) !important; font-size: 12.5px !important; }
.deploy-status { max-width: 860px; margin: 28px auto 0; text-align: center; }
.faq .faq-body .status-note { font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
  .ha-w { animation: none !important; }
}
