/* KubeTrust
 *
 * The implementation of the KubeTrust design system (claude.ai/design, "KubeTrust Design
 * System"). The site is built on its cloud-native layer - cool near-white field, white
 * 8px cards with one soft shadow, a saturated blue for action, Manrope display headings,
 * centred section titles, dropdown nav - with the paper layer's proof blocks and diagrams
 * set inside it.
 *
 * --action (you can click this) and --reach (an attacker can reach this) resolve to the
 * same blue. The brand collapsed them deliberately, so context carries the distinction:
 * a finding lives in a hop number, terminal output or a diagram; a control is a button
 * or a link. The service map is connectivity, not reachability, so nothing on it is
 * ever --reach coloured.
 *
 * Constraints this file still holds:
 *   - ONE accent colour for exposure, and it is never decoration, a button or a link.
 *   - Monospace for every Kubernetes noun.
 *   - Dark terminal-adjacent surfaces for proof blocks and diagrams only.
 *   - No gradients, no glassmorphism, no icon tiles, no illustration, no parallax.
 *     Shadows separate a card from the grey field; they never grow on hover.
 *   - prefers-reduced-motion is honoured strictly, not partially.
 *
 * The design system splits its tokens across tokens/*.css behind an @import entry point.
 * Here they are inlined in the same order under the same headings: server.js stamps asset
 * URLs from the newest mtime of files directly under public/, so an imported file would
 * miss the stamp and survive a redeploy in returning visitors' caches.
 */

/* ================================================================ tokens: colour
 *
 * A cool neutral ramp matched to the cloud-native field, plus exactly one accent: the
 * action blue, meaning "reachable / exposed" wherever it marks a finding. A second,
 * self-contained dark family exists for proof blocks and diagrams.
 */

:root {
  /* neutrals: cool, matched to the cloud-native field */
  --bg: #fafbfc;
  --bg-alt: #f4f5f7;
  --fg: #0f1419;
  --fg-soft: #3b444f;
  --muted: #6b7581;
  --line: #e3e6ea;
  --line-strong: #c5cad1;

  /* the one accent. Reachable / exposed. The same blue as --action: the brand collapsed
     the two, so only context tells a finding from a control. */
  --reach: #2a6fdb;
  --reach-soft: #e7effc;

  /* terminal-adjacent surfaces, for proof blocks and diagrams */
  --term-bg: #15171b;
  --term-alt: #1c1f24;
  --term-fg: #dde1e6;
  --term-muted: #8a919c;
  --term-line: #2a2e35;
  --term-reach: #6ba6f7;
  --term-plain: #a7aeb8;

  /* diagram ink (SVG primitives inside dark frames) */
  --diagram-edge: #343a42;
  --diagram-edge-cut: #22262c;
  --diagram-box-line: #3a4048;
  --diagram-label: #aeb5bf;
  --diagram-sub: #6d747d;

  /* semantic aliases */
  --surface-page: var(--bg);
  --surface-sunken: var(--bg-alt);
  --surface-proof: var(--term-bg);
  --surface-proof-raised: var(--term-alt);
  --surface-callout: var(--reach-soft);

  --text-body: var(--fg);
  --text-secondary: var(--fg-soft);
  --text-muted: var(--muted);
  --text-proof: var(--term-fg);
  --text-proof-muted: var(--term-muted);
  --text-exposed: var(--reach);
  --text-exposed-proof: var(--term-reach);

  --border-hairline: var(--line);
  --border-strong: var(--line-strong);
  --border-proof: var(--term-line);
  --border-exposed: var(--reach);

  --link-fg: var(--fg);
  --link-underline: var(--line-strong);
  --link-underline-hover: currentColor;

  --focus-ring: var(--reach);
}

/* ================================================================ tokens: type
 *
 * The one hard rule: EVERY Kubernetes noun is monospace, inline, at 0.9em of its context.
 * Mono also carries every machine-ish label: eyebrows, badges, the wordmark, hop numbers,
 * table headers, contact addresses, port numbers.
 */

:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --font-body: var(--sans);
  --font-technical: var(--mono);

  /* sizes */
  --text-base: 17px;          /* 16px below 520px */
  --text-h1: clamp(2.05rem, 4.6vw, 3.1rem);
  --text-h2: clamp(1.5rem, 2.6vw, 1.95rem);
  --text-h3: 1.06rem;
  --text-lede: 1.16rem;
  --text-note: 0.94rem;
  --text-small: 0.92rem;
  --text-eyebrow: 0.72rem;
  --text-label: 0.74rem;      /* table headers, dt, callout heading */
  --text-badge: 0.68rem;
  --text-mono-inline: 0.9em;
  --text-mono-proof: 0.82rem;
  --text-mono-meta: 0.8rem;

  /* weights - one bold on the paper layer. 620, not 700. */
  --weight-regular: 400;
  --weight-semibold: 620;

  /* line heights */
  --leading-body: 1.62;
  --leading-heading: 1.14;
  --leading-lede: 1.55;
  --leading-proof: 1.6;

  /* tracking */
  --tracking-heading: -0.021em;
  --tracking-h3: -0.01em;
  --tracking-mono: -0.01em;
  --tracking-eyebrow: 0.13em;
  --tracking-label: 0.06em;
  --tracking-badge: 0.1em;
}

/* ================================================================ tokens: spacing
 *
 * Section rhythm is deliberately uneven - equal-length sections are a marketing tell.
 */

:root {
  --page: 1120px;        /* paper column */
  --prose: 63ch;         /* body paragraph measure */
  --measure-lede: 54ch;
  --measure-h1: 22ch;
  --measure-list: 74ch;
  --measure-tech: 78ch;  /* the technical page column */
  --measure-talk: 60ch;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --section-y: clamp(3.5rem, 8vw, 6.5rem);
  --section-y-tight: clamp(2.5rem, 5vw, 4rem);
  --hero-y-top: clamp(3rem, 7vw, 5rem);
  --hero-y-bottom: clamp(2rem, 4vw, 3rem);

  --stack-1: 0.4rem;
  --stack-2: 0.6rem;
  --stack-3: 1.1rem;   /* paragraph bottom margin */
  --stack-4: 1.6rem;
  --stack-5: 2.25rem;
  --stack-6: 3.25rem;

  --pad-proof: 0.85rem 1rem;      /* terminal block */
  --pad-frame-head: 0.8rem 1rem;  /* dark frame header / footer */
  --pad-callout: 1rem 1.15rem;
  --pad-cta: 0.75rem 1.15rem;
  --pad-badge: 0.16rem 0.45rem;
  --pad-row: 1.4rem 0;            /* hairline-separated list row */
}

/* ================================================================ tokens: borders */

:root {
  --radius-sm: 2px;    /* badges, SVG node rects */
  --radius-frame: 3px; /* paper proof frames */
  --radius-radius-outline: 4px; /* the dashed blast-radius rectangle */

  --hairline: 1px;
  --border-width-entry: 1.5px;  /* SVG entry node emphasis */

  --border: var(--hairline) solid var(--line);
  --border-proof-frame: var(--hairline) solid var(--term-line);
  --border-badge: var(--hairline) solid var(--line-strong);
  --border-cta: var(--hairline) solid var(--fg);
  --callout-rule: 2px solid var(--reach);

  --dash-created: 3 2;  /* a pod the attacker creates */
  --dash-network: 2 3;  /* a network edge, not an RBAC edge */
  --dash-radius: 4 3;   /* a computed boundary */

  --shadow-none: none;
}

/* ================================================================ tokens: motion
 *
 * Motion happens once and then stops. Nothing loops, nothing reacts to scroll.
 */

:root {
  --ease-settle: cubic-bezier(.2, .7, .3, 1);
  --ease-fade: ease;

  --dur-settle: .5s;    /* a node arriving into place, once */
  --dur-lit: .28s;      /* a hop path lighting up */
  --dur-step: .45s;     /* a containment step fading in */
  --stagger-node: 22ms; /* per-node delay across the settle */
}

/* ================================================================ tokens: cloud-native surfaces */

:root {
  /* surfaces: cool, near-white, two steps */
  --surface-field: #f4f5f7;   /* the page behind the cards */
  --surface-card-bg: #ffffff; /* every card, every map node */
  --surface-chip: #eaecf0;    /* port numbers, small metadata chips */
  --surface-bar: #fbf3d8;     /* the announcement strip */

  /* ink on those surfaces */
  --ink-strong: #0f1419;      /* headings */
  --ink: #232a33;             /* nav links, card titles */
  --ink-soft: #4b535d;        /* body copy on light grey */
  --ink-faint: #939aa4;       /* namespace names, label lists, card meta */

  /* the one action colour */
  --action: #2a6fdb;
  --action-hover: #1f5cbd;
  --action-soft: #e7effc;
  --action-ink: #ffffff;

  /* lines on the cool layer */
  --line-cool: #e8eaee;
  --line-cool-strong: #d6dae1;
  --line-dotted: #ccd1d8;     /* the dashed namespace container */
  --line-edge: #bfc4cc;       /* service-map connectors */

  /* semantic aliases for this layer */
  --surface-page-cool: var(--surface-field);
  --text-on-cool: var(--ink-soft);
  --border-card: var(--line-cool);
  --link-action: var(--action);
}

