/* Animated high-level architecture */
.ax {
  --cycle: 7s;
  border-radius: 32px;
  padding: clamp(16px, 2.4vw, 28px);
  display: grid;
  gap: 14px;
}
.ax-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ax-band b {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
}
.ax-band span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.05);
  color: var(--dim);
}
.ax-band em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ax-row {
  display: grid;
  grid-template-columns: 1fr 56px 1fr 56px 1.15fr 56px 1fr;
  align-items: stretch;
}
.ax-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
}
.ax-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 2px;
}
.ax-pill,
.ax-chip,
.ax-db {
  padding: 8px 11px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
}
.ax-ag small {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--dim);
}
.ax-gate {
  color: #fff;
  background: var(--btn);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 24px 50px -24px rgba(0, 0, 0, 0.6);
  animation: ax-glow var(--cycle) ease-in-out infinite;
}
.ax-gate .ax-h {
  color: rgba(255, 255, 255, 0.6);
}
.ax-gate ul {
  display: grid;
  gap: 6px;
}
.ax-gate li {
  padding-left: 18px;
  position: relative;
  color: rgba(255, 255, 255, 0.85);
}
.ax-gate li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.ax-verdict {
  position: relative;
  margin-top: auto;
  height: 34px;
}
.ax-verdict span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
}
.ax-verdict .ok {
  color: #000;
  background: #fff;
  animation: ax-ok calc(var(--cycle) * 2) infinite;
}
.ax-verdict .no {
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6);
  animation: ax-no calc(var(--cycle) * 2) infinite;
}
.ax-db.hit {
  animation: ax-hit var(--cycle) ease-in-out infinite;
}
.ax-lane {
  position: relative;
  align-self: center;
  height: 2px;
  margin: 0 6px;
  background: repeating-linear-gradient(
    90deg,
    rgba(10, 12, 16, 0.25) 0 6px,
    transparent 6px 11px
  );
}
.pk {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 4px rgba(10, 12, 16, 0.1);
  opacity: 0;
}
.pk.back {
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #000,
    0 0 0 4px rgba(10, 12, 16, 0.08);
}
/* one cycle: go across lane 1, 2, 3 then come back 3, 2, 1 */
.ax-lane:nth-of-type(2) .pk.go {
  animation: ax-go var(--cycle) linear infinite;
  --a: 0%;
}
.ax-lane:nth-of-type(4) .pk.go {
  animation: ax-go var(--cycle) linear infinite;
  animation-delay: calc(var(--cycle) * 0.14);
}
.ax-lane:nth-of-type(6) .pk.go {
  animation: ax-go var(--cycle) linear infinite;
  animation-delay: calc(var(--cycle) * 0.34);
}
.ax-lane:nth-of-type(6) .pk.back {
  animation: ax-back var(--cycle) linear infinite;
  animation-delay: calc(var(--cycle) * 0.52);
}
.ax-lane:nth-of-type(4) .pk.back {
  animation: ax-back var(--cycle) linear infinite;
  animation-delay: calc(var(--cycle) * 0.66);
}
.ax-lane:nth-of-type(2) .pk.back {
  animation: ax-back var(--cycle) linear infinite;
  animation-delay: calc(var(--cycle) * 0.8);
}
.pk.deny {
  background: #000;
  animation: ax-deny calc(var(--cycle) * 2) linear infinite;
}
@keyframes ax-go {
  0% {
    left: 0;
    opacity: 1;
  }
  13% {
    left: 100%;
    opacity: 1;
  }
  14%,
  100% {
    left: 100%;
    opacity: 0;
  }
}
@keyframes ax-back {
  0% {
    left: 100%;
    opacity: 1;
  }
  13% {
    left: 0;
    opacity: 1;
  }
  14%,
  100% {
    left: 0;
    opacity: 0;
  }
}
@keyframes ax-deny {
  0%,
  57% {
    left: 0;
    opacity: 0;
  }
  58% {
    left: 0;
    opacity: 1;
  }
  64% {
    left: 92%;
    opacity: 1;
    transform: scale(1);
  }
  70% {
    left: 92%;
    opacity: 0;
    transform: scale(1.8);
  }
  100% {
    opacity: 0;
  }
}
@keyframes ax-glow {
  0%,
  24%,
  40%,
  100% {
    filter: none;
  }
  30% {
    filter: brightness(1.6);
  }
}
@keyframes ax-hit {
  0%,
  44%,
  58%,
  100% {
    background: #fff;
    color: inherit;
  }
  48%,
  54% {
    background: #000;
    color: #fff;
  }
}
@keyframes ax-ok {
  0%,
  13% {
    opacity: 0;
  }
  16%,
  44% {
    opacity: 1;
  }
  47%,
  100% {
    opacity: 0;
  }
}
@keyframes ax-no {
  0%,
  63% {
    opacity: 0;
  }
  66%,
  92% {
    opacity: 1;
  }
  95%,
  100% {
    opacity: 0;
  }
}
@media (max-width: 960px) {
  .ax-row {
    grid-template-columns: 1fr;
  }
  .ax-lane {
    justify-self: center;
    width: 2px;
    height: 34px;
    margin: 6px 0;
    background: repeating-linear-gradient(
      180deg,
      rgba(10, 12, 16, 0.25) 0 6px,
      transparent 6px 11px
    );
  }
  .pk {
    left: 50%;
    top: 0;
  }
  @keyframes ax-go {
    0% {
      top: 0;
      opacity: 1;
    }
    13% {
      top: 100%;
      opacity: 1;
    }
    14%,
    100% {
      top: 100%;
      opacity: 0;
    }
  }
  @keyframes ax-back {
    0% {
      top: 100%;
      opacity: 1;
    }
    13% {
      top: 0;
      opacity: 1;
    }
    14%,
    100% {
      top: 0;
      opacity: 0;
    }
  }
  @keyframes ax-deny {
    0%,
    57% {
      top: 0;
      opacity: 0;
    }
    58% {
      top: 0;
      opacity: 1;
    }
    64% {
      top: 85%;
      opacity: 1;
    }
    70%,
    100% {
      top: 85%;
      opacity: 0;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .ax * {
    animation: none !important;
  }
  .ax-verdict .ok {
    opacity: 1;
  }
}
/* v2: agent loop + task */
.ax-task {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ax-ask,
.ax-done {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
}
.ax-ask b,
.ax-done b {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.ax-ask {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.ax-ask b {
  color: var(--dim);
}
.ax-done {
  color: #fff;
  background: var(--btn);
  animation: ax-done var(--cycle) ease-in-out infinite;
}
.ax-done b {
  color: rgba(255, 255, 255, 0.6);
}
@keyframes ax-done {
  0%,
  86% {
    opacity: 0.25;
  }
  90%,
  100% {
    opacity: 1;
  }
}
.ax-pill.alt {
  font-weight: 500;
  border: 1px dashed rgba(10, 12, 16, 0.35);
  box-shadow: none;
  background: transparent;
}
.ax-loop {
  display: grid;
  gap: 6px;
  counter-reset: st;
}
.ax-loop li {
  position: relative;
  padding: 8px 10px 8px 36px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  counter-increment: st;
  animation: ax-step var(--cycle) ease-in-out infinite;
}
.ax-loop li::before {
  content: counter(st);
  position: absolute;
  left: 9px;
  top: 9px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #000;
}
.ax-loop b {
  display: block;
  font-size: 13.5px;
}
.ax-loop span {
  display: block;
  font-size: 12px;
  color: inherit;
  opacity: 0.68;
  line-height: 1.35;
}
.ax-loop li:nth-child(1) {
  animation-delay: calc(var(--cycle) * 0.13);
}
.ax-loop li:nth-child(2) {
  animation-delay: calc(var(--cycle) * 0.2);
}
.ax-loop li:nth-child(3) {
  animation-delay: calc(var(--cycle) * 0.27);
}
.ax-loop li:nth-child(4) {
  animation-delay: calc(var(--cycle) * 0.64);
}
.ax-loop li:nth-child(5) {
  animation-delay: calc(var(--cycle) * 0.71);
}
@keyframes ax-step {
  0%,
  9%,
  100% {
    background: #fff;
    color: inherit;
  }
  1%,
  8% {
    background: #000;
    color: #fff;
  }
}
.ax-loop li span {
  transition: none;
}
.ax-db em {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--dim);
}
.ax-db.hit em {
  color: inherit;
  opacity: 0.7;
}
@media (max-width: 960px) {
  .ax-task {
    grid-template-columns: 1fr;
  }
}
