.pitch-architecture {
  background: url('grafito-cuadros.png') repeat 0 0 / 256px 256px,
    radial-gradient(ellipse at 53% 56%, #2f1d4a, var(--bg) 71%);
}

.pitch-architecture > .architecture-slide {
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: clamp(18px, 5svh, 48px);
  padding-block: clamp(22px, 6svh, 65px);
}

.pitch-architecture h2 { max-width: none; font-size: clamp(44px, 6vw, 85px); }
.pitch-architecture h2 em { color: var(--accent); }

.architecture-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(34px, .27fr) minmax(126px, .65fr) minmax(34px, .27fr) minmax(0, 1fr);
  align-items: stretch;
}

.architecture-diagram h3 {
  margin: 0 0 12px;
  color: var(--accent-light);
  font-size: clamp(14px, 1.55vw, 21px);
  font-weight: 600;
}

.architecture-sources ul { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0; }
.architecture-sources li {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 54px;
  align-content: center;
  padding: 7px 15px;
  border: 1px solid #674d89;
  border-radius: 7px;
  background: #1b1429;
  line-height: 1.25;
}

.architecture-sources li::after {
  position: absolute;
  right: -4px;
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: '';
}

.architecture-sources strong { font-size: clamp(13px, 1.25vw, 17px); font-weight: 600; }
.architecture-sources span { color: var(--mut); font-size: clamp(11px, 1vw, 14px); }

.architecture-input-lines, .architecture-output-lines {
  width: 100%;
  height: 100%;
  fill: none;
  overflow: visible;
}

.architecture-cables { stroke: #7e60a8; stroke-width: 1.4; }
.architecture-signals { stroke: var(--accent-light); stroke-width: 2; stroke-dasharray: .15 .85; }
.architecture-signals use { animation: architecture-transmit 2s linear infinite paused; }
.architecture-signals use:nth-child(2n) { animation-delay: -.85s; }
.architecture-live .architecture-signals use { animation-play-state: running; }

@keyframes architecture-transmit { to { stroke-dashoffset: -1; } }

.architecture-engine { display: grid; place-content: center; justify-items: center; text-align: center; }
.architecture-engine h3 { margin: 0; }
.architecture-chip { display: block; width: min(100%, 224px); overflow: visible; filter: drop-shadow(0 0 22px #ae70fa55); }
.architecture-pins { fill: none; stroke: #a079d5; stroke-width: 2; stroke-linecap: round; }
.architecture-brain { fill: none; stroke: #e3caff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.architecture-output { display: grid; align-content: center; justify-items: center; }
.architecture-output h3 { margin-bottom: 39px; }
.architecture-agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.45vw, 20px); width: 100%; }

.architecture-agent {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--accent-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.architecture-agent:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.architecture-avatar {
  display: grid;
  place-items: center;
  width: min(100%, 62px);
  aspect-ratio: 1;
  border: 1px solid #805cb2;
  border-radius: 12px;
  background: #211633;
  animation: architecture-float 3.6s var(--agent-delay) ease-in-out infinite paused;
}

.architecture-live .architecture-avatar { animation-play-state: running; }
.architecture-avatar svg { width: 62%; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.agent-speaking { z-index: 1; }
.agent-speaking .architecture-avatar { border-color: #e3caff; background: #422767; }

.architecture-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 170px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #ead9ff;
  color: #211633;
  font: 600 12px/1.3 Inter, system-ui, sans-serif;
  box-shadow: 0 8px 20px #110b1e90;
  pointer-events: none;
}

.architecture-bubble::after {
  position: absolute;
  left: var(--bubble-tail, 50%);
  top: 100%;
  border: 4px solid transparent;
  border-top-color: #ead9ff;
  transform: translateX(-50%);
  content: '';
}

.agent-speaking .architecture-bubble { display: block; animation: architecture-speak .35s ease-out; }
.architecture-agent:nth-child(4n + 1) .architecture-bubble { left: 0; transform: none; --bubble-tail: 24px; }
.architecture-agent:nth-child(4n) .architecture-bubble { left: auto; right: 0; transform: none; --bubble-tail: calc(100% - 24px); }

@keyframes architecture-float { 50% { translate: 0 -4px; } }
@keyframes architecture-speak { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }

@media (max-width: 820px) {
  .architecture-diagram { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .architecture-input-lines, .architecture-output-lines { display: none; }
  .architecture-sources li::after { content: none; }
  .architecture-sources li { min-height: 0; padding: 6px 9px; }
  .architecture-sources ul { gap: 5px; }
  .architecture-engine { display: flex; align-items: center; justify-content: center; }
  .architecture-chip { width: 84px; }
  .architecture-output h3 { margin: 0 0 49px; }
  .architecture-agents { max-width: 370px; }
  .architecture-avatar { width: 44px; border-radius: 8px; }
  .architecture-engine::before, .architecture-engine::after { content: '↓'; color: var(--accent); margin: 0 8px; }
}
