.architecture-art {
  --art-green: #229969; /* Matches the conversion decision illustration. */
  --art-outline: #a8c5f0;
  --art-trace: #b6c8df;
  --art-rule: #e0e6ef;
  --art-paper: #fff;
  --art-surface: #edf4ff;
  --art-surface-light: #f7faff;
  --art-accent-fill: #dbe8fb;
  display: grid;
  justify-items: center;
  margin: 0 0 20px;
  padding: 6px 8px;
  background: radial-gradient(ellipse at center, var(--art-surface) 0%, transparent 68%);
}

.architecture-art__stage {
  position: relative;
  width: min(100%, 286px);
  height: 140px;
}

.architecture-art__stage > * { position: absolute; }

@media (min-width: 768px) {
  .architecture-art { padding-block: 15px; }
  .architecture-art__stage { scale: 1.12; }
}

.architecture-art__wire {
  height: 1px;
  background: var(--art-trace);
}

.architecture-art__packet {
  z-index: 4;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--art-surface);
  translate: -50% -50%;
  opacity: 0;
}

.architecture-art__paper {
  width: 33px;
  height: 42px;
  display: block;
  border: 1px solid var(--art-outline);
  border-radius: 3px;
  background: var(--art-paper);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__paper::before {
  content: "";
  position: absolute;
  inset: 12px 6px 6px;
  background: repeating-linear-gradient(to bottom, var(--art-trace) 0 2px, transparent 2px 6px);
}

.architecture-art__paper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-left: 1px solid var(--art-trace);
  border-bottom: 1px solid var(--art-trace);
  background: var(--art-surface);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.architecture-art__check {
  display: block;
  width: 13px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  rotate: -45deg;
  color: var(--art-green);
}

.architecture-art__rack {
  position: relative;
  display: grid;
  gap: 4px;
  width: 45px;
  padding: 5px;
  border: 1px solid var(--art-outline);
  border-radius: 5px;
  background: var(--art-surface);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__rack i {
  position: relative;
  display: block;
  height: 9px;
  border: 1px solid var(--art-trace);
  border-radius: 2px;
  background: var(--art-paper);
}

.architecture-art__rack i::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--art-trace);
  box-shadow: 6px 0 var(--art-trace);
}

/* One router accepts three separate requests and forwards each to its server. */
.architecture-art__gateway {
  top: 12px;
  left: 50%;
  translate: -50%;
  width: 80px;
  height: 26px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--art-outline);
  border-radius: 5px;
  background: linear-gradient(var(--art-surface) 0 38%, var(--art-trace) 40% 43%, var(--art-surface) 46%);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__gateway i {
  width: 12px;
  height: 7px;
  border: 1px solid var(--art-outline);
  border-radius: 1px;
  background: var(--accent);
  box-shadow: inset 0 -2px var(--art-accent-fill);
}

.architecture-art__junction, .architecture-art__routes {
  top: 38px;
  left: 0;
  right: 0;
  height: 52px;
}

.architecture-art__junction::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 50%;
  left: 50%;
  border-left: 1px solid var(--art-trace);
}

.architecture-art__junction::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline: 17%;
  border-top: 1px solid var(--art-trace);
}

.architecture-art__junction i {
  position: absolute;
  top: 50%;
  bottom: 0;
  left: var(--receiver);
  border-left: 1px solid var(--art-trace);
}

.architecture-art__junction i:nth-child(1), .architecture-art__routes i:nth-child(1) { --receiver: 17%; }
.architecture-art__junction i:nth-child(2), .architecture-art__routes i:nth-child(2) { --receiver: 50%; }
.architecture-art__junction i:nth-child(3), .architecture-art__routes i:nth-child(3) { --receiver: 83%; }

.architecture-art__racks {
  top: 89px;
  inset-inline: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}

.architecture-art__routes i { position: absolute; top: 0; left: 50%; }

/* A signed webhook passes the shield. A second copy stops at verification. */
.architecture-art--webhook .architecture-art__wire { top: 70px; left: 17%; right: 16%; }

.architecture-art__envelope {
  top: 49px;
  left: 8%;
  width: 53px;
  height: 37px;
  overflow: hidden;
  border: 1px solid var(--art-outline);
  border-radius: 4px;
  background: var(--art-surface);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__envelope::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  top: -23px;
  left: 7px;
  border-right: 1px solid var(--art-outline);
  border-bottom: 1px solid var(--art-outline);
  background: var(--art-surface);
  rotate: 45deg;
}