/* ================================================================ tokens: cloud-native display type
 *
 * Manrope is the design system's flagged substitution for the reference's geometric
 * grotesque. It is loaded in views/partials/head.ejs with display=swap, so text paints
 * immediately in the system stack and swaps when the face arrives. Send real font files
 * and this block plus that <link> are the only things that change.
 */

:root {
  --display: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--display);

  --text-display: clamp(2.4rem, 5vw, 3.6rem);   /* hero h1 */
  --text-section: clamp(1.9rem, 3.2vw, 2.6rem); /* centred section title */
  --text-card-title: 1.12rem;
  --text-map-node: 1.05rem;
  --text-nav: 0.95rem;
  --text-chip: 0.69rem;
  --text-port: 0.82rem;
  --text-map-label: 0.8rem;

  --weight-display: 800;
  --weight-card: 700;
  --weight-nav: 600;

  --leading-display: 1.08;
  --leading-card: 1.45;

  --tracking-display: -0.03em;
  --tracking-section: -0.025em;
  --tracking-chip: 0.06em;
}

/* ================================================================ tokens: cloud-native elevation */

:root {
  --radius-card: 8px;      /* cards, map nodes, proof frames on this layer */
  --radius-control: 6px;   /* buttons, nav pills, terminal blocks */
  --radius-chip: 4px;      /* port numbers, index chips */
  --radius-pill: 999px;
  --radius-container: 4px; /* the dashed namespace container */

  --shadow-card: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-node: 0 1px 4px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .04);
  --shadow-raised: 0 4px 16px rgba(16, 24, 40, .08);

  --border-dotted: 2px dotted var(--line-dotted);
  --edge-width: 1.5px;

  --pad-button: 0.85rem 1.5rem;
  --pad-button-sm: 0.45rem 0.8rem;
  --pad-card: 1.5rem;
  --pad-node-head: 0.85rem 1rem;
  --pad-node-row: 0.6rem 1rem;
  --pad-chip: 0.2rem 0.6rem;

  --gap-card-grid: 1.5rem;
  --gap-map: 3.5rem;
}

/* ================================================================ tokens: dark
 *
 * Defaults to the OS scheme. The sun/moon toggle in the nav overrides it by setting
 * data-scheme on <html>, and both blocks are duplicated under that attribute:
 * :root[data-scheme] outranks the bare :root inside the media query, so an explicit
 * choice wins in either direction.
 */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --bg-alt: #151a20;
    --fg: #e7e9ec;
    --fg-soft: #c2c6cc;
    --muted: #939aa5;
    --line: #232830;
    --line-strong: #363c46;
    --reach: #6ba6f7;
    --reach-soft: #15243c;
    --term-bg: #191c21;
    --term-alt: #1f2329;
    --term-line: #2d323a;

    --surface-field: #0e1116;
    --surface-card-bg: #151a20;
    --surface-chip: #232830;
    --surface-bar: #211c10;
    --ink-strong: #e7e9ec;
    --ink: #d5d9df;
    --ink-soft: #b0b6bf;
    --ink-faint: #7e858f;
    --action: #6ba6f7;
    --action-hover: #8bbaf9;
    --action-soft: #15243c;
    --action-ink: #0c1016;
    --line-cool: #232830;
    --line-cool-strong: #313741;
    --line-dotted: #313741;
    --line-edge: #434a54;
  }
}

:root[data-scheme="dark"] {
  color-scheme: dark;

  --bg: #0e1116;
  --bg-alt: #151a20;
  --fg: #e7e9ec;
  --fg-soft: #c2c6cc;
  --muted: #939aa5;
  --line: #232830;
  --line-strong: #363c46;
  --reach: #6ba6f7;
  --reach-soft: #15243c;
  --term-bg: #191c21;
  --term-alt: #1f2329;
  --term-line: #2d323a;

  --surface-field: #0e1116;
  --surface-card-bg: #151a20;
  --surface-chip: #232830;
  --surface-bar: #211c10;
  --ink-strong: #e7e9ec;
  --ink: #d5d9df;
  --ink-soft: #b0b6bf;
  --ink-faint: #7e858f;
  --action: #6ba6f7;
  --action-hover: #8bbaf9;
  --action-soft: #15243c;
  --action-ink: #0c1016;
  --line-cool: #232830;
  --line-cool-strong: #313741;
  --line-dotted: #313741;
  --line-edge: #434a54;
}

