/* ============================================================
   AI AGENTS — Graphics layer (v3)
   Adds visual flow, brand chips, icon-led cards, industry scene.
============================================================ */

/* ==============================
   PIPELINE — visual flow
============================== */
.aa-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--site-line);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(0,85,255,0.08), transparent 70%),
    linear-gradient(180deg, rgba(15,21,48,0.4), rgba(5,7,15,0.2));
  position: relative;
  overflow: hidden;
}
@media (max-width: 1000px) { .aa-flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .aa-flow { grid-template-columns: 1fr; } }

.aa-flow-node {
  position: relative;
  padding: 28px 24px 28px;
  border-right: 1px solid var(--site-line);
  border-bottom: 1px solid var(--site-line);
  display: flex; flex-direction: column; gap: 10px;
  transition: background 260ms;
}
.aa-flow-node:nth-child(4n) { border-right: 0; }
.aa-flow-node:nth-last-child(-n+4) { border-bottom: 0; }
@media (max-width: 1000px) {
  .aa-flow-node { border-right: 1px solid var(--site-line); border-bottom: 1px solid var(--site-line); }
  .aa-flow-node:nth-child(4n) { border-right: 1px solid var(--site-line); }
  .aa-flow-node:nth-child(2n) { border-right: 0; }
  .aa-flow-node:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 600px) {
  .aa-flow-node { border-right: 0 !important; }
  .aa-flow-node:nth-last-child(-n+1) { border-bottom: 0; }
  .aa-flow-node:not(:last-child) { border-bottom: 1px solid var(--site-line); }
}

.aa-flow-ring {
  position: relative; width: 76px; height: 76px;
  border: 1px solid rgba(79,200,255,0.3);
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(79,200,255,0.10), transparent 70%);
  display: grid; place-items: center;
  border-radius: 50%;
  transition: all 280ms;
}
.aa-flow-ring::before,
.aa-flow-ring::after {
  content: ""; position: absolute; inset: -4px;
  border: 1px dashed rgba(79,200,255,0.18);
  border-radius: 50%;
  pointer-events: none;
}
.aa-flow-ring::after { inset: -10px; border-color: rgba(79,200,255,0.10); }

.aa-flow-ico {
  width: 28px; height: 28px; color: var(--site-cyan);
  display: inline-flex;
}
.aa-flow-ico svg { width: 100%; height: 100%; }

.aa-flow-num {
  position: absolute; top: -8px; right: -10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  background: var(--site-bg); border: 1px solid var(--site-line-2);
  color: var(--site-cyan); padding: 3px 7px;
}

.aa-flow-h {
  font-family: var(--font-display);
  font-size: 19px; line-height: 1.15; letter-spacing: -0.012em;
  color: #fff; font-weight: 500; margin-top: 6px;
}
.aa-flow-p {
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.55;
  color: var(--site-text-3); letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

/* Right-edge connector arrow */
.aa-flow-node:not(:nth-child(4n))::after {
  content: ""; position: absolute;
  top: 28px + 76px / 2; right: -7px;
  width: 13px; height: 13px;
  background: var(--site-bg);
  border-top: 1px solid rgba(79,200,255,0.4);
  border-right: 1px solid rgba(79,200,255,0.4);
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}
@media (max-width: 1000px) {
  .aa-flow-node:not(:nth-child(2n))::after { content: ""; }
  .aa-flow-node:nth-child(2n)::after { content: none; }
  .aa-flow-node:nth-child(4n)::after  { content: ""; }
}
@media (max-width: 600px) {
  .aa-flow-node::after { content: none !important; }
}

/* Active step animation */
.aa-flow-node.on { background: rgba(79,200,255,0.06); }
.aa-flow-node.on .aa-flow-ring {
  border-color: rgba(79,200,255,0.7);
  box-shadow: 0 0 22px rgba(79,200,255,0.30), inset 0 0 16px rgba(79,200,255,0.10);
}
.aa-flow-node.on .aa-flow-ring::before { border-color: rgba(94,255,164,0.45); animation: aa-spin 8s linear infinite; }
.aa-flow-node.on .aa-flow-ico { color: #fff; }
.aa-flow-node.done .aa-flow-ring { border-color: rgba(94,255,164,0.5); }
.aa-flow-node.done .aa-flow-ico  { color: var(--site-mint); }
@keyframes aa-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .aa-flow-node.on .aa-flow-ring::before { animation: none; }
}

/* ==============================
   INTEGRATIONS — icon + brand chips
============================== */
.aa-intx-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) { .aa-intx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .aa-intx-grid { grid-template-columns: 1fr; } }