.architecture-art__shield {
  top: 40px;
  left: 50%;
  translate: -50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 51px;
  height: 56px;
}

.architecture-art__shield > svg {
  position: absolute;
  inset: 0;
  fill: var(--art-paper);
  stroke: var(--art-outline);
  stroke-width: 2.8;
  stroke-linejoin: round;
}

.architecture-art__shield .architecture-art__check { z-index: 1; margin-block-end: 4px; }

.architecture-art__inbox {
  top: 75px;
  right: 7%;
  width: 52px;
  height: 22px;
  border: 1px solid var(--art-outline);
  border-radius: 3px 3px 6px 6px;
  background: linear-gradient(var(--art-surface) 0 25%, var(--art-trace) 28% 41%, var(--art-surface) 45%);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__inbox .architecture-art__paper { position: absolute; left: 10px; bottom: 12px; }

.architecture-art__webhook-event {
  z-index: 2;
  top: 59px;
  left: 20%;
  width: 18px;
  height: 23px;
  opacity: 0;
}

.architecture-art__webhook-event::before { inset: 6px 4px 4px; }

/* Raw captures take a separate intake path into the analytical database. */
.architecture-art__database {
  top: 26px;
  width: 72px;
  height: 74px;
  translate: -50%;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 12px 2px 5px;
  border: 1px solid var(--art-outline);
  border-radius: 48% / 14%;
  background: linear-gradient(90deg, var(--art-accent-fill), var(--art-surface) 25% 58%, var(--art-accent-fill));
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__database::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 18px;
  border: 1px solid var(--art-outline);
  border-radius: 50%;
  background: var(--art-surface-light);
}

.architecture-art__database i {
  display: block;
  height: 14px;
  border-bottom: 1px solid var(--art-trace);
  border-radius: 0 0 48% 48%;
}

.architecture-art__database--transactional {
  left: 45%;
  border-color: var(--art-trace);
  background: linear-gradient(90deg, var(--art-accent-fill), var(--art-surface-light) 26% 58%, var(--art-accent-fill));
}
.architecture-art__database--transactional::before {
  border-color: var(--art-trace);
  background: linear-gradient(135deg, var(--art-paper), var(--art-rule));
}
.architecture-art__database--analytical { left: 78%; }
.architecture-art__database--analytical i {
  background: linear-gradient(var(--accent), var(--accent)) 9px center / 0 2px no-repeat;
}

.architecture-art__archive { top: 64px; left: 7%; width: 36px; height: 43px; }
.architecture-art__archive .architecture-art__paper { position: absolute; rotate: -8deg; }
.architecture-art__archive .architecture-art__paper + .architecture-art__paper { left: 7px; top: -3px; rotate: 7deg; }

.architecture-art__ingestion {
  top: 91px;
  left: 17%;
  right: 22%;
  height: 27px;
  border: solid var(--art-trace);
  border-width: 0 1px 1px;
  border-radius: 0 0 7px 7px;
}

.architecture-art__record {
  z-index: 2;
  top: 87px;
  left: 17%;
  width: 12px;
  height: 16px;
  opacity: 0;
}

.architecture-art__record::before { inset: 4px 2px 2px; }

/* A build package waits at the scanner, then proceeds to the smoke-test terminal. */
.architecture-art__conveyor {
  top: 86px;
  inset-inline: 5%;
  height: 24px;
  border: 1px solid var(--art-outline);
  border-radius: 11px;
  background: repeating-linear-gradient(90deg, var(--art-surface) 0 11px, var(--art-accent-fill) 12px 14px) 0 / 14px 100%;
  box-shadow: 0 2px 0 var(--art-rule);
}

.architecture-art__scanner {
  z-index: 2;
  top: 31px;
  left: 49%;
  translate: -50%;
  width: 65px;
  height: 57px;
  border: 4px solid var(--art-outline);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  box-shadow: inset 0 2px var(--art-surface), 3px 0 0 var(--art-rule);
}

.architecture-art__scanner i {
  position: absolute;
  inset: 1px 0 0;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(transparent 48%, #dbe8fbaa);
  transform-origin: top;
  opacity: 0;
}

.architecture-art__package {
  z-index: 1;
  top: 61px;
  left: 10%;
  width: 30px;
  height: 25px;
  border: 1px solid var(--art-outline);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--art-accent-fill) 36%, var(--art-surface) 37% 58%, var(--art-accent-fill) 59%);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__release-terminal {
  top: 34px;
  right: 7%;
  display: grid;
  place-items: center;
  width: 39px;
  height: 32px;
  border: 3px solid var(--art-outline);
  border-radius: 4px;
  background: var(--art-paper);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__release-terminal::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  height: 19px;
  border-left: 1px solid var(--art-trace);
}

/* The agent calls a tool, receives its response, then writes to the ledger. */
.architecture-art--orchestration .architecture-art__wire { top: 61px; left: 17%; right: 17%; }
.architecture-art--orchestration .architecture-art__wire--model {
  top: 61px;
  bottom: 23px;
  left: 50%;
  right: auto;
  width: 1px;
  height: auto;
}
.architecture-art--orchestration .architecture-art__rack {
  position: absolute;
  top: 44px;
  left: 9%;
}

.architecture-art__chip {
  z-index: 1;
  top: 29px;
  left: 50%;
  translate: -50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 65px;
  border: 1px solid var(--art-outline);
  border-radius: 7px;
  background: var(--art-surface);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__chip::before, .architecture-art__chip::after {
  content: "";
  position: absolute;
  z-index: -1;
  background: repeating-linear-gradient(to bottom, var(--art-trace) 0 3px, transparent 3px 7px);
  width: 7px;
  height: 41px;
  right: 100%;
}

.architecture-art__chip::after { right: auto; left: 100%; }

.architecture-art__chip span {
  padding: 5px 7px;
  border: 1px solid var(--art-outline);
  border-radius: 4px;
  background: var(--art-surface);
  font: 600 15px/1 ui-monospace, monospace;
  color: var(--accent);
}

.architecture-art__model {
  top: 111px;
  left: 50%;
  translate: -50%;
  width: 37px;
  height: 12px;
  border: 1px solid var(--art-outline);
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--art-surface) 0 4px, var(--art-accent-fill) 4px 7px);
}

