/* Webgentic Orchestrator hero tree, V5. Theme by overriding the --orc-* properties on .orc
   (or add .orc--dark for the dark preset). Every class the script sets starts with "orc-" so no
   host rule can reach it. No dot pills, no gradient text. */
.orc{
  --orc-ink:#121316; --orc-muted:#6B6F78; --orc-line:rgba(18,19,22,.22);
  --orc-node:#FFFFFF; --orc-node-line:rgba(18,19,22,.12); --orc-shadow:0 1px 2px rgba(18,19,22,.06),0 8px 24px -14px rgba(18,19,22,.25);
  --orc-card:var(--orc-node);
  --orc-agency:#0B0C10; --orc-agency-ink:#F4F5F8; --orc-agency-muted:#9BA2B2; --orc-agency-pain:#F6C27A;
  --orc-accent:#2E9CC4; --orc-accent-ink:#1A5F7A; --orc-accent-line:#2E9CC4; --orc-glow:rgba(160,225,247,.6);
  --orc-say-bg:#0B0C10; --orc-say-ink:#F4F5F8; --orc-say-agent-bg:#FFFFFF; --orc-say-agent-ink:#121316;
  --orc-pain:#B4441C;
  --orc-k1:#2E9CC4; --orc-k2:#5BB8DA; --orc-k3:#1A5F7A; --orc-spark:#2E9CC4;
  --orc-planning:#7A5BB5; --orc-approval:#966000; --orc-approved:#121316; --orc-building:#1A5F7A; --orc-shipped:#0E7C66;
  --orc-font:inherit; --orc-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --orc-r:10px;
  container:orc/inline-size;
  position:relative;color:var(--orc-ink);font-family:var(--orc-font);line-height:1.3;text-align:left
}
.orc--dark{
  --orc-ink:#F2F4FA; --orc-muted:#9AA3B8; --orc-line:rgba(255,255,255,.2);
  --orc-node:rgba(16,20,32,.92); --orc-node-line:rgba(255,255,255,.12); --orc-shadow:0 18px 40px -24px rgba(0,0,0,.9);
  --orc-agency:#A0E1F7; --orc-agency-ink:#0A0D14; --orc-agency-muted:rgba(10,13,20,.7); --orc-agency-pain:#FFE3A6;
  --orc-glow:rgba(160,225,247,.45); --orc-pain:#F6A97A;
  --orc-k1:#A0E1F7; --orc-k2:#E7B8E8; --orc-k3:#F9D58A; --orc-spark:#A0E1F7;
  --orc-planning:#D4B8F0; --orc-approval:#F9D58A; --orc-approved:#FFFFFF; --orc-building:#A0E1F7; --orc-shipped:#9FE1D8;
}
.orc *,.orc *::before,.orc *::after{box-sizing:border-box}
.orc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}

/* ---------- stage: tree on the left, annotation rail on the right ---------- */
.orc-stage{--orc-rail-w:clamp(150px,calc(25cqw - 5px),230px);--orc-rail-gap:24px;
  position:relative;padding-right:var(--orc-rail-w);transition:opacity .6s ease}
.orc-fade .orc-stage{opacity:0}
.orc-tree{container:orctree/inline-size;position:relative;display:flex;flex-direction:column;align-items:center;gap:44px}
.orc-wires{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:0}
.orc-wire{fill:none;stroke:var(--orc-line);stroke-width:1.25;stroke-linecap:round;transition:stroke-dashoffset .55s cubic-bezier(.2,.7,.2,1)}
.orc-dot{fill:var(--orc-k1)}
.orc-dot-up{fill:var(--orc-k3)}
.orc-dot-down{fill:var(--orc-k2)}
.orc--dark .orc-dot{filter:drop-shadow(0 0 5px currentColor)}
.orc--dark .orc-dot-up{color:var(--orc-k3)}
.orc--dark .orc-dot-down{color:var(--orc-k1);fill:var(--orc-k1)}

/* ---------- nodes ---------- */
.orc-node{position:relative;z-index:1;background:var(--orc-node);border:1px solid var(--orc-node-line);border-radius:var(--orc-r);box-shadow:var(--orc-shadow);
  opacity:0;transform:translateY(8px) scale(.97);transition:opacity .45s ease,transform .55s cubic-bezier(.2,.7,.2,1),box-shadow .4s ease,border-color .4s ease}
