/* home-v3.css — Rimfire homepage, version 3 (Alpha-only, served at /home-v3/).
   Direction: "an engineer's run sheet — precise, calm, schematic. One loud moment
   (the hero headline), everything else quiet and exact." Built on the house system
   (rimfire.css tokens); scoped under body.home3 so it can never touch the live homepage
   or v2. Design plan + the critique-against-tells pass: docs/design/home-v3-plan.md.

   What is intentionally different from v2 (each a decision, not a default):
   - cool PAPER, not warm cream (#f3f5f7, not #f8f7f5); orange spent on ONE motif;
   - the hero FOLLOWS the theme (light paper in light mode) — v2's hero was dark in both;
   - one fluid Utopia scale (--step-*) replaces v2's six hand-written clamps;
   - IBM Plex Sans as the real text face; Big Shoulders Display for the hero h1 ONLY;
   - the illustration is a SCHEMATIC (a drawing), not a fake live dashboard — no pulse,
     no green OK rows, no fabricated timestamps;
   - border-led cards (flat), an Every-Layout auto-fit Grid, three spacing intervals. */

/* =====================================================================
   1. TOKENS — only the warm LIGHT tokens are re-pointed to a cool paper.
   Dark mode already uses the house system's cool, composed dark ramp, so it is
   left alone. --accent (Rimfire orange) is unchanged: it is the brand.
   ===================================================================== */
body.home3 {
  /* cool paper replaces warm cream (the #1 AI tell v2 fell into) */
  --page: #f3f5f7;
  --surface-2: #e9edf1;
  --grid: #d9dee4;
  --axis: #b9c1ca;
  --ink: #15181c;
  --ink-2: #434a52;
  --muted: #697079;
  --field-border: #878d95;

  /* the text face: IBM Plex Sans (engineered, enterprise-data native). Display stays Big Shoulders. */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* content measure, capped near 1200px inside the shell's wide band */
  --v3-max: 1216px;

  /* ---- fluid type scale (Utopia method: 320px base16/1.2 -> 1520px base17/1.333) ---- */
  --step--2: clamp(0.7812rem, 0.773rem + 0.042vw, 0.8125rem); /* 12.5 -> 13.0px */
  --step--1: clamp(0.8438rem, 0.835rem + 0.042vw, 0.8750rem); /* 13.5 -> 14.0px */
  --step-0:  clamp(1.0000rem, 0.983rem + 0.083vw, 1.0625rem); /* 16.0 -> 17.0px  (body) */
  --step-1:  clamp(1.2000rem, 1.142rem + 0.288vw, 1.4163rem); /* 19.2 -> 22.7px */
  --step-2:  clamp(1.4400rem, 1.321rem + 0.597vw, 1.8879rem); /* 23.0 -> 30.2px */
  --step-3:  clamp(1.7280rem, 1.518rem + 1.052vw, 2.5166rem); /* 27.6 -> 40.3px  (section h2) */
  --step-4:  clamp(2.0736rem, 1.732rem + 1.708vw, 3.3547rem); /* 33.2 -> 53.7px */
  --step-5:  clamp(2.6250rem, 2.125rem + 2.500vw, 4.5000rem); /* 42.0 -> 72.0px  (hero h1) */

  /* ---- fluid space scale: three deliberate intervals ---- */
  --space-tight:  clamp(2.0rem, 1.733rem + 1.333vw, 3.0rem);  /* 32 -> 48 */
  --space-normal: clamp(3.0rem, 2.467rem + 2.667vw, 5.0rem);  /* 48 -> 80 */
  --space-peak:   clamp(4.5rem, 3.700rem + 4.000vw, 7.5rem);  /* 72 -> 120 */
  --flow:         clamp(0.875rem, 0.808rem + 0.333vw, 1.125rem);

  background: var(--page);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
}
/* The cool-paper overrides above are set on <body>, so they would otherwise shadow the house
   system's :root dark tokens in EVERY theme. Re-point the colour tokens back to the house dark
   ramp whenever dark is active, so dark mode stays composed and consistent with header/footer. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.home3 {
    --page: #0f1012; --surface-2: #212327; --grid: #2b2d31; --axis: #3a3c41;
    --ink: #f4f2ee; --ink-2: #c8c4bc; --muted: #9b978f; --field-border: #6e7178;
  }
}
:root[data-theme="dark"] body.home3 {
  --page: #0f1012; --surface-2: #212327; --grid: #2b2d31; --axis: #3a3c41;
  --ink: #f4f2ee; --ink-2: #c8c4bc; --muted: #9b978f; --field-border: #6e7178;
}

/* IBM Plex reads well a touch tighter than the OS sans */
body.home3 p { margin: 0; }