.architecture-art__ledger { top: 42px; right: 10%; }
.architecture-art__ledger::before { display: none; }

.architecture-art__ledger i {
  position: relative;
  display: block;
  height: 2px;
  margin: 7px 5px 0;
  background: var(--accent);
  transform-origin: left;
}

.architecture-art__tool-call, .architecture-art__model-call, .architecture-art__ledger-write { top: 61px; left: 50%; }

/* A spec becomes code on the build screen, then receives QA sign-off. */
.architecture-art--delivery .architecture-art__wire { top: 69px; left: 15%; right: 16%; }
.architecture-art__spec { top: 42px; left: 9%; rotate: -6deg; }

.architecture-art__monitor {
  z-index: 1;
  top: 32px;
  left: 50%;
  translate: -50%;
  width: 92px;
  height: 59px;
  padding: 12px 10px 8px;
  border: 4px solid var(--art-trace);
  border-radius: 6px;
  background: linear-gradient(var(--art-surface) 0 4px, var(--art-rule) 4px 5px, var(--art-paper) 5px);
  box-shadow: 1px 2px 0 var(--art-rule);
}

.architecture-art__monitor::after {
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  translate: -50%;
  width: 17px;
  height: 11px;
  border-bottom: 3px solid var(--art-outline);
  background: linear-gradient(to right, transparent 34%, var(--art-surface) 35% 65%, transparent 66%);
}

.architecture-art__monitor i {
  display: block;
  width: 86%;
  height: 3px;
  margin-block-end: 5px;
  border-radius: 2px;
  transform-origin: left;
  background: var(--art-trace);
}

.architecture-art__monitor i:nth-child(2) { width: 62%; margin-inline-start: 6px; background: var(--accent); }
.architecture-art__monitor i:nth-child(3) { width: 76%; margin-inline-start: 6px; }

.architecture-art__clipboard {
  top: 39px;
  right: 8%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 53px;
  border: 2px solid var(--art-outline);
  background: var(--art-paper);
}

.architecture-art__clipboard::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 8px;
  right: 8px;
  height: 7px;
  border: 1px solid var(--art-outline);
  border-radius: 3px;
  background: var(--art-accent-fill);
  clip-path: none;
  width: auto;
}

.architecture-art__clipboard::before { inset: 13px 6px auto; height: 13px; }
.architecture-art__clipboard .architecture-art__check { margin-block-start: 19px; }

.architecture-art__spec-handoff {
  top: 60px;
  left: 16%;
  width: 15px;
  height: 19px;
  opacity: 0;
}

.architecture-art__spec-handoff::before { inset: 4px 3px 3px; }
.architecture-art__review-handoff { top: 69px; left: 62%; }

