/* GR00T 2 animated agentic-runtime figure (#agentfig). Built by js/agentfig.js inside <div id="agentfig">.
   Desktop: four panels in a row (agent | MCP server | execution | environment) with the wires drawn over them;
   below 1000 px the same panels stacked, the two return wires running down the side gutters. Sits on the page color. */

.agentfig { --ag-pan: #efede8; --ag-wire: #a8a8a8; --ag-blue: #2f63d0; --ag-amber: #f0b429; --ag-amber-ink: #a16207;
  position: relative; padding: 4px 0; color: var(--text); }
@media (min-width: 1000px) { .agentfig { margin: 0 -60px; } }   /* a .block caps media at the 800 px text column; take the 920 px media width archfig gets */
.ag-stage { position: relative; padding: 30px 0 42px; }
.ag-grid { position: relative; z-index: 1; display: grid; column-gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .98fr) minmax(0, 1.12fr) minmax(0, 1.12fr); }
.ag-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }

/* panels, headers, cards */
.ag-pan { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 9px; border-radius: 16px; background: var(--ag-pan); }
.ag-hr { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ag-hd { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; padding: 3px 11px 3px 3px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 14px; line-height: 1.3; font-weight: 700; color: #222; white-space: nowrap; }
.ag-n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; line-height: 1; }
.ag-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.07); transition: box-shadow .4s ease; }
.ag-card b { font-size: 13px; line-height: 1.25; font-weight: 700; color: #222; white-space: nowrap; }

/* 1 agent */
.ag-say { position: relative; display: flex; align-items: flex-start; gap: 7px; margin-bottom: 6px; padding: 7px 10px;
  background: #fff; border: 1px solid #d9d9d9; font-size: 13px; line-height: 1.35; font-style: italic; color: #333; }
.ag-say::before, .ag-say::after { content: ""; position: absolute; left: 14px; border: 7px solid transparent; border-bottom: 0; }
.ag-say::before { bottom: -8px; border-top: 8px solid #d9d9d9; }
.ag-say::after { bottom: -6.5px; left: 15px; border-width: 6px 6px 0; border-top: 7px solid #fff; }
.ag-say svg { flex: none; width: 15px; height: 15px; margin-top: 1px; fill: #6b7280; }
.ag-say .g { opacity: 0; }
.ag-ring { display: block; width: 100%; max-width: 210px; margin: auto; overflow: visible; }
.ag-ring .base { fill: none; stroke: var(--green); stroke-width: 1.5; }
.ag-ring .tip { fill: var(--green); }
.ag-ring .hi { fill: none; stroke: var(--green); stroke-width: 5; stroke-linecap: round; opacity: 0; }
.ag-ring rect { fill: #fff; stroke: var(--green); stroke-width: 1.5; transition: fill .3s ease; }
.ag-ring text { font: 700 12.5px var(--font); fill: #222; text-anchor: middle; transition: fill .3s ease; }
.ag-ring .on rect { fill: var(--green); }
.ag-ring .on text { fill: #fff; }
.ag-ring .bot { fill: #1f1f1f; }
.ag-ring .bot path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ag-files { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 4px; text-align: center; }
.ag-files svg { display: block; width: 50px; max-width: none; margin: 0 auto; overflow: visible; }
.ag-files span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.3; color: var(--text-2); white-space: nowrap; }
.ag-pg { fill: #fff; stroke: #bdbdbd; stroke-width: 1.3; stroke-linejoin: round; }
.ag-fold { fill: none; stroke: #bdbdbd; stroke-width: 1.3; stroke-linejoin: round; }
.ag-files text { font: 700 9.5px var(--mono); fill: #333; }
.ag-ln { fill: none; stroke: #d6d6d6; stroke-width: 2.6; stroke-linecap: round; }

/* 2 MCP server */
.ag-tools { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 11px 10px 9px; }
.ag-grp > b { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-size: 11.5px; letter-spacing: .06em; }
.ag-grp > b i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ag-grp.wam > b { color: var(--green-ink); } .ag-grp.wam > b i { background: var(--green); }
.ag-grp.obs > b { color: var(--tok-text); }
.ag-grp.cap > b { color: var(--ag-amber-ink); } .ag-grp.cap > b i { background: var(--tok-act); }
.ag-grp code { display: block; margin: 0 -4px 0 10px; padding: 0 4px; border-radius: 4px; font: 11px/1.68 var(--mono); color: #333;
  white-space: nowrap; transition: background-color .3s ease, color .3s ease; }
.ag-grp code.more { line-height: 1; color: var(--text-3); }
.ag-grp hr { margin: 4px 0 4px 10px; border: 0; border-top: 1px dashed rgba(240, 180, 41, .7); }
.ag-grp.wam code.on { background: rgba(118, 185, 0, .2); color: #2d4a00; }
.ag-grp.obs code.on { background: rgba(37, 99, 235, .13); color: #1e3a8a; }
.ag-grp.cap code.on { background: rgba(245, 158, 11, .2); color: #6b4a00; }

/* 3 execution */
.ag-obs { display: flex; align-items: center; gap: 3px; }
.ag-obs i { width: 10px; height: 10px; border-radius: 2.5px; background: #d3d6db; transition: background-color .25s ease; }
.ag-obs span { font-size: 11px; line-height: 1; letter-spacing: 1px; color: var(--text-3); }
.ag-obs.on i { background: #b9c9ea; }
.ag-obs.on i.hit { background: #7da2e8; }
.ag-wam { display: grid; place-items: center; height: 58px; border: 1.5px solid var(--green); border-radius: 10px;
  background: rgba(118, 185, 0, .12); transition: box-shadow .5s ease, background-color .5s ease; }
.ag-wam.on { background: rgba(118, 185, 0, .24); box-shadow: 0 0 0 4px rgba(118, 185, 0, .16); }
.ag-pi { font: italic 30px/1 "Times New Roman", Times, serif; color: #222; }
.ag-pi sub { font-size: 13px; font-style: normal; letter-spacing: .02em; vertical-align: -.25em; margin-left: 2px; }
.ag-chunk { display: flex; justify-content: flex-end; gap: 4px; margin-top: -4px; }
.ag-chunk i { width: 12px; height: 12px; border-radius: 2.5px; background: var(--green); transition: opacity .15s linear; }
.ag-back { position: relative; display: flex; flex-direction: column; gap: 7px; margin-top: 4px; padding: 14px 7px 7px; border: 1.5px dashed #c6c6c6; border-radius: 10px; }
.ag-back > span { position: absolute; top: -8px; left: 9px; padding: 0 4px; background: var(--ag-pan);
  font-size: 10.5px; line-height: 14px; font-weight: 700; letter-spacing: .08em; color: var(--text-2); }
.ag-srv { display: flex; align-items: center; gap: 6px; padding: 7px 8px; }
.ag-srv svg { flex: none; width: 19px; height: 19px; color: var(--green); }
.ag-srv em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.ag-srv.on { box-shadow: 0 0 0 1.5px rgba(118, 185, 0, .7), 0 1px 3px rgba(0,0,0,.07); }
.ag-prov { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; padding: 7px 8px; }
.ag-prov b { flex-basis: 100%; }
.ag-prov.on { box-shadow: 0 0 0 1.5px rgba(240, 180, 41, .8), 0 1px 3px rgba(0,0,0,.07); }
.ag-chip { padding: 2px 6px; border-radius: 999px; border: 1px solid transparent; background: #eef0f2;
  font-size: 10.5px; line-height: 1.3; font-weight: 700; color: #333; transition: background-color .3s ease, border-color .3s ease; }
.ag-chip.on { background: rgba(245, 158, 11, .18); border-color: var(--ag-amber); color: #6b4a00; }
.ag-prog { margin-top: auto; border: 1.5px solid var(--ag-amber); border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .5s ease; }
.ag-prog.on { box-shadow: 0 0 0 4px rgba(245, 158, 11, .16); }
.ag-prog > div { display: flex; align-items: center; justify-content: space-between; padding: 4px 9px; background: #fcefcc; }
.ag-prog > div span { font: 11px var(--mono); color: var(--ag-amber-ink); }
.ag-prog pre { margin: 0; padding: 6px 9px 7px; font: 11px/1.7 var(--mono); color: #333; white-space: pre; overflow: hidden; }
.ag-prog .g { opacity: .25; }
.ag-prog .ko { color: #1d4ed8; font-weight: 700; }
.ag-prog .kc { color: var(--ag-amber-ink); font-weight: 700; }
.ag-prog .ks { color: #3f7a1a; }
.cur { display: inline-block; width: 0; height: 1.15em; vertical-align: -.22em; box-shadow: 0 0 0 .75px #333; }

/* 4 environment */
.ag-mode { display: flex; gap: 3px; }
.ag-mode span { padding: 2px 7px; border-radius: 999px; border: 1.5px solid var(--green); background: rgba(118, 185, 0, .1);
  font-size: 11.5px; line-height: 1.3; font-weight: 700; color: var(--green-ink); transition: background-color .45s ease, color .45s ease; }
.ag-mode span.on { background: var(--green); color: #fff; }
.ag-media { position: relative; flex: 1 1 0; min-height: 150px; border-radius: 9px; overflow: hidden; background: #1d1d1b; isolation: isolate; }
.ag-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; opacity: 0; transition: opacity .45s ease; }
.ag-media video.on { opacity: 1; }
.ag-svcs { display: flex; flex-direction: column; gap: 9px; }
.ag-svc { display: flex; align-items: center; gap: 9px; padding: 9px 10px; }
.ag-svc svg { flex: none; width: 22px; height: 22px; }
.ag-svc.ctl svg { color: var(--green); }
.ag-svc.rbt svg { color: var(--tok-text); }
.ag-svc span { display: block; font-size: 11.5px; line-height: 1.3; color: var(--text-2); white-space: nowrap; }

/* wires */
.ag-wires path { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ag-wires .w-g { stroke: var(--ag-wire); }
.ag-wires .w-st { stroke: var(--ag-blue); }
.ag-wires .w-od { stroke: var(--ag-blue); stroke-dasharray: 5 5; stroke-linecap: butt; }
.ag-wires .w-hi { stroke: var(--ag-blue); stroke-width: 3; opacity: 0; }
.ag-wires .ah { stroke: none; }
.ag-wires .ah.w-g { fill: var(--ag-wire); }
.ag-wires .ah.w-st, .ag-wires .ah.w-od { fill: var(--ag-blue); }
.ag-wl { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 0 8px; background: var(--bg);
  font-size: 12px; line-height: 1.3; font-style: italic; color: rgba(47, 99, 208, .78); white-space: nowrap; transition: color .4s ease; }
.ag-wl.on { color: var(--ag-blue); }

/* stacked: agent -> MCP server -> execution -> environment, return wires in the side gutters */
@media (max-width: 999px) {
  .ag-stage { max-width: 560px; margin: 0 auto; padding: 0; }
  .ag-grid { grid-template-columns: minmax(0, 1fr); row-gap: 38px; padding: 0 16px; }
  .ag-say { align-self: stretch; }
  .ag-ring { max-width: 220px; margin: 2px auto 4px; }
  .ag-files { width: 100%; max-width: 270px; margin: 0 auto; }
  .ag-tools { display: grid; grid-template-columns: auto auto; grid-template-areas: "wam cap" "obs cap"; justify-content: space-between; column-gap: 12px; }
  .ag-grp.wam { grid-area: wam; } .ag-grp.obs { grid-area: obs; } .ag-grp.cap { grid-area: cap; }
  .ag-prog { margin-top: 6px; }
  .ag-media { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
  .ag-svcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .ag-wl { padding: 0; background: none; font-size: 11.5px; transform: translate(0, -50%); }
  .ag-wl.r { transform: translate(-100%, -50%); text-align: right; }
  .ag-wl span { display: block; }
  .ag-wl i { display: none; }
}