.orc-node.orc-is-in{opacity:1;transform:none}
.orc-node.orc-flash{box-shadow:0 0 0 4px var(--orc-glow),var(--orc-shadow);border-color:var(--orc-accent)}

/* agency node */
.orc-agency{display:flex;align-items:center;gap:12px;width:min(380px,100%);padding:11px 14px 11px 12px;background:var(--orc-agency);border-color:transparent;color:var(--orc-agency-ink);transform:none}
.orc-a-icon{position:relative;width:24px;height:24px;flex:none}
.orc-a-icon svg{position:absolute;left:0;top:0;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round;opacity:0;transition:opacity .35s ease}
.orc-agency[data-orc-mode="agency"] .orc-i-tree,.orc-agency[data-orc-mode="night"] .orc-i-moon{opacity:.92}
.orc-a-text{display:flex;flex-direction:column;line-height:1.25;min-width:0;flex:1}
.orc-a-title{font-weight:600;font-size:14px;letter-spacing:-.01em;white-space:nowrap}
.orc-a-sub{font-size:12px;color:var(--orc-agency-muted);white-space:nowrap;overflow:hidden;transition:color .3s ease}
.orc-a-sub.orc-lesson{color:var(--orc-agency-ink)}
.orc-know{display:flex;flex-direction:column;align-items:flex-end;flex:none;line-height:1.1;padding-left:12px;border-left:1px solid rgba(255,255,255,.18);transition:opacity .4s ease}
.orc-know-n{font-family:var(--orc-mono);font-weight:500;font-size:18px;font-variant-numeric:tabular-nums}
.orc-know-l{font-size:11px;color:var(--orc-agency-muted);white-space:nowrap}
.orc-swap{animation:orc-swap .45s ease}
@keyframes orc-swap{0%{opacity:0}100%{opacity:1}}
.orc-agency.orc-pulse{animation:orc-pulse .8s ease}
.orc-agency.orc-sharing{box-shadow:0 0 0 5px var(--orc-glow),var(--orc-shadow)}
@keyframes orc-pulse{40%{box-shadow:0 0 0 6px var(--orc-glow),var(--orc-shadow)}}

/* client agents */
.orc-clients{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%}
.orc-col{display:flex;flex-direction:column;gap:16px;min-width:0}
.orc-client{display:flex;flex-direction:column;justify-content:center;min-height:42px;padding:7px 16px 7px 10px;line-height:1.2}
.orc-c-name{font-weight:600;font-size:12px;white-space:nowrap;overflow:hidden}
.orc-stack{font-size:11px;color:var(--orc-muted);white-space:nowrap}

/* project agents */
.orc-projects{display:flex;flex-direction:column;gap:8px;padding-left:16px}
.orc-project{display:flex;flex-direction:column;justify-content:center;gap:3px;min-height:46px;padding:7px 9px 9px;overflow:hidden;color:var(--orc-ink)}
.orc-p-name{padding-right:12px;font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;line-height:1.25}
.orc-ps{display:none}
.orc-status{font-size:11px;line-height:1.2;white-space:nowrap;overflow:hidden;transition:color .3s ease}
.orc-sm,.orc-ss{display:none}
.orc-status[data-s="ready"]{color:var(--orc-muted)}
.orc-status[data-s="asked"]{color:var(--orc-accent-ink);font-weight:600}
.orc-status[data-s="planning"]{color:var(--orc-planning)}
.orc-status[data-s="approval"]{color:var(--orc-approval)}
.orc-status[data-s="approved"]{color:var(--orc-approved);font-weight:600}
.orc-status[data-s="building"]{color:var(--orc-building)}
.orc-status[data-s="shipped"]{color:var(--orc-shipped)}
/* Progress line along the bottom edge; three lanes while workers build. */
.orc-bar{position:absolute;left:0;right:0;bottom:0;height:2px;display:flex;gap:2px}
.orc-bar i{flex:1;background:currentColor;opacity:.9;transform-origin:left;transform:scaleX(0);transition:transform .9s cubic-bezier(.2,.7,.2,1)}
.orc-project .orc-bar{color:var(--orc-planning)}
.orc-project[data-s="planning"] .orc-bar i:first-child{transform:scaleX(.5)}
.orc-project[data-s="approval"] .orc-bar{color:var(--orc-approval)}
.orc-project[data-s="approval"] .orc-bar i:first-child{transform:scaleX(1)}
.orc-project[data-s="approved"] .orc-bar{color:var(--orc-accent)}
.orc-project[data-s="approved"] .orc-bar i:first-child{transform:scaleX(1)}
.orc-project[data-s="building"] .orc-bar{color:var(--orc-building)}
.orc-project[data-s="building"] .orc-bar i{transform:scaleX(.7)}
.orc-project[data-s="building"] .orc-bar i:nth-child(2){transition-delay:.12s}
.orc-project[data-s="building"] .orc-bar i:nth-child(3){transition-delay:.24s}
.orc-project[data-s="shipped"] .orc-bar{color:var(--orc-shipped)}
.orc-project[data-s="shipped"] .orc-bar i{transform:scaleX(1)}