:root[data-scheme="light"] {
  color-scheme: light;

  --bg: #fafbfc;
  --bg-alt: #f4f5f7;
  --fg: #0f1419;
  --fg-soft: #3b444f;
  --muted: #6b7581;
  --line: #e3e6ea;
  --line-strong: #c5cad1;
  --reach: #2a6fdb;
  --reach-soft: #e7effc;
  --term-bg: #15171b;
  --term-alt: #1c1f24;
  --term-line: #2a2e35;

  --surface-field: #f4f5f7;
  --surface-card-bg: #ffffff;
  --surface-chip: #eaecf0;
  --surface-bar: #fbf3d8;
  --ink-strong: #0f1419;
  --ink: #232a33;
  --ink-soft: #4b535d;
  --ink-faint: #939aa4;
  --action: #2a6fdb;
  --action-hover: #1f5cbd;
  --action-soft: #e7effc;
  --action-ink: #ffffff;
  --line-cool: #e8eaee;
  --line-cool-strong: #d6dae1;
  --line-dotted: #ccd1d8;
  --line-edge: #bfc4cc;
}

/* ================================================================ scheme toggle
 *
 * Shows the icon for the scheme you would switch to: a moon while light, a sun while
 * dark - whether dark came from the OS or from an explicit choice.
 */

.cn-scheme {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2rem; height: 2rem; padding: 0;
  background: transparent; border: 0; border-radius: var(--radius-control);
  color: var(--ink); cursor: pointer;
}
.cn-scheme:hover { color: var(--action); }
.cn-scheme:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.cn-scheme .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .cn-scheme .i-sun { display: block; }
  :root:not([data-scheme="light"]) .cn-scheme .i-moon { display: none; }
}
:root[data-scheme="dark"] .cn-scheme .i-sun { display: block; }
:root[data-scheme="dark"] .cn-scheme .i-moon { display: none; }

/* On a phone the nav takes its own row, so the toggle stays up beside the wordmark. */
@media (max-width: 760px) {
  .cn-scheme { margin-left: auto; }
  .cn-topbar .cn-nav { order: 3; }
}

/* ================================================================ base */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-field);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink-strong);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-display); font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display); line-height: var(--leading-display);
}
h2 {
  font-size: var(--text-section); font-weight: var(--weight-display);
  letter-spacing: var(--tracking-section); line-height: var(--leading-display);
  margin-bottom: 1.2rem;
}
h3 {
  font-size: var(--text-card-title); font-weight: var(--weight-card);
  letter-spacing: -0.015em; line-height: var(--leading-card);
}

p { margin: 0 0 var(--stack-3); max-width: var(--prose); }
p:last-child { margin-bottom: 0; }

a { color: var(--link-action); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

strong { font-weight: var(--weight-card); color: var(--ink-strong); }

/* Every Kubernetes noun goes in here. */
code, .k {
  font-family: var(--font-technical);
  font-size: var(--text-mono-inline);
  letter-spacing: var(--tracking-mono);
  word-break: break-word;
}

.lede {
  font-family: var(--font-display);
  font-size: 1.14rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 40rem;
}

.eyebrow {
  display: block;
  margin: 0 0 .9rem;
  font-family: var(--font-technical);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.note { color: var(--ink-faint); font-size: var(--text-note); }

/* ================================================================ shell */

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink-strong); color: var(--surface-card-bg); padding: .6rem 1rem; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

/* Section rhythm is deliberately uneven. Bands alternate field and white. */
section { padding: var(--section-y) 0; }
section.tight { padding-top: var(--section-y-tight); padding-bottom: var(--section-y-tight); }
section.alt {
  background: var(--surface-card-bg);
  border-top: var(--hairline) solid var(--line-cool);
  border-bottom: var(--hairline) solid var(--line-cool);
}

/* ================================================================ announcement bar */

.cn-announce {
  background: var(--surface-bar);
  border-bottom: var(--hairline) solid rgba(0, 0, 0, .05);
  padding: .7rem var(--gutter);
  text-align: center;
  font-family: var(--font-display); font-size: .92rem; color: var(--ink);
}
.cn-announce .sep { margin: 0 1rem; color: var(--line-cool-strong); }
.cn-announce a {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: var(--weight-card); color: var(--ink-strong);
}
.cn-announce a:hover { color: var(--action); text-decoration: none; }

/* ================================================================ nav */

.cn-topbar {
  position: relative; z-index: 20;
  background: var(--surface-field);
  border-bottom: var(--hairline) solid var(--line-cool);
}
.cn-topbar .wrap { display: flex; align-items: center; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }

.cn-brand {
  flex: 0 0 auto;
  font-family: var(--mono); font-size: 1.2rem; font-weight: 600;
  letter-spacing: -0.03em; color: var(--ink-strong);
}
.cn-brand:hover { text-decoration: none; }

.cn-pills { display: flex; gap: .5rem; flex: 0 0 auto; }
.cn-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--line-cool); border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
  padding: var(--pad-button-sm);
  font-family: var(--font-display); font-size: .82rem; font-weight: var(--weight-nav); color: var(--ink);
}
.cn-pill:hover { border-color: var(--line-cool-strong); text-decoration: none; }
.cn-pill .v {
  font-family: var(--mono); font-size: .78rem; font-weight: 400; color: var(--ink-faint);
  border-left: var(--hairline) solid var(--line-cool); padding-left: .45rem;
}