.aa-intx {
  position: relative;
  border: 1px solid var(--site-line);
  background: rgba(255,255,255,0.01);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 220ms;
}
.aa-intx:hover { border-color: rgba(79,200,255,0.45); background: rgba(79,200,255,0.04); }

.aa-intx-row { display: flex; align-items: center; gap: 14px; }
.aa-intx-ico {
  width: 40px; height: 40px; flex-shrink: 0;
  border: 1px solid rgba(79,200,255,0.3);
  background: rgba(79,200,255,0.06);
  color: var(--site-cyan);
  display: grid; place-items: center;
}
.aa-intx-ico svg { width: 20px; height: 20px; }

.aa-intx-h {
  font-family: var(--font-display);
  font-size: 17px; color: #fff; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.15;
}
.aa-intx-tag {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.18em;
  color: var(--site-text-3); margin-top: 3px;
}

.aa-intx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aa-intx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--site-line);
  background: rgba(255,255,255,0.01);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--site-text-2);
}
.aa-intx-chip .mono {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  font-size: 8.5px; letter-spacing: 0;
  color: var(--site-cyan);
  border: 1px solid rgba(79,200,255,0.4);
  background: rgba(79,200,255,0.08);
  font-weight: 600;
}

/* ==============================
   WHY — icon-led cards
============================== */
.aa-why-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--site-line);
}
@media (max-width: 1100px) { .aa-why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .aa-why-grid { grid-template-columns: 1fr; } }
.aa-why {
  padding: 24px 22px;
  border-right: 1px solid var(--site-line);
  border-bottom: 1px solid var(--site-line);
  position: relative;
  background: rgba(255,255,255,0.01);
  transition: all 240ms;
}
.aa-why:hover { background: rgba(79,200,255,0.04); }
.aa-why:nth-child(4n) { border-right: 0; }
.aa-why:nth-last-child(-n+4) { border-bottom: 0; }
@media (max-width: 1100px) {
  .aa-why:nth-child(4n) { border-right: 1px solid var(--site-line); }
  .aa-why:nth-child(2n) { border-right: 0; }
  .aa-why:nth-last-child(-n+4) { border-bottom: 1px solid var(--site-line); }
  .aa-why:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 600px) {
  .aa-why { border-right: 0 !important; }
  .aa-why:not(:last-child) { border-bottom: 1px solid var(--site-line); }
  .aa-why:last-child { border-bottom: 0; }
}
.aa-why-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.aa-why-tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  color: var(--site-mint);
}
.aa-why-ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid rgba(94,255,164,0.3);
  background: rgba(94,255,164,0.05);
  color: var(--site-mint);
}
.aa-why-ico svg { width: 20px; height: 20px; }
.aa-why-h {
  font-family: var(--font-display);
  font-size: 17px; line-height: 1.2; letter-spacing: -0.01em;
  color: #fff; font-weight: 500; margin: 0 0 8px;
}
.aa-why-p {
  font-size: 13px; line-height: 1.55; color: var(--site-text-2); margin: 0;
}

/* ==============================
   AGENT TYPES v3 — chip view + capacity meter
============================== */
.aa-tx-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
@media (max-width: 900px) { .aa-tx-grid { grid-template-columns: 1fr; } }

.aa-tx {
  border: 1px solid var(--site-line);
  background: linear-gradient(180deg, rgba(15,21,48,0.5), rgba(5,7,15,0.3));
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: all 240ms;
  position: relative;
  overflow: hidden;
}
.aa-tx::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, rgba(79,200,255,0.0), transparent);
  transition: background 240ms;
}
.aa-tx:hover {
  border-color: rgba(79,200,255,0.45);
  transform: translateY(-2px);
}
.aa-tx:hover::after { background: linear-gradient(90deg, transparent, rgba(79,200,255,0.6), transparent); }

