/* The landing page's product scenes, which scenes.js plays: the board (the hub at work), Sync, nodes
   and teams. They are drawn as the app looks on screen (Graphite), so they stay dark in a light system
   theme too. Every movement is opacity and transform. The page's sections are in landing.css. */

/* Scene basics: hidden until their tick when a script plays them. */
.scene {
  --s-bg: #0a0a0a;
  --s-panel: #111112;
  --s-panel-2: #19191b;
  --s-line: rgba(255, 255, 255, 0.09);
  --s-line-2: rgba(255, 255, 255, 0.16);
  --s-text: #ececec;
  --s-text-2: #b5b5ba;
  --s-muted: #8a8a91;
  --c1: #ff8a3d;
  --c2: #6cb6ff;
  --c3: #5ed39b;
  --c4: #c49bff;
  --c5: #f5c04a;
  margin: 0;
  position: relative;
  color: var(--s-text);
  color-scheme: dark;
}
.js .scene [data-at] {
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity 0.38s ease,
    transform 0.38s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .scene [data-at].on {
  opacity: 1;
  transform: none;
}
.scene .gone {
  display: none !important;
}
/* Pills and labels that replace one another take no room until their turn. */
.js .scene :is(.st, .lease, em, .merge, .merged, .n-btn, .n-chip, .tick, .spin, .owe)[data-at]:not(.on) {
  display: none;
}
.js .scene.resetting .on {
  opacity: 0;
}
.scene.paused,
.scene.paused * {
  animation-play-state: paused !important;
}
.scene.still *,
.scene.still {
  transition: none !important;
  animation: none !important;
}
html:not(.js) .scene [data-off] {
  display: none;
}
.win {
  background: var(--s-bg);
  border: 1px solid var(--s-line-2);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 30px 80px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  .win {
    box-shadow: 0 30px 70px -24px rgba(15, 20, 30, 0.45);
  }
}
.av {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  flex: none;
  background: var(--c, var(--c1));
  box-shadow: inset 0 -0.2em 0 rgba(0, 0, 0, 0.25);
}
.c1 {
  --c: var(--c1);
}
.c2 {
  --c: var(--c2);
}
.c3 {
  --c: var(--c3);
}
.c4 {
  --c: var(--c4);
}
.c5 {
  --c: var(--c5);
}
.c1t {
  color: var(--c1);
}
.c2t {
  color: var(--c2);
}
.c3t {
  color: var(--c3);
}
.c4t {
  color: var(--c4);
}
.st {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  height: 1.7em;
  padding: 0 0.6em;
  border-radius: 999px;
  font-size: 0.86em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  color: var(--s-text-2);
  white-space: nowrap;
}
.st::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
}
.st-work {
  color: #8ccdf5;
  background: rgba(140, 205, 245, 0.1);
}
.st-work::before {
  animation: blink 1.4s ease-in-out infinite;
}
.st-wait {
  color: #f5c04a;
  background: rgba(245, 192, 74, 0.12);
}
.st-idle {
  color: #5ed39b;
  background: rgba(94, 211, 155, 0.1);
}
.st-moved {
  color: var(--s-muted);
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}
.k {
  display: inline-grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 0.4em;
  font-style: normal;
  font-size: 0.85em;
  font-weight: 700;
  background: var(--s-panel-2);
  color: var(--s-text-2);
  flex: none;
}
.k-ue {
  color: #fff;
  background: #2a2a2e;
}
.k-unity {
  color: #e6e6e6;
}
.k-code {
  color: #8ccdf5;
  font-family: var(--mono);
  font-size: 0.75em;
}
.k-app {
  color: #c49bff;
}