.cn-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.6rem;
  font-family: var(--font-display); font-size: var(--text-nav); font-weight: var(--weight-nav);
}
.cn-nav > a:not(.cn-btn) { color: var(--ink); }
.cn-nav > a:not(.cn-btn):hover,
.cn-nav > a[aria-current="page"] { color: var(--action); text-decoration: none; }

/* Dropdowns open on hover and on keyboard focus, with no script. */
.cn-menu { position: relative; }
.cn-menu > button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
}
.cn-menu > button svg { transition: transform .15s ease; }
.cn-menu:hover > button, .cn-menu:focus-within > button { color: var(--action); }
.cn-menu:hover > button svg, .cn-menu:focus-within > button svg { transform: rotate(180deg); }
.cn-menu-list { display: none; position: absolute; top: 100%; left: -.75rem; min-width: 14rem; padding-top: .6rem; }
.cn-menu:hover .cn-menu-list, .cn-menu:focus-within .cn-menu-list { display: block; }
.cn-menu-panel {
  display: grid; gap: .1rem; padding: .45rem;
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--line-cool); border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}
.cn-menu-panel a {
  padding: .5rem .65rem; border-radius: var(--radius-chip);
  color: var(--ink-soft); font-weight: 500; font-size: .9rem;
}
.cn-menu-panel a:hover { background: var(--action-soft); color: var(--action); text-decoration: none; }

/* ================================================================ buttons */

.cn-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: var(--weight-nav); font-size: 1rem;
  padding: var(--pad-button); border: var(--hairline) solid transparent; border-radius: var(--radius-control);
  line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.cn-btn:hover { text-decoration: none; }
.cn-btn-primary { background: var(--action); color: var(--action-ink); }
.cn-btn-primary:hover { background: var(--action-hover); color: var(--action-ink); }
.cn-btn-secondary {
  background: var(--surface-card-bg); color: var(--ink);
  border-color: var(--line-cool); box-shadow: var(--shadow-card);
}
.cn-btn-secondary:hover { border-color: var(--line-cool-strong); color: var(--ink); }
.cn-btn-sm { font-size: .85rem; padding: var(--pad-button-sm); }

.cn-btn:focus-visible, .cn-pill:focus-visible, .cn-menu > button:focus-visible,
.cn-menu-panel a:focus-visible, .toc a:focus-visible {
  outline: 2px solid var(--action); outline-offset: 2px;
}

.cn-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ================================================================ section heading */

.cn-heading { text-align: center; max-width: 48rem; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.cn-heading h2 { margin: 0; }
.cn-heading p { max-width: none; margin: 1rem 0 0; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; }
.cn-heading p + p { margin-top: .7rem; }
.cn-heading.left { text-align: left; margin-left: 0; max-width: 52rem; }

/* ================================================================ cards */

.cn-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--gap-card-grid);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.cn-grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); }
.cn-grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }

.cn-card {
  display: flex; flex-direction: column; min-width: 0; margin: 0;
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--border-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--pad-card);
}
.cn-card h3 { margin: 0 0 .6rem; }
.cn-card p { max-width: none; color: var(--ink-soft); font-size: .95rem; line-height: 1.55; margin-bottom: .6rem; }
.cn-card p:last-child { margin-bottom: 0; }
.cn-card-foot { margin-top: auto; padding-top: 1.1rem; border-top: var(--hairline) solid var(--line-cool); }
.cn-card.has-foot > p:last-of-type { margin-bottom: 1.2rem; }

.cn-card-link {
  font-family: var(--font-display); font-size: var(--text-chip); font-weight: var(--weight-card);
  letter-spacing: var(--tracking-chip); text-transform: uppercase; color: var(--action);
}

.cn-chip {
  display: inline-block; align-self: flex-start; margin-bottom: .9rem;
  background: var(--surface-chip); border-radius: var(--radius-chip); padding: var(--pad-chip);
  font-family: var(--mono); font-size: .74rem; color: var(--ink);
}

