/* Custom Agents, rebuilt 18 Nov 2026: figures in place of text.
   Loaded after custom_agents-1-1.css (tokens, chrome, buttons, bars).
   21 Nov 2026 walkthrough: every box is white with the dark blue border of
   site_v5.css (--v5-edge), nothing carries a wash or a tint, no box has a line
   down its left side, and every ambient motion plays a few times and stops.
   The costs figure, the hero and the Train figure live in custom_agents_v5.css. */

/* ---------- type contract: the Services h1 and section h2 ---------- */
.pg-head h1{ font-size:var(--fs-h2); letter-spacing:-.03em; line-height:1.08; color:var(--ink); text-wrap:balance; }
.sec-h{ font-size:var(--fs-h2); letter-spacing:-.03em; line-height:1.04; color:var(--ink);
        text-wrap:wrap; white-space:normal; }
.sec-lead{ margin-top:12px; font-size:var(--fs-lead); line-height:1.45; color:var(--ink); max-width:none; }
.pg-head .lead{ max-width:none; }

/* every heading, line and figure is visible from the first paint: no reveal
   hides content until a script or an observer catches up (anchor jumps, fast
   scrolls, slow phones). Overrides the .rv / .fx reveal in custom_agents-1-1.css. */
.js .rv, .js .fx{ opacity:1; transform:none; transition:none; will-change:auto; }

/* ---------- 1. three mistakes, three fixes ---------- */
.mf{ list-style:none; margin-left:0; display:grid; gap:14px; }
.mf-row{ display:grid; grid-template-columns:minmax(0,1fr) clamp(56px,9vw,140px) minmax(0,1fr); align-items:center; }
.mf-m, .mf-f{ display:flex; align-items:center; gap:12px; min-height:72px; padding:12px 18px; background:#fff;
              border-radius:var(--v5-r); font-size:var(--fs-body); line-height:1.4; color:var(--ink); }
.mf-m span, .mf-f span{ text-wrap:balance; }
.mf-m{ border:var(--v5-edge-w) dashed var(--v5-edge); }
.mf-f{ border:var(--v5-edge-w) solid var(--v5-edge); font-weight:500; box-shadow:var(--v5-lift); }
.mf-i{ width:30px; height:30px; flex:none; padding:6px; border-radius:50%; color:var(--ink); border:1.5px dashed var(--ink); }
.mf-wire{ position:relative; height:2px; margin:0 6px; background:var(--brand); }
.mf-wire::after{ content:""; position:absolute; right:-2px; top:50%; width:9px; height:9px;
                 border-top:2px solid var(--brand); border-right:2px solid var(--brand);
                 transform:translateY(-50%) rotate(45deg); }
.mf-wire i{ position:absolute; left:0; top:50%; width:8px; height:8px; margin-top:-4px; border-radius:50%;
            background:var(--sky); opacity:0; }
.go-on .mf-wire i{ animation:mfRun 2.6s var(--e-out) 2; }
.mf-row:nth-child(2) .mf-wire i{ animation-delay:.5s; }
.mf-row:nth-child(3) .mf-wire i{ animation-delay:1s; }
@keyframes mfRun{ 0%{ left:0; opacity:0; } 15%{ opacity:1; } 70%{ left:calc(100% - 14px); opacity:1; } 100%{ left:calc(100% - 14px); opacity:0; } }

/* ---------- 2. the harness: pick a layer ---------- */
/* one centred figure: the layers nest on one axis, each named at its top, and the picked layer's
   note sits under it (the six notes share one cell, so the longest sets the height at every width
   and nothing below moves) */