.aa-tx-head {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--site-line);
}
.aa-tx-ico {
  width: 44px; height: 44px;
  border: 1px solid rgba(79,200,255,0.3);
  background: rgba(79,200,255,0.08);
  color: var(--site-cyan);
  display: grid; place-items: center;
}
.aa-tx-ico svg { width: 22px; height: 22px; }
.aa-tx-name {
  font-family: var(--font-display);
  font-size: 18px; color: #fff; font-weight: 500; letter-spacing: -0.01em;
}
.aa-tx-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--site-text-3); margin-top: 3px;
}
.aa-tx-st {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  padding: 4px 9px; border: 1px solid currentColor;
  color: var(--site-mint);
  display: inline-flex; align-items: center; gap: 6px;
}
.aa-tx-st .d {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 6px currentColor;
}

.aa-tx-skills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.aa-tx-skill {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.02em;
  padding: 5px 10px;
  border: 1px solid var(--site-line);
  background: rgba(255,255,255,0.015);
  color: var(--site-text-2);
  transition: all 180ms;
}
.aa-tx:hover .aa-tx-skill { border-color: var(--site-line-2); }
.aa-tx-skill:hover { color: #fff; border-color: rgba(79,200,255,0.4); }

.aa-tx-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--site-line);
}
.aa-tx-meter-l {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  color: var(--site-text-3);
}
.aa-tx-meter-bar {
  position: relative; height: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--site-line);
}
.aa-tx-meter-fill {
  position: absolute; inset: 0;
  width: var(--w, 70%);
  background: linear-gradient(90deg, var(--site-cyan), var(--site-mint));
  box-shadow: 0 0 8px rgba(94,255,164,0.4);
}
.aa-tx-meter-bar::after {
  content: ""; position: absolute;
  top: -3px; bottom: -3px;
  left: var(--w, 70%);
  width: 1px;
  background: rgba(94,255,164,0.6);
  box-shadow: 0 0 6px rgba(94,255,164,0.6);
}
.aa-tx-meter-v {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--site-mint); letter-spacing: 0.04em;
}

/* ==============================
   INDUSTRIES — small visual scene
============================== */
.aa-ind-scene-card {
  border: 1px solid var(--site-line);
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(0,85,255,0.18), transparent 70%),
    linear-gradient(180deg, rgba(15,21,48,0.6), rgba(5,7,15,0.4));
  padding: 24px 28px 18px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.aa-ind-scene-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(79,200,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,200,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 80%);
}
.aa-ind-scene-row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
}
.aa-ind-scene-l {
  display: flex; align-items: center; gap: 18px;
}
.aa-ind-scene-ico {
  width: 64px; height: 64px;
  border: 1px solid rgba(79,200,255,0.4);
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(79,200,255,0.18), transparent 70%);
  color: var(--site-cyan);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.aa-ind-scene-ico::before,
.aa-ind-scene-ico::after {
  content: ""; position: absolute; inset: -6px;
  border: 1px dashed rgba(79,200,255,0.18);
  pointer-events: none;
}
.aa-ind-scene-ico::after { inset: -14px; border-color: rgba(79,200,255,0.10); }
.aa-ind-scene-ico { position: relative; }
.aa-ind-scene-ico svg { width: 30px; height: 30px; }

.aa-ind-scene-meta { display: flex; flex-direction: column; gap: 4px; }
.aa-ind-scene-eb {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  color: var(--site-cyan);
}
.aa-ind-scene-h {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 34px); line-height: 1.05; letter-spacing: -0.025em;
  color: #fff; font-weight: 400; margin: 0;
}

.aa-ind-scene-r { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.aa-ind-scene-stat {
  border: 1px solid var(--site-line-2);
  padding: 8px 14px;
  text-align: right;
}
.aa-ind-scene-stat .v {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: -0.01em; color: var(--site-mint);
}
.aa-ind-scene-stat .l {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  color: var(--site-text-3);
}

.aa-ind-scene-net {
  position: relative; z-index: 1;
  height: 70px; margin-top: 16px;
  border-top: 1px solid var(--site-line);
  padding-top: 12px;
}
.aa-ind-scene-net svg { width: 100%; height: 100%; display: block; }