/* =====================================================================
   2. BAND SCAFFOLD + rhythm (three intervals, not one uniform 64px)
   ===================================================================== */
.home3 .band { position: relative; }
.home3 .band > .in { max-width: var(--v3-max); margin: 0 auto; padding-left: var(--home-pad); padding-right: var(--home-pad); }
.home3 .band.section { padding-top: var(--space-normal); padding-bottom: var(--space-normal); }
.home3 .band.section.tight-top { padding-top: var(--space-tight); }     /* a band closely tied to the one above */
.home3 .band.section.peak { padding-top: var(--space-peak); padding-bottom: var(--space-peak); } /* the one peak */
.home3 .band.tint { background: var(--surface-2); }
.home3 .band + .band { border-top: 1px solid var(--grid); }

/* section heads — heading carries itself (no eyebrow, no orange underline motif per section) */
.home3 .head { max-width: 62ch; margin-bottom: var(--space-tight); }
.home3 .head h2 { font-family: var(--font); font-weight: 600; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.home3 .head p { color: var(--ink-2); font-size: var(--step-1); margin-top: var(--flow); max-width: 60ch; }

/* interactive-target floor */
.home3 .btn, .home3 button, .home3 input, .home3 select, .home3 textarea { min-height: 44px; }
.home3 .btn.lg { min-height: 54px; }

/* de-shout the shell's all-caps field labels into sentence case (removes a known tell) */
.home3 .field label, .home3 .lbl { text-transform: none; letter-spacing: normal; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }

/* =====================================================================
   3. HERO — follows the theme. The loud moment is the headline typography,
   not a dark slab. One accent motif: the short rule under the h1.
   ===================================================================== */
.home3 .hero3 { background: var(--page); color: var(--ink); }
.home3 .hero3 .in { max-width: var(--v3-max); margin: 0 auto; padding: var(--space-normal) var(--home-pad);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.home3 .hero3 h1 { font-family: var(--display); font-weight: 800; font-size: var(--step-5);
  line-height: 0.98; letter-spacing: 0.005em; margin: 0; color: var(--ink); text-wrap: balance; max-width: 15ch; }
/* THE one accent motif: a short run-sheet rule */
.home3 .hero3 .rule { width: 72px; height: 4px; border-radius: 2px; background: var(--accent); margin: clamp(18px, 2.2vw, 26px) 0 0; }
.home3 .hero3 .lead { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 46ch; margin-top: var(--flow); }
.home3 .hero3 .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: var(--space-tight); }
.home3 .hero3 .fine { margin-top: 16px; font-size: var(--step--1); color: var(--muted); }

/* =====================================================================
   4. SCHEMATIC — a labelled drawing of one data job. Nodes + connectors,
   orange ONLY on the monitored-run node. No telemetry, no pulse, no OK rows.
   The one raised element on the page.
   ===================================================================== */
.home3 .schematic { background: var(--surface); border: 1px solid var(--grid); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 20px 22px; }
.home3 .titleblock { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--grid); }
.home3 .titleblock b { font-weight: 600; font-size: var(--step-0); letter-spacing: 0.01em; color: var(--ink); flex: 1; }
.home3 .titleblock .tag { font-size: var(--step--2); font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  border: 1px solid var(--grid); border-radius: 6px; padding: 3px 9px; }
.home3 .pipe { list-style: none; margin: 0; padding: 14px 0 0; display: grid; }
.home3 .pipe li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; padding: 11px 0; position: relative; }
/* schematic connector between node centres */
.home3 .pipe li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 43px; bottom: -3px; width: 2px; background: var(--axis); }
.home3 .pipe .node { width: 34px; height: 34px; border: 1.5px solid var(--axis); border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); background: var(--surface); position: relative; z-index: 1; }
.home3 .pipe .node svg { width: 18px; height: 18px; }
.home3 .pipe .label b { display: block; font-weight: 600; font-size: var(--step-0); color: var(--ink); }
.home3 .pipe .label span { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 1px; }
/* orange only here (the differentiator endpoint) */
.home3 .pipe .run .node { border-color: var(--accent); color: var(--accent); }
.home3 .pipe .run .label b { color: var(--accent-ink); }
.home3 .schematic .cap { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); font-size: var(--step--2); color: var(--muted); line-height: 1.5; }

@media (max-width: 900px) {
  .home3 .hero3 .in { grid-template-columns: 1fr; gap: var(--space-tight); }
  .home3 .hero3 h1 { max-width: 18ch; }
  .home3 .hero3 .lead { max-width: 54ch; }
  .home3 .schematic { max-width: 560px; }
}

