/* Black Diamond motion kit v3 — scene styles (HTML + GSAP scenes, phone-first).
   Needs the page theme tokens: --bg --surface --sunk --ink --ink-2 --muted --line --line-2 --mark --mark-ink --live --hub --hub-ink, pastels --p-* and --p-ink, --shadow, --font. */
/* ---------- shared scene shell ---------- */
.s3 { position: relative; width: 100%; border-radius: 16px; overflow: hidden; color: var(--ink); background: var(--sunk);
  padding: 4.5%; display: flex; flex-direction: column; gap: 10px; font-size: clamp(14px, 3.8vw, 15px); isolation: isolate; }
.s3::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--glow) 45%, transparent), transparent 60%); }
.s3 .s3-win { flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.s3 .win-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.s3 .ico { width: 22px; height: 22px; border-radius: 6px; background: #fff; padding: 3px; border: 1px solid var(--line); flex: none; display: block; }
.s3 .pill { margin-left: auto; font-size: max(12px, .78em); font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.s3 .pill.s3-on { background: var(--p-green); color: var(--p-ink); }
.s3 .k { font-size: max(12px, .74em); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.s3 .s3-num { font-variant-numeric: tabular-nums; }
.s3 .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.s3 .eq i { width: 2px; background: currentColor; border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.s3 .eq i:nth-child(2) { animation-delay: .15s; } .s3 .eq i:nth-child(3) { animation-delay: .3s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }
.s3 .s3-toast { position: absolute; left: 50%; bottom: 4.5%; translate: -50% 0; z-index: 7; display: flex; align-items: center; gap: 8px; background: var(--hub); color: var(--hub-ink);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px 8px 8px; font-weight: 700; font-size: max(12px, .88em); box-shadow: var(--shadow); opacity: 0; white-space: nowrap; }
.s3 .s3-ok { width: 22px; height: 22px; border-radius: 50%; background: var(--p-green); display: grid; place-items: center; flex: none; }
.s3 .s3-ok svg { width: 12px; height: 12px; }

/* ---------- 1. agent ---------- */
.agent3 { --glow: var(--p-purple); }
.agent3 .mail { display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.agent3 .mail:last-child { border-bottom: 0; }
.agent3 .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: max(12px, .8em); color: var(--p-ink); grid-row: span 2; }
.agent3 .mail b { font-weight: 700; font-size: max(12px, .95em); }
.agent3 .mail .s3-t { font-size: max(12px, .78em); color: var(--muted); }
.agent3 .mail .sn { grid-column: 2 / 4; font-size: max(12px, .85em); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent3 .mail.sel { background: color-mix(in srgb, var(--p-purple) 18%, var(--surface)); }
.agent3 .s3-body { position: relative; padding: 0 12px; height: 0; overflow: hidden; font-size: max(12px, .98em); line-height: 1.5; }
.agent3 .s3-body p { margin: 0 0 8px; }
.agent3 .hl { position: relative; white-space: nowrap; }
.agent3 .hl::before { content: ""; position: absolute; inset: 55% -2px 0; border-radius: 3px; background: var(--k); z-index: -1; transform: scaleX(var(--s, 0)); transform-origin: left; }
.agent3 .beam { position: absolute; left: 0; right: 0; height: 26px; top: -30px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--p-purple) 55%, transparent) 70%, var(--p-purple) 96%, transparent);
  mix-blend-mode: multiply; opacity: 0; }
:root[data-theme="dark"] .agent3 .beam { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .agent3 .beam { mix-blend-mode: screen; } }
.dark .agent3 .beam { mix-blend-mode: screen; }
.agent3 .beam::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 1.5px; background: var(--p-purple); box-shadow: 0 0 10px 2px var(--p-purple); }
.agent3 .lead { padding: 9px 12px 11px; display: grid; gap: 7px; }
.agent3 .lead-h { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.agent3 .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.agent3 .f { border: 1px dashed var(--line-2); border-radius: 10px; padding: 5px 9px; }
.agent3 .f span { display: block; }
.agent3 .f b { display: inline-block; font-weight: 700; font-size: max(12px, .92em); opacity: 0; }
.agent3 .f.filled { border-style: solid; border-color: var(--line); background: color-mix(in srgb, var(--k) 22%, var(--surface)); }
.agent3 .s3-chip { position: absolute; z-index: 6; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: max(12px, .85em); color: var(--p-ink); background: var(--k); box-shadow: 0 6px 16px -6px rgb(0 0 0 / .35); white-space: nowrap; pointer-events: none; }
.agent3 .reply { padding: 10px 12px; display: grid; gap: 8px; }
.agent3 .reply .txt { min-height: 2.8em; font-size: max(12px, .95em); color: var(--ink-2); }
.agent3 .caret { display: inline-block; width: 2px; height: 1.05em; background: var(--ink); vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.agent3 .bar { display: flex; align-items: center; gap: 8px; }
.agent3 .bar .lbl { font-size: max(12px, .8em); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.agent3 .bar .lbl .ico { width: 18px; height: 18px; }
.agent3 .send { margin-left: auto; background: var(--mark); color: var(--mark-ink); font-weight: 800; font-size: max(12px, .85em); border-radius: 999px; padding: 6px 14px; }

/* ---------- 2. flow ---------- */
.flow3 { --glow: var(--p-orange); }
.flow3 .canvas { padding: 12px; display: grid; gap: 0; }
.flow3 .node { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--surface); position: relative; overflow: hidden; }
.flow3 .node .tx { min-width: 0; flex: 1; }
.flow3 .node b { display: block; font-weight: 700; font-size: max(12px, .95em); line-height: 1.25; }
.flow3 .node small { display: block; color: var(--muted); font-size: max(12px, .8em); }
.flow3 .node .s3-ok { opacity: 0; transform: scale(.4); }
.flow3 .node .prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--p-orange); }
.flow3 .node.trigger { border-color: color-mix(in srgb, var(--p-orange) 60%, var(--line)); }
.flow3 .wire { position: relative; height: 18px; margin-left: 22px; width: 2px; background: var(--line-2); }
.flow3 .wire i { position: absolute; left: -3px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 40%, transparent); opacity: 0; }
.flow3 .router { display: flex; align-items: center; gap: 8px; margin-left: 13px; font-size: max(12px, .82em); font-weight: 700; color: var(--muted); }
.flow3 .router .dia { width: 20px; height: 20px; transform: rotate(45deg); border-radius: 5px; background: var(--hub); border: 1px solid var(--line-2); display: grid; place-items: center; }
.flow3 .router .dia img { width: 12px; height: 12px; transform: rotate(-45deg); }
.flow3 .acts { display: grid; gap: 7px; margin-top: 2px; }
.flow3 .stats { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.flow3 .stats .big { font: 900 1.55em/1 var(--font); letter-spacing: -.03em; }

/* ---------- 3. board ---------- */
.board3 { --glow: var(--p-teal); }
.board3 .tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); position: relative; }
.board3 .tab { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; font-weight: 700; font-size: max(12px, .82em); color: var(--muted); position: relative; z-index: 1; }
.board3 .tab .ico { width: 18px; height: 18px; padding: 2px; }
.board3 .tab.s3-on { color: var(--ink); }
.board3 .tabbg { position: absolute; top: 8px; height: calc(100% - 16px); border-radius: 8px; background: var(--sunk); border: 1px solid var(--line); z-index: 0; }
.board3 .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; position: relative; }
.board3 .col { background: var(--sunk); border-radius: 10px; padding: 7px; min-height: 13.5em; display: flex; flex-direction: column; gap: 6px; }
.board3 .col-h { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; font-size: max(12px, .82em); }
.board3 .col-h .s3-num { color: var(--muted); font-weight: 600; }
.board3 .s3-card { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px 7px; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.board3 .s3-card b { display: block; font-weight: 700; font-size: max(12px, .82em); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board3 .s3-card span { display: flex; justify-content: space-between; align-items: center; font-size: max(12px, .76em); color: var(--muted); margin-top: 3px; }
.board3 .s3-card span i { width: 14px; height: 6px; border-radius: 3px; background: var(--k, var(--p-gray)); display: block; }
.board3 .s3-card.mover { position: absolute; z-index: 5; }
.board3 .auto { position: absolute; z-index: 6; font-size: max(12px, .74em); font-weight: 700; color: var(--p-ink); background: var(--p-teal); border-radius: 999px; padding: 2px 8px; white-space: nowrap; opacity: 0; box-shadow: var(--shadow); }
.board3 .sum { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 10px; }
.board3 .sum .big { font: 900 1.45em/1 var(--font); letter-spacing: -.03em; }

/* ---------- 4. build ---------- */
.build3 { --glow: var(--p-blue); }
.build3 .bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.build3 .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.build3 .bar .url { margin-left: 8px; flex: 1; text-align: center; font-size: max(12px, .78em); color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 3px 8px; }
.build3 .app { position: relative; display: grid; grid-template-columns: 30% 1fr; min-height: 22em; }
.build3 .side { background: var(--hub); color: var(--hub-ink); padding: 10px 8px; display: grid; gap: 4px; align-content: start; font-size: max(12px, .82em); font-weight: 600; }
.build3 .side span { padding: 5px 8px; border-radius: 7px; opacity: .75; }
.build3 .side span.s3-on { background: var(--mark); color: var(--mark-ink); opacity: 1; font-weight: 800; }
.build3 .main { padding: 10px; display: grid; gap: 8px; align-content: start; }
.build3 .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.build3 .s3-kpi { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; }
.build3 .s3-kpi b { display: block; font: 900 1.35em/1.1 var(--font); letter-spacing: -.03em; }
.build3 .chart { border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; }
.build3 .s3-bars { display: flex; align-items: flex-end; gap: 5px; height: 4.6em; margin-top: 4px; }
.build3 .s3-bars i { flex: 1; border-radius: 3px 3px 0 0; background: var(--ink); opacity: .2; height: 10%; }
.build3 .s3-bars i.s3-on { opacity: 1; } .build3 .s3-bars i.s3-hi { opacity: 1; background: var(--mark); box-shadow: inset 0 0 0 1.5px var(--ink); }
.build3 .rows { display: grid; gap: 4px; }
.build3 .r { display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: max(12px, .82em); }
.build3 .r b { font-weight: 700; } .build3 .r span { color: var(--muted); }
.build3 .r.new { background: color-mix(in srgb, var(--p-blue) 30%, var(--surface)); border-color: color-mix(in srgb, var(--p-blue) 60%, var(--line)); }
.build3 .wire { position: absolute; inset: 0; display: grid; grid-template-columns: 30% 1fr; pointer-events: none; z-index: 3; background: var(--surface); }
.build3 .wire .ws { border-right: 1.5px dashed var(--line-2); }
.build3 .wire .wm { padding: 10px; display: grid; gap: 8px; align-content: start; }
.build3 .wire .wm div { border: 1.5px dashed var(--line-2); border-radius: 9px; }
.build3 .scanx { position: absolute; top: 0; bottom: 0; width: 3px; left: 0; z-index: 4; background: var(--p-blue); box-shadow: 0 0 14px 4px color-mix(in srgb, var(--p-blue) 70%, transparent); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .s3 .caret, .s3 .eq i { animation: none; } }

/* scene heights fit each scene's end state (no fixed aspect ratio, so text never clips) */
.agent3 { height: 35em; } .flow3 { height: 32em; } .board3 { height: 24em; } .build3 { height: 27em; }