/* The board: a miniature of the app's grid. */
.board {
  margin-top: clamp(40px, 6vw, 72px);
}
.board .win {
  font-size: clamp(8px, 1.03vw, 12.5px);
  line-height: 1.45;
}
.b-top {
  display: flex;
  align-items: center;
  gap: 1.2em;
  height: 3.6em;
  padding: 0 1.2em;
  border-bottom: 1px solid var(--s-line);
  background: #0b0b0c;
}
.b-brand {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.b-brand img {
  width: 2.3em;
  height: auto;
}
.b-brand .word {
  display: block;
  height: 1.05em;
  aspect-ratio: 1494 / 196;
  background: var(--s-text);
  -webkit-mask: url("/assets/wordmark.svg") left center / contain no-repeat;
  mask: url("/assets/wordmark.svg") left center / contain no-repeat;
}
.seg {
  display: flex;
  padding: 0.2em;
  border-radius: 0.6em;
  background: rgba(255, 255, 255, 0.045);
  color: var(--s-muted);
}
.seg > * {
  padding: 0.25em 0.8em;
  border-radius: 0.45em;
  font-weight: 500;
}
.seg b {
  background: rgba(255, 255, 255, 0.11);
  color: var(--s-text);
}
.b-spacer {
  flex: 1;
}
.b-cmd {
  color: var(--s-text-2);
}
.b-cmd kbd {
  font-family: var(--font);
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
  background: rgba(255, 255, 255, 0.07);
  color: var(--s-muted);
}
.b-new {
  padding: 0.45em 1em;
  border-radius: 0.55em;
  background: #c55300;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}
.b-body {
  display: grid;
  grid-template-columns: 15.5em minmax(0, 1fr);
  height: 37em;
}
.b-rail {
  padding: 1em 0.9em;
  border-right: 1px solid var(--s-line);
  background: #0b0b0c;
}
.b-rail p {
  margin: 0;
}
.r-h {
  display: flex;
  justify-content: space-between;
  margin: 0.4em 0.4em 0.6em !important;
  color: var(--s-muted);
  font-size: 0.85em;
  font-weight: 600;
}
.r-h + .r-ws,
.r-h + .r-ag {
  margin-top: 0;
}
.r-ag:last-child {
  margin-bottom: 0;
}
.r-ws + .r-h {
  margin-top: 1.6em !important;
}
.r-ws,
.r-ag {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.42em 0.5em;
  border-radius: 0.5em;
  font-weight: 550;
}
.r-ws em,
.r-ag em {
  margin-left: auto;
  font-style: normal;
  font-weight: 400;
  font-size: 0.85em;
  color: var(--s-muted);
}
.r-ag:first-of-type {
  background: rgba(255, 255, 255, 0.06);
}
.dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.b-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.6em;
  padding: 0.6em;
}
.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.7em;
  overflow: hidden;
  background: var(--s-bg);
}
.p1 {
  border-color: color-mix(in srgb, var(--c1) 55%, transparent);
}
.p-head {
  display: flex;
  align-items: center;
  gap: 0.55em;
  height: 2.9em;
  padding: 0 0.8em;
  border-bottom: 1px solid var(--s-line);
  white-space: nowrap;
  overflow: hidden;
}
.p-head b {
  font-weight: 650;
}
.chip {
  padding: 0.1em 0.55em;
  border-radius: 0.4em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--s-text-2);
  font-size: 0.86em;
}
.lease {
  margin-left: auto;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 650;
  color: #ffb27a;
  background: rgba(255, 122, 26, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.35);
}
.p-body {
  flex: 1;
  min-height: 0;
  padding: 0.75em 0.9em;
  font-family: var(--mono);
  font-size: 0.92em;
  overflow: hidden;
}
.p-body p {
  margin: 0 0 0.55em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--s-text-2);
}
.p-body .u {
  display: inline-block;
  max-width: 100%;
  padding: 0.3em 0.75em;
  border-radius: 0.8em;
  background: #1c1c1e;
  color: var(--s-text);
  font-family: var(--font);
}
.p-body .tool {
  color: var(--s-text);
  font-weight: 700;
  margin-right: 0.5em;
}
.p-body .t::before {
  content: "›_ ";
  color: var(--s-muted);
}
.p-body .h {
  color: #ffb27a;
}
.p-body .h::before {
  content: "◆ ";
}
.p-body .no {
  color: #f58585;
}
.p-body .no::before {
  content: "✕ ";
}
.p-body .ok {
  color: #5ed39b;
}
.p-body .ok::before {
  content: "✓ ";
}
.p-body .m {
  color: #8ccdf5;
}
.p-body .m::before {
  content: "✉ ";
}
.mini-app {
  position: relative;
  display: flex;
  gap: 0.9em;
  height: 6.4em;
  margin: 0 0 0.6em;
  padding: 0.35em 0.6em;
  border-radius: 0.5em;
  background: #232326;
  font-family: var(--font);
  font-size: 0.9em;
  color: var(--s-text-2);
  overflow: hidden;
}
.mesh {
  position: absolute;
  left: 50%;
  bottom: 0.4em;
  width: 7em;
  transform: translateX(-50%);
  fill: none;
  stroke: #c49bff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.cursor {
  position: absolute;
  left: 70%;
  top: 70%;
  width: 0.9em;
  height: 1.25em;
  background: #fff;
  clip-path: polygon(0 0, 100% 72%, 55% 70%, 75% 100%, 58% 100%, 40% 73%, 0 100%);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
.mini-app.on .cursor,
.app-view .cursor.on {
  animation: pointer 2.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
@keyframes pointer {
  0% {
    left: 70%;
    top: 70%;
  }
  45% {
    left: 1.2em;
    top: 0.5em;
  }
  55% {
    left: 1.2em;
    top: 0.5em;
    transform: scale(0.85);
  }
  62% {
    transform: none;
  }
  100% {
    left: 2.2em;
    top: 2.8em;
  }
}
.b-hub {
  display: flex;
  align-items: center;
  gap: 1em;
  height: 3.2em;
  padding: 0 1.2em;
  border-top: 1px solid var(--s-line);
  background: #0b0b0c;
  overflow: hidden;
}
.hub-name {
  flex: none;
  padding: 0.15em 0.6em;
  border-radius: 0.4em;
  background: rgba(255, 122, 26, 0.14);
  color: #ffb27a;
  font-weight: 650;
}
.hub-log {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 1.6em;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--s-text-2);
  mask-image: linear-gradient(90deg, #000 75%, transparent);
}
.js .hub-log [data-at]:not(.on) {
  display: none;
}
.hub-log .on {
  animation: logIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hub-log .on + .on {
  color: var(--s-muted);
}
@keyframes logIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
}
@media (max-width: 760px) {
  .board .win {
    font-size: 10.5px;
  }
  .b-body {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .b-rail,
  .b-cmd,
  .seg {
    display: none;
  }
  .b-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .pane {
    height: 16.5em;
  }
  .p3,
  .p4 {
    display: none;
  }
}


/* Sync. */
.sync-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font);
  overflow: visible;
}
.sync-svg text {
  text-anchor: middle;
  fill: var(--text-2);
  font-size: 13px;
}
.wire {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
  animation: wire 1.2s linear infinite;
}
@keyframes wire {
  to {
    stroke-dashoffset: -10;
  }
}
.dev rect:first-child {
  fill: var(--surface);
  stroke: var(--line-2);
}
.dev .scr {
  fill: #0a0a0a;
  stroke: rgba(255, 255, 255, 0.08);
}
.relay circle {
  fill: var(--surface-2);
  stroke: color-mix(in srgb, var(--accent) 55%, transparent);
  stroke-width: 1.5;
}
.relay .r1 {
  fill: var(--text);
  font-weight: 650;
  font-size: 14px;
}
.relay .r2 {
  fill: var(--muted);
  font-size: 11px;
}
.lockbadge rect {
  fill: var(--accent-fill);
}
.lockbadge path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.msg rect {
  fill: #1c1c1e;
  stroke: rgba(255, 255, 255, 0.12);
}
.sync-svg .msg text {
  fill: #ececec;
  font-size: 11.5px;
  font-weight: 600;
}
.sync-svg .msg .act {
  fill: #ff8a3d;
  font-size: 10.5px;
}
.m-tap circle {
  fill: rgba(255, 138, 61, 0.35);
  stroke: #ff8a3d;
}
.m-tap.on {
  animation: tap 0.8s ease-out 2;
}
@keyframes tap {
  50% {
    opacity: 0.2;
  }
}
.m-ok rect {
  stroke: rgba(94, 211, 155, 0.6);
}
.sync-svg .m-ok text {
  fill: #5ed39b;
}
.pkt rect {
  fill: var(--accent-fill);
}
.sync-svg .pkt text {
  fill: #fff;
  font-family: var(--mono);
  font-size: 10px;
}
.js .sync .pkt {
  transform: translate(150px, 210px);
}
.js .sync .pkt.on {
  opacity: 1;
}
.sync .p-a.on {
  animation: pktA 3.2s cubic-bezier(0.45, 0, 0.3, 1) forwards;
}
.sync .p-c.on {
  animation: pktC 3.2s cubic-bezier(0.45, 0, 0.3, 1) forwards;
}
.sync .p-b.on {
  animation: pktB 3.2s cubic-bezier(0.45, 0, 0.3, 1) forwards;
}
@keyframes pktA {
  0% {
    transform: translate(150px, 210px);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  42%,
  56% {
    transform: translate(320px, 210px);
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate(505px, 305px);
    opacity: 0;
  }
}
@keyframes pktC {
  0% {
    transform: translate(150px, 210px);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  42%,
  56% {
    transform: translate(320px, 210px);
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate(500px, 112px);
    opacity: 0;
  }
}
@keyframes pktB {
  0% {
    transform: translate(505px, 305px);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  42%,
  56% {
    transform: translate(320px, 210px);
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate(150px, 210px);
    opacity: 0;
  }
}
.scene.still .pkt {
  display: none;
}

/* Nodes. */
.nodes {
  font-size: clamp(9.5px, 1.05vw, 13px);
}
.n-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4em, 0.55fr) minmax(0, 1fr);
  align-items: center;
}
.n-dev {
  border: 1px solid var(--s-line-2);
  border-radius: 1em;
  background: var(--s-panel);
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
}
.n-top {
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: 2.8em;
  padding: 0 1em;
  border-bottom: 1px solid var(--s-line);
  font-weight: 650;
}
.nodebadge {
  padding: 0.1em 0.55em;
  border-radius: 999px;
  font-size: 0.85em;
  color: #ffb27a;
  background: rgba(255, 122, 26, 0.14);
}
.n-screen {
  position: relative;
  min-height: 15em;
  padding: 1em;
  background: var(--s-bg);
  transition: filter 0.6s ease;
}

.n-agent {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-bottom: 0.7em;
}
.n-task,
.n-meta {
  margin: 0 0 1em;
  color: var(--s-text-2);
}
.n-meta {
  color: var(--s-muted);
  font-size: 0.92em;
}
.n-btn,
.n-chip {
  display: inline-block;
  padding: 0.5em 0.9em;
  border-radius: 0.6em;
  font-weight: 600;
}
.n-btn {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 61, 0.6);
  color: #ffb27a;
}
.n-btn.on {
  animation: press 0.45s ease 0.6s;
}
.n-chip {
  color: var(--s-muted);
  background: rgba(255, 255, 255, 0.05);
}
.n-lid {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #060607;
  color: var(--s-text);
  font-weight: 650;
}
.n-line {
  margin: 0 0 0.45em;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--s-text-2);
}
.n-line.ok {
  color: #5ed39b;
}
.n-line.ok::before {
  content: "✓ ";
}
.n-track {
  position: relative;
  height: 2px;
  margin: 0 0.4em;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 9px);
  container-type: inline-size;
}
.bundle {
  position: absolute;
  left: 0;
  top: 50%;
  width: 2.4em;
  height: 2.4em;
  margin-top: -1.2em;
  border-radius: 0.6em;
  background: #c55300;
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15);
  color: transparent;
  overflow: hidden;
  font-size: 1em;
}
.bundle::after {
  content: "";
  position: absolute;
  inset: 0.65em;
  border: 2px solid #fff;
  border-radius: 0.2em;
  border-top-width: 0.45em;
}
.js .nodes .bundle.on {
  animation: carry 1.6s cubic-bezier(0.5, 0, 0.3, 1) forwards;
}
@keyframes carry {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100cqw - 2.4em));
    opacity: 0;
  }
}
.scene.still .bundle {
  display: none;
}
.n-phone {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: min(23em, 80%);
  margin: 1.4em 0 0 auto;
  padding: 0.85em 1em;
  border-radius: 1.1em;
  background: rgba(36, 36, 40, 0.96);
  border: 1px solid var(--s-line-2);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.n-phone span {
  display: grid;
  color: var(--s-text-2);
  font-size: 0.92em;
}
.n-phone b {
  color: var(--s-text);
}
@media (max-width: 560px) {
  .nodes {
    font-size: 9px;
  }
  .n-screen {
    min-height: 17em;
  }
}

/* Teams. */
.team {
  font-size: clamp(10px, 1.02vw, 13px);
}
.team-win {
  display: grid;
  grid-template-columns: 15em minmax(0, 1fr);
  min-height: 30em;
}
.t-side {
  padding: 1em;
  border-right: 1px solid var(--s-line);
  background: #0b0b0c;
}
.t-side p {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin: 0 0 0.35em;
  padding: 0.35em 0.4em;
}
.t-h {
  color: var(--s-muted);
  font-weight: 600;
  font-size: 0.88em;
}
.t-w + .t-h,
.t-p + .t-h {
  margin-top: 1.2em !important;
}
.t-side em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.82em;
  color: var(--s-muted);
  white-space: nowrap;
}
.t-side em.viewer {
  color: #f5c04a;
}
.t-side .lv-ctl {
  color: #ffb27a;
}
.t-side .lv-view {
  color: #8ccdf5;
}
.muted-w {
  color: var(--s-muted);
}
.t-chat {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 1em 1.3em;
}
.t-enc {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  color: var(--s-muted);
  font-size: 0.9em;
}
.t-enc svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.t-msg {
  display: flex;
  gap: 0.7em;
}
.t-msg .av {
  margin-top: 0.2em;
}
.t-msg b {
  font-weight: 650;
}
.t-msg p {
  margin: 0.15em 0 0;
  color: var(--s-text-2);
}
.at {
  padding: 0 0.3em;
  border-radius: 0.3em;
  background: rgba(255, 122, 26, 0.18);
  color: #ffb27a;
}
.t-link,
.t-btn {
  display: inline-block;
  margin-top: 0.5em;
  padding: 0.3em 0.7em;
  border-radius: 0.5em;
  border: 1px solid var(--s-line-2);
  color: var(--s-text-2);
  font-size: 0.92em;
}
.t-btn {
  border-color: rgba(255, 138, 61, 0.6);
  color: #ffb27a;
}
.t-btn.on {
  animation: press 0.45s ease 0.6s;
}
.t-agent > div {
  padding: 0.6em 0.8em;
  border-radius: 0.7em;
  background: rgba(255, 255, 255, 0.05);
}
@media (max-width: 560px) {
  .team-win {
    grid-template-columns: minmax(0, 1fr);
  }
  .t-side {
    border-right: 0;
    border-bottom: 1px solid var(--s-line);
  }
  .t-side p {
    margin: 0;
  }
}