/* ================================================================ hero */

.hero { padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.4rem; }
.hero-meta {
  max-width: none; margin-top: 1.6rem;
  font-family: var(--font-technical); font-size: var(--text-mono-proof); color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: .35rem 1.1rem;
}
.hero.center { text-align: center; }
.hero.center h1, .hero.center .lede { margin-left: auto; margin-right: auto; }
.hero.center .cn-actions, .hero.center .hero-meta { justify-content: center; }

/* Nav labels are short phrases. Wrapping them mid-phrase reads as a layout fault, so
   they hold one line and the pill beside them gives way first. */
.cn-nav a { white-space: nowrap; }

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

/* Three plain statements under the hero buttons. Deliberately not cards and not icons:
   the point is that they read as facts, not as a feature grid. */
.cn-assure {
  list-style: none; margin: clamp(2rem, 4vw, 2.75rem) auto 0; padding: 0;
  max-width: 62rem; text-align: left;
  display: grid; gap: 1rem clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.cn-assure li {
  border-top: var(--hairline) solid var(--line-cool);
  padding-top: .85rem;
  font-size: .95rem; line-height: 1.55; color: var(--ink-soft);
}
.cn-assure strong {
  display: block; margin-bottom: .2rem;
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
}

/* ---------------------------------------------------------------- pull quote */

.cn-quote {
  margin: 0 auto; max-width: 34rem; padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--line-cool);
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.35;
  letter-spacing: -0.015em; color: var(--ink);
  font-style: italic;
}
.cn-quote-after {
  max-width: 34rem; margin: 1.1rem auto clamp(2rem, 4vw, 3rem);
  padding-left: calc(1.1rem + 2px);
  color: var(--ink-soft);
}

/* The two founder cards sit under the three engagement points, so they need their own
   break rather than the grid gap. */
.founders-row { margin-top: var(--gap-card-grid); }

/* ================================================================ illustrations */

/* Canvas illustrations ported from the presentation deck: public/breach.js, stack.js and
   contain.js. Each draws into a fixed-height stage, plays once when it scrolls into view,
   then holds its last frame. Colour still only ever means "reachable". */
.viz { margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; text-align: left; }
.viz-frame {
  background: var(--surface-proof);
  border: var(--border-proof-frame);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}
.viz-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  padding: var(--pad-frame-head); border-bottom: var(--border-proof-frame);
  font-family: var(--font-technical); font-size: 0.76rem; color: var(--text-proof-muted);
}
.viz-head .flag { color: var(--text-proof); letter-spacing: var(--tracking-badge); }
.viz-head .replay { margin-left: auto; }
.replay {
  font: inherit; font-family: var(--font-technical); font-size: 0.76rem;
  color: var(--text-proof-muted); background: transparent;
  border: var(--border-proof-frame); border-radius: var(--radius-chip);
  padding: .3rem .6rem; cursor: pointer;
}
.replay:hover { color: var(--text-proof); border-color: var(--term-muted); }
.replay:focus-visible { outline: 2px solid var(--text-exposed-proof); outline-offset: 1px; }

.viz-stage { position: relative; height: clamp(320px, 50vw, 540px); }
.viz-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.viz-foot {
  margin: 0; padding: .7rem 1rem; border-top: var(--border-proof-frame); min-height: 2.9rem;
  font-size: 0.86rem; color: var(--text-proof-muted);
}
.viz-foot p { margin: 0; max-width: 68ch; }
.viz-foot b { color: var(--text-exposed-proof); font-weight: 600; }
.viz > figcaption.note { text-align: center; margin-left: auto; margin-right: auto; }

/* ================================================================ proof blocks */

/* Terminal-adjacent, used only where there is something to verify. */
.term {
  background: var(--surface-proof); color: var(--text-proof);
  border: var(--border-proof-frame); border-radius: var(--radius-control);
  font-family: var(--font-technical); font-size: var(--text-mono-proof); line-height: var(--leading-proof);
  padding: var(--pad-proof); margin: 0; overflow-x: auto;
  white-space: pre; -webkit-overflow-scrolling: touch;
}
.term .prompt { color: var(--text-proof-muted); user-select: none; }
/* The accent is only used on output that says a path holds. */
.term .out { color: var(--text-exposed-proof); }
.term .plain { color: var(--term-plain); }
.term .cm { color: var(--text-proof-muted); }

