/* =========================================================
   HUMANBOTS — AI BOT OPTIMIZATION PAGE ONLY
   Loads after ai-search.css, which supplies the hero card frame,
   platform cards, optimisation map, why grid, steps and type sizes.
   This file adds:
   1. Hero optimisation console (quality steps up, faders move)
   2. Service card drawings (.ab-ill)
   3. "Where your bot lives" chips and the map's outcome list
========================================================= */


/* ---------- 1. HERO: optimisation console (inline SVG) ---------- */
#hb-sub-ai-bot-optimization .ais-hero{padding-top:190px;padding-bottom:90px}
.ab-console{position:relative;margin:0}
.ab-console::before{content:"";position:absolute;inset:8% 6% -6%;z-index:-1;border-radius:40px;background:radial-gradient(closest-side,rgba(255,77,22,.16),transparent);filter:blur(10px)}
.ab-con-svg{display:block;width:100%;height:auto;font-family:var(--font-mono, monospace)}
.cn-frame{fill:#0a0a0a;stroke:rgba(255,255,255,.1)}
.cn-div{stroke:rgba(255,255,255,.07)}
.cn-label{fill:#cfcfcf;font-size:10px;letter-spacing:.12em}
.cn-dim{fill:#5f5f5f}
.cn-led{fill:var(--orange);animation:cn-blink 1.6s ease-in-out infinite}
.cn-grid{stroke:rgba(255,255,255,.05);stroke-dasharray:2 6}
.cn-base{stroke:#2a2a2a}
.cn-step-bg{fill:none;stroke:#1f1f1f;stroke-width:3}
.cn-step{fill:none;stroke:var(--orange);stroke-width:2.5;stroke-linejoin:round;stroke-dasharray:420;stroke-dashoffset:420;animation:cn-draw 7s ease-in-out infinite}
.cn-pts circle{fill:#0a0a0a;stroke:#3a3a3a;stroke-width:2;animation:cn-pt 7s ease-in-out infinite}
.cn-pts circle:nth-child(2){animation-delay:.35s}.cn-pts circle:nth-child(3){animation-delay:.7s}.cn-pts circle:nth-child(4){animation-delay:1.05s}.cn-pts circle:nth-child(5){animation-delay:1.4s}
.cn-xl text{fill:#4f4f4f;font-size:9px}
.cn-track{stroke:#1e1e1e;stroke-width:6;stroke-linecap:round}
.cn-fill{stroke:var(--orange);stroke-width:6;stroke-linecap:round;stroke-dasharray:152;stroke-dashoffset:152}
.cn-fill-g{stroke:#3ddc84}
.cn-knob{fill:#e8e8e8;stroke:#0a0a0a;stroke-width:2}
.cn-knob-g{fill:#e8e8e8}
.cn-f1 .cn-fill{animation:cn-f1 7s ease-in-out infinite}.cn-f1 .cn-knob{animation:cn-k1 7s ease-in-out infinite}
.cn-f2 .cn-fill{animation:cn-f2 7s ease-in-out infinite}.cn-f2 .cn-knob{animation:cn-k2 7s ease-in-out infinite}
.cn-f3 .cn-fill{animation:cn-f3 7s ease-in-out infinite}.cn-f3 .cn-knob{animation:cn-k3 7s ease-in-out infinite}
.cn-logos image{opacity:.9}
.cn-pass rect{fill:rgba(61,220,132,.08);stroke:rgba(61,220,132,.4)}
.cn-pass circle{fill:#3ddc84;animation:cn-blink 1.6s ease-in-out infinite}
.cn-pass text{fill:#3ddc84;font-size:10px;letter-spacing:.04em}
.cn-pass{opacity:0;animation:cn-pass 7s ease-in-out infinite}
@keyframes cn-blink{0%,100%{opacity:1}50%{opacity:.3}}
@keyframes cn-draw{0%,6%{stroke-dashoffset:420}55%,92%{stroke-dashoffset:0}100%{stroke-dashoffset:0;opacity:0}}
@keyframes cn-pt{0%,20%{stroke:#3a3a3a;fill:#0a0a0a}35%,92%{stroke:var(--orange);fill:var(--orange)}100%{stroke:#3a3a3a;fill:#0a0a0a}}
/* faders: accuracy and speed rise, cost drops (track runs y=244 -> 92, length 152) */
@keyframes cn-f1{0%,8%{stroke-dashoffset:110}55%,92%{stroke-dashoffset:22}100%{stroke-dashoffset:110}}
@keyframes cn-k1{0%,8%{transform:translateY(196px)}55%,92%{transform:translateY(108px)}100%{transform:translateY(196px)}}
@keyframes cn-f2{0%,8%{stroke-dashoffset:96}55%,92%{stroke-dashoffset:38}100%{stroke-dashoffset:96}}
@keyframes cn-k2{0%,8%{transform:translateY(182px)}55%,92%{transform:translateY(124px)}100%{transform:translateY(182px)}}
@keyframes cn-f3{0%,8%{stroke-dashoffset:24}55%,92%{stroke-dashoffset:104}100%{stroke-dashoffset:24}}
@keyframes cn-k3{0%,8%{transform:translateY(110px)}55%,92%{transform:translateY(190px)}100%{transform:translateY(110px)}}
@keyframes cn-pass{0%,55%{opacity:0}62%,92%{opacity:1}100%{opacity:0}}


/* ---------- 2. SERVICE CARD DRAWINGS ---------- */
.ab-art{height:170px}
.ab-ill{display:block;width:100%;max-width:320px;height:auto;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.ab-ill text{stroke:none}
.ab-doc{fill:#121212;stroke:#2e2e2e}
.ab-mono{fill:#ff8a5c;font-family:var(--font-mono, monospace);font-size:10px}
.ab-ln{fill:#d8d8d8}.ab-dim{fill:#333}
/* prompt rewrite */
.ab-strike{stroke:#ff5c5c;stroke-width:2;stroke-dasharray:130;stroke-dashoffset:130;animation:ab-strike 6s ease-in-out infinite}
.ab-new{fill:var(--orange);transform-box:fill-box;transform-origin:left;animation:ab-write 6s ease-in-out infinite}
.ab-n2{animation-delay:.6s}
.ab-caret{fill:var(--orange);animation:ab-blink 1s steps(1) infinite}
@keyframes ab-strike{0%,10%{stroke-dashoffset:130}30%,90%{stroke-dashoffset:0}100%{stroke-dashoffset:130}}
@keyframes ab-write{0%,30%{transform:scaleX(0)}55%,90%{transform:scaleX(1)}100%{transform:scaleX(0)}}
@keyframes ab-blink{50%{opacity:0}}
/* evals: tests turn green, score fills */
.ab-res{fill:#3a1a1a;stroke:#ff5c5c;animation:ab-pass 6s ease-in-out infinite}
.ab-r2 .ab-res{animation-delay:.4s}.ab-r3 .ab-res{animation-delay:.8s}.ab-r4 .ab-res{animation-delay:1.2s}
.ab-gauge-bg{stroke:#1e1e1e;stroke-width:8}
.ab-gauge{stroke:var(--orange);stroke-width:8;stroke-dasharray:214;stroke-dashoffset:214;transform:rotate(-90deg);transform-origin:254px 76px;animation:ab-gauge 6s ease-in-out infinite;filter:drop-shadow(0 0 6px rgba(255,77,22,.5))}
.ab-gauge-tick{stroke:#fff;stroke-width:3;opacity:0;animation:ab-show 6s ease-in-out infinite}
@keyframes ab-pass{0%,20%{fill:#3a1a1a;stroke:#ff5c5c}35%,90%{fill:#1f3a29;stroke:#3ddc84}100%{fill:#3a1a1a;stroke:#ff5c5c}}
@keyframes ab-gauge{0%,20%{stroke-dashoffset:214}60%,90%{stroke-dashoffset:20}100%{stroke-dashoffset:214}}
@keyframes ab-show{0%,55%{opacity:0}65%,90%{opacity:1}100%{opacity:0}}
/* RAG: the right chunk is found and fed to the bot */
.ab-chunk rect{fill:#161616;stroke:#333}
.ab-hit rect{animation:ab-hit 5s ease-in-out infinite}
.ab-beam{fill:none;stroke:var(--orange);stroke-width:2;stroke-dasharray:6 5;opacity:0;animation:ab-beam 5s ease-in-out infinite}
.ab-pull{stroke:var(--orange);stroke-dasharray:4 6;animation:ab-flow 1.2s linear infinite}
.ab-botb rect{fill:var(--orange);stroke:none}.ab-botb circle{fill:#fff;stroke:none}.ab-botb path{stroke:#fff;stroke-width:2.5}
@keyframes ab-hit{0%,25%{fill:#161616;stroke:#333}35%,90%{fill:rgba(255,77,22,.18);stroke:var(--orange)}100%{fill:#161616;stroke:#333}}
@keyframes ab-beam{0%{transform:translateY(-32px);opacity:0}10%{opacity:1}30%,90%{transform:translateY(0);opacity:1}100%{opacity:0}}
@keyframes ab-flow{to{stroke-dashoffset:-20}}
/* tool use: a request visits each tool in turn */
.ab-wire{stroke:#2e2e2e;stroke-width:2}
.ab-agent rect{fill:var(--orange);stroke:none}.ab-agent circle{fill:#fff;stroke:none}.ab-agent path{stroke:#fff;stroke-width:2.5}
.ab-tool rect:first-child{fill:#161616;stroke:#333;animation:ab-tool 6s ease-in-out infinite}
.ab-tool path,.ab-tool circle{stroke:#8a8a8a}
.ab-t2 rect:first-child{animation-delay:2s}.ab-t3 rect:first-child{animation-delay:4s}
.ab-packet{fill:#fff;filter:drop-shadow(0 0 6px var(--orange));offset-path:path("M100 75H160V30H220M220 30H160V75H220M220 75H160V120H220");animation:ab-packet 6s linear infinite}
@keyframes ab-tool{0%,8%{stroke:#333;fill:#161616}14%,30%{stroke:var(--orange);fill:rgba(255,77,22,.12)}36%,100%{stroke:#333;fill:#161616}}
@keyframes ab-packet{from{offset-distance:0%}to{offset-distance:100%}}
/* speed & cost: needle climbs, coin stack shrinks */
.ab-dial-bg{stroke:#1e1e1e;stroke-width:10}
.ab-dial{stroke:var(--orange);stroke-width:10;stroke-dasharray:202;stroke-dashoffset:202;animation:ab-dial 5s ease-in-out infinite}
.ab-needle path{stroke:#fff;stroke-width:4}.ab-needle circle{fill:#fff;stroke:none}
.ab-needle{transform-origin:124px 112px;animation:ab-needle 5s ease-in-out infinite}
.ab-coin{fill:#2a2a2a;stroke:#444}
.ab-c3,.ab-c4{animation:ab-coin 5s ease-in-out infinite}.ab-c3{animation-delay:.2s}
.ab-down{stroke:#3ddc84;stroke-width:3}
@keyframes ab-dial{0%,10%{stroke-dashoffset:202}55%,90%{stroke-dashoffset:30}100%{stroke-dashoffset:202}}
@keyframes ab-needle{0%,10%{transform:rotate(-80deg)}55%,90%{transform:rotate(62deg)}100%{transform:rotate(-80deg)}}
@keyframes ab-coin{0%,25%{opacity:1;transform:none}50%,90%{opacity:0;transform:translateY(-16px)}100%{opacity:1;transform:none}}
/* safety: bad message bounces off, good one passes */
.ab-shield{fill:rgba(255,77,22,.1);stroke:var(--orange);stroke-width:2.5}
.ab-shield-tick{stroke:#fff;stroke-width:4;stroke-dasharray:70;stroke-dashoffset:70;animation:ab-tick 5s ease-in-out infinite}
.ab-bad rect{fill:#2a1414;stroke:#ff5c5c}.ab-bad path{stroke:#ff5c5c;stroke-width:2.2}
.ab-bad{animation:ab-bounce 5s ease-in-out infinite}
.ab-good rect{fill:#13261b;stroke:#3ddc84}.ab-good path{stroke:#3ddc84;stroke-width:2.2}
.ab-good{animation:ab-pass2 5s ease-in-out infinite}
@keyframes ab-tick{0%,20%{stroke-dashoffset:70}45%,90%{stroke-dashoffset:0}100%{stroke-dashoffset:70}}
@keyframes ab-bounce{0%{transform:translateX(-20px);opacity:0}15%{opacity:1}35%{transform:translateX(36px)}55%,85%{transform:translateX(0);opacity:1}100%{opacity:0}}
@keyframes ab-pass2{0%,40%{opacity:0;transform:translateX(-30px)}60%,90%{opacity:1;transform:none}100%{opacity:0}}
.svc-card:hover .ab-ill .ab-doc{stroke:#5a5a5a}


/* ---------- 3. CHANNELS + MAP OUTCOMES ---------- */
.ab-chans{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;margin-top:28px}
.ab-chans .svc-mono{color:#777;text-transform:uppercase}
.ab-chans ul{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0;padding:0;list-style:none}
.ab-chans li{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border:1px solid rgba(255,255,255,.08);border-radius:999px;background:#0e0e0e;color:#cfcfcf;font-size:13px}
.ab-chans img{width:16px;height:16px}
.ab-out-list{display:grid;gap:6px;margin:0;padding:0;list-style:none}
.ab-out-list li{position:relative;padding-left:20px;color:#d6d6d6;font-size:13px}
.ab-out-list li::before{content:"↑";position:absolute;left:0;color:#3ddc84;font-weight:700}
.ab-out-list li:nth-child(3)::before{content:"↓"}

@media (max-width:650px){
  .ab-art{height:130px}
  #hb-sub-ai-bot-optimization .ais-hero{padding-top:140px;padding-bottom:40px}
  .ab-chans{justify-content:flex-start}
  .ab-chans ul{justify-content:flex-start}
  .ab-chans li{padding:7px 11px;font-size:12px}
}
@media (prefers-reduced-motion:reduce){
  .ab-ill *,.ab-ill g,.ab-con-svg *{animation:none !important}
  .cn-step,.cn-fill{stroke-dashoffset:0}.cn-pass{opacity:1}
  .cn-f1 .cn-knob{transform:translateY(108px)}.cn-f2 .cn-knob{transform:translateY(124px)}.cn-f3 .cn-knob{transform:translateY(190px)}
  .ab-strike,.ab-shield-tick{stroke-dashoffset:0}.ab-gauge-tick{opacity:1}
}