/* ------------------------------------------------------------------------------------- the score
   Under the board's panes: one lane per agent, time running left to right, drawn by the same ticks
   as the panes above. A bar is work, hatching is a wait, an orange band is a lease held, and the
   marks are the hub's events. One column is one tick (.k1 to .k15); a cell fills across its column
   during its tick, so the bars grow at the speed of the playhead. */
.score {
  --lane: 2.5em;
  --tick: 0.65s;
  --who: 6.6em;
  position: relative;
  padding: 0.7em 1.2em 0.5em;
  border-top: 1px solid var(--s-line);
  background: #0b0b0c;
}
.sc-lane {
  display: grid;
  grid-template-columns: var(--who) minmax(0, 1fr);
  align-items: center;
  height: var(--lane);
}
.sc-who {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 600;
  color: var(--s-text);
}
.sc-who img,
.board .face {
  width: 1.7em;
  height: 1.7em;
  flex: none;
}
.r-ag .face {
  width: 1.35em;
  height: 1.35em;
}
.sc-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  align-items: center;
  height: 100%;
}
.sc-track::before {
  /* The lane's own line: where the bar will run. */
  content: "";
  grid-column: 1 / -1;
  grid-row: 1;
  height: 1px;
  background: var(--s-line);
}
.sc-track > * {
  grid-row: 1;
}
.k1 { grid-column: 1; } .k2 { grid-column: 2; } .k3 { grid-column: 3; } .k4 { grid-column: 4; } .k5 { grid-column: 5; }
.k6 { grid-column: 6; } .k7 { grid-column: 7; } .k8 { grid-column: 8; } .k9 { grid-column: 9; } .k10 { grid-column: 10; }
.k11 { grid-column: 11; } .k12 { grid-column: 12; } .k13 { grid-column: 13; } .k14 { grid-column: 14; } .k15 { grid-column: 15; }
.sc-track i {
  display: block;
  /* A hair wider than its column, so neighbours never show a seam. */
  width: calc(100% + 0.5px);
  height: 0.6em;
  background: var(--c);
  z-index: 1;
}
.sc-track i.a {
  border-radius: 0.3em 0 0 0.3em;
}
.sc-track i.z {
  border-radius: 0 0.3em 0.3em 0;
}
.sc-track i.a.z {
  border-radius: 0.3em;
}
.sc-track i.q {
  background: repeating-linear-gradient(-45deg, var(--c) 0 0.14em, transparent 0.14em 0.42em);
  opacity: 0.75;
}
.sc-track i.l {
  width: 100%;
  height: 1.55em;
  background: rgba(255, 122, 26, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 122, 26, 0.6),
    inset 0 -1px 0 rgba(255, 122, 26, 0.6);
  z-index: 0;
}
.sc-track i.l.a {
  border-radius: 0.5em 0 0 0.5em;
  box-shadow:
    inset 0 1px 0 rgba(255, 122, 26, 0.6),
    inset 0 -1px 0 rgba(255, 122, 26, 0.6),
    inset 1px 0 0 rgba(255, 122, 26, 0.6);
}
.sc-track i.l.z {
  border-radius: 0 0.5em 0.5em 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 122, 26, 0.6),
    inset 0 -1px 0 rgba(255, 122, 26, 0.6),
    inset -1px 0 0 rgba(255, 122, 26, 0.6);
}
.js .score .sc-track i[data-at] {
  opacity: 1;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--tick) linear;
}
.js .score .sc-track i[data-at].on {
  transform: none;
}
.js .scene.resetting .score i.on {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Marks and pills sit on the bar, at the start of their column. */
.sc-pill,
.sc-mark {
  position: relative;
  z-index: 2;
  justify-self: start;
  white-space: nowrap;
  font-weight: 650;
}
.sc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  height: 1.7em;
  padding: 0 0.7em;
  border-radius: 999px;
  font-size: 0.82em;
  background: #141415;
  color: var(--s-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent);
}
.sc-pill::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 0.12em;
  background: var(--c);
}
.sc-baton {
  background: #2a1608;
  color: #ffb27a;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.7);
}
.sc-baton::before {
  background: #ff7a1a;
  transform: rotate(45deg);
}
.sc-wait {
  color: var(--s-text-2);
  box-shadow: inset 0 0 0 1px var(--s-line-2);
}
.sc-wait::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--s-muted);
  border-radius: 50%;
}
.sc-gate {
  color: #5ed39b;
  box-shadow: inset 0 0 0 1px rgba(94, 211, 155, 0.55);
}
.sc-gate::before {
  width: 0.2em;
  height: 0.9em;
  border-radius: 0;
  background: none;
  border-left: 0.16em solid #5ed39b;
  border-right: 0.16em solid #5ed39b;
  box-sizing: content-box;
}
.sc-mark {
  display: grid;
  place-content: center;
  width: 1.45em;
  height: 1.45em;
  margin-left: -0.72em;
  border-radius: 50%;
  background: #141415;
  font-size: 0.95em;
  line-height: 1;
}
.sc-ok {
  color: #5ed39b;
  box-shadow: inset 0 0 0 1px rgba(94, 211, 155, 0.6);
}
.sc-ok::before {
  content: "✓";
}
.sc-no {
  color: #f58585;
  box-shadow: inset 0 0 0 1px rgba(245, 133, 133, 0.65);
}
.sc-no::before {
  content: "✕";
}
.sc-msg {
  color: #8ccdf5;
  box-shadow: inset 0 0 0 1px rgba(140, 205, 245, 0.6);
}
.sc-msg::before {
  content: "✉";
  font-size: 0.85em;
}