/* =====================================================================
   5. FOUNDER BLOCK — the sign-off on the sheet. Name + role sign it; the
   four numbers are small supporting facts; the attribution is honest and verbatim.
   ===================================================================== */
.home3 .founder3 { background: var(--surface); }
.home3 .founder3 .in { padding-top: var(--space-normal); padding-bottom: var(--space-normal); }
.home3 .founder3 h2 { font-weight: 600; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.home3 .founder3 .who { margin-top: var(--space-tight); padding-top: var(--space-tight); border-top: 2px solid var(--ink); display: inline-block; }
.home3 .founder3 .who .nm { font-weight: 600; font-size: var(--step-2); letter-spacing: 0.01em; color: var(--ink); line-height: 1.1; }
.home3 .founder3 .who .role { font-size: var(--step-0); color: var(--ink-2); margin-top: 2px; }
.home3 .founder3 .attrib { color: var(--ink-2); font-size: var(--step-0); max-width: 70ch; margin-top: var(--flow); }
.home3 .founder3 .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: 20px 28px; margin: var(--space-tight) 0 0; }
.home3 .founder3 .facts > div { border-top: 1px solid var(--grid); padding-top: 12px; }
.home3 .founder3 .facts dt { font-weight: 600; font-size: var(--step-2); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.home3 .founder3 .facts dt span { color: var(--accent-ink); }
.home3 .founder3 .facts dd { margin: 8px 0 0; color: var(--muted); font-size: var(--step--1); max-width: 22ch; line-height: 1.4; }

/* =====================================================================
   6. GRID + CARDS — Every-Layout auto-fit (no 1000-1199px dead zone),
   border-led flat panels (not the SaaS soft-shadow card kit).
   ===================================================================== */
.home3 .grid { display: grid; gap: 20px; }
/* 16rem (not 18) so four cards fill the ~1200px measure cleanly instead of orphaning the
   4th onto its own row, while still collapsing to 2/1 columns through the mid widths (no dead zone). */
.home3 .grid.autofit { grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.home3 .card { background: var(--surface); border: 1px solid var(--grid); border-radius: 10px; box-shadow: none; padding: 22px; min-width: 0; }

.home3 .cap { display: flex; flex-direction: column; }
.home3 .cap .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-ink); border: 1px solid var(--grid); margin-bottom: 14px; }
.home3 .cap .ic svg { width: 22px; height: 22px; }
.home3 .cap h3 { font-size: var(--step-1); font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.home3 .cap p { color: var(--ink-2); font-size: var(--step-0); margin: 0 0 12px; }
.home3 .cap ul { margin: auto 0 0; padding-left: 18px; color: var(--ink-2); font-size: var(--step--1); display: grid; gap: 4px; }

/* how we work — numbered because the SEQUENCE is the information */
.home3 .steps3 { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-tight); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.home3 .steps3 .step { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.home3 .steps3 .no { font-weight: 600; font-size: var(--step-3); line-height: 0.9; color: var(--accent); font-variant-numeric: tabular-nums; }
.home3 .steps3 h3 { font-size: var(--step-1); font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.home3 .steps3 p { color: var(--ink-2); font-size: var(--step-0); }
.home3 .steps3.compact { gap: 18px; margin-top: var(--space-tight); }
.home3 .steps3.compact .no { font-size: var(--step-2); }
.home3 .steps3.compact h3 { font-size: var(--step-0); }
.home3 .steps3.compact p { font-size: var(--step-0); }

/* proof / demos */
.home3 .demo { display: flex; flex-direction: column; }
.home3 .demo .badge.sample { align-self: flex-start; margin-bottom: 12px; }
.home3 .demo h3 { font-size: var(--step-1); font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.home3 .demo p { color: var(--ink-2); font-size: var(--step-0); margin: 0 0 16px; }
.home3 .demo .row { margin-top: auto; }
.home3 .demo.soon { border-style: dashed; background: transparent; }

/* experience / track-record work cards */
.home3 .work h3 { font-size: var(--step-1); font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.home3 .work .where { color: var(--muted); font-size: var(--step--1); margin: 0 0 10px; }
.home3 .work p { color: var(--ink-2); font-size: var(--step-0); }
.home3 .exp-note { color: var(--muted); font-size: var(--step--1); margin: var(--space-tight) 0 0; max-width: 72ch; }

/* free tools — capped so two cards never stretch the band (Impeccable #5); JS adds .three for 3 */
.home3 .grid.tools { max-width: 940px; }
.home3 .grid.tools.three { max-width: none; }
.home3 .tool { display: flex; flex-direction: column; gap: 10px; }
.home3 .tool[hidden] { display: none; }
.home3 .tool h3 { font-size: var(--step-1); font-weight: 600; margin: 0; color: var(--ink); }
.home3 .tool p { color: var(--ink-2); font-size: var(--step-0); margin: 0; }
.home3 .tool .src { color: var(--muted); font-size: var(--step--1); }
.home3 .tool .state:empty { display: none; }
.home3 .tool .state { min-height: 22px; }
.home3 .tool .row { margin-top: auto; padding-top: 4px; }

/* =====================================================================
   7. CONTACT + FORM — GOV.UK error summary, inline per-field errors, success state
   ===================================================================== */
.home3 .contact-grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 56px); align-items: start; }
@media (min-width: 900px) { .home3 .contact-grid { grid-template-columns: 1fr 1fr; } }
.home3 .formcard { padding: 24px; }

/* error summary (GOV.UK pattern): thick edge, heading, links that jump to each field */
.home3 .errsum { border: 3px solid var(--critical); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; background: transparent; }
.home3 .errsum h3 { font-size: var(--step-1); font-weight: 600; margin: 0 0 8px; color: var(--critical-ink); }
.home3 .errsum ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.home3 .errsum a { color: var(--critical-ink); font-weight: 600; text-underline-offset: 2px; }
.home3 .errsum:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* inline per-field error: red left edge on the field + message under it */
.home3 .field .err { color: var(--critical-ink); font-size: var(--step--1); font-weight: 500; margin: 5px 0 0; }
.home3 .field .err[hidden] { display: none; }
.home3 .field input[aria-invalid="true"], .home3 .field textarea[aria-invalid="true"] { border-color: var(--critical); box-shadow: inset 3px 0 0 0 var(--critical); }

/* success state */
.home3 .formdone { text-align: center; padding: 28px 10px; }
.home3 .formdone .big { font-weight: 600; font-size: var(--step-3); color: var(--accent-ink); }
.home3 .formdone p { color: var(--ink-2); font-size: var(--step-0); margin: 8px 0 18px; }

/* =====================================================================
   8. MOTION — the single orchestrated moment: the schematic draws itself in
   once on load. Everything is visible by default; motion only adds.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .home3 .pipe li { animation: pipeIn 0.5s var(--ease-out) backwards; }
  .home3 .pipe li:nth-child(1) { animation-delay: 0.06s; }
  .home3 .pipe li:nth-child(2) { animation-delay: 0.15s; }
  .home3 .pipe li:nth-child(3) { animation-delay: 0.24s; }
  .home3 .pipe li:nth-child(4) { animation-delay: 0.33s; }
  @keyframes pipeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* =====================================================================
   9. #demos anchor + admin Workspace panel.
   The header nav and footer link to /#demos; .anchor is a zero-size landing
   target inside the proof section (its own id stays #proof). The Workspace
   panel is admin-only and server-gated (home.js renders it only on a 200 from
   /rf-api/admin/workspace); it reuses the house card/grid, link list only.
   ===================================================================== */
.home3 .anchor { display: block; height: 0; scroll-margin-top: 80px; }
.home3 #workspace .wslinks { list-style: none; margin: var(--flow) 0 0; padding: 0; display: grid; gap: var(--space-tight); }
.home3 #workspace .wslinks .btn { width: 100%; justify-content: flex-start; }
/* Sort/filter/search over the Workspace app list (admin-only). */
.home3 #workspace .ws-controls { margin: var(--flow) 0 var(--space-tight); gap: 12px 16px; align-items: flex-end; }
.home3 #workspace .ws-controls .f { display: flex; flex-direction: column; gap: 5px; }
.home3 #workspace .ws-controls .lbl { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.home3 #workspace .ws-controls select { width: auto; min-width: 9rem; }
.home3 #workspace .ws-controls input[type="search"] { width: 16rem; max-width: 100%; }
.home3 #workspace .ws-controls .ws-q { flex: 1 1 14rem; }
.home3 #workspace .wslist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-tight); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.home3 #workspace .wsapp { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--grid); border-radius: 12px; background: var(--surface); }
.home3 #workspace .wsapp .btn { width: 100%; justify-content: flex-start; }
.home3 #workspace .wsmeta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--fs-sm); color: var(--ink-2); }
.home3 #workspace .wsgrp { color: var(--muted); }
.home3 #workspace .wswhen { font-variant-numeric: tabular-nums; }
.home3 #workspace .wsempty { color: var(--ink-2); padding: 10px 0; }
@media (max-width: 640px) { .home3 #workspace .ws-controls select, .home3 #workspace .ws-controls input[type="search"] { width: 100%; } .home3 #workspace .ws-controls .f { flex: 1 1 100%; } }