.callout {
  border-left: var(--callout-rule); background: var(--surface-callout);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  padding: var(--pad-callout); margin: var(--stack-4) 0; max-width: var(--prose);
}
.callout p { margin-bottom: .5rem; }
.callout p:last-child { margin-bottom: 0; }
.callout .h {
  display: block; margin-bottom: .4rem;
  font-family: var(--font-technical); font-size: var(--text-label); letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-exposed);
}

/* ================================================================ two questions */

/* The middle card is what happens between the two questions, so it sits back a step. */
.questions .between {
  background: var(--surface-field); box-shadow: none;
  border-style: dashed; border-color: var(--line-cool-strong);
}

/* ================================================================ layers */

.stack { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) {
  .stack { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; }
}
.stack .viz { margin: 0; }
.stack .viz-stage { height: clamp(300px, 44vw, 460px); }
.stack-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.stack-step {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: .2rem .6rem; width: 100%;
  text-align: left; font: inherit; color: var(--ink-soft); cursor: pointer;
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--border-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 1rem 1.1rem;
  transition: border-color var(--dur-step) var(--ease-fade), box-shadow var(--dur-step) var(--ease-fade);
}
.stack-step .n {
  grid-row: span 2; padding-top: .2rem;
  font-family: var(--font-technical); font-size: .78rem; color: var(--ink-faint);
}
.stack-step .t { font-family: var(--font-display); font-weight: var(--weight-card); font-size: 1.02rem; color: var(--ink-strong); }
.stack-step .d { font-size: .92rem; line-height: 1.5; }
.stack-step:hover { border-color: var(--line-cool-strong); }
.stack-step.reached .n { color: var(--reach); }
.stack-step[aria-pressed="true"] { border-color: var(--reach); box-shadow: var(--shadow-raised); }
.stack-step:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.stack-note { padding: .25rem .2rem 0; line-height: 1.55; }
.stack-note a { white-space: nowrap; }

/* ================================================================ drift */