/* The playhead: one hairline across the four lanes, moving a column a tick. */
.sc-head {
  position: absolute;
  left: calc(1.2em + var(--who));
  right: 1.2em;
  top: 0.4em;
  bottom: 0.3em;
  container-type: inline-size;
  pointer-events: none;
}
.sc-ph {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(#ff7a1a, rgba(255, 122, 26, 0.25));
  transform: translateX(calc(min(var(--step, 0), 15) * 100cqw / 15));
  transition: transform var(--tick) linear;
}
.sc-ph::before {
  content: "";
  position: absolute;
  left: -0.24em;
  top: -0.1em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 0.1em;
  background: #ff7a1a;
  transform: rotate(45deg);
}
html:not(.js) .sc-head,
.scene.still .sc-head,
.scene.resetting .sc-head {
  opacity: 0;
}
.scene.resetting .sc-ph {
  transition: none;
}

/* What the marks do when they arrive. A refusal shakes its head, a message hops from its sender's
   lane to the lane it was sent to (Otto, two lanes down, to Ada), and the lease is caught a lane
   below where it was held. The springs are in site.css (--spring). */
@media (prefers-reduced-motion: no-preference) {
  .js .score .sc-mark.on,
  .js .score .sc-pill.on {
    animation: sc-pop 0.5s var(--spring) both;
  }
  .js .score .sc-no.on {
    animation: sc-no 0.55s ease-out both;
  }
  .js .score .sc-msg.on {
    animation: sc-hop 0.9s var(--spring) 0.35s both;
  }
  .js .score .sc-catch.on {
    animation: sc-catch 0.75s var(--spring) both;
  }
  @keyframes sc-pop {
    from {
      opacity: 0;
      transform: scale(0.6);
    }
  }
  @keyframes sc-no {
    0% {
      opacity: 0;
      transform: scale(0.6);
    }
    30% {
      opacity: 1;
      transform: translateX(-0.3em);
    }
    50% {
      transform: translateX(0.3em);
    }
    70% {
      transform: translateX(-0.18em);
    }
    100% {
      transform: none;
    }
  }
  @keyframes sc-hop {
    from {
      transform: none;
    }
    to {
      transform: translateY(calc(var(--lane) * -2));
    }
  }
  @keyframes sc-catch {
    from {
      opacity: 0.4;
      transform: translate(-1.6em, calc(var(--lane) * -1)) scale(0.9);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc-msg {
    transform: translateY(calc(var(--lane) * -2));
  }
}
html:not(.js) .sc-msg,
.scene.still .sc-msg {
  transform: translateY(calc(var(--lane) * -2));
}
@media (max-width: 760px) {
  .score {
    --who: 2.4em;
    --lane: 2.3em;
    padding-inline: 0.9em;
  }
  .sc-head {
    left: calc(0.9em + var(--who));
    right: 0.9em;
  }
  .sc-who {
    font-size: 0;
  }
  .sc-who img {
    width: 18px;
    height: 18px;
  }
  .sc-pill {
    padding: 0 0.42em;
    gap: 0;
  }
  .sc-pill span {
    display: none;
  }
}

/* An agent's face in the other scenes, where a dot used to stand for it. */
.scene .face {
  width: 1.5em;
  height: 1.5em;
  flex: none;
}
.t-msg .face {
  margin-top: 0.1em;
}

/* ---------------------------------------------------------------------------------- the mission
   The same score, for agents that run agents: the orchestrator's lane, and a lane for each agent it
   started. A start drops from the orchestrator's lane, a report hops back up to it. */
.scene {
  --c6: #f472b6;
}
.c5 {
  --c: var(--c5);
}
.c6 {
  --c: var(--c6);
}
.c5t {
  color: var(--c5);
}
.c6t {
  color: var(--c6);
}
.mission .win {
  font-size: clamp(9px, 1.03vw, 12.5px);
  line-height: 1.45;
  overflow: hidden;
}
.ms-top {
  display: flex;
  align-items: center;
  gap: 1em;
  height: 3.6em;
  padding: 0 1.2em;
  border-bottom: 1px solid var(--s-line);
  background: #0b0b0c;
  white-space: nowrap;
}
.ms-tab {
  padding: 0.25em 0.8em;
  border-radius: 0.45em;
  background: rgba(255, 255, 255, 0.11);
  font-weight: 500;
}
.ms-top b {
  font-weight: 650;
}
.ms-count {
  margin-left: auto;
  color: var(--s-text-2);
}
.ms-done {
  color: #5ed39b;
}
.js .scene .ms-count[data-at]:not(.on) {
  display: none;
}
.mission .score {
  --who: 19em;
  --lane: 3.4em;
  border-top: 0;
  padding-block: 1em 0.8em;
}
.mission .sc-who > span {
  display: grid;
  line-height: 1.25;
}
.mission .sc-who em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.86em;
  color: var(--s-muted);
  white-space: nowrap;
}
.mission .sc-child .sc-who {
  position: relative;
  padding-left: 1.9em;
}
.mission .sc-child .sc-who::before {
  /* The branch from the orchestrator's lane down to this one. */
  content: "";
  position: absolute;
  left: 0.8em;
  top: calc(var(--lane) * -0.5);
  width: 0.7em;
  height: var(--lane);
  border-left: 1px solid var(--s-line-2);
  border-bottom: 1px solid var(--s-line-2);
  border-bottom-left-radius: 0.5em;
}
.sc-spawn {
  color: var(--c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 65%, transparent);
}
.sc-spawn::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--c);
}
.sc-msg,
.sc-spawn {
  --hop: 2;
}
.hop1 {
  --hop: 1;
}
.hop3 {
  --hop: 3;
}
.mission .sc-msg,
html:not(.js) .mission .sc-msg,
.scene.still.mission .sc-msg {
  transform: translateY(calc(var(--lane) * var(--hop) * -1));
}
@media (prefers-reduced-motion: no-preference) {
  .js .mission .sc-msg.on {
    animation: ms-up 0.9s var(--spring) 0.3s both;
  }
  .js .mission .sc-spawn.on {
    animation: ms-down 0.8s var(--spring) both;
  }
  @keyframes ms-up {
    from {
      transform: none;
    }
    to {
      transform: translateY(calc(var(--lane) * var(--hop) * -1));
    }
  }
  @keyframes ms-down {
    from {
      opacity: 0.3;
      transform: translateY(calc(var(--lane) * var(--hop) * -1));
    }
  }
}
@media (max-width: 760px) {
  .mission .win {
    font-size: 10.5px;
  }
  .mission .score {
    --who: 4.2em;
    --lane: 2.6em;
  }
  .mission .sc-who > span {
    display: none;
  }
  .ms-count {
    display: none;
  }
}

