/* =========================================================
   CodeChaps — AIChaps (AI development services) page
   Page-specific styles (AI agent console + model monitor hero).
   Shared styles live in codechaps-motion.css
   ========================================================= */
.hero-visual{min-height:540px;align-items:center}
.ai-wrap{position:relative;width:520px;height:520px}
.js .ai-wrap{opacity:0;transform:translateY(40px) scale(.96)}
.js.loaded .ai-wrap{opacity:1;transform:none;transition:opacity 1s var(--ease) .35s,transform 1.2s var(--ease) .35s}
.ai-wrap .float{z-index:4}
.hero-pills{display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.hero-pills span{font-size:12.5px;font-weight:600;color:#CBD5E1;border:1px solid rgba(148,163,184,.3);border-radius:999px;padding:6px 13px;background:rgba(255,255,255,.04)}

/* ---- agent console ---- */
.agent{position:absolute;left:0;top:74px;width:298px;border-radius:22px;background:linear-gradient(160deg,#111A2B,#0A0F19);border:1px solid #263244;box-shadow:0 50px 90px rgba(0,0,0,.55);color:#E2E8F0;animation:floatY 8s ease-in-out infinite;z-index:2;overflow:hidden}
.ag-bar{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid #1F2A3D;font-size:11.5px}
.ag-bar .dots{display:flex;gap:5px}
.ag-bar .dots i{width:8px;height:8px;border-radius:50%;background:#334155}
.ag-bar .dots i:nth-child(1){background:#F87171}.ag-bar .dots i:nth-child(2){background:#FBBF24}.ag-bar .dots i:nth-child(3){background:#4ADE80}
.ag-bar b{display:flex;align-items:center;gap:6px;margin-left:4px}
.ag-bar b .ico{width:14px;height:14px;color:#A78BFA}
.ag-bar .mdl{margin-left:auto;font-size:9px;font-weight:700;color:#C4B5FD;background:rgba(139,92,246,.16);padding:3px 8px;border-radius:999px}
.ag-body{display:flex;flex-direction:column;gap:10px;padding:14px;min-height:276px}
.msg{font-size:11px;line-height:1.5;border-radius:14px;padding:9px 12px}
.msg.user{align-self:flex-end;max-width:84%;background:var(--blue);color:#fff;border-bottom-right-radius:4px}
.steps{display:flex;flex-direction:column;gap:6px;padding-left:2px}
.step{display:flex;align-items:center;gap:8px;font-size:10.5px;color:#94A3B8}
.step .st{position:relative;width:16px;height:16px;flex:none}
.step .sp,.step .ok{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.step .sp i{width:11px;height:11px;border:1.6px solid #A78BFA;border-left-color:transparent;border-radius:50%;animation:spin360 .9s linear infinite}
.step .ok{border-radius:50%;background:rgba(34,197,94,.18);color:#4ADE80}
.step .ok .ico{width:10px;height:10px}
.step .sp{opacity:0}
@keyframes spin360{to{transform:rotate(360deg)}}
.msg.bot{background:rgba(255,255,255,.05);border:1px solid #263244;border-bottom-left-radius:4px;color:#E2E8F0}
.msg.bot .ln{display:block;white-space:nowrap}
.msg.bot b{color:#fff}
.ag-acts{display:flex;gap:6px}
.ag-acts span{font-size:10px;font-weight:700;border-radius:9px;padding:6px 10px}
.ag-acts .pri{background:#fff;color:#0F172A}
.ag-acts .sec{border:1px solid #334155;color:#CBD5E1}
.ag-in{display:flex;align-items:center;gap:8px;margin:0 12px 12px;padding:9px 12px;border-radius:12px;background:#0B111C;border:1px solid #263244;font-size:10.5px;color:#64748B}
.ag-in .caret{width:1.5px;height:12px;background:#A78BFA;animation:blink 1s steps(1) infinite}
.ag-in .send{margin-left:auto;width:24px;height:24px;border-radius:8px;background:linear-gradient(135deg,#7C3AED,#2563EB);display:flex;align-items:center;justify-content:center;color:#fff}
.ag-in .send .ico{width:12px;height:12px}
@keyframes blink{50%{opacity:0}}

/* sequence (ai.js toggles .run on a loop) */
.js .agent .seq{opacity:0;transform:translateY(8px);transition:opacity .25s ease,transform .25s ease}
.js .agent.run .seq{opacity:1;transform:none;transition:opacity .5s ease var(--t,0s),transform .6s var(--ease) var(--t,0s)}
.js .agent .step .sp{opacity:1}
.js .agent .step .ok{opacity:0;transform:scale(.4);transition:opacity .2s,transform .2s}
.js .agent.run .step .sp{opacity:0;transition:opacity .2s ease var(--t2)}
.js .agent.run .step .ok{opacity:1;transform:none;transition:opacity .3s ease var(--t2),transform .45s cubic-bezier(.34,1.56,.64,1) var(--t2)}
.js .agent.run .step{color:#CBD5E1}
.js .agent .ln{clip-path:inset(0 100% 0 0);transition:clip-path .2s}
.js .agent.run .ln{clip-path:inset(0 0 0 0);transition:clip-path .9s linear var(--t)}

/* ---- model monitor ---- */
.mon{position:absolute;right:-10px;top:0;width:226px;border-radius:22px;background:linear-gradient(160deg,#111A2B,#0B111C);border:1px solid #263244;padding:15px;color:#fff;box-shadow:0 30px 60px rgba(0,0,0,.5);animation:floatY 7s ease-in-out infinite reverse;z-index:1}
.mon-top{display:flex;justify-content:space-between;align-items:center;font-size:11.5px}
.mon-top b{display:flex;align-items:center;gap:6px}
.mon-top b .ico{width:14px;height:14px;color:#60A5FA}
.mon-live{display:flex;align-items:center;gap:5px;font-size:8.5px;font-weight:800;letter-spacing:.08em;color:#86EFAC}
.mon-live i{width:6px;height:6px;border-radius:50%;background:#22C55E;animation:livePing 1.6s ease-out infinite}
@keyframes livePing{0%{box-shadow:0 0 0 0 rgba(34,197,94,.6)}100%{box-shadow:0 0 0 7px rgba(34,197,94,0)}}
.net{display:block;width:100%;height:auto;margin:10px 0 8px}
.net .e{stroke:#1F2A3D;stroke-width:.8;fill:none}
.net .sig{fill:none;stroke:url(#sigGrad);stroke-width:1.6;stroke-linecap:round;stroke-dasharray:10 110;stroke-dashoffset:10;opacity:0}
.js.loaded .net .sig{animation:sig 2.4s linear infinite;animation-delay:var(--d)}
@keyframes sig{0%{stroke-dashoffset:10;opacity:1}90%{opacity:1}100%{stroke-dashoffset:-100;opacity:0}}
.net .n{fill:#1E293B;stroke:#60A5FA;stroke-width:1.2}
.net .n.out{stroke:#A78BFA}
.js.loaded .net .n{animation:nodeGlow 2.4s ease-in-out infinite;animation-delay:var(--d)}
@keyframes nodeGlow{0%,100%{fill:#1E293B}40%{fill:#3B82F6}}
.net .n.out{animation-name:nodeGlowOut}
@keyframes nodeGlowOut{0%,100%{fill:#1E293B}40%{fill:#8B5CF6}}
.net text{font-size:6px;fill:#64748B;font-family:var(--body)}
.mt{display:flex;flex-direction:column;gap:7px}
.mt div{font-size:9.5px;color:#94A3B8}
.mt p{display:flex;justify-content:space-between;margin-bottom:3px}
.mt b{color:#fff;font-variant-numeric:tabular-nums}
.mt .trk{display:block;height:4px;border-radius:4px;background:#1E293B;overflow:hidden}
.mt .trk i{display:block;height:100%;width:var(--w);border-radius:4px;background:linear-gradient(90deg,#2563EB,#8B5CF6);transform-origin:left;transform:scaleX(0)}
.js.loaded .mt .trk i{transform:scaleX(1);transition:transform 1.4s var(--ease);transition-delay:calc(1.1s + var(--i) * .15s)}

.float--1{right:-60px;top:286px}
.float--2{right:-34px;top:auto;bottom:4px}
.float--3{left:-60px;top:auto;bottom:-30px}
@media (max-width:1240px) and (min-width:961px){.ai-wrap{transform-origin:left center;scale:.9}.float--1{right:-24px}.float--2{right:-10px}.float--3{left:-40px}.mon{right:-40px}}
@media (max-width:960px){.hero-visual{min-height:0}.ai-wrap{width:100%;max-width:580px;height:auto;display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:20px}.agent,.mon{position:relative;left:auto;right:auto;top:auto}.mon{margin-top:40px}}
@media (max-width:560px){.mon{display:none}.agent{width:100%;max-width:340px}}
@media (prefers-reduced-motion:reduce){.net .sig{display:none}.mt .trk i{transform:none}}