.orc-spark{position:absolute;top:5px;right:5px;width:10px;height:10px;fill:var(--orc-spark);opacity:0;transform:scale(.4) rotate(-30deg);transition:opacity .4s ease,transform .5s cubic-bezier(.2,.7,.2,1)}
.orc-learned>.orc-spark{opacity:1;transform:none}


/* ---------- who is using which tier right now ---------- */
.orc-node{transition:opacity .5s ease,transform .55s cubic-bezier(.2,.7,.2,1),box-shadow .4s ease,border-color .4s ease}
.orc[data-orc-focus="projects"] .orc-agency.orc-is-in,
.orc[data-orc-focus="projects"] .orc-client.orc-is-in,
.orc[data-orc-focus="client"] .orc-agency.orc-is-in,
.orc[data-orc-focus="client"] .orc-col:not(.orc-col-asked) .orc-node.orc-is-in{opacity:.42}
.orc[data-orc-focus="client"] .orc-col:not(.orc-col-asked) .orc-client.orc-is-in{opacity:.42}
.orc-node.orc-asked{box-shadow:0 0 0 4px var(--orc-glow),var(--orc-shadow);border-color:var(--orc-accent-line)}
.orc-agency.orc-asked{box-shadow:0 0 0 5px var(--orc-glow),var(--orc-shadow)}
.orc-project.orc-needs{box-shadow:0 0 0 3px rgba(150,96,0,.28),var(--orc-shadow);border-color:var(--orc-approval)}

/* ---------- speech bubbles: someone asking an agent ---------- */
.orc-says{position:absolute;inset:0;z-index:4;pointer-events:none}
.orc-say{position:absolute;left:0;top:0;width:max-content;padding:5px 10px 6px;border-radius:10px;background:var(--orc-say-bg);color:var(--orc-say-ink);
  font-size:11.5px;line-height:1.35;box-shadow:0 10px 24px -12px rgba(10,13,20,.55);opacity:0;transform:translateY(6px);
  transition:opacity .4s ease,transform .5s cubic-bezier(.2,.7,.2,1)}
.orc-say::after{content:"";position:absolute;top:100%;left:var(--orc-tail,18px);margin-left:-6px;border:6px solid transparent;border-top-color:var(--orc-say-bg)}
.orc-say.orc-say-in{opacity:1;transform:none}
.orc-say b{font-weight:700;margin-right:3px}
.orc-say-i{width:12px;height:12px;margin:0 4px -2px 0;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;vertical-align:baseline;opacity:.8}
.orc-say.orc-say-agent{background:var(--orc-say-agent-bg);color:var(--orc-say-agent-ink)}
.orc-say.orc-say-agent::after{border-top-color:var(--orc-say-agent-bg)}

