/* Agent pipeline visuals: About page (from the design canvas), customer project log, staff review.
   Uses the site tokens only, so light and dark both work. */

.ai-hero { position: relative; overflow: hidden; background-color: var(--surface); color: var(--on-surface); border-bottom: 1px solid var(--outline-variant); }
.ai-hero::after { content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%; background: linear-gradient(transparent, oklch(0.74 0.14 222 / 0.07), transparent); animation: ai-scan 7s linear infinite; pointer-events: none; }
@keyframes ai-scan { to { transform: translateY(440%); } }

/* Orchestrator diagram */
.ai-net { position: relative; width: 100%; max-width: 560px; aspect-ratio: 520 / 440; margin-inline: auto; }
.ai-net svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ai-line { stroke: var(--outline); stroke-width: 1; fill: none; opacity: .55; }
.ai-flow { stroke: var(--primary); stroke-width: 1.5; fill: none; stroke-dasharray: 6 14; animation: ai-dash 1.6s linear infinite; }
@keyframes ai-dash { to { stroke-dashoffset: -40; } }
.ai-ring { stroke: var(--primary); fill: none; opacity: .35; transform-origin: 260px 220px; animation: ai-spin 30s linear infinite; }
.ai-ring--rev { animation-direction: reverse; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-node { position: absolute; width: 25.4%; height: 11.8%; display: grid; align-content: center; gap: 1px; padding: 0 10px; background: var(--surface-container); border: 1px solid var(--outline); border-radius: var(--corner-small); font-family: var(--font-mono); box-shadow: var(--elevation-3); }
.ai-node b { font-weight: 500; font-size: 12px; color: var(--on-surface); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-node span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-surface-variant); display: flex; align-items: center; gap: 6px; }
.ai-node--off { border-style: dashed; box-shadow: none; }
.ai-core { left: 35%; top: 42%; width: 30%; height: 16%; border-color: var(--primary); background: var(--primary-container); }
.ai-core b, .ai-core span { color: var(--on-primary-container); }
.ai-core b { font-size: 13px; }
.ai-n1 { left: 37.3%; top: 6.6%; } .ai-n2 { left: 68.9%; top: 25.3%; } .ai-n3 { left: 68.9%; top: 62.8%; }
.ai-n4 { left: 37.3%; top: 81.6%; } .ai-n5 { left: 5.7%; top: 62.8%; } .ai-n6 { left: 5.7%; top: 25.3%; }

/* Live dot + status chip */
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--product-roomful); flex: none; animation: ai-pulse 2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .35; } }
.ai-state { display: inline-flex; align-items: center; gap: 6px; }

/* Status strip */
.ai-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--outline-variant); background: var(--surface); }
.ai-status > div { padding: var(--space-4); display: grid; gap: 4px; border-right: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.ai-status .n { font: 500 28px/1 var(--font-mono); letter-spacing: -.02em; color: var(--on-surface); }

/* Agent cards */
.ai-agent { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-5); background: var(--surface); border: 1px solid var(--outline-variant); }
.ai-agent:hover { border-color: var(--primary); box-shadow: var(--elevation-2); }
.ai-agent header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.ai-agent h3 { margin: 0; font: 600 20px/1.3 var(--font-display); }
.ai-agent p { margin: 0; color: var(--on-surface-variant); font-size: 15px; }
.ai-io { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--space-3); margin: 0; font: 400 12.5px/1.5 var(--font-mono); padding-top: var(--space-3); border-top: 1px dashed var(--outline-variant); }
.ai-io dt { color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; padding-top: 1px; }
.ai-io dd { margin: 0; color: var(--on-surface); }

/* Seven-stage pipeline (About page and project log) */
.ai-pipe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border: 1px solid var(--outline-variant); background: var(--surface); }
.ai-pipe > li { padding: var(--space-4); display: grid; gap: 6px; align-content: start; border-right: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.ai-pipe b { font: 600 16px/1.3 var(--font-display); }
.ai-pipe small { font-size: 13px; color: var(--on-surface-variant); line-height: 1.45; }
.ai-pipe > li.is-done .sp-label { color: var(--primary); }
.ai-pipe > li[aria-current="step"] { background: var(--primary-container); color: var(--on-primary-container); }
.ai-pipe > li[aria-current="step"] small, .ai-pipe > li[aria-current="step"] .sp-label { color: var(--on-primary-container); }
.ai-bar { height: 3px; background: var(--outline-variant); position: relative; overflow: hidden; }
.ai-bar i { position: absolute; top: 0; bottom: 0; width: 22%; background: var(--primary); animation: ai-run 3.2s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes ai-run { from { left: -22%; } to { left: 100%; } }

/* Terminal-style project log */
.ai-term { background: var(--surface); color: var(--on-surface); border: 1px solid var(--outline); border-radius: var(--corner-small); overflow: hidden; box-shadow: var(--elevation-4); }
.ai-term__bar { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--space-3); min-height: 32px; border-bottom: 1px solid var(--outline-variant); background: var(--surface-container); }
.ai-term pre { margin: 0; padding: var(--space-4); font: 400 13px/1.8 var(--font-mono); color: var(--on-surface-variant); white-space: pre-wrap; overflow-x: auto; }
.ai-term pre b, .ai-log b { font-weight: 500; color: var(--primary); }
.ai-term pre em { font-style: normal; color: var(--product-roomful); }
.ai-cursor { display: inline-block; width: 8px; height: 15px; background: var(--primary); vertical-align: -2px; animation: ai-blink 1s steps(1) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }
.ai-log { list-style: none; margin: 0; padding: var(--space-4); display: grid; gap: var(--space-2); font: 400 13px/1.6 var(--font-mono); color: var(--on-surface-variant); }
.ai-log li { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-3); }
.ai-log time { color: var(--on-surface-variant); opacity: .8; }
.ai-log .is-internal { color: var(--on-surface-variant); font-style: italic; }

@media (min-width: 840px) {
  .ai-status { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ai-pipe { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ai-log li { grid-template-columns: 13ch 12ch minmax(0, 1fr); }
  .ai-log time { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-hero::after, .ai-flow, .ai-ring, .ai-dot, .ai-bar i, .ai-cursor { animation: none; }
}
