/* ========================================
   /agents page styles
   Uses site tokens from style.css.
   ======================================== */

.agents-philosophy {
    max-width: 820px;
    margin: 0 auto 5rem;
    padding: 2.5rem 2.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
}
.agents-philosophy h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1rem;
}
.agents-philosophy p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}
.agents-philosophy p:last-child { margin-bottom: 0; }
.agents-philosophy strong { color: var(--text-heading); font-weight: 600; }

.section-heading {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.015em;
    margin-bottom: 0.5rem;
}
.section-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

/* ========================================
   8-step guide
   ======================================== */
.agents-guide { margin-bottom: 5rem; }

.guide-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 1.5rem 1.35rem;
    transition: border-color 0.25s, transform 0.25s;
}
.guide-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.guide-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}
.guide-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}
.guide-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}
.guide-card li {
    padding: 0.2rem 0 0.2rem 0.85rem;
    position: relative;
}
.guide-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.7;
}

@media (max-width: 960px) {
    .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .guide-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Demo sections
   ======================================== */
.agents-demo { margin-bottom: 5rem; }

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.demo-controls .btn { white-space: nowrap; }

.demo-stage {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.75rem;
}

.demo-flow-wrap {
    overflow-x: auto;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}
svg.demo-flow {
    display: block;
    width: 100%;
    height: auto;
}
#imageFlow { min-width: 1050px; }
#leadFlow  { min-width: 800px;  }

/* Node styles (SVG) */
.node-rect {
    fill: var(--bg-tertiary);
    stroke: var(--border-primary);
    stroke-width: 1.5;
    transition: fill 250ms, stroke 250ms, filter 250ms;
}
.node.active .node-rect {
    fill: #1e2a48;
    stroke: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow-strong));
}
.node.thinking .node-rect {
    stroke: #f59e0b;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.55));
}
.node.dim .node-rect,
.node.dim .diamond { opacity: 0.32; }

.node-icon { font-size: 15px; text-anchor: middle; dominant-baseline: central; fill: var(--text-primary); }
.node-label { fill: var(--text-heading); font-size: 11px; text-anchor: middle; font-weight: 500; }
.node-sub   { fill: var(--text-tertiary); font-size: 9px;  text-anchor: middle; }

.diamond {
    fill: var(--bg-tertiary);
    stroke: var(--border-primary);
    stroke-width: 1.5;
    transition: fill 250ms, stroke 250ms, filter 250ms;
}
.node.active .diamond {
    fill: #1e2a48;
    stroke: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow-strong));
}

.edge { fill: none; stroke: var(--border-primary); stroke-width: 1.5; transition: stroke 250ms, opacity 250ms; }
.edge.dim { opacity: 0.25; }
.edge.traveled { stroke: var(--accent-primary); }

.pulse { fill: #7cf2c7; filter: drop-shadow(0 0 6px rgba(124, 242, 199, 0.9)); }

.branch-label { fill: var(--text-tertiary); font-size: 10px; text-anchor: middle; font-style: italic; }

/* Inbound email panel (lead demo) */
.demo-inbound {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
}
.inbound-tag {
    background: #0078d4;
    color: #fff;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    margin-top: 2px;
}
.inbound-body { flex: 1; min-width: 0; }
.inbound-meta {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}
.inbound-meta strong { color: var(--text-primary); font-weight: 600; }
.inbound-text {
    color: var(--text-primary);
    line-height: 1.55;
}

/* Results */
.demo-results {
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 400ms, transform 400ms;
}
.demo-results.show { opacity: 1; transform: translateY(0); }
.demo-results-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
}
.demo-results-hdr .query { color: var(--text-primary); font-weight: 600; }
.demo-results-hdr .verdict { color: #7cf2c7; font-weight: 600; }
.demo-results-hdr .verdict.spam { color: #f87171; }

.demo-grid { display: grid; gap: 0.85rem; }
.image-grid { grid-template-columns: repeat(5, 1fr); }
.lead-grid  { grid-template-columns: repeat(3, 1fr); }
.lead-grid.spam-layout { grid-template-columns: 1fr; max-width: 520px; }

.image-card {
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: border-color 300ms, transform 300ms;
}
.image-card img { width: 100%; height: 125px; object-fit: cover; display: block; background: var(--bg-tertiary); }
.image-card.winner { border-color: #7cf2c7; transform: translateY(-3px); }
.image-card.winner::after {
    content: '★ chosen';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #7cf2c7;
    color: #062018;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
}
.image-card .card-src {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}
.image-card.winner .card-src { color: var(--text-primary); }

.lead-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
}
.lead-card .card-hdr {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-heading);
}
.lead-card .dot { width: 7px; height: 7px; border-radius: 50%; background: #7cf2c7; flex-shrink: 0; }
.lead-card .card-body {
    padding: 0.75rem 0.9rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.lead-card .card-body strong { color: var(--text-primary); font-weight: 600; }
.lead-card .card-body em { color: var(--text-primary); font-style: normal; font-weight: 500; }
.lead-card .card-body a { color: var(--accent-link); }

.mini-tbl { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.mini-tbl th { text-align: left; padding: 3px 5px; color: var(--text-tertiary); font-weight: 500; border-bottom: 1px solid var(--border-primary); }
.mini-tbl td { padding: 3px 5px; color: var(--text-primary); }
.mini-tbl tr.new td { background: rgba(124, 242, 199, 0.08); }

@media (max-width: 860px) {
    .image-grid { grid-template-columns: repeat(2, 1fr); }
    .lead-grid  { grid-template-columns: 1fr; }
    .demo-header { flex-direction: column; align-items: flex-start; }
}