.hx2{ display:grid; grid-template-columns:minmax(0,1fr); justify-items:center; gap:clamp(16px,2vw,24px); }
.hx2 > [role="tablist"]{ width:100%; max-width:880px; }
.hx2-cloud{ border:var(--v5-edge-w) dashed var(--v5-edge); border-radius:var(--v5-r); padding:14px; text-align:center;
            background:#fff; transition:background var(--d2) ease; }
.hx2-harness{ margin-top:12px; border:var(--v5-edge-w) solid var(--v5-edge); border-radius:var(--v5-r); padding:14px; background:#fff;
              transition:box-shadow var(--d2) ease; }
.hx2-in{ margin-top:12px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.hx2-tab{ appearance:none; font:inherit; cursor:pointer; display:inline-flex; align-items:center; gap:10px;
          min-height:44px; padding:8px 16px; border-radius:99px; border:var(--v5-edge-w) solid var(--v5-edge); background:#fff;
          font-family:var(--f-display); font-weight:600; font-size:var(--fs-small); line-height:1.25; color:var(--ink);
          transition:background var(--d1) ease, color var(--d1) ease, box-shadow var(--d2) ease; }
.hx2-tab svg{ width:22px; height:22px; flex:none; color:var(--brand); }
.hx2-cell{ justify-content:center; min-height:64px; border-radius:12px; }
.hx2-models{ width:100%; justify-content:center; border-style:dashed; border-radius:12px; }
/* the models sit outside your cloud: a short link from the harness down to them */
.hx2-link{ display:block; width:2px; height:26px; margin:0 auto; background:var(--brand); position:relative; }
.hx2-link::after{ content:""; position:absolute; left:50%; top:0; width:7px; height:7px; margin-left:-3.5px; border-radius:50%;
                  background:var(--sky); opacity:0; animation:hxLink 2.4s ease-in-out 3; }
@keyframes hxLink{ 0%{ top:0; opacity:0; } 20%{ opacity:1; } 80%{ opacity:1; } 100%{ top:calc(100% - 7px); opacity:0; } }
/* selected: the one light fill, blue text; the ring round a picked step or layer is that same fill, solid */
.hx2-tab[aria-selected="true"]{ background:var(--v5-select); color:var(--brand); box-shadow:0 0 0 4px var(--v5-select); }
.hx2-tab:focus-visible{ outline:3px solid var(--sky); outline-offset:3px; }
@media (pointer:fine){ .hx2-tab:hover{ color:var(--brand); } }
.hx2-cloud:has(> .hx2-tab[aria-selected="true"]){ background:var(--v5-select); }
.hx2-harness:has(> .hx2-tab[aria-selected="true"]){ box-shadow:0 0 0 6px var(--v5-select); }
.hx2-notes{ width:100%; max-width:46em; font-size:var(--fs-lead); line-height:1.45; text-align:center; text-wrap:balance; }
.js .is-live .hx2-notes{ display:grid; }
.js .is-live .hx2-note{ grid-area:1 / 1; }
.hx2-note{ font-size:inherit; line-height:inherit; color:var(--ink); text-wrap:balance; }
.hx2-note b{ font-family:var(--f-display); font-weight:600; color:var(--brand); }
.js .is-live .hx2-note:not(.is-on){ visibility:hidden; }
.js .was-picked .hx2-note.is-on{ animation:fadeUp var(--d2) var(--e-out); }
.hx2-note + .hx2-note{ margin-top:6px; }
.js .is-live .hx2-note + .hx2-note{ margin-top:0; }

/* ---------- 3. how we build it: the stepper ---------- */
.stp{ display:grid; gap:18px; }
.stp-rail{ position:relative; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.stp-track{ position:absolute; left:calc(100% / 12); right:calc(100% / 12); top:22px; height:2px;
            background:var(--edge); pointer-events:none; }
.stp-fill{ position:absolute; inset:0; background:var(--brand); transform:scaleX(0); transform-origin:left center;
           transition:transform 420ms var(--e-out); }
.stp-tab{ appearance:none; background:none; border:0; font:inherit; cursor:pointer; position:relative;
          display:flex; flex-direction:column; align-items:center; gap:8px; min-height:44px; padding:0 4px 6px;
          color:var(--ink); border-radius:12px; }
.stp-n{ width:44px; height:44px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
        border:1.5px solid var(--brand); background:#fff; color:var(--brand);
        font-family:var(--f-display); font-weight:600; font-size:1.0625rem;
        transition:background var(--d1) ease, color var(--d1) ease, box-shadow var(--d2) ease, transform var(--d2) var(--e-out); }
/* the rule under a picked label is one rule under the whole label, also when the label takes two lines */
.stp-l{ font-family:var(--f-display); font-weight:600; font-size:var(--fs-small); line-height:1.3; color:var(--ink);
        padding-bottom:2px; border-bottom:2px solid transparent; }
.stp-tab[aria-selected="true"] .stp-n{ background:var(--v5-select); border:2px solid var(--brand);
                                       box-shadow:0 0 0 6px var(--v5-select); transform:scale(1.08); }
.stp-tab[aria-selected="true"] .stp-l{ color:var(--brand); border-bottom-color:var(--brand); }
.stp-tab:focus-visible{ outline:3px solid var(--sky); outline-offset:2px; }
@media (pointer:fine){ .stp-tab:hover .stp-n{ box-shadow:0 0 0 6px var(--v5-select); } }

.stp-panel{ display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:clamp(20px,3vw,48px); align-items:center;
            padding:clamp(18px,2.6vw,36px); background:#fff; border:var(--v5-edge-w) solid var(--v5-edge);
            border-radius:var(--v5-r); box-shadow:var(--v5-lift); }
.stp-panel + .stp-panel{ margin-top:12px; }
.js .stp.is-live .stp-panel + .stp-panel{ margin-top:0; }
.js .stp.is-live > .stp-rail{ grid-row:1; }
/* the six steps share one cell, so the tallest sets the height and Back and Next never move */
.js .stp.is-live > .stp-panel{ grid-row:2; grid-column:1; }
.js .stp.is-live > .stp-panel:not(.is-on){ visibility:hidden; }
.js .stp.is-live > .stp-nav{ grid-row:3; }
.js .stp.was-picked .stp-panel.is-on .stp-copy{ animation:fadeUp 260ms var(--e-out); }
.stp-copy h3{ font-size:var(--fs-h3); letter-spacing:-.015em; line-height:1.2; color:var(--ink); }
.stp-copy p{ margin-top:10px; font-size:var(--fs-body); line-height:1.5; color:var(--ink); }
.stp-copy b{ font-family:var(--f-display); font-weight:600; color:var(--brand); }
.stp-copy .stp-get{ margin-top:16px; }
/* Back and Next (this stepper and the costs figure): the pair is centred under the figure. Next is
   wide enough for every label and is there at every step (at the last it starts over); Back is not
   shown at the first step, where Next stands alone on the centre line, still under the pointer */
.stp-nav{ display:none; }
.is-live .stp-nav{ display:flex; justify-content:center; gap:10px; }
.stp-nav .btn{ min-width:7.5rem; }
.stp-nav .stp-next{ min-width:14rem; }
.stp-nav .btn[hidden]{ display:none; }
/* a picked step's text slides in from visible, never from blank */
@keyframes fadeUp{ from{ opacity:.35; transform:translateY(6px); } to{ opacity:1; transform:none; } }

/* the small diagrams: line art on white, motion only when the step is picked */
.dg{ width:100%; height:auto; max-height:300px; display:block; overflow:visible; }
/* label sizes: 14px in the drawing's own units, 16px on phones, so they render at 12px or more from 360 up */
.dg-t{ font-family:var(--f-display); font-weight:500; font-size:14px; fill:var(--ink); }
.dg-b{ font-weight:600; fill:var(--brand); }
.dg-tw{ fill:var(--ink); font-weight:600; }
.dg-dash{ fill:#fff; stroke:var(--brand); stroke-width:1.4; stroke-dasharray:4 4; }
.dg-path, .dg-wire{ fill:none; stroke:var(--sky); stroke-width:1.5; stroke-linecap:round; }
.dg-pick{ fill:#fff; stroke:var(--brand); stroke-width:2.5; }
.dg-pulse{ fill:none; stroke:var(--sky); stroke-width:1.5; }
.dg-box{ fill:#fff; stroke:var(--brand); stroke-width:1.5; }
.dg-pill{ fill:#fff; stroke:var(--brand); stroke-width:1.2; }
.dg-pill--d{ stroke-dasharray:4 4; }
.dg-run{ fill:var(--sky); cx:180px; cy:115px; opacity:0; }
.dg-axis{ stroke:var(--ink); stroke-width:1.2; }
.dg-bh{ fill:var(--c-hand); }
.dg-bo{ fill:var(--c-ours); }
.dg-up{ transform-box:fill-box; transform-origin:center bottom; }
.dg-desk{ fill:#fff; stroke:var(--brand); stroke-width:1.5; }
.dg-desk--new{ stroke-width:2.5; }
.dg-desk--d{ stroke-dasharray:4 4; }
.dg-pop{ transform-box:fill-box; transform-origin:center; }
.dg-drop{ transform-box:fill-box; }
.dg-draw{ stroke-dasharray:820; stroke-dashoffset:0; }

@media (prefers-reduced-motion:no-preference){
  /* each step settles in about half a second: draw ~500ms, pops ~300ms; the pulse and the dots run three times, then rest */
  .js .is-on .dg-path{ stroke-dasharray:640; animation:dgDraw .5s var(--e-out) both; }
  .js .is-on .dg-pick{ transform-box:fill-box; transform-origin:center; animation:dgPop .3s var(--e-out) .3s both; }
  .js .is-on .dg-pulse{ transform-box:fill-box; transform-origin:center; animation:dgPulse 2.4s ease-out .6s 3; }
  .js .is-on .dg-pop{ animation:dgPop .3s var(--e-out) both; animation-delay:calc(var(--i,0) * 50ms); }
  .js .is-on .dg-draw{ animation:dgDraw2 .5s var(--e-out) both; }
  .js .is-on .dg-wire{ stroke-dasharray:120; animation:dgDraw .5s var(--e-out) both; }
  .js .is-on .dg-run{ animation:dgRun 2.4s var(--e-out) 3; animation-delay:calc(var(--i,0) * 300ms + .5s); }
  .js .is-on .dg-up{ animation:dgUp .3s var(--e-out) both; animation-delay:calc(var(--i,0) * 70ms); }
  .js .is-on .dg-drop{ animation:dgDrop .3s var(--e-out) both; animation-delay:calc(var(--i,0) * 70ms); }
}
@keyframes dgDraw{ from{ stroke-dashoffset:640; } to{ stroke-dashoffset:0; } }
@keyframes dgDraw2{ from{ stroke-dashoffset:820; } to{ stroke-dashoffset:0; } }
@keyframes dgPop{ from{ opacity:0; transform:scale(.6); } to{ opacity:1; transform:none; } }
@keyframes dgPulse{ 0%{ opacity:.9; transform:scale(1); } 100%{ opacity:0; transform:scale(1.9); } }
@keyframes dgRun{ 0%{ opacity:0; transform:translate(0,0); } 15%{ opacity:1; } 80%{ opacity:1; transform:translate(var(--x),var(--y)); } 100%{ opacity:0; transform:translate(var(--x),var(--y)); } }
@keyframes dgUp{ from{ transform:scaleY(0); } to{ transform:none; } }
@keyframes dgDrop{ from{ opacity:0; transform:translateY(-26px); } to{ opacity:1; transform:none; } }

/* ---------- 4. the flow figure: from the problem to the ROI target ---------- */
.flw{ list-style:none; margin-left:0; display:grid; grid-template-columns:repeat(var(--n,4),minmax(0,1fr)); --fg:clamp(14px,2vw,32px);
      gap:var(--fg); padding:clamp(18px,2.6vw,34px); background:#fff; border:var(--v5-edge-w) solid var(--v5-edge);
      border-radius:var(--v5-r); box-shadow:var(--v5-lift); cursor:default; }
.flw-s{ position:relative; display:flex; flex-direction:column; gap:10px; transition:opacity .45s ease; }
.flw-s:not(:last-child)::after{ content:""; position:absolute; left:62px; right:calc(10px - var(--fg)); top:25px; height:2px;
      background:var(--edge); transition:background .45s ease; }
.flw-s:not(:last-child)::before{ content:""; position:absolute; right:calc(10px - var(--fg)); top:21px; width:8px; height:8px;
      border-top:2px solid var(--edge); border-right:2px solid var(--edge); transform:rotate(45deg); transition:border-color .45s ease; }
.flw-ring{ width:52px; height:52px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex:none;
      background:#fff; border:1.5px solid var(--brand); color:var(--brand); font-family:var(--f-display); font-weight:600; font-size:1.25rem;
      transition:box-shadow .45s ease, background .45s ease, transform .45s var(--e-out); }
.flw-ring svg{ width:26px; height:26px; }
.flw-s h3{ font-size:var(--fs-h3); letter-spacing:-.015em; line-height:1.2; color:var(--ink); }
.flw-s p{ font-size:var(--fs-body); line-height:1.5; color:var(--ink); }
.flw-s--key h3{ color:var(--brand); }
/* while it plays: the step being shown is ringed, the steps still to come wait, faint */
.flw.is-run .flw-s:not(.is-done):not(.is-at){ opacity:.3; }
.flw.is-run .flw-s.is-done::after{ background:var(--brand); }
.flw.is-run .flw-s.is-done::before{ border-color:var(--brand); }
.flw-s.is-at .flw-ring{ box-shadow:0 0 0 8px var(--v5-select); background:var(--v5-select); transform:scale(1.08); }
/* the step the whole page turns on: the one solid ring */
.flw-s.flw-s--key .flw-ring{ background:var(--brand); color:#fff; }
/* across the page the steps share their rows: every title starts on one line and every paragraph
   on another, however many lines a title takes */
@media (min-width: 701px){
  @supports (grid-template-rows:subgrid){
    .flw{ grid-template-rows:auto auto 1fr; row-gap:10px; }
    .flw-s{ display:grid; grid-template-rows:subgrid; grid-row:span 3; row-gap:10px; }
    .flw-ring{ justify-self:start; }
  }
}

/* ---------- smaller screens ---------- */
@media (max-width: 960px){
  /* the step's words over its drawing, both on the centre line */
  .stp-panel{ grid-template-columns:minmax(0,1fr); }
  .stp-copy{ max-width:36em; margin-inline:auto; text-align:center; }
  .stp-copy p{ text-wrap:balance; }
  .dg{ max-height:240px; }
}
@media (max-width: 700px){
  /* the flow turns down the page: ring left, words beside it */
  .flw{ grid-template-columns:minmax(0,1fr); --fg:22px; }
  .flw-s{ display:grid; grid-template-columns:52px minmax(0,1fr); column-gap:16px; row-gap:4px; align-items:start; }
  .flw-ring{ grid-row:1 / span 2; }
  .flw-s h3{ align-self:end; }
  .flw-s:not(:last-child)::after{ left:25px; right:auto; top:58px; bottom:calc(-6px - var(--fg) + 12px); width:2px; height:auto; }
  .flw-s:not(:last-child)::before{ display:none; }
  .dg-t{ font-size:16px; }
  .mf-row{ grid-template-columns:minmax(0,1fr); gap:0; }
  .mf-wire{ width:2px; height:22px; margin:0 auto; }
  .mf-wire::after{ right:auto; left:50%; top:auto; bottom:-1px; transform:translateX(-50%) rotate(135deg); }
  .go-on .mf-wire i{ animation:none; }
  .hx2-in{ grid-template-columns:minmax(0,1fr); }
  /* the six rings fit a phone in one row, with short labels under them: nothing to scroll sideways */
  .stp-rail{ gap:2px; }
  .stp-tab{ padding:0 0 6px; }
  .stp-l{ font-size:.75rem; line-height:1.2; }
}
@media (max-width: 480px){
  /* Back and Next side by side, each in its own column; alone, Next takes the row */
  .is-live .stp-nav{ display:grid; grid-template-columns:auto minmax(0,1fr); }
  .stp-nav .btn, .stp-nav .stp-next{ width:auto; min-width:0; padding:0 16px; }
  .stp-nav .stp-prev[hidden] + .stp-next{ grid-column:1 / -1; }
}

/* reduced motion: every figure in its final state */
@media (prefers-reduced-motion: reduce){
  .mf-wire i, .dg-run, .hx2-link::after{ animation:none !important; opacity:0; }
  .hx2-note, .stp-copy{ animation:none !important; }
  .stp-fill{ transition:none; }
  .flw-s, .flw-ring, .flw-s::after, .flw-s::before{ transition:none; }
}
