/* ============================================================
   Live-motion scenes: hero video, guard, teams, log, orbit,
   agent loop, pipeline, marquee. Loaded after style.css.
   ============================================================ */
.hero--video { padding-bottom: clamp(3rem, 7vw, 5rem); }
.video--live { aspect-ratio: 16/9; border-radius: 22px; box-shadow: 0 40px 90px -30px rgba(46,230,166,.25), var(--shadow-lg); }
.video--live::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.hero--short { padding-bottom: 2rem; }
.stats--2 { grid-template-columns: repeat(2, 1fr); }

/* guard scene */
.guard { padding-top: 1.6rem; }
.guard__row { display: grid; grid-template-columns: 1fr 48px 1fr; gap: .8rem; align-items: center; margin-bottom: .9rem; }
.guard__box { background: #111A33; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: .7rem .85rem; position: relative; min-height: 78px; }
.guard__box small { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; color: #7A82A3; display: block; margin-bottom: .35rem; }
.guard__box code { font-family: var(--font-mono); font-size: .72rem; color: #C9CEE3; line-height: 1.5; display: block; }
.guard__box mark { background: rgba(240,86,107,.18); color: #FF8A9A; border-radius: 4px; padding: 0 .2em; animation: markPulse 2.4s infinite; }
.guard__box--ok { border-color: rgba(46,230,166,.4); }
.guard__box--ok b { color: var(--teal); font-weight: 500; }
.guard__box--bad { border-color: rgba(240,86,107,.4); }
.guard__box--bad code { color: #FF8A9A; }
.guard__tag { position: absolute; top: -9px; right: 10px; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px; }
.guard__tag--ok { background: var(--teal); color: var(--dark); }
.guard__tag--bad { background: var(--rose); color: #fff; }
.guard__shield { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--teal); background: rgba(46,230,166,.1); border: 1px solid rgba(46,230,166,.35); box-shadow: 0 0 20px rgba(46,230,166,.25); animation: shieldPulse 2.4s infinite; }
.guard__shield svg { width: 22px; height: 22px; }
.guard__shield--bad { color: var(--rose); background: rgba(240,86,107,.1); border-color: rgba(240,86,107,.35); box-shadow: 0 0 20px rgba(240,86,107,.25); }
.guard__foot { color: #7A82A3; margin: .4rem 0 0; text-align: center; }
@keyframes shieldPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes markPulse { 0%,100% { background: rgba(240,86,107,.18); } 50% { background: rgba(240,86,107,.4); } }
.panel.is-active .guard__row { animation: fadeUp .7s var(--ease) both; }
.panel.is-active .guard__row--2 { animation-delay: .5s; }

/* teams scene */
.teams { padding-top: 1.6rem; display: grid; gap: .7rem; }
.gw .slack svg, .gw .guard__shield svg { width: 18px; height: 18px; }
.team { background: #111A33; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: .75rem .9rem; }
.team__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.team__head b { color: #fff; font-family: var(--font-head); font-size: .9rem; }
.team__head .mono { color: #7A82A3; font-size: .66rem; }
.team__bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.team__bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--teal); }
.team small { font-family: var(--font-mono); font-size: .62rem; color: #9AA1BF; display: block; margin-top: .35rem; }
.team--hot .team__bar i { background: var(--rose); }
.team--hot small { color: #FF8A9A; }
.panel.is-active .team__bar i { animation: grow 1.6s var(--ease) forwards; }
.panel.is-active .team:nth-child(2) .team__bar i { animation-delay: .25s; }
.panel.is-active .team:nth-child(3) .team__bar i { animation-delay: .5s; }
@keyframes grow { to { width: var(--to); } }
.slack { display: flex; gap: .7rem; align-items: center; background: rgba(240,86,107,.08); border: 1px solid rgba(240,86,107,.45); border-radius: 12px; padding: .7rem .9rem; color: #fff; opacity: 0; transform: translateY(8px); }
.slack svg { color: var(--rose); flex: 0 0 auto; width: 18px; height: 18px; }
.slack b { display: block; font-family: var(--font-head); font-size: .88rem; }
.slack span { font-family: var(--font-mono); font-size: .64rem; color: #FF8A9A; }
.panel.is-active .slack { animation: fadeUp .6s var(--ease) 1.9s forwards; }

/* log scene */
.term--bare { margin-top: 1.6rem; }
.log__l { display: block; opacity: 0; }
.panel.is-active .log__l { animation: lineIn .35s var(--ease) forwards; }
.panel.is-active .log__l:nth-child(1) { animation-delay: .1s; } .panel.is-active .log__l:nth-child(2) { animation-delay: .4s; }
.panel.is-active .log__l:nth-child(3) { animation-delay: .7s; } .panel.is-active .log__l:nth-child(4) { animation-delay: 1s; }
.panel.is-active .log__l:nth-child(5) { animation-delay: 1.3s; } .panel.is-active .log__l:nth-child(6) { animation-delay: 1.6s; }
.panel.is-active .log__l:nth-child(7) { animation-delay: 1.9s; } .panel.is-active .log__l:nth-child(8) { animation-delay: 2.2s; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* orbit scene */
.orbit { position: relative; width: min(100%, 440px); aspect-ratio: 1; margin: 0 auto; }
.orbit__ring { position: absolute; inset: 12%; border-radius: 50%; border: 1px dashed rgba(46,230,166,.35); animation: spin 40s linear infinite; }
.orbit__ring::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid rgba(255,255,255,.06); }
.orbit__core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #16234A, #0F1A33 70%); border: 1px solid rgba(46,230,166,.6); box-shadow: 0 0 60px rgba(46,230,166,.25); display: grid; place-content: center; text-align: center; color: #fff; gap: .1rem; }
.orbit__core svg { width: 30px; height: 30px; color: var(--teal); margin: 0 auto .2rem; }
.orbit__core b { font-family: var(--font-head); font-size: 1.1rem; }
.orbit__core .mono { color: #9AA1BF; font-size: .58rem; }
.orbit__items { position: absolute; inset: 12%; animation: spin 40s linear infinite; container-type: size; }
.orbit__item { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translate(0, -50cqw); }
.orbit__item span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(calc(-1 * var(--a))); white-space: nowrap; background: #111A33; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: .4rem .8rem; font-size: .78rem; color: #E4E7F3; font-weight: 500; box-shadow: 0 8px 24px -10px rgba(0,0,0,.6); animation: counterspin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes counterspin { from { transform: translate(-50%, -50%) rotate(calc(-1 * var(--a))); } to { transform: translate(-50%, -50%) rotate(calc(-1 * var(--a) - 360deg)); } }

/* agent loop */
.loop { display: grid; gap: .6rem; }
.loop__step { display: grid; grid-template-columns: 30px 1fr auto; gap: .9rem; align-items: center; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 12px; padding: .7rem 1rem; animation: loopGlow 6s infinite; animation-delay: calc(var(--i, 0) * 1s); }
.loop__step:nth-child(1) { --i: 0; } .loop__step:nth-child(2) { --i: 1; } .loop__step:nth-child(3) { --i: 2; } .loop__step:nth-child(4) { --i: 3; } .loop__step:nth-child(5) { --i: 4; } .loop__step:nth-child(6) { --i: 5; }
.loop__step i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-family: var(--font-mono); font-size: .72rem; background: rgba(255,255,255,.05); color: #AEB4CC; animation: loopGlowI 6s infinite; animation-delay: calc(var(--i, 0) * 1s); }
.loop__step b { color: #fff; font-family: var(--font-head); }
.loop__step span { font-family: var(--font-mono); font-size: .64rem; color: #7A82A3; }
@keyframes loopGlow { 0%, 14%, 100% { border-color: var(--dark-line); background: var(--dark-2); transform: none; } 4%, 10% { border-color: var(--teal); background: #0F1A33; transform: translateX(6px); } }
@keyframes loopGlowI { 0%, 14%, 100% { background: rgba(255,255,255,.05); color: #AEB4CC; } 4%, 10% { background: var(--teal); color: var(--dark); } }

/* pipeline scene */
.pipe { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem .6rem; box-shadow: var(--shadow); }
.pipe svg { width: 100%; height: auto; }
.pipe__line { fill: none; stroke: var(--line); stroke-width: 4; }
.pipe__stage circle { fill: #fff; stroke: var(--line); stroke-width: 2; animation: stageOn 4s infinite; animation-delay: var(--d); }
.pipe__stage text { font-family: var(--font-mono); font-size: 16px; fill: var(--primary); font-weight: 600; }
.pipe__stage .pipe__label { font-family: var(--font-head); font-size: 14px; fill: var(--ink); font-weight: 600; }
.pipe__dot { fill: var(--primary); filter: drop-shadow(0 0 6px rgba(91,91,240,.8)); }
.pipe__dot--2 { fill: var(--teal-dark); filter: drop-shadow(0 0 6px rgba(19,181,127,.8)); }
@keyframes stageOn { 0%, 30%, 100% { stroke: var(--line); fill: #fff; } 8%, 20% { stroke: var(--primary); fill: var(--primary-soft); } }

/* marquee */
.marquee { overflow: hidden; margin-top: 3.5rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: .7rem; width: max-content; animation: marquee 38s linear infinite; }
.marquee__track span { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; padding: .5rem 1rem; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--dark-line); color: #C9CEE3; white-space: nowrap; }
.marquee--light .marquee__track span { background: #fff; border-color: var(--line); color: var(--ink-3); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.footer__grid--slim { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 900px) {
  .guard__row { grid-template-columns: 1fr; }
  .guard__shield { margin: 0 auto; }
  .footer__grid--slim { grid-template-columns: 1fr 1fr; }
  .orbit__item span { font-size: .68rem; padding: .3rem .6rem; }
}
@media (max-width: 600px) { .stats--2 { grid-template-columns: 1fr; } .footer__grid--slim { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .orbit__ring, .orbit__items, .orbit__item span, .marquee__track, .loop__step, .loop__step i, .pipe__stage circle, .guard__shield, .guard__box mark { animation: none !important; }
  .team__bar i { width: var(--to); }
  .log__l, .slack { opacity: 1; transform: none; }
}

/* brand logos */
.lg { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-style: normal; flex: 0 0 auto; vertical-align: middle; }
.lg img { width: 16px; height: 16px; display: block; }
.lg--t { background: var(--c); color: #fff; font-family: var(--font-mono); font-size: .5rem; font-weight: 600; letter-spacing: 0; line-height: 1; }
.lg--s { color: var(--teal); } .lg--s svg { width: 16px; height: 16px; }
.marquee__track span, .chips span, .tags span { display: inline-flex; align-items: center; gap: .45rem; }
.marquee__track span { padding: .45rem .9rem .45rem .6rem; }
.tags span .lg { width: 16px; height: 16px; } .tags span .lg img { width: 13px; height: 13px; } .tags span .lg--t { font-size: .42rem; }
.orbit__item span { display: inline-flex; align-items: center; gap: .4rem; padding-left: .5rem; }
.orbit__item .lg { width: 22px; height: 22px; background: rgba(255,255,255,.06); }
.loop__tools { display: inline-flex; align-items: center; gap: .3rem; }
.loop__tools .lg { width: 18px; height: 18px; background: rgba(255,255,255,.05); } .loop__tools .lg img { width: 13px; height: 13px; } .loop__tools .lg--t { font-size: .42rem; }
.loop__tools .lg:last-of-type { margin-right: .3rem; }
.card .tools { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; }
.card .tools .lg { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-tint); border: 1px solid var(--line); } .card .tools .lg img { width: 18px; height: 18px; }
.card .tools .lg--t { background: var(--c); border-color: transparent; font-size: .55rem; }

/* workflow canvas (agents + pipeline) */
.wf { position: relative; background: var(--dark); border-radius: 24px; padding: 2.4rem 1rem 1rem; border: 1px solid rgba(255,255,255,.06); box-shadow: var(--shadow-lg);
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 32px 32px; }
.wf svg { width: 100%; height: auto; display: block; }
.wf__wire { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 1.6; }
.wf__pkt { fill: var(--teal); filter: drop-shadow(0 0 6px rgba(46,230,166,.9)); }
.wf__pkt--v { fill: #A78BFA; filter: drop-shadow(0 0 6px rgba(167,139,250,.9)); }
.wf__pkt--a { fill: var(--amber); filter: drop-shadow(0 0 6px rgba(245,184,46,.9)); }
.wf__node rect:first-child { fill: #111A33; stroke: rgba(255,255,255,.14); stroke-width: 1; }
.wf__node--hub rect:first-child { stroke: var(--teal); stroke-width: 1.4; filter: drop-shadow(0 0 10px rgba(46,230,166,.35)); }
.wf__t { font-family: var(--font-head); font-weight: 600; font-size: 12px; fill: #fff; }
.wf__s { font-family: var(--font-mono); font-size: 8.5px; fill: #8A92B2; }
.wf__b { font-family: var(--font-mono); font-size: 7px; font-weight: 700; fill: #fff; }
.wf__robot { transform: translate(300px, 210px); animation: bob 4s ease-in-out infinite; }
.wf__halo { fill: rgba(46,230,166,.06); stroke: rgba(46,230,166,.35); stroke-dasharray: 4 6; animation: spinC 30s linear infinite; transform-origin: 0 0; }
.wf__head { fill: #0F1A33; stroke: var(--teal); stroke-width: 1.5; filter: drop-shadow(0 0 14px rgba(46,230,166,.35)); }
.wf__eye { fill: var(--teal); transform-origin: center; transform-box: fill-box; animation: blink 4s infinite; }
.wf__mouth { fill: rgba(46,230,166,.6); }
.wf__ant { stroke: var(--teal); stroke-width: 1.5; }
.wf__antdot { fill: var(--teal); animation: blinkDot 1.6s infinite; }
@keyframes spinC { to { transform: rotate(360deg); } }
@keyframes bob { 0%,100% { transform: translate(300px,210px); } 50% { transform: translate(300px,204px); } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes blinkDot { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
.wf--light { background: #fff; border-color: var(--line); box-shadow: var(--shadow);
  background-image: linear-gradient(rgba(16,24,64,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(16,24,64,.05) 1px, transparent 1px); }
.wf--light .wf__wire { stroke: #D9DCEA; }
.wf--light .wf__node rect:first-child { fill: #fff; stroke: var(--line); }
.wf--light .wf__node--hub rect:first-child { stroke: var(--primary); filter: drop-shadow(0 0 10px rgba(91,91,240,.3)); }
.wf--light .wf__t { fill: var(--ink); } .wf--light .wf__s { fill: var(--muted); }
.wf--light .wf__pkt { fill: var(--primary); filter: drop-shadow(0 0 6px rgba(91,91,240,.8)); }
.wf--light .wf__pkt--v { fill: var(--teal-dark); filter: drop-shadow(0 0 6px rgba(19,181,127,.8)); }
.wf--light .wf__pkt--a { fill: var(--amber); }
.gw__status--light { color: var(--primary); background: var(--primary-soft); border-color: rgba(91,91,240,.3); }
.gw__status--light::before { background: var(--primary); }
/* sticky: keep the panel in view until the last step, and fit short windows */
.story__steps { padding-bottom: 38vh; }
@media (max-height: 820px) { .story__sticky { top: 84px; } .story__sticky .gw { zoom: .82; } }
@media (max-height: 680px) { .story__sticky .gw { zoom: .68; } }
@media (max-width: 900px) { .story__steps { padding-bottom: 20vh; } .story__sticky { top: 60px; } .story__sticky .gw { zoom: .7; } .wf { padding: 2.9rem .5rem .5rem; } .gw__status { font-size: .58rem; letter-spacing: .12em; } }
@media (max-width: 900px) and (max-height: 700px) { .story__sticky .gw { zoom: .58; } .panels { --panel-h: 270px; } }
@media (prefers-reduced-motion: reduce) { .wf__halo, .wf__eye, .wf__antdot, .wf__robot { animation: none !important; } }