@media (prefers-reduced-motion: no-preference) {
  .architecture-art { --art-motion: paused; }
  .rail-cell.card-arrived .architecture-art { --art-motion: running; }

  .architecture-art__routes i {
    animation: architecture-route-request 5.6s linear infinite var(--art-motion);
  }

  .architecture-art__routes i:nth-child(2) { animation-delay: .8s; }
  .architecture-art__routes i:nth-child(3) { animation-delay: 1.6s; }
  .architecture-art__racks .architecture-art__rack i:first-child::before {
    animation: architecture-server-received 5.6s linear infinite var(--art-motion);
  }
  .architecture-art__racks .architecture-art__rack:nth-child(2) i:first-child::before { animation-delay: .8s; }
  .architecture-art__racks .architecture-art__rack:nth-child(3) i:first-child::before { animation-delay: 1.6s; }

  .architecture-art__webhook-event {
    animation: architecture-signed-webhook 5.9s linear infinite var(--art-motion);
  }
  .architecture-art__webhook-event--duplicate {
    animation-name: architecture-duplicate-webhook;
  }
  .architecture-art__shield .architecture-art__check {
    animation: architecture-draw-check 5.9s ease-out infinite var(--art-motion);
  }
  .architecture-art__inbox .architecture-art__paper {
    animation: architecture-inbox-receipt 5.9s ease-out infinite var(--art-motion);
  }

  .architecture-art__record {
    translate: -50% -50%;
    animation: architecture-ingest-record 5.8s linear infinite var(--art-motion);
  }
  .architecture-art__record:nth-of-type(2) { animation-delay: .38s; }
  .architecture-art__record:nth-of-type(3) { animation-delay: .76s; }
  .architecture-art__database--analytical i {
    animation: architecture-store-record 5.8s ease-out infinite var(--art-motion);
  }
  .architecture-art__database--analytical i:nth-child(2) { animation-delay: .38s; }
  .architecture-art__database--analytical i:nth-child(3) { animation-delay: .76s; }

  .architecture-art__package {
    animation: architecture-move-build 6s ease-in-out infinite var(--art-motion);
  }
  .architecture-art__conveyor {
    animation: architecture-roll-belt 6s linear infinite var(--art-motion);
  }
  .architecture-art__scanner i {
    animation: architecture-scan-build 6s ease-in-out infinite var(--art-motion);
  }
  .architecture-art__release-terminal .architecture-art__check {
    animation: architecture-release-pass 6s ease-out infinite var(--art-motion);
  }

  .architecture-art__tool-call {
    animation: architecture-call-tool 6.4s linear infinite var(--art-motion);
  }
  .architecture-art__model-call {
    animation: architecture-call-model 6.4s linear infinite var(--art-motion);
  }
  .architecture-art__ledger-write {
    animation: architecture-write-ledger 6.4s linear infinite var(--art-motion);
  }
  .architecture-art__ledger i {
    animation: architecture-log-line 6.4s ease-out infinite var(--art-motion);
  }
  .architecture-art__ledger i:nth-child(2) { animation-delay: .19s; }
  .architecture-art__ledger i:nth-child(3) { animation-delay: .38s; }

  .architecture-art__spec-handoff {
    animation: architecture-send-spec 6.2s linear infinite var(--art-motion);
  }
  .architecture-art__monitor i {
    animation: architecture-type-code 6.2s steps(5, end) infinite var(--art-motion);
  }
  .architecture-art__monitor i:nth-child(2) { animation-delay: .36s; }
  .architecture-art__monitor i:nth-child(3) { animation-delay: .72s; }
  .architecture-art__review-handoff {
    animation: architecture-send-review 6.2s linear infinite var(--art-motion);
  }
  .architecture-art__clipboard .architecture-art__check {
    animation: architecture-sign-off 6.2s ease-out infinite var(--art-motion);
  }
}

@keyframes architecture-route-request {
  0% { left: 50%; top: 0; opacity: 0; }
  3% { opacity: 1; }
  12% { left: 50%; top: 50%; }
  23% { left: var(--receiver); top: 50%; }
  32% { left: var(--receiver); top: 100%; opacity: 1; }
  37%, 100% { left: var(--receiver); top: 100%; opacity: 0; }
}

@keyframes architecture-server-received {
  0%, 30%, 55%, 100% { background: var(--art-trace); }
  34%, 47% { background: var(--art-green); }
}

