/* ─── pages/how-it-works.css ─ How It Works only. Shared components live in site.css. ── */

/* ── Data-flow chart + proof points ────────────────────────────────────────── */
.flowrow { display: flex; flex-direction: column; gap: 40px; margin: 48px 0; }
.chart-shell { position: relative; min-width: 0; width: 60%; margin: 0 auto; }

.ec-wrap { display: flex; align-items: stretch; width: 100%; }
.ec-node { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; background: var(--bg-base); }
.ec-source { flex-shrink: 0; align-self: center; padding: 10px 14px 14px; border: 1px solid var(--brand); }
.ec-mid { position: relative; flex: 1; min-width: 80px; }
.ec-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ec-svg-v { display: none; }
.ec-line { fill: none; stroke: var(--success); stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.ec-tag-area { position: absolute; inset: 0; pointer-events: none; }
.ec-tags { position: absolute; left: 55.5%; transform: translate(-50%,-50%); display: flex; gap: 4px; }
.ec-tags--top    { top: 23.97%; }
.ec-tags--bottom { top: 76.03%; }
.ec-tag {
  display: inline-flex; padding: 2px 4px; white-space: nowrap;
  background: rgb(0,0,0); border: 1px solid var(--success);
  font: 700 10px/1 var(--font-mono); color: var(--fg-primary);
}
.ec-dests { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; width: 172px; }
.ec-dest { flex: 1; min-height: 68px; border: 1px solid var(--success); }
.ec-nodelabel { font: 700 10px/1 var(--font-mono); color: var(--fg-muted); }
.ec-nodebody { display: flex; align-items: center; gap: 8px; flex: 1; }
.ec-nodetext { display: flex; flex-direction: column; gap: 3px; }
.ec-icon { width: 24px; height: 24px; flex-shrink: 0; }
.ec-icon-db {
  background: var(--brand);
  -webkit-mask: url('/assets/icons/database.svg') center/contain no-repeat;
  mask: url('/assets/icons/database.svg') center/contain no-repeat;
}
.ec-icon-robot {
  background: var(--success);
  -webkit-mask: url('/assets/icons/robot-sharp.svg') center/contain no-repeat;
  mask: url('/assets/icons/robot-sharp.svg') center/contain no-repeat;
}
.ec-pixel-icon { flex-shrink: 0; fill: var(--success); image-rendering: pixelated; }
.ec-wm { display: flex; align-items: center; gap: 2px; }
.ec-wm-text { font: 700 18px/1 var(--font-mono); color: var(--brand); }
.ec-wm-mark { margin-left: 2px; }
.ec-destname { font: 700 13px/1 var(--font-mono); letter-spacing: .6px; color: var(--fg-secondary); }
.ec-sub { font: 700 10px/1 var(--font-mono); color: var(--fg-secondary); }


@media (max-width:1040px) {
  .flowrow { gap: 28px; }
  .chart-shell { width: 100%; }
  .ec-wrap { flex-direction: column; gap: 6px; }
  .ec-mid { flex: none; width: 100%; height: 92px; min-width: 0; }
  .ec-dests { flex-direction: row; width: 100%; gap: 8px; }
  .ec-dest { flex: 1; min-height: 64px; }
  .ec-svg-h { display: none; }
  .ec-svg-v { display: block; }
  .ec-tags--top    { top: 75%; left: 25%; }
  .ec-tags--bottom { top: 75%; left: 75%; }
}

/* ── Use cases + most used skills ───────────────────────────────────────────── */
.api-row .uc-t { font-weight: 700; color: var(--fg-primary); }
.skills-h { margin-top: 64px; }
.cmd-list { display: flex; flex-direction: column; margin: 24px 0 0; padding: 0; list-style: none; border-top: 1px dashed var(--brand-line); }
.cmd {
  display: grid; grid-template-columns: minmax(0,320px) minmax(0,1fr) auto; gap: 24px; align-items: center;
  padding: 18px 4px; border-bottom: 1px dashed var(--brand-line);
  font: 400 14px/20px var(--font-mono); color: var(--fg-secondary);
}
.cmd code { font: 700 14px/1 var(--font-mono); color: var(--success); }
.cmd code em { font-style: normal; color: var(--brand); }
.cmd .go { font: 700 11px/1 var(--font-mono); letter-spacing: .8px; text-transform: uppercase; color: var(--fg-muted); }
.cmd:hover { background: rgba(244,128,93,.06); color: var(--fg-primary); }
.cmd:hover .go { color: var(--brand); }
.ctas--center { justify-content: center; }
@media (max-width:900px) {
  .cmd { grid-template-columns: 1fr; gap: 8px; }
  .cmd .go { display: none; }
}

/* ── Chart build (plays once when the chart enters view) ───────────────────────
   Matches the original sequence (ms after the chart is in view): thinking
   500-1750 · source 2125 · lines draw 2687-3812 · "100% verified" 3187 ·
   clay 3462 · emails 3662 · phones 3862 · ad IDs 4062 · claude.ai 4374.
   Opacity / clip-path only: text never changes and nothing shifts layout. */
.chart-think { position: absolute; inset: 0; justify-content: center; z-index: 2; opacity: 0; }
@keyframes line-draw-h { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes line-draw-v { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.js:not(.reveal-all) .chart-reveal [class*="ec-step-"] { opacity: 0; }
.js:not(.reveal-all) .chart-reveal .ec-svg-h { clip-path: inset(0 100% 0 0); }
.js:not(.reveal-all) .chart-reveal .ec-svg-v { clip-path: inset(0 0 100% 0); }

.js .chart-reveal.is-in .chart-think { animation: appear 1ms 500ms linear both, vanish 1ms 1750ms linear forwards; }
.js .chart-reveal.is-in [class*="ec-step-"] { animation: appear 1ms linear both; }
.js .chart-reveal.is-in .ec-step-src    { animation-delay: 2125ms; }
.js .chart-reveal.is-in .ec-step-tg     { animation-delay: 3187ms; }
.js .chart-reveal.is-in .ec-step-clay   { animation-delay: 3462ms; }
.js .chart-reveal.is-in .ec-step-t1     { animation-delay: 3662ms; }
.js .chart-reveal.is-in .ec-step-t2     { animation-delay: 3862ms; }
.js .chart-reveal.is-in .ec-step-t3     { animation-delay: 4062ms; }
.js .chart-reveal.is-in .ec-step-claude { animation-delay: 4374ms; }
.js .chart-reveal.is-in .ec-svg-h { animation: line-draw-h 1125ms 2687ms linear both; }
.js .chart-reveal.is-in .ec-svg-v { animation: line-draw-v 1125ms 2687ms linear both; }

@media (prefers-reduced-motion: reduce) {
  .js .chart-reveal [class*="ec-step-"], .js .chart-reveal .ec-svg { animation: none !important; opacity: 1 !important; clip-path: none !important; }
}
