/* Home-specific styling */

/* ─── Hero scene switching ─── */
.hero-visual { position: relative; min-height: 560px; min-width: 0; max-width: 100%; }
.hero-scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px);
  visibility: hidden; pointer-events: none;
  overflow: hidden;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
body[data-hero="swarm"]     .scene-swarm,
body[data-hero="dashboard"] .scene-dashboard,
body[data-hero="split"]     .scene-split {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
}
@media (max-width: 860px) {
  /* W1L.5c: keep the swarm graph on mobile, rendered as a compact 4-stage
     portrait variant (Strategy Input → EBA → 3 clusters → grouped chips).
     W1L.6c: scope min-height to the swarm scene so it wins over the ≤960px
     dashboard rule below (specificity raised via body[data-hero="swarm"]).
     Height matches the trimmed agent-graph design envelope (380px) so the
     graph fills the hero column without trailing dead space. */
  body[data-hero="swarm"] .hero-visual { min-height: 380px; }
  body[data-hero="swarm"] .scene-swarm { opacity: 1; visibility: visible; }
  /* Caption/legend is hidden on mobile so the graph occupies the full
     hero visual area — feel like a featured visual, not a thumbnail. */
  body[data-hero="swarm"] .agent-graph-caption { display: none; }
  /* Tablet portrait (≈540–860px): cap the graph wrap so the 360px design
     doesn't float in a much wider column with accidental dead space. The
     wrap is centered by its existing margin-inline:auto. */
  body[data-hero="swarm"] .agent-graph-wrap { max-width: 460px; }
}
@media (max-width: 540px) {
  /* Phone: let the graph wrap fill its column so fitTo() can scale up to
     the available width (target ≈85–95vw on a 390px viewport). */
  body[data-hero="swarm"] .agent-graph-wrap { max-width: 100%; }
}

/* ─── Capability graph mode containers ─── */
/* Desktop: original 760×660 design coords. */
#agent-graph.ag-mode-desktop {
  width: 760px;
  height: 660px;
}
/* Mobile: 360×380 portrait coords; same SVG engine, compact 4-stage layout.
   (W1L.6c: height trimmed from 760 to match the actual content envelope so
   the graph reads as a featured hero visual without trailing dead space.
   With 3 leaves under every cluster, the chain ends at y≈346 and 380 leaves
   a small breathing margin for the pulse-edge glow.) */
#agent-graph.ag-mode-mobile {
  width: 360px;
  height: 380px;
}
/* Mobile: tighten card title typography so manager labels
   (Acquisition / Performance) fit a 110px card without truncation. */
#agent-graph.ag-mode-mobile .ag-card-title {
  font-size: 9.5px;
  letter-spacing: 0.04em;
}
#agent-graph.ag-mode-mobile .ag-card-sub {
  font-size: 8px;
  letter-spacing: 0.08em;
}
#agent-graph.ag-mode-mobile .ag-card-row { gap: 6px; }
#agent-graph.ag-mode-mobile .ag-card { padding: 6px 8px; }

/* Swarm legend */
.swarm-legend {
  position: absolute;
  bottom: 0; left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  display: flex; flex-direction: column; gap: 6px;
}
.legend-row { display: flex; align-items: center; gap: 8px; }
.lg-dot, .lg-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-teal); }
.lg-pulse { animation: pulse 1.4s ease-in-out infinite; }

/* Mini nexus */
.mini-nexus { width: 100%; max-width: 560px; margin-left: auto; }
.mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--nx-line);
  margin-bottom: 14px;
}
.mini-stat { display: flex; flex-direction: column; gap: 4px; }
.mini-stat .k {
  font-size: 9px; letter-spacing: 0.14em;
  color: var(--nx-ink-dim);
}
.mini-stat .v {
  font-size: 22px; color: var(--nx-cyan);
  letter-spacing: -0.01em;
  font-weight: 500;
}

.nx-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 64px; padding: 12px 0;
  border-bottom: 1px solid var(--nx-line);
  margin-bottom: 12px;
}
.nx-bar {
  flex: 1; background: var(--nx-cyan);
  opacity: 0.7;
  transition: height .3s linear;
  min-height: 10%;
}

.nx-feed-head {
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--nx-cyan-dim);
  margin-bottom: 8px;
}
.nx-feed { display: flex; flex-direction: column; gap: 4px; }
.nx-row {
  display: grid;
  grid-template-columns: 56px 90px 1fr 110px 14px;
  gap: 8px;
  font-size: 10px;
  padding: 6px 8px;
  background: var(--nx-bg-2);
  border-left: 2px solid var(--nx-cyan);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .35s, transform .35s;
  white-space: nowrap; overflow: hidden;
}
.nx-row.nx-in { opacity: 1; transform: none; }
.nx-t { color: var(--nx-ink-dim); }
.nx-who { color: var(--nx-cyan); }
.nx-act { color: var(--nx-ink); }
.nx-target { color: var(--nx-ink-dim); text-align: right; overflow:hidden; text-overflow:ellipsis; }
.nx-status { color: var(--nx-green); font-size: 12px; line-height: 1; }
.nx-status.nx-warn { color: var(--nx-amber); }
.nx-status.nx-new { color: var(--brand-teal); }

/* Mini split */
.mini-split {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  max-width: 560px; margin-left: auto;
  background: var(--bg-card);
  box-shadow: var(--shadow-2);
}
.mini-split-old { background: var(--bg-sub); padding: 32px; color: var(--ink-3); }
.mini-split-new { background: var(--ink); padding: 32px; color: var(--bg); position: relative; overflow: hidden; }
.mini-split-new::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(45,230,242,0.15), transparent 60%);
}
.msp-lbl {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 20px;
}
.mini-split-old .msp-lbl { color: var(--ink-4); }
.mini-split-new .msp-lbl { color: var(--brand-teal); position: relative; }
.msp-big {
  font-family: var(--font-display);
  font-size: 28px; line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.mini-split-old .msp-big { color: var(--ink-2); }
.mini-split-new .msp-big { color: #fff; position: relative; }
.msp-row {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 0;
  border-top: 1px solid;
  position: relative;
}
.mini-split-old .msp-row { border-color: var(--line); color: var(--ink-3); }
.mini-split-new .msp-row { border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }

/* (Pin-scroll legacy removed — process section is now a responsive grid) */

/* Scene dashboard mini adjustments for small screens */
@media (max-width: 960px) {
  .hero-visual { min-height: 420px; }
  .mini-nexus, .mini-split { margin: 0 auto; }
}

/* ─── Solution flow row (Ingest → Train → Deploy → Improve) ─── */
.flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flow-step {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.flow-step .fs-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--brand-teal);
}
.flow-step .fs-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.flow-step .fs-d {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  text-wrap: pretty;
}
.flow-arr {
  width: 28px;
  height: 12px;
  align-self: center;
  color: var(--brand-teal);
  flex-shrink: 0;
  margin: 0 4px;
}

@media (max-width: 860px) {
  .flow-row {
    grid-template-columns: 1fr;
    border-top: none;
    border-bottom: none;
  }
  .flow-step {
    padding: 24px 0;
    border-top: 1px solid var(--line);
  }
  .flow-step:last-child { border-bottom: 1px solid var(--line); }
  .flow-arr {
    width: 12px;
    height: 24px;
    transform: rotate(90deg);
    margin: 0 auto;
  }
}
