  :root {
    /* SpecDeck DS — dark canonical theme */
    --bg: #0a0d10;
    --panel: #11171c;
    --panel-2: #1a2128;
    --panel-3: #232b33;
    /* Text tiers tuned per the 2026-08 contrast audit: --muted clears AA on
       every panel level, --faint clears it on --bg and --panel (use it only
       for truly incidental text). */
    --fg: #f0f4f8;
    --fg-2: #c2ccd8;
    --muted: #93a0ad;
    --faint: #7e8a96;
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.14);
    --border-bright: rgba(255,255,255,0.22);
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --accent-ink: #02110f;
    --accent-muted: rgba(20,184,166,0.12);
    --accent-glow: rgba(20,184,166,0.30);
    /* Status palette — lifecycle only */
    --status-progress: #3b82f6;
    --status-published: #10b981;
    --status-done: #a78bfa;
    --status-blocked: #ef4444;
    --status-review: #f59e0b;   /* the app's in_review lane */
    /* The two actors the page draws: people and AI agents */
    --actor-person: #a78bfa;
    --actor-agent: var(--accent);
    --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
  }

  /* Buttons are excluded: their own text colors carry the AA contrast pair
     against the button background, and this rule would override them. */
  a:not([class*="btn-"]):hover { color: var(--fg) !important; }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  .btn-primary:focus-visible {
    outline-color: var(--fg);
  }

  .btn-primary {
    display: inline-block;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-ink) !important;
    border: 1px solid var(--accent);
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease, transform 120ms ease;
  }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-primary:active { transform: scale(0.98); }
  .btn-primary.btn-lg { padding: 11px 18px; font-size: 14px; }

  /* Secondary button: a neutral tonal fill, so it reads as a button on --bg
     and on a card's --panel alike, while only the primary carries the
     accent. The fill lifts the surface it sits on by 7% --fg, mixed in
     sRGB to give the color that 7% --fg over that surface would. It is
     opaque, so the hero's grid doesn't show through it. A button on
     anything but --bg names that surface in --btn-surface. */
  .btn-ghost {
    display: inline-block;
    padding: 8px 14px;
    background: color-mix(in srgb, var(--fg) 7%, var(--btn-surface, var(--bg)));
    color: var(--fg) !important;
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 color-mix(in oklab, var(--fg) 6%, transparent);
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  }
  .btn-ghost:hover {
    background: color-mix(in srgb, var(--fg) 12%, var(--btn-surface, var(--bg)));
    border-color: color-mix(in oklab, var(--fg) 34%, transparent);
  }
  .btn-ghost:active { transform: scale(0.98); }
  .btn-ghost.btn-lg { padding: 11px 18px; font-size: 14px; }

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

  /* ============================================================
     HERO STORY (Hero.jsx, HeroStory.jsx). One section: the hero copy
     and five captions in the left column, a sticky stage in the right
     one, centered under the nav. The hero copy is step 0 and fills the
     first screen with the agents row under it; each caption fills one
     more.
     ============================================================ */
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .hero-story {
    --stage-h: min(660px, calc(100svh - 65px - 48px));
    --hs-fail: color-mix(in oklab, var(--status-blocked) 65%, var(--fg-2));
    --hs-amber: var(--status-review);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 40px;
  }
  /* The first screen: the hero copy, centred in what the agents row
     leaves, and the row across both columns at the bottom */
  .hero-first {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - 65px);
    min-height: calc(100svh - 65px);
  }
  .hero-story-intro {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
  }
  .hero-works { grid-column: 1 / -1; transition: opacity 200ms ease; }
  /* The stage stays put while the page scrolls, so the row fades as soon
     as the page moves, before it would slide across the stage */
  @media (min-width: 1024px) {
    .hero-story[data-scrolled] .hero-works { opacity: 0; }
  }
  .hero-copy { text-align: left; }
  .hero-story-rail { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
  .hero-story-steps { grid-column: 1; grid-row: 2; }
  .hero-story-steps ol { list-style: none; margin: 0; padding: 0; }
  /* A screen under the nav each, like the hero, so a link to one shows it
     the way the hero first shows */
  .hero-story-step {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 65px);
    min-height: calc(100svh - 65px);
    padding: 48px 0;
    scroll-margin-top: 65px;
  }
  /* A link reached by keyboard stops clear of the nav */
  .hero-story-step a { scroll-margin: 80px 0; }
  /* Where the caption's half of the story happens */
  .hero-story-chapter {
    margin-bottom: 12px;
    font: 600 15px/1.4 var(--sans);
  }
  .hero-story-chapter-problem { color: var(--hs-fail); }
  .hero-story-chapter-solution { color: var(--accent); }
  .hero-story-step h3 {
    margin: 0;
    max-width: 520px;
    font-family: var(--display);
    font-size: clamp(28px, 2.6vw, 38px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--fg);
    text-wrap: balance;
  }
  .hero-story-step p {
    margin: 16px 0 0;
    max-width: 480px;
    font-size: clamp(15px, 1.2vw, 17px);
    line-height: 1.6;
    color: var(--fg-2);
    text-wrap: pretty;
  }
  /* Like a step of a tour: where it is, then the link on */
  .hero-story-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 28px;
  }
  .hero-story-count {
    font: 14px/1.4 var(--sans);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
  }

  /* Room under the picture for the agents row, which runs under the
     stage on the first screen */
  .hs-stage {
    position: sticky;
    top: calc(65px + (100svh - 65px - var(--stage-h)) / 2);
    display: flex;
    flex-direction: column;
    height: var(--stage-h);
    padding-bottom: 36px;
    pointer-events: none;
  }
  .hs-view {
    position: relative;
    flex: 1;
    min-height: 0;
    container-type: size;
    transition: opacity 200ms ease;
  }
  .hs-view-narrow { display: none; }
  .hs-stage[data-fading] .hs-view { opacity: 0; }
  /* The canvas is drawn at a fixed size and scaled to the stage: the
     smaller of width and height over the canvas's own, as a number
     (tan(atan2(a, b)) is a / b). */
  .hs-canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 500px;
    height: 570px;
    --k: min(1.1, tan(atan2(100cqw, 500px)), tan(atan2(100cqh, 570px)));
    transform: translate(-50%, -50%) scale(var(--k));
    color: var(--fg);
    font-size: 12px;
    line-height: 1.4;
  }
  .hs-view-narrow .hs-canvas {
    width: 340px;
    height: 336px;
    --k: min(1.4, tan(atan2(100cqw, 340px)), tan(atan2(100cqh, 336px)));
  }

  /* A piece's place per step comes from its own --t0..--t5 (transform),
     --o0..--o5 (opacity) and delays (place() and fade() in HeroStory.jsx). */
  .hs-canvas .hs-p {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    transform: var(--t);
    opacity: var(--o);
    transition: transform 550ms cubic-bezier(0.33, 0, 0.15, 1) var(--dt), opacity 400ms ease var(--df);
  }
  .hs-canvas .hs-f { opacity: var(--o); transition: opacity 400ms ease var(--df); }
  .hs-canvas[data-step="0"] :is(.hs-p, .hs-f) { --t: var(--t0); --o: var(--o0); --dt: var(--dt0); --df: var(--df0); }
  .hs-canvas[data-step="1"] :is(.hs-p, .hs-f) { --t: var(--t1); --o: var(--o1); --dt: var(--dt1); --df: var(--df1); }
  .hs-canvas[data-step="2"] :is(.hs-p, .hs-f) { --t: var(--t2); --o: var(--o2); --dt: var(--dt2); --df: var(--df2); }
  .hs-canvas[data-step="3"] :is(.hs-p, .hs-f) { --t: var(--t3); --o: var(--o3); --dt: var(--dt3); --df: var(--df3); }
  .hs-canvas[data-step="4"] :is(.hs-p, .hs-f) { --t: var(--t4); --o: var(--o4); --dt: var(--dt4); --df: var(--df4); }
  .hs-canvas[data-step="5"] :is(.hs-p, .hs-f) { --t: var(--t5); --o: var(--o5); --dt: var(--dt5); --df: var(--df5); }

  .hs-glyph { flex-shrink: 0; }
  .hs-panel {
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.35);
  }
  .hs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    padding: 0 14px;
    font: 600 13px/1 var(--sans);
    color: var(--muted);
  }
  /* The count beside the label */
  .hs-head span + span { font: 12px/1 var(--mono); }

  /* Issues */
  .hs-list { overflow: hidden; }
  .hs-issue {
    position: relative;
    display: grid;
    grid-template-columns: 14px 40px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 7px 14px 0;
    border-top: 1px solid var(--border);
    background: var(--panel);
  }
  .hs-issue-state {
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border: 1.5px solid var(--muted);
    border-radius: 50%;
  }
  .hs-issue-done { border-color: var(--muted); background: var(--muted); color: var(--bg); }
  .hs-issue-done .hs-glyph { width: 9px; height: 9px; }
  .hs-issue-id { font: 12.5px/20px var(--mono); color: var(--faint); }
  .hs-issue-text { display: flex; flex-direction: column; min-width: 0; }
  .hs-issue-title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    color: var(--fg);
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  /* The issues the agent never sees: muted, but still readable */
  .hs-tracker .hs-issue-title { color: var(--fg-2); }
  .hs-tracker .hs-issue-aside .hs-issue-title { color: var(--muted); }
  .hs-slot { width: 100%; border-top: 1px solid var(--border); }
  .hs-slot::after {
    content: '';
    position: absolute;
    inset: 5px 8px;
    border: 1px dashed var(--border-bright);
    border-radius: 6px;
  }
  /* #1142: the issue the agent takes */
  .hs-focus { border-radius: 8px; background: var(--panel); }
  .hs-focus .hs-issue { z-index: 1; border-top-color: transparent; background: transparent; }
  .hs-focus-lift { position: absolute; inset: 0; border-radius: 8px; }
  .hs-focus-lift {
    border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    box-shadow: 0 0 0 3px var(--accent-muted), 0 14px 32px rgba(0,0,0,0.5);
  }
  /* A decision as it reads in its issue, marked like a highlighter */
  .hs-frag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 7px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--hs-amber) 22%, var(--panel));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--hs-amber) 45%, transparent);
    font-size: 13.5px;
    line-height: 17px;
    color: var(--fg);
    white-space: nowrap;
  }
  .hs-frag .hs-glyph { color: var(--hs-amber); }
  /* The problem steps happen in someone else's tool: a grey window */
  .hs-tracker {
    --panel: #15181b;
    border-color: rgba(255,255,255,0.1);
    background: var(--panel);
  }
  .hs-tracker .hs-head { color: #8c939a; }
  /* What the agent sees: #1142 lands in it */
  .hs-canvas .hs-bubble { padding: 11px 12px; }
  .hs-bubble-label { font: 600 13px/1 var(--sans); color: var(--muted); }
  .hs-wide .hs-bubble .sa-thought-dot-1 { left: 62px; }
  .hs-wide .hs-bubble .sa-thought-dot-2 { left: 72px; }
  .hs-narrow .hs-bubble .sa-thought-dot-1 { left: 40px; }
  .hs-narrow .hs-bubble .sa-thought-dot-2 { left: 48px; }
  /* What the ticket asked for works; the bug appears below it */
  .hs-pass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-2);
    font-size: 15px;
    line-height: 20px;
    white-space: nowrap;
  }
  .hs-pass .hs-glyph { color: var(--accent); }
  .hs-sticker {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-ink);
    font: 600 12.5px/1.4 var(--mono);
    white-space: nowrap;
    transform: rotate(4deg);
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
  }
  .hs-layer { position: absolute; left: 0; top: 0; white-space: nowrap; }
  .hs-canvas .hs-halo {
    position: absolute;
    inset: -40px;
    pointer-events: none;
  }
  .hs-halo-good { background: radial-gradient(closest-side, var(--accent-muted), transparent); }
  .hs-halo-warn { background: radial-gradient(closest-side, color-mix(in srgb, var(--status-review) 9%, transparent), transparent); }

  /* The spec card, shared with the hero's earlier picture */
  .hs-card .spec-card-document { height: 100%; }
  .spec-card-stack,
  .spec-card-document {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel);
  }
  .spec-card-stack { position: absolute; inset: 0; transform: translate(7px, 7px) rotate(1.5deg); }
  .spec-card-document {
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3), inset 0 1px 0 var(--border);
  }
  .spec-card-header { height: 84px; padding: 16px 22px 0; }
  .spec-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  .spec-card-kind { font: 600 13px/1.5 var(--sans); color: var(--accent); }
  .spec-card-reviewed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid var(--accent-glow);
    border-radius: 4px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
  }
  .spec-card-title {
    font-family: var(--display);
    font-size: 27px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  .spec-card-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6px;
    align-items: start;
    gap: 10px;
    width: 100%;
    padding: 13px 22px;
    border-top: 1px solid var(--border);
  }
  .spec-card-section-label { font-size: 15px; font-weight: 600; line-height: 20px; color: var(--fg-2); }
  .spec-card-section-text { margin-top: 3px; font-size: 14px; line-height: 20px; color: var(--muted); }
  .spec-card-node {
    width: 6px;
    height: 6px;
    margin-top: 7px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: var(--accent-muted);
  }
  .spec-card-history-label { margin-bottom: 8px; font: 8px/1.5 var(--mono); letter-spacing: 0.04em; color: var(--muted); }
  .spec-card-versions { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .spec-card-version { min-width: 0; color: var(--muted); }
  .spec-card-version > span { display: block; font: 13.5px/1.5 var(--mono); }
  .spec-card-version small { display: block; margin-top: 2px; font-size: 13px; }
  .spec-card-version-current { color: var(--fg-2); }
  .spec-card-version-current > span { color: var(--accent); }
  .spec-card-version-current b { padding: 2px 5px; border-radius: 3px; background: var(--accent-muted); font-size: 12px; font-weight: 500; }
  .spec-card-version-arrow { color: var(--faint); }
  .hs-section-body { position: relative; min-width: 0; }
  /* What changed since v2, marked as an added line */
  .hs-diff {
    position: absolute;
    left: -16px;
    right: -10px;
    top: 22px;
    bottom: -2px;
    z-index: -1;
    padding-left: 3px;
    border-left: 2px solid var(--accent);
    border-radius: 0 3px 3px 0;
    background: var(--accent-muted);
    font: 600 12px/20px var(--mono);
    color: var(--accent);
  }
  .hs-timeline { padding: 11px 20px; }
  .hs-timeline .spec-card-history-label { display: none; }
  .hs-delta-arrow { color: var(--accent); }
  .hs-criterion {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 22px;
    font-size: 14.5px;
    color: var(--fg-2);
    white-space: nowrap;
  }
  .hs-crit-mark { position: relative; width: 16px; height: 16px; }
  .hs-crit-pending {
    position: absolute;
    inset: 1px;
    border: 1.5px solid var(--border-bright);
    border-radius: 50%;
  }
  .hs-canvas .hs-crit-pass {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    transform-origin: 50% 50%;
  }
  .hs-crit-pass .hs-glyph { width: 11px; height: 11px; }
  /* Each check ticks in with a small overshoot */
  .hs-canvas .hs-p.hs-crit-pass {
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--dt), opacity 120ms ease var(--df);
  }
  .hs-crit-text { overflow: hidden; text-overflow: ellipsis; }
  .hs-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 13.5px/1.5 var(--mono);
    color: var(--fg-2);
    white-space: nowrap;
  }
  .hs-done .hs-glyph { color: var(--accent); }

  /* The narrow canvas: three issues, no version timeline, tighter padding.
     It is drawn short so it scales up on a phone, which is why its type is
     no smaller than the wide one's. */
  .hs-narrow .hs-head { padding: 0 10px; font-size: 13.5px; }
  .hs-narrow .hs-head span + span { font-size: 12.5px; }
  .hs-narrow .hs-issue {
    grid-template-columns: 12px 38px minmax(0, 1fr);
    column-gap: 8px;
    padding: 4px 10px 0;
  }
  .hs-narrow .hs-issue-state { width: 12px; height: 12px; }
  .hs-narrow .hs-issue-id { font-size: 12.5px; line-height: 19px; }
  .hs-narrow .hs-issue-title { font-size: 15px; line-height: 19px; }
  .hs-narrow .hs-frag { gap: 5px; padding: 1.5px 6px; }
  .hs-narrow .hs-bubble { padding: 5px 10px 8px; }
  .hs-narrow .hs-bubble-label { font-size: 13.5px; }
  .hs-narrow .hs-pass,
  .hs-narrow .sa-bug-label { font-size: 14px; line-height: 20px; }
  .hs-narrow .sa-status { font-size: 13px; }
  /* Beside the agent, which has little room on either side here */
  .hs-narrow .sa-status b { display: block; }
  /* The title and Reviewed share a line; the kind line goes */
  .hs-narrow .spec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 50px;
    padding: 0 14px;
  }
  .hs-narrow .spec-card-meta { order: 2; margin: 0; }
  .hs-narrow .spec-card-kind { display: none; }
  .hs-narrow .spec-card-title { font-size: 22px; }
  .hs-narrow .spec-card-section { gap: 8px; padding: 7px 14px; }
  .hs-narrow .spec-card-section-label { font-size: 14.5px; line-height: 17px; }
  .hs-narrow .spec-card-section-text { margin-top: 1px; font-size: 13.5px; line-height: 16px; }
  .hs-narrow .hs-sentence { display: block; }
  .hs-narrow .spec-card-node { margin-top: 5px; }
  .hs-narrow .hs-diff { left: -12px; right: -6px; top: 18px; padding-left: 1px; font-size: 12px; line-height: 16px; }
  .hs-narrow .spec-card-stack { transform: translate(4px, 4px) rotate(1deg); }
  .hs-narrow .hs-criterion { grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 0 14px; font-size: 13.5px; }
  .hs-narrow .hs-crit-mark { width: 14px; height: 14px; }
  .hs-narrow .hs-crit-pass { width: 14px; height: 14px; }

  /* Below 1024px the stage sits at the bottom of the screen and the
     captions scroll in above it, one per part of the screen it leaves, so
     each caption is read before the picture changes. The first screen is
     the hero copy with the agents row at its bottom, and no picture. */
  @media (max-width: 1023px) {
    .hero-story {
      --stage-h: clamp(300px, 46svh, 372px);
      --free-h: calc(100svh - 65px - var(--stage-h));
      grid-template-columns: minmax(0, 1fr);
    }
    .hero-story-intro { padding: 56px 0 40px; }
    .hero-copy { text-align: center; max-width: 680px; margin: 0 auto; }
    .hero-copy h1 { margin-left: auto !important; margin-right: auto !important; }
    .hero-actions { justify-content: center; }
    /* The rail lies over the captions with the stage at its foot, held a
       caption's height below its top: the stage comes up under step 1's
       caption, then stays at the bottom of the screen. Clicks on the
       captions pass through the rail. */
    .hero-story-rail {
      grid-column: 1;
      grid-row: 2;
      position: relative;
      z-index: 2;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding-top: var(--free-h);
      pointer-events: none;
    }
    /* Room after the last caption for the stage to sit under it */
    .hero-story-steps { grid-column: 1; grid-row: 2; padding-bottom: var(--stage-h); }
    .hs-stage {
      top: auto;
      bottom: 0;
      padding-bottom: 0;
      background: var(--bg);
      pointer-events: auto;
    }
    /* Captions fade in as they come out from behind it */
    .hs-stage::before {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 100%;
      height: 32px;
      background: linear-gradient(to bottom, transparent, var(--bg));
    }
    .hs-view-wide { display: none; }
    /* An explicit height: as a flex item inside the flex rail its size
       container reads 0px tall to the canvas's scale */
    .hs-view-narrow { display: block; flex: none; height: var(--stage-h); }
    .hero-story-step {
      align-items: center;
      min-height: var(--free-h);
      padding: 20px 0;
      text-align: center;
    }
    /* On a phone the part above the stage is barely a caption tall, so
       the gap between two captions is set here, not left to that height */
    .hero-story-step + .hero-story-step { margin-top: 80px; }
    /* The last caption ends where the stage stops, so its button needs room
       clear of the fade on the stage's top edge */
    .hero-story-step:last-child { padding-bottom: 56px; }
    /* A link reached by keyboard stops clear of the stage */
    .hero-story-step a { scroll-margin-bottom: calc(var(--stage-h) + 16px); }
    .hero-story-step h3 { font-size: clamp(24px, 4.4vw, 32px); }
    .hero-story-step p { font-size: 15px; }
    /* Scrolling is the tour here: no count, and only the last caption
       keeps its button */
    .hero-story-count { display: none; }
    .hero-story-step:not(:last-child) .hero-story-actions { display: none; }
  }

  /* Reduced motion: nothing moves; StoryStage fades the stage out and back
     in around each change, and these beat the global rule further down */
  @media (prefers-reduced-motion: reduce) {
    .hs-canvas :is(.hs-p, .hs-f) { transition: none !important; }
    .hs-stage .hs-view { transition: opacity 200ms ease !important; }
  }

  /* ============================================================
     STORY AGENT (StoryAgent.jsx): a robot with a terminal screen
     for a face and a context battery on its chest. --sa-tone is its
     mood colour: teal when it has what it needs, amber when context
     is missing, a sick green when it ships bugs.
     ============================================================ */
  .sa-good { --sa-tone: #2dd4bf; }
  .sa-warn { --sa-tone: #fbbf24; }
  .sa-sick { --sa-tone: #b5cf68; }
  .sa {
    position: relative;
    width: 108px;
    height: 156px;
  }
  .sa-bob { position: absolute; inset: 0 0 auto; height: 144px; }
  /* Two antennas, shaped by the mood (AGENT_ANTENNAS) */
  .sa-antennas { position: absolute; left: 0; top: 0; width: 108px; height: 30px; }
  .sa-antennas svg { position: absolute; inset: 0; overflow: visible; }
  .sa-antennas path { stroke: #46525d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sa-tip {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sa-tone);
    box-shadow: 0 0 10px color-mix(in srgb, var(--sa-tone) 70%, transparent);
  }
  .sa-sick .sa-tip { box-shadow: 0 0 6px color-mix(in srgb, var(--sa-tone) 40%, transparent); }
  .sa-mark {
    position: absolute;
    left: 88px;
    top: -12px;
    font: 700 22px/1 var(--mono);
    color: var(--sa-tone);
    text-shadow: 0 0 10px color-mix(in srgb, var(--sa-tone) 50%, transparent);
    transform: rotate(10deg);
  }
  .sa-head {
    position: absolute;
    left: 0;
    top: 22px;
    width: 108px;
    height: 86px;
    border: 1.5px solid rgba(255,255,255,0.16);
    border-radius: 24px;
    background: linear-gradient(180deg, #252e36, #171d23);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 28px rgba(0,0,0,0.45);
  }
  /* The chest, tucked under the head, with the context battery */
  .sa-body {
    position: absolute;
    left: 18px;
    top: 102px;
    width: 72px;
    height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 10px;
    border: 1.5px solid rgba(255,255,255,0.16);
    border-radius: 10px 10px 14px 14px;
    background: linear-gradient(180deg, #1d242b, #151a1f);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 22px rgba(0,0,0,0.4);
  }
  .sa-cells {
    position: relative;
    display: flex;
    gap: 2px;
    padding: 1.5px;
    border: 1.5px solid rgba(255,255,255,0.22);
    border-radius: 3px;
  }
  .sa-cells::after {
    content: '';
    position: absolute;
    right: -4.5px;
    top: 3px;
    width: 2.5px;
    height: 6px;
    border-radius: 0 2px 2px 0;
    background: rgba(255,255,255,0.22);
  }
  .sa-cells i { position: relative; width: 10px; height: 9px; border-radius: 1px; background: rgba(255,255,255,0.07); }
  .sa-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--sa-tone);
    box-shadow: 0 0 6px color-mix(in srgb, var(--sa-tone) 55%, transparent);
  }
  .sa-ear {
    position: absolute;
    top: 30px;
    width: 6px;
    height: 22px;
    background: #2b343d;
    border: 1px solid rgba(255,255,255,0.12);
  }
  .sa-ear-l { left: -7px; border-radius: 4px 0 0 4px; border-right: 0; }
  .sa-ear-r { right: -7px; border-radius: 0 4px 4px 0; border-left: 0; }
  .sa-screen {
    position: absolute;
    inset: 8px;
    overflow: hidden;
    border-radius: 16px;
    background: #05090a;
  }
  /* The screen's glow in the mood's colour; the story fades between them */
  .sa-tint {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120% 90% at 50% 35%, color-mix(in srgb, var(--sa-tone) 16%, #05090a), #05090a 78%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sa-tone) 22%, transparent), inset 0 0 18px color-mix(in srgb, var(--sa-tone) 12%, transparent);
  }
  .sa-face-set { position: absolute; inset: 0; }
  /* Faint scanlines, so it reads as a screen */
  .sa-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px);
  }
  .sa-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 600 25px/1 var(--mono);
    letter-spacing: -0.02em;
    color: var(--sa-tone);
    text-shadow: 0 0 12px color-mix(in srgb, var(--sa-tone) 55%, transparent);
    white-space: nowrap;
  }
  .sa-look-down > .sa-face { top: 8px; }
  .sa-blink { opacity: 0; }
  .sa-chew-alt { opacity: 0; }
  .sa-claw { position: absolute; width: 30px; height: 30px; }
  .sa-claw svg { display: block; overflow: visible; filter: drop-shadow(0 5px 7px rgba(0,0,0,0.45)); }
  .sa-claw-right svg { transform: scaleX(-1); }
  .sa-claw-part { fill: #29323b; stroke: rgba(255,255,255,0.22); stroke-width: 1.25; stroke-linejoin: round; }
  .sa-claw-wrist { fill: #313b45; }
  .sa-claw-bolt { fill: #56636e; }
  /* On the stage a claw turns about its middle */
  .hs-canvas .hs-p.sa-claw { transform-origin: 15px 15px; }
  .sa-shadow {
    position: absolute;
    left: 18px;
    bottom: 0;
    width: 72px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0,0,0,0.5), transparent);
  }

  .sa-status { font: 13px/1.4 var(--mono); color: var(--muted); white-space: nowrap; }
  .sa-status b { font-weight: 500; color: var(--sa-tone); }

  .sa-bug { position: absolute; display: flex; align-items: center; gap: 8px; color: var(--hs-fail, #e2827d); }
  .sa-bug svg { flex-shrink: 0; }
  .sa-bug-label { color: var(--fg-2); font-size: 15px; line-height: 20px; white-space: nowrap; }

  .sa-thought {
    position: absolute;
    padding: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  }
  .sa-thought-dot {
    position: absolute;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--panel);
  }
  .sa-thought-left .sa-thought-dot-1 { left: 26px; bottom: -16px; width: 12px; height: 12px; }
  .sa-thought-left .sa-thought-dot-2 { left: 16px; bottom: -28px; width: 7px; height: 7px; }
  .sa-thought-right .sa-thought-dot-1 { right: 26px; bottom: -16px; width: 12px; height: 12px; }
  .sa-thought-right .sa-thought-dot-2 { right: 16px; bottom: -28px; width: 7px; height: 7px; }

  /* At rest: a slow float, a blink every few seconds, chewing in bursts,
     eyes that scan a line, and an amber tip that pulses */
  .sa-float .sa-bob { animation: sa-bob 3.6s ease-in-out infinite; }
  .sa-float .sa-shadow { animation: sa-shadow 3.6s ease-in-out infinite; }
  .sa-blink { animation: sa-blink 4.2s steps(1) infinite; }
  .sa-face:has(+ .sa-blink) { animation: sa-unblink 4.2s steps(1) infinite; }
  .sa-chew { animation: sa-chew 2.4s steps(1) infinite; }
  .sa-chew-alt { animation: sa-chew-alt 2.4s steps(1) infinite; }
  .sa-scan { animation: sa-scan 2.2s ease-in-out infinite; }
  .sa-warn .sa-tip { animation: sa-tip 1.2s ease-in-out infinite; }
  @keyframes sa-bob { 50% { transform: translateY(-5px); } }
  @keyframes sa-shadow { 50% { transform: scale(0.88); opacity: 0.75; } }
  @keyframes sa-blink { 0%, 93% { opacity: 0; } 94%, 97% { opacity: 1; } 98% { opacity: 0; } }
  @keyframes sa-unblink { 0%, 93% { opacity: 1; } 94%, 97% { opacity: 0; } 98% { opacity: 1; } }
  @keyframes sa-chew { 0%, 12%, 24%, 36% { opacity: 1; } 6%, 18%, 30% { opacity: 0; } 42% { opacity: 1; } }
  @keyframes sa-chew-alt { 0%, 12%, 24%, 36% { opacity: 0; } 6%, 18%, 30% { opacity: 1; } 42% { opacity: 0; } }
  @keyframes sa-scan { 0%, 100% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
  @keyframes sa-tip { 50% { scale: 0.6; } }
  @media (prefers-reduced-motion: reduce) {
    .sa *, .sa { animation: none !important; }
    .sa-blink, .sa-chew-alt { opacity: 0 !important; }
  }

  /* ============================================================
     RESPONSIVE — goal board (<= 1100px): four lanes -> two by two.
     Narrower than this the lanes clip goal titles.
     ============================================================ */
  @media (max-width: 1100px) {
    .status-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  }

  /* Goal planner: the arrow into the node shows only once the lines into
     it go (<= 960px) */
  .planner-arrow-in { display: none; }

  /* ============================================================
     RESPONSIVE — tablet (<= 960px)
     ============================================================ */
  @media (max-width: 960px) {
    .container { padding-left: 20px !important; padding-right: 20px !important; }

    /* Spec architecture: stack */
    .arch-grid { grid-template-columns: 1fr !important; }

    /* Goal planner: the lines that tie the node to the two spec columns
       go with the columns, and a down arrow from the stacked columns
       takes their place, so the specs, the agent and the board still
       read as one flow */
    .planner-lines { display: none !important; }
    .planner-arrow-in { display: block !important; }

    /* Ownership modes: 3 cards stack */
    .modes-grid { grid-template-columns: 1fr !important; }

    /* Pricing: stack */
    .pricing-grid {
      grid-template-columns: 1fr !important;
      gap: 32px !important;
    }

    /* Assistant mock: one column; the panel sizes to its thread instead
       of matching the document's height. The document starts at
       Scenarios, as if scrolled, so the changed scenario and all four
       criteria fit above the fade. */
    .assist-doc { min-height: 400px !important; }
    .assist-panel { min-height: 0 !important; }
    .assist-doc-lead { display: none; }
  }

  /* ============================================================
     RESPONSIVE — mobile (<= 760px)
     ============================================================ */
  @media (max-width: 760px) {
    /* Hide desktop nav, show hamburger */
    .nav-links-desktop,
    .nav-cta-desktop { display: none !important; }
    .nav-burger { display: inline-flex !important; }
    /* The signup button sits right of the logo, next to the burger and as
       tall as it. */
    .nav-inner { gap: 10px !important; }
    .nav-cta-mobile {
      display: inline-flex !important;
      align-items: center;
      height: 40px;
      margin-left: auto;
    }
    .nav-cta-mobile,
    .nav-burger { flex-shrink: 0; }

    /* Tighter container padding */
    .container { padding-left: 16px !important; padding-right: 16px !important; }

    /* Hero: a tighter gap under the nav */
    .hero-story-intro { padding-top: 28px; padding-bottom: 32px; }

    /* Docs landing hero: a tighter gap under the header */
    .docs-landing-hero {
      padding-top: 36px !important;
    }

    /* Integration logos: stack neatly */
    .integration-logos {
      justify-content: center !important;
      gap: 16px 28px !important;
    }

    /* Section padding */
    #preview, #assistant, #pricing, #shift, #control, #demo { padding-top: 64px !important; }
    /* That padding is the nav's height, so a section link ("See the
       product", the nav) would land the heading against the nav. */
    #preview, #assistant, #pricing, #shift, #control, #demo { scroll-margin-top: 16px; }

    /* Goal board: the four lanes in a row you swipe, the next one peeking
       in. Stacked, they made the board 850px tall. The row runs out to
       the board's edges, over its 24px padding, and each lane snaps to
       where that padding starts. */
    .status-lanes {
      grid-template-columns: none !important;
      grid-auto-flow: column;
      grid-auto-columns: calc(100% - 32px);
      margin-left: -24px;
      margin-right: -24px;
      padding: 0 24px;
      scroll-padding: 0 24px;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      overscroll-behavior-x: contain;
      scrollbar-width: thin;
      scrollbar-color: var(--border-strong) transparent;
    }
    .status-lanes > * { scroll-snap-align: start; }
    /* The row takes keyboard focus here (ProductPreview.jsx); the ring
       sits inside it, clear of the frame's border */
    .status-lanes:focus-visible { outline-offset: -2px; }
    /* A lane is as wide as a phone allows, so the spec chips can be read */
    .goal-spec { font-size: 12px !important; }

    /* Buttons full-width-ish */
    .btn-primary.btn-lg,
    .btn-ghost.btn-lg { padding: 12px 18px !important; font-size: 14px !important; }
  }

  /* ============================================================
     RESPONSIVE — small mobile (<= 480px)
     ============================================================ */
  @media (max-width: 480px) {
    .container { padding-left: 16px !important; padding-right: 16px !important; }

    /* Footer: keep logo and links on one row */
    .footer-inner { flex-wrap: nowrap !important; gap: 12px !important; }

    /* Card padding shrink */
    .arch-grid > *,
    .status-lanes > * { padding: 14px !important; }
    /* The spec and goal frames too, which leaves a lane room for its
       goals from 360px up; the swipe row runs out over the new padding */
    .preview-frame { padding: 16px !important; }
    .status-lanes {
      margin-left: -16px;
      margin-right: -16px;
      padding: 0 16px;
      scroll-padding: 0 16px;
    }

    /* Assistant composer: keep Actions / level / Send on one row */
    .ai-level-label { display: none !important; }

    /* Assistant mock: tighter insets; the editor and the panel keep their
       own insets (not the card padding above) */
    .assist-doc-inner { padding: 14px !important; }
    .arch-grid > .assist-editor,
    .arch-grid > .assist-panel { padding: 0 !important; }
  }

  /* Assistant mock on phones (<= 540px). The document's lines wrap more,
     so the box grows until the last criterion clears the fade. The
     toolbar wraps below 520px, where a divider would hang at the end of
     the first row or lead the second; the groups keep its spacing. */
  @media (max-width: 540px) {
    .assist-doc { min-height: 520px !important; }
    .assist-tool-sep { background: transparent !important; }
  }

  /* Assistant mock: the text caret in the composer. The reduced-motion
     rule below stops it after one cycle, visible. */
  .assist-caret { animation: blink 1.06s steps(1) infinite; }

  /* Assistant mock on the narrowest phones (<= 350px): the composer's
     Send button takes its own line rather than clipping the level chip */
  @media (max-width: 350px) {
    .assist-composer-row { flex-wrap: wrap !important; }
  }

  /* hide the burger by default on desktop */
  .nav-burger { display: none; }
  .nav-cta-mobile { display: none; }
  .nav-cta-short { display: none; }
  @media (max-width: 359px) {
    .nav-cta-long { display: none; }
    .nav-cta-short { display: inline; }
  }

  ::selection { background: color-mix(in oklab, var(--accent) 45%, transparent); color: var(--fg); }

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

  /* ============================================================
     DOCS — shared chrome for the /docs/ pages
     ============================================================ */
  html { scroll-behavior: smooth; }
  body.docs a { color: var(--accent); text-decoration: none; }
  body.docs a strong { color: inherit; }

  /* ============================================================
     DEMO TOUR — the film across the full container width with its
     controls inside it, and one attribution line below. Base styles
     are inline in components/DemoTour.jsx; these rules cover the
     control bar, hover, focus and the mobile sizes.
     ============================================================ */

  /* Click-to-seek bar along the bottom of the video frame. The visible
     track stays a 3px progress strip until the visitor reaches for it:
     the hit zone is 20px tall, and hovering (or keyboard focus) grows
     the track to 7px. The focus ring draws inset because the stage
     clips overflow. */
  .demo-seek {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 20px;
    cursor: pointer;
  }
  .demo-seek:focus-visible {
    outline-offset: -2px;
    border-radius: 0;
  }
  .demo-seek-track {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: rgba(255,255,255,.1);
    transition: height .15s;
  }
  .demo-seek:hover .demo-seek-track,
  .demo-seek:focus-visible .demo-seek-track {
    height: 7px;
  }

  /* Control bar inside the film, above the seek bar: play/pause, the time,
     sound and full screen on a dark scrim. The film is dark whatever the page theme, so
     the colours are fixed. The scrim lets clicks through to the video; only
     the controls take them. data-hidden (on the poster, and while the film
     plays and the pointer rests) fades it out, and keyboard focus anywhere
     in the stage brings it back. */
  .demo-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 28px 10px 20px;
    background: linear-gradient(to top, rgba(4, 6, 8, .88), rgba(4, 6, 8, .6) 55%, rgba(4, 6, 8, 0));
    pointer-events: none;
    transition: opacity .2s;
  }
  .demo-bar > * { pointer-events: auto; }
  .demo-bar[data-hidden] { opacity: 0; }
  .demo-bar[data-hidden] > * { pointer-events: none; }
  .demo-stage:has(:focus-visible) .demo-bar[data-hidden] { opacity: 1; }
  .demo-stage:has(:focus-visible) .demo-bar[data-hidden] > * { pointer-events: auto; }
  .demo-ctl {
    display: inline-flex;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: none;
    color: rgba(255, 255, 255, .86);
    cursor: pointer;
    transition: color .15s, background-color .15s;
  }
  .demo-ctl svg { width: 18px; height: 18px; }
  .demo-ctl:hover { color: #fff; background: rgba(255, 255, 255, .1); }
  .demo-ctl:focus-visible { outline-offset: -2px; border-radius: 6px; }
  .demo-ctl { scroll-margin-bottom: 12px; }
  /* A chapter step under the film scrolls the film back into view; the
     margin keeps its top clear of the sticky nav. */
  .demo-stage video { scroll-margin-top: 80px; }
  .demo-time {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  }

  /* Flow strip under the film: each step, and the loop label, plays the
     film from its chapter. The "▶ 0:04" time lights up on hover as the
     cue that it is a link into the film. */
  .flow-step { transition: border-color .15s, background-color .15s; }
  .flow-step:not(:disabled):hover { border-color: var(--border-bright) !important; }
  .flow-step:focus-visible { outline-offset: 3px; border-radius: 11px; }
  .flow-loop-label:focus-visible { border-radius: 999px; }
  .flow-step:not(:disabled):hover .flow-time,
  .flow-loop-label:not(:disabled):hover .flow-time { color: var(--accent) !important; }
  .flow-loop-label:not(:disabled):hover { color: var(--fg) !important; }
  .flow-step:disabled,
  .flow-loop-label:disabled { cursor: default !important; }

  /* Narrower than four readable columns: two, down to the narrowest
     phones. The arrows and the drawn loop go; the loop's label stays as a
     row of its own. */
  @media (max-width: 900px) {
    .flow-steps { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .flow-arrow,
    .flow-loop-line { display: none !important; }
    .flow-loop { display: block !important; margin-top: 12px; }
    .flow-loop-span { height: auto !important; }
    .flow-loop-label {
      position: static !important;
      transform: none !important;
      width: 100%;
      padding: 12px 14px !important;
      border: 1px dashed var(--border-strong) !important;
      border-radius: 11px !important;
      background: transparent !important;
      white-space: normal !important;
      text-align: left;
    }
    .flow-loop-label:focus-visible { border-radius: 11px; }
  }
  @media (max-width: 560px) {
    .planner-node { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }
  }

  @media (max-width: 900px) {
    .demo-stage { border-radius: 14px !important; }
  }
  /* Full screen (the bar's last button): the stage fills the screen and
     the film sits on black, letterboxed when the screen is not 16:9.
     !important beats the stage's inline frame styles. */
  .demo-stage:fullscreen {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
  .demo-stage:fullscreen video { object-fit: contain !important; }
  @media (max-width: 560px) {
    .demo-bar { padding: 14px 4px 20px; gap: 0; }
    .demo-ctl { padding: 6px; }
    .demo-ctl svg { width: 16px; height: 16px; }
    .demo-time { font-size: 12px; }
  }

  /* Link cards on docs landing */
  .door-card:hover {
    border-color: var(--border-bright) !important;
    transform: translateY(-3px);
    box-shadow: 0 24px 60px -28px color-mix(in oklab, black 60%, transparent);
  }

  /* Next-page cards at the foot of a docs page. Hover brightens every side
     but the left, which carries the card's color. */
  .docs-next-card:hover {
    border-top-color: var(--border-bright) !important;
    border-right-color: var(--border-bright) !important;
    border-bottom-color: var(--border-bright) !important;
    transform: translateY(-2px);
  }

  /* Agent tabs in the quickstart and the MCP guide (AgentTabs in
     components/DocsBits.jsx). The color is inline, so hover needs !important
     to lift an unselected tab; the focus ring sits inside the tab so the tab
     row's overflow cannot clip it. */
  .docs-agent-tab:hover:not([aria-selected="true"]) { color: var(--fg-2) !important; }
  .docs-agent-tab:focus-visible { outline-offset: -2px; }
  /* On a phone the quickstart's three tabs must fit the indented step column. */
  @media (max-width: 480px) {
    .docs-agent-tab { padding: 8px 7px !important; font-size: 13.5px !important; }
  }

  /* Custom scrollbar inside sidebar */
  .docs-sidebar-nav::-webkit-scrollbar { width: 6px; }
  .docs-sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  .docs-sidebar-nav::-webkit-scrollbar-track { background: transparent; }

  /* Inline code in the docs (InlineCode in components/DocsBits.jsx). It
     stays on one line, and ligatures are off so "--" and "-->" show as
     typed. On phones only a long chip (docs-code-long) wraps, so it
     cannot make the page pan sideways; each line keeps its own padding
     and border. */
  .docs-code {
    font-family: var(--mono);
    font-size: 0.88em;
    font-variant-ligatures: none;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--fg);
    white-space: nowrap;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
  @media (max-width: 480px) {
    .docs-code-long { white-space: normal; overflow-wrap: anywhere; }
  }

  /* Scrollbar inside code blocks */
  pre::-webkit-scrollbar { height: 8px; }
  pre::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  pre::-webkit-scrollbar-track { background: transparent; }

  /* Docs responsive */
  @media (max-width: 1080px) {
    body.docs .container { padding-left: 20px !important; padding-right: 20px !important; }
    .docs-grid {
      grid-template-columns: 220px 1fr !important;
      gap: 32px !important;
    }
  }

  @media (max-width: 860px) {
    .docs-grid {
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }
    .docs-sidebar { display: none !important; }
    .doors-grid {
      grid-template-columns: 1fr !important;
    }
    .qs-deeper-grid {
      grid-template-columns: 1fr !important;
    }
    .glance-grid {
      grid-template-columns: 1fr 1fr !important;
    }
  }

  @media (max-width: 480px) {
    .glance-grid { grid-template-columns: 1fr !important; }
  }

  /* ============================================================
     LEGAL — scoped chrome shared by the /privacy/ and /terms/ pages
     ============================================================ */
  body.privacy a, body.terms a { color: inherit; }
  body.privacy section[id], body.terms section[id] { scroll-margin-top: 80px; }

  body.privacy .hero, body.terms .hero {
    position: relative;
    padding: 88px 0 56px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--accent) 3%, transparent) 60%, transparent);
    overflow: hidden;
  }
  body.privacy .hero-grid, body.terms .hero-grid {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(to right, var(--border) 1px, transparent 1px),
      linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
  }
  body.privacy .hero-inner, body.terms .hero-inner { position: relative; }


  body.privacy .h1, body.terms .h1 {
    font-family: var(--display);
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.02; letter-spacing: -0.035em;
    font-weight: 600;
    margin: 18px 0 18px;
    text-wrap: balance;
  }
  body.privacy .lead, body.terms .lead {
    font-family: var(--display);
    font-size: clamp(18px, 1.7vw, 22px);
    line-height: 1.5; color: var(--fg-2);
    max-width: 640px; margin: 0;
    text-wrap: pretty;
    font-weight: 400;
  }

  body.privacy .meta-row, body.terms .meta-row {
    margin-top: 36px;
    display: flex; flex-wrap: wrap; gap: 12px;
    font-family: var(--mono); font-size: 11.5px;
    color: var(--muted);
  }
  body.privacy .meta-row .chip, body.terms .meta-row .chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
  }
  body.privacy .meta-row .chip b, body.terms .meta-row .chip b { color: var(--fg); font-weight: 500; }

  body.privacy .body, body.terms .body { min-width: 0; }
  body.privacy .body h2, body.terms .body h2 {
    font-family: var(--display);
    font-size: clamp(24px, 2.4vw, 30px);
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-weight: 600;
    margin: 0 0 8px;
    text-wrap: balance;
  }
  body.privacy .body h2 .num, body.terms .body h2 .num {
    font: 600 14px/1.4 var(--sans);
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    letter-spacing: 0;
    display: block; margin-bottom: 8px;
  }
  body.privacy .body h3, body.terms .body h3 {
    font-family: var(--sans);
    font-size: 14px; font-weight: 600;
    margin: 22px 0 6px;
    color: var(--fg);
    letter-spacing: -0.005em;
  }
  body.privacy .body p, body.terms .body p {
    color: var(--fg-2);
    font-size: 15px; line-height: 1.65;
    margin: 0 0 14px;
    text-wrap: pretty;
  }
  body.privacy .body ul, body.terms .body ul {
    margin: 0 0 14px; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: 8px;
  }
  body.privacy .body ul li, body.terms .body ul li {
    position: relative;
    padding-left: 22px;
    color: var(--fg-2);
    font-size: 15px; line-height: 1.6;
  }
  body.privacy .body ul li::before, body.terms .body ul li::before {
    content: ''; position: absolute;
    left: 4px; top: 0.65em;
    width: 8px; height: 1px;
    background: var(--accent);
  }
  body.privacy .body ul li b, body.terms .body ul li b { color: var(--fg); font-weight: 500; }

  body.privacy .section + .section, body.terms .section + .section {
    margin-top: 48px; padding-top: 40px;
    border-top: 1px solid var(--border);
  }

  body.privacy .callout, body.terms .callout {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: color-mix(in oklab, var(--accent) 4%, transparent);
    border-radius: 0 10px 10px 0;
    padding: 18px 20px;
    margin: 18px 0;
  }
  body.privacy .callout p, body.terms .callout p { margin: 0; color: var(--fg-2); font-size: 14.5px; }
  body.privacy .callout .callout-label, body.terms .callout .callout-label {
    font: 600 13px/1.4 var(--sans);
    color: var(--accent);
    margin-bottom: 6px;
  }

  body.privacy .data-table, body.terms .data-table {
    margin: 14px 0 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--panel);
  }
  body.privacy .data-row, body.terms .data-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid var(--border);
  }
  body.privacy .data-row:last-child, body.terms .data-row:last-child { border-bottom: none; }
  body.privacy .data-row .k, body.terms .data-row .k {
    padding: 14px 16px;
    font: 600 13px/1.55 var(--sans);
    color: var(--accent);
    background: color-mix(in oklab, var(--panel-2) 60%, transparent);
    border-right: 1px solid var(--border);
  }
  body.privacy .data-row .v, body.terms .data-row .v {
    padding: 14px 18px;
    font-size: 14px; color: var(--fg-2); line-height: 1.55;
  }
  body.privacy .data-row .v code, body.terms .data-row .v code {
    font-family: var(--mono); font-size: 12.5px;
    color: var(--fg);
    background: var(--panel-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
  }

  body.privacy .contact-card, body.terms .contact-card {
    margin-top: 56px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    background:
      radial-gradient(ellipse at top right, color-mix(in oklab, var(--accent) 8%, transparent), transparent 60%),
      var(--panel);
    display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between;
    gap: 20px;
  }
  body.privacy .contact-card h3, body.terms .contact-card h3 {
    font-family: var(--display);
    font-size: 22px; letter-spacing: -0.02em;
    margin: 0 0 4px; font-weight: 500;
  }
  body.privacy .contact-card p, body.terms .contact-card p {
    margin: 0; color: var(--fg-2); font-size: 14px;
  }
  body.privacy .contact-card .actions, body.terms .contact-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }
  body.privacy .mono, body.terms .mono { font-family: var(--mono); }

  @media (max-width: 760px) {
    body.privacy .hero, body.terms .hero { padding: 56px 0 36px; }
    body.privacy .data-row, body.terms .data-row { grid-template-columns: 1fr; }
    body.privacy .data-row .k, body.terms .data-row .k { border-right: none; border-bottom: 1px solid var(--border); }
  }

  /* ============================================================
     BLOG — scoped chrome for the /blog/ pages
     ============================================================ */
  body.blog a { color: inherit; text-decoration: none; }

  /* Card lift on hover (featured + post cards + "keep reading" cards) */
  body.blog .blog-featured:hover,
  body.blog .blog-card:hover {
    border-color: var(--border-bright) !important;
    transform: translateY(-3px);
    box-shadow: 0 24px 60px -28px color-mix(in oklab, black 60%, transparent);
  }

  @media (max-width: 920px) {
    body.blog .blog-grid { grid-template-columns: 1fr 1fr !important; }
    body.blog .blog-featured { grid-template-columns: 1fr !important; }
    body.blog .blog-featured > div:last-child {
      min-height: 200px !important;
      border-left: none !important;
      border-top: 1px solid var(--border) !important;
    }
  }

  @media (max-width: 760px) {
    body.blog .blog-more-grid { grid-template-columns: 1fr !important; }
  }

  @media (max-width: 600px) {
    body.blog .blog-grid { grid-template-columns: 1fr !important; }
  }