@keyframes architecture-signed-webhook {
  0%, 4% { left: 23%; opacity: 0; transform: translateY(-6px); }
  8% { opacity: 1; transform: translateY(0); }
  25%, 36% { left: calc(50% - 9px); }
  56% { left: 78%; opacity: 1; }
  62%, 100% { left: 78%; opacity: 0; }
}

@keyframes architecture-duplicate-webhook {
  0%, 31% { left: 23%; opacity: 0; }
  35% { opacity: 1; }
  56% { left: calc(50% - 44px); opacity: 1; border-color: var(--art-outline); }
  65% { left: calc(50% - 44px); opacity: 1; border-color: #bd8a62; transform: rotate(-12deg); }
  71%, 100% { left: calc(50% - 44px); opacity: 0; transform: rotate(-12deg); }
}

@keyframes architecture-draw-check {
  0%, 26%, 100% { clip-path: inset(0 100% 0 0); }
  35%, 87% { clip-path: inset(0); }
  94% { clip-path: inset(0 100% 0 0); }
}

@keyframes architecture-inbox-receipt {
  0%, 53%, 100% { transform: scaleY(.65); transform-origin: bottom; }
  64%, 91% { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes architecture-ingest-record {
  0% { left: 17%; top: 91px; opacity: 0; }
  5% { opacity: 1; }
  16% { left: 17%; top: 118px; }
  46% { left: 78%; top: 118px; }
  58% { left: 78%; top: 94px; opacity: 1; transform: scaleY(.33); }
  63%, 100% { left: 78%; top: 94px; opacity: 0; transform: scaleY(.33); }
}

@keyframes architecture-store-record {
  0%, 58%, 100% { background-size: 0 2px; }
  68%, 90% { background-size: calc(100% - 18px) 2px; }
}

@keyframes architecture-move-build {
  0%, 7% { left: 10%; opacity: 1; }
  29%, 55% { left: calc(49% - 15px); }
  81%, 91% { left: calc(93% - 35px); opacity: 1; }
  100% { left: calc(93% - 35px); opacity: 0; }
}

@keyframes architecture-roll-belt {
  0%, 7% { background-position-x: 0; }
  29%, 55% { background-position-x: 112px; }
  81%, 100% { background-position-x: 224px; }
}

@keyframes architecture-scan-build {
  0%, 28%, 100% { opacity: 0; transform: scaleY(.06); }
  33% { opacity: .9; transform: scaleY(.06); }
  50% { opacity: .9; transform: scaleY(1); }
  55%, 99% { opacity: 0; transform: scaleY(1); }
}

@keyframes architecture-release-pass {
  0%, 78%, 100% { clip-path: inset(0 100% 0 0); }
  85%, 97% { clip-path: inset(0); }
}

@keyframes architecture-call-tool {
  0% { left: 50%; opacity: 0; }
  4% { opacity: 1; }
  18%, 22% { left: 17%; }
  36% { left: 50%; opacity: 1; }
  40%, 100% { opacity: 0; left: 50%; }
}

@keyframes architecture-call-model {
  0%, 36% { top: 61px; opacity: 0; }
  41% { opacity: 1; }
  48%, 53% { top: 116px; }
  61% { top: 61px; opacity: 1; }
  64%, 100% { top: 61px; opacity: 0; }
}

@keyframes architecture-write-ledger {
  0%, 60% { left: 50%; opacity: 0; }
  65% { opacity: 1; }
  76% { left: 83%; opacity: 1; }
  79%, 100% { left: 83%; opacity: 0; }
}

@keyframes architecture-log-line {
  0%, 75%, 100% { transform: scaleX(0); }
  83%, 96% { transform: scaleX(1); }
}

@keyframes architecture-send-spec {
  0% { left: 16%; opacity: 0; }
  5% { opacity: 1; }
  23% { left: 47%; opacity: 1; }
  28%, 100% { left: 47%; opacity: 0; }
}

@keyframes architecture-type-code {
  0%, 23%, 100% { transform: scaleX(0); }
  40%, 91% { transform: scaleX(1); }
}

@keyframes architecture-send-review {
  0%, 56% { left: 62%; opacity: 0; }
  61% { opacity: 1; }
  74% { left: 82%; opacity: 1; }
  78%, 100% { left: 82%; opacity: 0; }
}

@keyframes architecture-sign-off {
  0%, 74%, 100% { clip-path: inset(0 100% 0 0); }
  84%, 97% { clip-path: inset(0); }
}