.drift { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .drift { grid-template-columns: 1.05fr .95fr; } }
.drift > div > p { color: var(--ink-soft); font-size: 1.02rem; }
.quarters { margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.quarters li {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding: .85rem 0; border-top: var(--hairline) solid var(--line-cool); color: var(--ink-soft);
}
.quarters li:first-child { border-top: 0; padding-top: 0; }
.quarters li:last-child { padding-bottom: 0; }
.quarters .q { font-family: var(--font-technical); font-size: var(--text-mono-meta); color: var(--ink-faint); padding-top: .15rem; }
.quarters .exposed { color: var(--text-exposed); }

/* ================================================================ founders */

.founder .portrait {
  display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 1.1rem;
  background: var(--surface-chip); border: var(--hairline) solid var(--line-cool);
  border-radius: var(--radius-control); object-fit: cover;
}
.founder .portrait.placeholder {
  display: grid; place-items: center;
  font-family: var(--font-technical); font-size: .72rem; color: var(--ink-faint);
}
.founder figcaption { display: flex; flex-direction: column; flex: 1; }
.founder h3 { margin-bottom: .1rem; }
.founder .role { font-size: .9rem; color: var(--ink-faint); margin: 0 0 .6rem; }
.founder .links {
  max-width: none; margin: 0;
  font-family: var(--font-technical); font-size: var(--text-mono-meta);
  display: flex; gap: .4rem .9rem; flex-wrap: wrap;
}

/* ================================================================ ladder */

.status {
  align-self: flex-start; margin-bottom: .9rem;
  font-family: var(--font-technical); font-size: var(--text-badge); letter-spacing: var(--tracking-badge);
  text-transform: uppercase; white-space: nowrap;
  border: var(--hairline) solid var(--line-cool-strong); color: var(--ink-faint);
  padding: var(--pad-badge); border-radius: var(--radius-chip);
}
.status.now { border-color: var(--ink-strong); color: var(--ink-strong); }
.rung-card .access { font-size: .9rem; }

/* Containment cycle (future architecture). One cycle, then it holds. contain.js adds
   .staged and marks the step on screen .on and the ones before it .done; without script
   every step simply reads as written. */
#contain .viz-stage { height: clamp(300px, 42vw, 460px); }
.contain-steps {
  margin: 0; padding: 0; list-style: none; border-top: var(--border-proof-frame);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.contain-steps li {
  display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem;
  padding: .75rem 1rem; font-size: 0.86rem; line-height: 1.5; color: var(--text-proof);
  border-top: 2px solid transparent;
  transition: color var(--dur-step) var(--ease-fade), border-color var(--dur-step) var(--ease-fade);
}
.contain-steps li .s { font-family: var(--font-technical); font-size: .76rem; padding-top: .1rem; color: var(--text-exposed-proof); }
.staged .contain-steps li, .staged .contain-steps li .s { color: var(--text-proof-muted); }
.staged .contain-steps li.done, .staged .contain-steps li.on { color: var(--text-proof); }
.staged .contain-steps li.done .s, .staged .contain-steps li.on .s { color: var(--text-exposed-proof); }
.staged .contain-steps li.on { border-top-color: var(--text-exposed-proof); }

/* ================================================================ talk */

.talk-card { max-width: 46rem; margin: 0 auto; text-align: center; padding: clamp(2rem, 5vw, 3.5rem); }
.talk-card h2 { margin-bottom: 1rem; }
.talk-card p { margin-left: auto; margin-right: auto; font-size: 1.02rem; }
.talk-card .cn-actions { justify-content: center; }
.contacts {
  margin-top: 1.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem;
  font-family: var(--font-technical); font-size: .88rem;
}

/* ================================================================ technical page */

.toc {
  list-style: none; margin: 2rem auto 0; padding: 0; max-width: 62rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
}
.toc a {
  display: inline-block;
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--line-cool); border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
  padding: var(--pad-button-sm);
  font-family: var(--font-display); font-size: .85rem; font-weight: var(--weight-nav); color: var(--ink);
}
.toc a:hover { border-color: var(--line-cool-strong); color: var(--action); text-decoration: none; }

/* The document card. It sits on the same element as .wrap, so it replaces the wrap's
   width and padding rather than nesting inside them. */
.cn-doc {
  width: calc(100% - var(--gutter) * 2);
  max-width: calc(var(--measure-tech) + clamp(3rem, 8vw, 7rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--surface-card-bg);
  border: var(--hairline) solid var(--line-cool); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.tech-body { color: var(--ink-soft); }
.tech-body h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  margin-top: var(--stack-6); scroll-margin-top: 1.5rem;
}
.tech-body h2:first-of-type { margin-top: 0; }
.tech-body h3 { margin-top: 2rem; margin-bottom: .5rem; }
.tech-body ul, .tech-body ol { max-width: var(--prose); padding-left: 1.15rem; }
.tech-body li { margin-bottom: .45rem; }
.tech-body code { color: var(--ink); }
.tech-body .term { margin: 1.2rem 0; }
.tech-body .term code { color: inherit; }
.tech-body table { border-collapse: collapse; width: 100%; font-size: var(--text-small); margin: 1.4rem 0; }
.tech-body th, .tech-body td {
  text-align: left; vertical-align: top; padding: .7rem .9rem .7rem 0;
  border-bottom: var(--hairline) solid var(--line-cool);
}
.tech-body th {
  font-family: var(--font-technical); font-size: var(--text-label); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--ink-faint); font-weight: var(--weight-regular);
}
.tech-body td:first-child { color: var(--ink); }

/* ================================================================ footer */

.cn-footer {
  background: var(--surface-field);
  border-top: var(--hairline) solid var(--line-cool);
  padding: 2.5rem 0 3.5rem;
  font-family: var(--font-display); font-size: .92rem; color: var(--ink-faint);
}
.cn-footer .wrap { display: flex; flex-wrap: wrap; gap: .6rem 2rem; align-items: baseline; }
.cn-footer .brand { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.cn-footer .fine { flex-basis: 100%; font-size: .85rem; color: var(--ink-faint); }
section.alt + .cn-footer, main > section:last-child.alt { border-bottom: 0; }

/* ================================================================ small screens */

@media (max-width: 1200px) {
  .cn-pills { display: none; }
}

/* The nav holds five items that must not wrap mid-label, so it needs its own row well
   before phone widths - otherwise the scheme toggle is pushed off the right edge and the
   whole page scrolls sideways. */
@media (max-width: 1040px) {
  .cn-topbar .wrap { flex-wrap: wrap; gap: .6rem 1rem; }
  .cn-nav { margin-left: 0; width: 100%; gap: 1.1rem; flex-wrap: wrap; }
  .cn-nav .cn-btn { margin-left: auto; }
}

@media (max-width: 760px) {
  .cn-announce .sep { display: none; }
  .cn-announce a { display: flex; justify-content: center; margin-top: .2rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .quarters li { grid-template-columns: 1fr; gap: .1rem; }
  .cn-card { padding: 1.2rem; }
}

/* ================================================================ motion */

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

.mt1 { margin-top: 1rem; }
.mt2 { margin-top: var(--stack-4); }

@media print {
  .cn-announce, .cn-nav, .cn-pills, .cn-actions, .replay { display: none; }
  body { font-size: 11pt; background: #fff; }
  .cn-card, .cn-doc, .viz-frame { box-shadow: none; }
}