/* ---------- annotation rail ---------- */
.orc-rail{position:absolute;top:0;right:0;bottom:0;width:var(--orc-rail-w);z-index:1;pointer-events:none}
.orc-tier{position:absolute;left:var(--orc-rail-gap);right:0;top:0;margin-top:-9px;opacity:0;transition:opacity .4s ease}
.orc-tier.orc-placed{opacity:1}
.orc-rail.orc-rail-dim .orc-tier.orc-placed:not(.orc-tier-you){opacity:.62}
.orc-tier-l{display:block;font-size:13px;font-weight:600;line-height:18px;color:var(--orc-muted);white-space:nowrap;transition:color .4s ease}
.orc-tier-f{font-weight:500;color:var(--orc-muted);transition:color .4s ease}
.orc-tier.orc-tier-on .orc-tier-f{color:var(--orc-accent-ink)}
.orc-tier-d{display:block;margin-top:2px;font-size:11.5px;line-height:1.38;color:var(--orc-muted);transition:color .4s ease}
.orc-tier-lead{position:absolute;top:8px;right:calc(100% + 5px);width:0;height:1.5px;border-radius:1px;background:var(--orc-line);transition:background-color .4s ease}
.orc-tier.orc-tier-on .orc-tier-l,.orc-tier.orc-tier-on .orc-tier-d{color:var(--orc-ink)}
.orc-tier.orc-tier-on .orc-tier-lead{background:var(--orc-accent)}

/* ---------- caption + pause ---------- */
.orc-foot{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-top:22px}
.orc-cap{margin:0;font-size:13.5px;line-height:1.45;min-height:2.9em;color:var(--orc-muted);max-width:62ch}
.orc-cap b{color:var(--orc-ink);font-weight:600}
.orc-cap .orc-n{margin-right:8px;font-family:var(--orc-mono);font-size:12px;color:var(--orc-muted)}
.orc-pause{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:32px;margin:0;padding:6px 12px;border-radius:8px;border:1px solid var(--orc-node-line);
  background:transparent;color:var(--orc-muted);font:inherit;font-size:12.5px;line-height:1;cursor:pointer}
.orc-pause:hover{color:var(--orc-ink);border-color:var(--orc-line)}
.orc-pause:focus-visible{outline:2px solid var(--orc-accent);outline-offset:2px}
.orc-pause svg{width:12px;height:12px;fill:currentColor}

.orc-is-paused *{animation-play-state:paused!important}
.orc-resetting *{transition:none!important;animation:none!important}

/* ---------- tree width: label lengths and columns ---------- */
@container orctree (max-width:719px){
  .orc-status .orc-sl{display:none}
  .orc-status .orc-sm{display:inline}
  .orc-p-name .orc-pl{display:none}
  .orc-p-name .orc-ps{display:inline}
}
@container orctree (max-width:549px){
  .orc-tree{gap:34px}
  .orc-clients{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .orc-col:nth-child(4){display:none}
  .orc-col{gap:22px}
  .orc-client{min-height:36px;padding:6px 7px}
  .orc-c-name{font-size:11px;white-space:nowrap;line-height:1.2;letter-spacing:-.01em}
  .orc-client .orc-spark{top:3px;right:3px;width:8px;height:8px}
  .orc-client .orc-stack{display:none}
  .orc-stack{font-size:10.5px}
  .orc-projects{padding-left:10px;gap:6px}
  .orc-project{min-height:42px;gap:2px;padding:6px 6px 8px 7px}
  .orc-p-name{font-size:11px;padding-right:8px}
  .orc-project .orc-spark{top:auto;bottom:9px}
  .orc-status{font-size:10.5px}
  .orc-status .orc-sl,.orc-status .orc-sm{display:none}
  .orc-status .orc-ss{display:inline}
  .orc-agency{width:100%;gap:10px;padding:10px 12px 10px 10px}
  .orc-a-title{font-size:13.5px}
  .orc-a-sub{font-size:11.5px}
  .orc-know-l{display:none}
}

/* ---------- narrow container: compact tier labels in a right gutter ---------- */
@container orc (max-width:599px){
  .orc-stage{--orc-rail-w:62px;--orc-rail-gap:16px}
  .orc-tier-d{display:none}
  .orc-tier-l{font-size:11.5px}
  .orc-tier-l{white-space:normal;line-height:1.25}
  .orc-tier-f{display:block;font-size:10.5px}
  .orc-cap{font-size:13px;min-height:4.4em}
  .orc-foot{gap:12px;margin-top:18px}
}
@media (prefers-reduced-motion:reduce){
  .orc-node,.orc-wire,.orc-bar i,.orc-spark,.orc-stage,.orc-tier,.orc-say{transition:none!important}
}
@container orctree (max-width:320px){
  .orc-c-name{font-size:10px;letter-spacing:-.015em}
  .orc-client{padding:6px 5px}
}