/* ----------------------------------------------------------------------------- the conversation
   One agent's pane as the app draws it: the thread on the left, its plan on the right, the
   composer under both. An approval is answered, the plan ticks, and the next message is queued. */
.conv .win {
  font-size: clamp(9.5px, 1.1vw, 13.5px);
  line-height: 1.5;
  overflow: hidden;
}
.cv-head {
  height: 3.2em;
  padding: 0 1.1em;
  background: #0b0b0c;
}
.cv-term {
  margin-left: auto;
  padding: 0.2em 0.7em;
  border-radius: 0.45em;
  color: var(--s-text-2);
  box-shadow: inset 0 0 0 1px var(--s-line-2);
  font-size: 0.86em;
}
.cv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19em;
  height: 25.5em;
}
.cv-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7em;
  padding: 1.3em clamp(1.2em, 6%, 5em);
  overflow: hidden;
}
.cv-thread p {
  margin: 0;
}
.cv-you {
  align-self: flex-end;
  padding: 0.45em 1em;
  border-radius: 1.1em 1.1em 0.3em 1.1em;
  background: #1c1c1e;
}
.cv-say {
  color: var(--s-text);
}
.cv-tool,
.cv-diff {
  display: flex;
  align-items: center;
  gap: 0.8em;
  align-self: stretch;
  padding: 0.5em 0.9em;
  border-radius: 0.6em;
  box-shadow: inset 0 0 0 1px var(--s-line);
  background: #0e0e0f;
}
.cv-tool b,
.cv-diff b {
  font-weight: 650;
}
.cv-tool code {
  color: var(--s-muted);
  font-size: 0.92em;
}
.cv-check {
  margin-left: auto;
  width: 1.1em;
  height: 1.1em;
  color: #5ed39b;
}
.cv-check::before {
  content: "✓";
  font-style: normal;
  font-weight: 700;
}
.cv-diff .add {
  color: #5ed39b;
  font-family: var(--mono);
  font-size: 0.9em;
}
.cv-diff .del {
  color: #f58585;
  font-family: var(--mono);
  font-size: 0.9em;
  margin-left: -0.3em;
}
.cv-diff em {
  margin-left: auto;
  font-style: normal;
  color: var(--s-text-2);
  font-size: 0.9em;
}
.cv-ask {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7em;
  align-self: stretch;
  padding: 0.6em 0.7em 0.6em 0.9em;
  border-radius: 0.7em;
  background: rgba(245, 192, 74, 0.07);
  box-shadow: inset 0 0 0 1px rgba(245, 192, 74, 0.5);
}
.cv-ask p {
  margin-right: auto;
}
.cv-ask code {
  color: var(--s-text-2);
}
.cv-btn {
  padding: 0.3em 0.95em;
  border-radius: 0.5em;
  box-shadow: inset 0 0 0 1px var(--s-line-2);
  font-weight: 600;
}
.cv-allow {
  background: #c55300;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
}
.cv-tap {
  /* The press on Allow: a ring that opens from where the finger lands. */
  position: absolute;
  right: 6.6em;
  top: 50%;
  width: 2.2em;
  height: 2.2em;
  margin-top: -1.1em;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
  pointer-events: none;
}
.cv-plan {
  padding: 1.2em 1.2em;
  border-left: 1px solid var(--s-line);
  background: #0b0b0c;
}
.cv-plan p {
  margin: 0;
}
.cv-plan-h {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.9em !important;
  font-weight: 650;
}
.cv-plan-h span {
  color: var(--s-muted);
  font-weight: 400;
}
.cv-step {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.38em 0;
  color: var(--s-text-2);
}
.cv-dot {
  width: 0.95em;
  height: 0.95em;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--s-line-2);
}
.cv-dot.done {
  background: #5ed39b;
  box-shadow: none;
}
.cv-compose {
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin: 0 1.1em 1.1em;
  padding: 0.55em 0.6em 0.55em 1.1em;
  border-radius: 0.9em;
  box-shadow: inset 0 0 0 1px var(--s-line-2);
  background: #0e0e0f;
}
.cv-input {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.cv-ph {
  color: var(--s-muted);
}
.cv-queued {
  padding: 0.2em 0.8em;
  border-radius: 999px;
  color: #ffb27a;
  background: rgba(255, 122, 26, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.35);
  font-size: 0.86em;
  font-weight: 650;
  white-space: nowrap;
}
.cv-send {
  width: 2em;
  height: 2em;
  flex: none;
  border-radius: 50%;
  background: #c55300;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
/* Parts that replace one another take no room until their turn. */
.js .scene :is(.cv-plan-h span, .cv-dot, .cv-ph, .cv-typed, .cv-queued, .cv-ask, .cv-tap)[data-at]:not(.on) {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .js .conv .cv-dot.done.on,
  .js .conv .cv-check.on,
  .js .conv .cv-queued.on {
    animation: sc-pop 0.5s var(--spring) both;
  }
  .js .conv .cv-tap.on {
    animation: cv-tap 0.6s ease-out both;
  }
  .js .conv .cv-typed.on {
    animation: cv-type 0.6s steps(24) both;
  }
  @keyframes cv-tap {
    from {
      opacity: 0.9;
      transform: scale(0.3);
    }
    to {
      opacity: 0;
      transform: scale(1.3);
    }
  }
  @keyframes cv-type {
    from {
      clip-path: inset(0 100% 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }
}
html:not(.js) .cv-ask,
html:not(.js) .cv-tap {
  display: none;
}
@media (max-width: 760px) {
  .conv .win {
    font-size: 11px;
  }
  .cv-body {
    grid-template-columns: minmax(0, 1fr);
    height: 27em;
  }
  .cv-plan,
  .cv-term,
  .cv-diff em {
    display: none;
  }
  .cv-thread {
    padding: 1em;
  }
}
