{['100K+ Members','4.9★ Rating','28 Days Avg. Result'].map(function(s,i){
return
{s}
;
})}
)}
{lpStep >= 7 && (
{[
{name:'Sarah M.',q:'Lost 12kg in 28 days. Unbelievable.'},
{name:'James T.',q:'Best investment I ever made.'},
{name:'Priya K.',q:'My coach never sleeps.'},
{name:'Marco R.',q:'Down 3 sizes in 30 days.'},
{name:'Lisa W.',q:'Finally a program that works.'},
{name:'Sarah M.',q:'Lost 12kg in 28 days. Unbelievable.'},
{name:'James T.',q:'Best investment I ever made.'},
{name:'Priya K.',q:'My coach never sleeps.'},
{name:'Marco R.',q:'Down 3 sizes in 30 days.'},
{name:'Lisa W.',q:'Finally a program that works.'},
].map(function(t,i){
return (
{(function(){
var SCRIPT_SECTIONS = [
{ label:'[HOOK]', showAt:1, lines:[
[{t:'POV: everyone keeps asking where I got these rings 💍',b:false}]
]},
{ label:'[PROBLEM → SOLUTION]', showAt:2, lines:[
[{t:"So I'm finally telling you my secret...",b:false}],
[{t:'I found ',b:false},{t:'YOUR BRAND',b:true},{t:' a few months ago and honestly?',b:false}]
]},
{ label:'[PRODUCT]', showAt:4, lines:[
[{t:'The quality is insane for the price.',b:false}],
[{t:'Every piece feels so premium and they never tarnish.',b:false}]
]},
{ label:'[CTA]', showAt:6, lines:[
[{t:'Code SARAH = 30% off',b:true},{t:' your first order ✨',b:false}]
]}
];
return (
{/* Left: Phone */}
REC
{[{t:'POV: everyone keeps asking where I got these rings 💍',b:false},{t:"So I'm finally telling you my secret...",b:false},{t:'I found ',b:false},{t:'YOUR BRAND',b:true},{t:' a few months ago and honestly?',b:false},{t:'The quality is insane for the price.',b:false},{t:'Every piece feels so premium and they never tarnish.',b:false},{t:'I literally wear them every single day now.',b:false},{t:'Code SARAH = 30% off',b:true},{t:' your first order ✨',b:false},{t:"Trust me, you're gonna want to grab these. Link in bio 🛍️",b:false}].slice(0,Math.max(0,ugcLineIdx)).map(function(p,i){
return
);
}
// ── JARVIS agent constellation (Three.js, ES module via dynamic import) ──
var __dynImport = new Function('u', 'return import(u)');
var THREE_MODULE_URL = 'https://unpkg.com/three@0.160.0/build/three.module.js';
function RealisticAtom(){
var hostRef = React.useRef(null);
React.useEffect(function(){
var host = hostRef.current; if(!host) return;
var raf=null, renderer=null, ro=null, disposed=false, onActiveL=null, onInactiveL=null;
async function loadDeps(){
var THREE = await __dynImport(THREE_MODULE_URL);
var res = await fetch('https://unpkg.com/three@0.160.0/examples/jsm/environments/RoomEnvironment.js');
var txt = (await res.text()).replace(/from\s*['"]three['"]/g, "from '"+THREE_MODULE_URL+"'");
var url = URL.createObjectURL(new Blob([txt],{type:'text/javascript'}));
var Room = await __dynImport(url);
return { THREE: THREE, RoomEnvironment: Room.RoomEnvironment };
}
loadDeps().then(function(mod){
var THREE = mod.THREE, RoomEnvironment = mod.RoomEnvironment;
if(disposed || !hostRef.current) return;
var W = host.clientWidth||320, H = host.clientHeight||320;
renderer = new THREE.WebGLRenderer({ antialias:true, alpha:true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio||1, 2));
renderer.setSize(W, H);
renderer.setClearAlpha(0); // transparent — blends seamlessly into the card (no grey box)
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.18;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.domElement.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100%;display:block';
host.appendChild(renderer.domElement);
var scene = new THREE.Scene(); // no scene.background — fully transparent canvas
// Studio reflections from RoomEnvironment
var pmrem = new THREE.PMREMGenerator(renderer);
scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
var camera = new THREE.PerspectiveCamera(38, W/H, 0.5, 4000);
camera.position.set(0, 6, 400);
camera.lookAt(0,0,0);
// Canvas now spans BOTH panels. Keep the orb fixed over the RIGHT panel by panning the camera
// so world-origin renders at 75% of the full-width canvas (= centre of the right half).
// Aspect-independent: as the canvas widens, the pan scales with it, so the orb never moves or resizes.
var ORB_FRAC = 0.75;
var _halfW=0,_halfH=0,_camX=0; // live camera frustum half-extents at z=0 (for reach targeting)
function applyPan(){
var halfH = Math.tan(THREE.MathUtils.degToRad(camera.fov/2)) * camera.position.z;
var halfW = halfH * camera.aspect;
var camX = -((ORB_FRAC-0.5)*2) * halfW;
camera.position.x = camX;
camera.lookAt(camX, 0, 0);
_halfW=halfW; _halfH=halfH; _camX=camX;
}
applyPan();
// Lighting: RoomEnvironment reflections + hemisphere ambient + key/fill
scene.add(new THREE.HemisphereLight(0xffffff, 0x555555, 0.65));
var key = new THREE.DirectionalLight(0xffffff, 1.7);
key.position.set(4,7,5).multiplyScalar(40); key.castShadow = true;
key.shadow.mapSize.set(2048,2048); key.shadow.radius = 12; key.shadow.bias = -0.0004;
var scam = key.shadow.camera; scam.near=1; scam.far=1200; scam.left=-260; scam.right=260; scam.top=260; scam.bottom=-260;
scene.add(key);
var fill = new THREE.DirectionalLight(0xffffff, 0.4); fill.position.set(-5,2,-4).multiplyScalar(40); scene.add(fill);
// ── Matte stone bumpMap: fine grain + scattered micro-craters ──
function stoneBump(){
var S=1024, c=document.createElement('canvas'); c.width=c.height=S; var x=c.getContext('2d');
var img=x.createImageData(S,S), d=img.data;
for(var i=0;i0.5; x.fillStyle=dark?'rgba(10,10,10,0.85)':'rgba(245,245,245,0.7)'; x.beginPath(); x.arc(Math.random()*S,Math.random()*S,r,0,Math.PI*2); x.fill(); }
var t=new THREE.CanvasTexture(c); t.wrapS=t.wrapT=THREE.RepeatWrapping; t.repeat.set(6,6); return t;
}
// ── Materials ──
var stone = new THREE.MeshStandardMaterial({ color:0x3e3e42, roughness:1.0, metalness:0.05, envMapIntensity:0.55, bumpMap:stoneBump(), bumpScale:1.05 });
var glass = new THREE.MeshPhysicalMaterial({ color:0xffffff, transmission:0.96, roughness:0.0, ior:1.45, thickness:0.4, metalness:0.0, transparent:true, clearcoat:1.0, clearcoatRoughness:0.04, envMapIntensity:1.4, emissive:0x111111, emissiveIntensity:0.5 });
// Soft radial glow sprite texture (additive particles + halos)
function glowSprite(){
var S=64, c=document.createElement('canvas'); c.width=c.height=S; var x=c.getContext('2d');
var g=x.createRadialGradient(S/2,S/2,0,S/2,S/2,S/2);
g.addColorStop(0,'rgba(255,255,255,1)'); g.addColorStop(0.25,'rgba(220,240,255,0.85)');
g.addColorStop(0.55,'rgba(150,200,255,0.30)'); g.addColorStop(1,'rgba(120,180,255,0)');
x.fillStyle=g; x.fillRect(0,0,S,S);
var t=new THREE.CanvasTexture(c); t.colorSpace=THREE.SRGBColorSpace; return t;
}
var sparkTex = glowSprite();
var atom = new THREE.Group(); scene.add(atom);
var CORE_R=38, AGENT_R=17, ORBIT=92;
var core = new THREE.Mesh(new THREE.SphereGeometry(CORE_R,96,96), stone);
core.castShadow=core.receiveShadow=true; atom.add(core);
// ── Carbonium "C" identity mark — billboarded arc-reactor glow ──
function letterTex(shimmer){
var S=512, c=document.createElement('canvas'); c.width=c.height=S; var x=c.getContext('2d');
x.clearRect(0,0,S,S);
var grd=x.createRadialGradient(S/2,S*0.54,S*0.04,S/2,S*0.54,S*0.42);
grd.addColorStop(0.0,'#ffffff'); grd.addColorStop(0.45,'#dff2ff'); grd.addColorStop(0.8,'#7cd0ff'); grd.addColorStop(1.0,'#4db8ff');
x.font='700 360px Satoshi, "DM Sans", system-ui, sans-serif'; x.textAlign='center'; x.textBaseline='middle';
x.shadowColor='rgba(90,190,255,0.8)'; x.shadowBlur=16; x.fillStyle=grd; x.fillText('C',S/2,S*0.54);
x.shadowBlur=0; x.lineWidth=7; x.strokeStyle='rgba(255,255,255,'+(0.5+0.5*shimmer)+')'; x.strokeText('C',S/2,S*0.54);
var t=new THREE.CanvasTexture(c); t.colorSpace=THREE.SRGBColorSpace; t.anisotropy=8; return t;
}
var cTexBase = letterTex(0);
var markGroup = new THREE.Group(); scene.add(markGroup);
var markSize = CORE_R*1.6;
var cMark = new THREE.Mesh(new THREE.PlaneGeometry(markSize,markSize), new THREE.MeshStandardMaterial({ map:cTexBase, transparent:true, depthWrite:false, emissive:0xbfe6ff, emissiveIntensity:1.2, emissiveMap:cTexBase, roughness:1, metalness:0, toneMapped:false }));
markGroup.add(cMark);
function haloSprite(color, scale, opacity){
var s=new THREE.Sprite(new THREE.SpriteMaterial({ map:sparkTex, color:color, transparent:true, blending:THREE.AdditiveBlending, depthWrite:false, opacity:opacity, toneMapped:false }));
s.scale.set(markSize*scale, markSize*scale, 1); s.position.z=-2; return s;
}
var cHaloInner=haloSprite(0xd6f0ff,1.5,0.28), cHaloMid=haloSprite(0x6fc6ff,2.2,0.4), cHaloOuter=haloSprite(0x2f9bff,3.2,0.3);
markGroup.add(cHaloOuter); markGroup.add(cHaloMid); markGroup.add(cHaloInner);
var cBaseScales={ inner:1.5, mid:2.2, outer:3.2 };
// The Carbonium "C" + its glow always render LAST and ON TOP of everything
// (orbs, glass, core) — depthTest off + high renderOrder — so no agent orb
// can ever visually cover the mark, while orbs still orbit freely in 3D.
cMark.material.depthTest=false; cMark.renderOrder=1000;
[cHaloOuter,cHaloMid,cHaloInner].forEach(function(h){ h.material.depthTest=false; h.renderOrder=999; });
// True-3D Fibonacci sphere distribution
function fib(n){
var pts=[], ga=Math.PI*(3-Math.sqrt(5));
for(var i=0;i0.9) _perp.set(1,0,0);
var ax1=new THREE.Vector3().crossVectors(baseDir,_perp).normalize();
var ax2=new THREE.Vector3().crossVectors(baseDir,ax1).normalize();
var curve=new THREE.QuadraticBezierCurve3(new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3());
var tube=new THREE.Mesh(new THREE.TubeGeometry(curve,40,0.5,12,false), glass); atom.add(tube);
arcs.push(curve);
agents.push({ baseDir:baseDir, mesh:n, mat:agentMat, flash:0, goldFlash:0, pop:0, curve:curve, tube:tube, ax1:ax1, ax2:ax2, phase:i*0.7, sp1:0.5+(i%3)*0.18, sp2:0.37+(i%4)*0.13, amp:12+(i%3)*5 });
});
function rebuildArc(a, flex){
var pos=a.mesh.position; var dir=pos.clone().normalize();
var start=dir.clone().multiplyScalar(CORE_R*0.9);
var end=pos.clone().sub(dir.clone().multiplyScalar(AGENT_R*0.7));
var mid=start.clone().add(end).multiplyScalar(0.5).add(dir.clone().multiplyScalar(10)).add(flex);
a.curve.v0.copy(start); a.curve.v1.copy(mid); a.curve.v2.copy(end);
a.curve.updateArcLengths();
a.tube.geometry.dispose();
a.tube.geometry=new THREE.TubeGeometry(a.curve,40,0.5,12,false);
}
// ── Electric neural-synapse firing along the glass tubes ──
var TRAIL=7;
function rand(a,b){ return a+Math.random()*(b-a); }
function newSprite(scale){
var s=new THREE.Sprite(new THREE.SpriteMaterial({ map:sparkTex, color:0xcfe8ff, transparent:true, blending:THREE.AdditiveBlending, depthWrite:false, opacity:0, toneMapped:false }));
s.scale.set(scale,scale,1); s.visible=false; atom.add(s); return s;
}
var synapses=agents.map(function(a,i){
var head=newSprite(6.5); var trail=[]; for(var k=0;kcore when a task is delivered,
// plus a gold "received" flash on the core.
var delivHead=goldSprite(13);
var delivTrail=[]; for(var _dvi=0;_dvi<8;_dvi++) delivTrail.push(goldSprite(12-_dvi*0.8));
var coreFlash=0;
// Permanent task removal + rain replenishment bookkeeping.
var taskRemoved={}, rains=[];
function easeOutBounce(x){ var n1=7.5625,d1=2.75; if(x<1/d1)return n1*x*x; if(x<2/d1){x-=1.5/d1;return n1*x*x+0.75;} if(x<2.5/d1){x-=2.25/d1;return n1*x*x+0.9375;} x-=2.625/d1;return n1*x*x+0.984375; }
// ── Heartbeat ripple ring (faces camera, expands + fades each beat) ──
var ripple=new THREE.Mesh(new THREE.RingGeometry(CORE_R*0.9, CORE_R*0.9+2.2, 96), new THREE.MeshBasicMaterial({ color:0xcfe8ff, transparent:true, opacity:0, blending:THREE.AdditiveBlending, side:THREE.DoubleSide, depthWrite:false, toneMapped:false }));
atom.add(ripple);
// ── Animate: slow weightless tumble + core self-rotation ──
atom.rotation.set(0.32, 0.0, 0.12);
// ── Reach-and-return: when the gold pulse hits an orb, that orb lobs out
// over the LEFT panel toward a random task cell, hovers, then arcs back.
// Path stays ABOVE the figure's head the whole way except the final dip.
var REACH_DUR=3.2; // seconds, < assignTimer so only one reaches at a time
var _zeroFlex=new THREE.Vector3();
var _tmpF=new THREE.Vector3(), _tmpQ=new THREE.Quaternion(), _unitX=new THREE.Vector3(1,0,0);
var _tmpUp=new THREE.Vector3(), _tmpQ2=new THREE.Quaternion();
function eio(u){ u=u<0?0:u>1?1:u; return u<0.5?2*u*u:1-Math.pow(-2*u+2,2)/2; }
// task cells live in the FAR-LEFT grid; aim at their real on-screen
// positions at trigger time. These fractions are only a fallback.
var REACH_LABELS=['Emails','Phone Calls','Meetings','Targets','Leads','Invoices','Payroll','Reports','Hiring','Budgeting','Proposals','Follow-ups','Scheduling','Contracts','Expenses','Analytics','Support','Social Posts','Client Calls','Onboarding'];
// Per-task icons (raw SVG, drawn in the cell's 0..24 icon frame). Swapped onto a
// cell whenever its label changes, so every task name shows its own matching icon.
var ICONS={
'Emails':'',
'Phone Calls':'',
'Meetings':'',
'Targets':'',
'Leads':'',
'Invoices':'',
'Payroll':'$',
'Reports':'',
'Hiring':'',
'Budgeting':'',
'Proposals':'',
'Follow-ups':'',
'Scheduling':'',
'Contracts':'',
'Expenses':'$',
'Analytics':'',
'Support':'',
'Social Posts':'',
'Client Calls':'',
'Onboarding':''
};
var REACH_FX=[0.05,0.09,0.13,0.17,0.21], REACH_FY=[0.60,0.74];
var _rp=new THREE.Vector3();
function reachWorld(rt, home, tx, ty){
var HY=_halfH*0.7, tz=0; // HY = high travel altitude (above the figure's head)
function seg(a,b){ return eio(THREE.MathUtils.clamp((rt-a)/(b-a),0,1)); }
// CLAW-MACHINE L-PATH. Horizontal legs ride high; only the leg over the
// basket (far left of the figure) drops vertically. Rounded corners come
// from the X and Y eased timelines overlapping slightly in time.
var hp=seg(0.10,0.34)-seg(0.70,0.92); // horizontal: home -> task (out) -> home (back)
var x=home.x+(tx-home.x)*hp;
var z=home.z+(tz-home.z)*hp;
var y;
if(rt<0.14) y=home.y+(HY-home.y)*seg(0,0.14); // 1) rise straight up out of the slot
else if(rt<0.32) y=HY; // 2) travel left, high, over+past the figure
else if(rt<0.46) y=HY+(ty-HY)*seg(0.32,0.46); // 3) drop straight down onto the task (left of figure)
else if(rt<0.58) y=ty; // 4) hover (~0.4s)
else if(rt<0.70) y=ty+(HY-ty)*seg(0.58,0.70); // 5) rise straight back up
else if(rt<0.90) y=HY; // 6) travel right, high, back over the cluster
else y=HY+(home.y-HY)*seg(0.90,1.0); // 7) drop into the orbit slot
return _rp.set(x,y,z);
}
var t=0, running=false;
function tick(){
if(!running) return; // gated on Card 03 visibility (IntersectionObserver in AgentOrbitalVis)
raf=requestAnimationFrame(tick);
t+=0.01;
atom.rotation.y+=0.0024; atom.rotation.x+=0.0009;
atom.position.y=Math.sin(t*0.6)*6+Math.sin(t*1.7)*1.5; // gentle weightless bob, centered on 0
atom.position.x=Math.sin(t*0.45)*3;
core.rotation.y+=0.0016;
var hb=t%1.4, beat=0;
if(hb<0.12) beat=Math.sin((hb/0.12)*Math.PI)*0.06; // lub
else if(hb<0.34) beat=Math.sin(((hb-0.22)/0.12)*Math.PI)*0.04; // dub
if(beat<0) beat=0;
var sc2=1+beat; core.scale.set(sc2,sc2,sc2);
// gold "task received" flash on the core (~0.2s, quick expand + glow)
if(coreFlash>0){ coreFlash=Math.max(0,coreFlash-(1/0.2)/60); var _cfk=Math.sin(THREE.MathUtils.clamp(coreFlash,0,1)*Math.PI);
core.material.emissive.setHex(0xfff4d6); core.material.emissiveIntensity=_cfk*1.9; var _cfs=sc2*(1+_cfk*0.09); core.scale.set(_cfs,_cfs,_cfs);
} else { core.material.emissiveIntensity=0; }
// Carbonium "C": billboarded on the camera-facing core surface, pulses with the beat
var coreWorld=new THREE.Vector3(); atom.getWorldPosition(coreWorld);
var toCam=camera.position.clone().sub(coreWorld).normalize();
markGroup.position.copy(coreWorld).addScaledVector(toCam, CORE_R*sc2+2.5);
markGroup.lookAt(camera.position);
var flare=beat*7.0, shimmer=0.5+0.5*Math.sin(t*4.0);
cMark.material.emissiveIntensity=1.7+flare+shimmer*0.3;
var hpc=1+beat*3.0;
cHaloInner.material.opacity=0.28+beat*1.6; cHaloMid.material.opacity=0.4+beat*2.2; cHaloOuter.material.opacity=0.3+beat*1.8+shimmer*0.04;
cHaloInner.scale.set(markSize*cBaseScales.inner*hpc, markSize*cBaseScales.inner*hpc, 1);
cHaloMid.scale.set(markSize*cBaseScales.mid*hpc, markSize*cBaseScales.mid*hpc, 1);
cHaloOuter.scale.set(markSize*cBaseScales.outer*(1+beat*2.0), markSize*cBaseScales.outer*(1+beat*2.0), 1);
// agents drift; glass flexes to follow
// Gentle lateral bias: ease any orb that drifts into the small
// front-and-centre zone over the C sideways out to the zone edge.
// Depth (distance toward camera) is left untouched, so no orb is ever
// hidden, shrunk, or pushed behind — it only slides around the ring.
var _vDir=atom.worldToLocal(camera.position.clone()).normalize();
var _side=new THREE.Vector3().crossVectors(_vDir,new THREE.Vector3(0,1,0));
if(_side.lengthSq()<1e-4)_side.set(1,0,0);
_side.normalize();
var _biasR=CORE_R*0.8+AGENT_R; // clear the C's footprint
for(var ai=0;ai0.001 && _to.lengthSq()>1e-6 && _cos<0.999){
_to.normalize().applyQuaternion(atom.getWorldQuaternion(_tmpQ).invert()); // -> orb-local
a.mesh.quaternion.setFromUnitVectors(_unitX,_to);
a.mesh.scale.set(1+(_cos-1)*_pw,1,1); // squash ramps out as _pw -> 0
} else { a.mesh.quaternion.identity(); a.mesh.scale.set(1,1,1); }
if(_rt>=1){ a.reaching=false; a.pop=0; a.mesh.quaternion.identity(); a.mesh.scale.set(1,1,1);
if(a.task && a.task.clone){ a.delivering=true; a.deliverT=0; a.coreHit=false; } // hand off to the delivery sequence
else { if(a.task&&a.task.g){ a.task.g.setAttribute('transform',a.task.orig); a.task.g.style.opacity=''; if(a.task.ov) a.task.ov.remove(); } a.task=null; } }
// Route the glass tether through a fixed GATEWAY that is LEFT of and
// ABOVE the figure whenever the orb is on the figure's left side. For
// EVERY task (incl. right-column near ones) the tube then arches over
// the head (core->gateway crosses the figure x up high) and descends
// on the LEFT of the figure (gateway->orb stays left of it) — never
// into the arm/body. Weighted in only once the orb is past the figure.
var _figRX=_camX+(0.363-0.5)*2*_halfW; // figure right edge (world x)
var _routeW=eio(THREE.MathUtils.clamp((_figRX-_w.x)/(_halfW*0.30),0,1));
var _pos=a.mesh.position, _dir=_pos.clone().normalize();
var _gmid=_dir.clone().multiplyScalar(CORE_R*0.9).add(_pos.clone().addScaledVector(_dir,-AGENT_R*0.7)).multiplyScalar(0.5).addScaledVector(_dir,10);
var _gateW=_tmpUp.set(_camX+(0.22-0.5)*2*_halfW, _halfH*0.7, 0); // gateway: left of + above figure
var _flex=atom.worldToLocal(_gateW.clone()).sub(_gmid).multiplyScalar(_routeW);
rebuildArc(a, _flex); // glass connector stretches/retracts + arches over the figure
// ── MAGNET GRAB + CARRY + FADE (placeholder for "delivered") ──
// <0.40: cell sits in the grid. 0.40-0.46: magnet jitter + lift toward
// the descending orb. >=0.46: snapped onto the orb (shrunk, just under
// it) and rides the claw path back, fading out as it nears the cluster.
if(a.task && a.task.g){
var _tg=a.task.g, _T=a.task;
if(_rt<0.40){
_tg.setAttribute('transform', _T.orig); _tg.style.opacity=''; // still resting in the grid
} else {
// GRABBED: a CLONE rides in an overlay ABOVE the 3D canvas (z-index 30),
// locked to the orb's screen position EVERY frame; the original cell is
// hidden immediately so the task never lingers/detaches at the basket.
if(!_T.clone){
var _ov=document.createElement('div');
_ov.style.cssText='position:absolute;inset:0;pointer-events:none;overflow:visible;z-index:30';
var _osvg=document.createElementNS('http://www.w3.org/2000/svg','svg');
_osvg.style.cssText='position:absolute;inset:0;width:100%;height:100%;overflow:visible';
var _cl=_tg.cloneNode(true); _cl.style.opacity='';
_osvg.appendChild(_cl); _ov.appendChild(_osvg); host.appendChild(_ov);
_T.ov=_ov; _T.clone=_cl;
}
_tg.style.opacity='0';
var _cr=host.getBoundingClientRect();
var _vv=_w.clone().project(camera);
var _rc=renderer.domElement.getBoundingClientRect();
var _sx=_rc.left+(_vv.x*0.5+0.5)*_rc.width, _sy=_rc.top+(-_vv.y*0.5+0.5)*_rc.height;
var _jw=_rt<0.4726?(0.4726-_rt)/0.0726:0; // brief settle wobble right after the grab (10% slower snap, twice)
var _jx=Math.sin(_rt*150)*2.0*_jw, _jy=Math.cos(_rt*168)*1.6*_jw;
_T.clone.setAttribute('transform','translate('+(_sx-_cr.left+_jx).toFixed(1)+','+(_sy-_cr.top+_jy).toFixed(1)+') scale(0.75)'); // centered ON the orb
_T.clone.style.opacity='1';
}
}
continue;
}
var _fr=a.mesh.position.dot(_vDir);
var _lv=a.mesh.position.clone().addScaledVector(_vDir,-_fr);
var _ll=_lv.length();
if(_fr>0 && _ll<_biasR){
var _fg=THREE.MathUtils.clamp(_fr/(CORE_R*0.6),0,1); _fg=_fg*_fg*(3-2*_fg);
var _cw=THREE.MathUtils.clamp(1-_ll/_biasR,0,1); _cw=_cw*_cw*(3-2*_cw);
var _g=_fg*_cw;
var _nl=_ll+(_biasR-_ll)*_g;
var _dir=_ll>1e-3?_lv.multiplyScalar(1/_ll):_side;
a.mesh.position.copy(_dir).multiplyScalar(_nl).addScaledVector(_vDir,_fr);
}
var flex=a.ax1.clone().multiplyScalar(d1*1.5).addScaledVector(a.ax2,d2*1.5).addScaledVector(a.ax1, Math.sin(t*1.3+a.phase*2.0)*a.amp*0.9).addScaledVector(a.ax2, Math.cos(t*0.9+a.phase)*a.amp*0.9);
rebuildArc(a, flex);
}
glass.emissiveIntensity=0.5+beat*5.0;
var ringPhase=hb/0.7;
if(ringPhase<=1){ var e=1+ringPhase*2.2; ripple.scale.set(e,e,e); ripple.material.opacity=0.5*(1-ringPhase); ripple.quaternion.copy(camera.quaternion); ripple.visible=true; }
else ripple.visible=false;
// synapse firing + cascades
var dt=1/60;
cascadeTimer-=dt;
if(cascadeTimer<=0){
cascadeTimer=rand(3,6);
var idxs=synapses.map(function(_,k){return k;}).sort(function(){return Math.random()-0.5;}).slice(0, 3+(Math.random()<0.5?1:0));
idxs.forEach(function(k,nn){ if(!synapses[k].firing) synapses[k].next=Math.min(synapses[k].next, 0.04+nn*0.05); });
}
for(var si=0;si0?syn.u:1-syn.u;
syn.head.visible=true;
syn.head.position.copy(syn.curve.getPoint(THREE.MathUtils.clamp(headU,0,1)));
syn.head.material.opacity=0.95;
syn.head.scale.setScalar(6.5*(1+beat*1.2));
for(var k2=0;k20?tu:1-tu;
spr.visible=true; spr.position.copy(syn.curve.getPoint(THREE.MathUtils.clamp(su,0,1)));
spr.material.opacity=0.8*(1-(k2+1)/(syn.trail.length+1));
}
if(syn.u>=1){ if(syn.dir>0) syn.agent.flash=1; syn.firing=false; syn.head.visible=false; syn.trail.forEach(function(s){ s.visible=false; }); }
}
}
// ── Assignment pulse (deterministic gold, core → agents[assignIndex]) ──
assignTimer-=dt;
if(!assignActive && assignTimer<=0){ assignActive=true; assignU=0; }
if(assignActive){
var tgt=agents[assignIndex];
assignU+=assignSpeed;
assignHead.visible=true;
assignHead.position.copy(tgt.curve.getPoint(THREE.MathUtils.clamp(assignU,0,1)));
assignHead.material.opacity=1.0;
assignHead.scale.setScalar(11*(1+beat*1.0));
for(var gk=0;gk=1){
tgt.goldFlash=1; tgt.pop=1; // "you're assigned" — strong gold flash + scale pop
// begin reach-and-return toward a random task cell on the left panel
tgt.reaching=true; tgt.reachT=0; tgt.task=null;
// Aim the dip at a REAL task cell in the far-left grid (never the figure):
// read the on-screen rect of a random labelled cell and map it to world,
// and keep that cell so it can be magnet-grabbed & carried back.
var _cv=renderer.domElement.getBoundingClientRect(), _fx, _fy;
var _lsvg=host.parentNode.querySelector('svg'); // left-panel grid SVG only (never the overlay clone)
var _cells=[].slice.call(_lsvg.querySelectorAll('text')).filter(function(tn){
return REACH_LABELS.indexOf((tn.textContent||'').trim())>=0 && !tn.parentNode.__rm; // only remaining (non-removed) tasks
});
if(!_cells.length){ _cells=[].slice.call(_lsvg.querySelectorAll('text')).filter(function(tn){ return REACH_LABELS.indexOf((tn.textContent||'').trim())>=0; }); _cells.forEach(function(tn){ tn.parentNode.__rm=false; }); }
if(_cells.length){
var _pick=_cells[Math.floor(Math.random()*_cells.length)];
var _c=_pick.getBoundingClientRect();
_fx=(_c.left+_c.width/2-_cv.left)/_cv.width;
_fy=(_c.top+_c.height/2-_cv.top)/_cv.height-0.03; // nudge onto the cell body (label sits at its base)
var _cg=_pick.parentNode;
tgt.task={ g:_cg, svg:_cg.ownerSVGElement, orig:(_cg.getAttribute('transform')||''), label:(_pick.textContent||'').trim() };
} else {
var _ri=Math.floor(Math.random()*10);
_fx=REACH_FX[_ri%5]; _fy=REACH_FY[Math.floor(_ri/5)];
}
tgt.reachTX=_camX+(_fx-0.5)*2*_halfW;
tgt.reachTY=(0.5-_fy)*2*_halfH;
assignActive=false; assignTimer=3.5; assignIndex=(assignIndex+1)%agents.length;
assignHead.visible=false; assignTrail.forEach(function(s){ s.visible=false; });
}
}
for(var fi=0;fi0){
ag.goldFlash=Math.max(0, ag.goldFlash-dt/0.6); // slower, lingering gold
ag.mat.emissive.setHex(0xffcf57);
ag.mat.emissiveIntensity=ag.goldFlash*2.2;
} else if(ag.flash>0){
ag.flash=Math.max(0, ag.flash-dt/0.3);
ag.mat.emissive.setHex(0xcfe8ff);
ag.mat.emissiveIntensity=ag.flash*0.9;
} else {
ag.mat.emissiveIntensity=0;
}
if(ag.reaching){
/* scale/orientation handled by the round-silhouette correction in the reach block */
} else {
if(ag.pop>0) ag.pop=Math.max(0, ag.pop-dt/0.5); // brief scale-pop, up-then-settle
ag.mesh.scale.setScalar(1+Math.sin(ag.pop*Math.PI)*0.42);
}
}
// ── DELIVERY SEQUENCE: processing shimmer → dissolve into the glass tube
// → gold pulse down the tube to the core → core flash → cleanup (~1.2s) ──
for(var dvj=0;dvj'+_gs.outerHTML+'';
_Tk.frags=[];
for(var _rr=0;_rr<_rows;_rr++)for(var _coo=0;_coo<_cols;_coo++){
var _fo=document.createElement('div');
_fo.style.cssText='position:absolute;overflow:hidden;width:'+_fw+'px;height:'+_fh+'px;left:'+(_coo*_fw-_cwp2/2)+'px;top:'+(_rr*_fh-_chp2/2)+'px;transform-origin:center';
var _fi=document.createElement('div');
_fi.style.cssText='position:absolute;left:'+(-_coo*_fw)+'px;top:'+(-_rr*_fh)+'px;width:'+_cwp2+'px;height:'+_chp2+'px';
_fi.innerHTML=_cellHTML; _fo.appendChild(_fi); _fc.appendChild(_fo);
var _ang=Math.random()*6.283, _dist=10+Math.random()*10;
_Tk.frags.push({el:_fo, dx:Math.cos(_ang)*_dist, dy:Math.sin(_ang)*_dist, rot:Math.random()*30-15, stag:(_rr*_cols+_coo)*0.012});
}
_Tk.ov.appendChild(_fc);
}
for(var _fk=0;_fk<_Tk.frags.length;_fk++){
var _F=_Tk.frags[_fk], _lt=_DT-0.30-_F.stag, _fr=THREE.MathUtils.clamp(_lt/0.5,0,1), _e=_fr*_fr*(3-2*_fr);
_F.el.style.transform='translate('+(_F.dx*_e).toFixed(1)+'px,'+(_F.dy*_e).toFixed(1)+'px) rotate('+(_F.rot*_e).toFixed(1)+'deg) scale('+(1-_e).toFixed(3)+')';
_F.el.style.opacity=(1-_e).toFixed(3);
}
}
}
if(_DT>=0.30 && _DT<0.95){ // (3) gold pulse orb -> core down the tube
var _gu=1-THREE.MathUtils.clamp((_DT-0.30)/0.60,0,1);
delivHead.visible=true; delivHead.position.copy(dag.curve.getPoint(_gu)); delivHead.material.opacity=1.0; delivHead.scale.setScalar(13);
for(var dk=0;dk1){ _ds.visible=false; continue; }
_ds.visible=true; _ds.position.copy(dag.curve.getPoint(_tu)); _ds.material.opacity=0.85*(1-(dk+1)/(delivTrail.length+1));
}
} else { delivHead.visible=false; for(var dk2=0;dk2=0.90){ dag.coreHit=true; coreFlash=1; } // (4) core flash on arrival
if(_DT>=1.2){ // (5) cleanup + PERMANENT removal + schedule rain
delivHead.visible=false; for(var dk3=0;dk3=0;_rj--){
var _R=rains[_rj];
if(_R.delay>0){ _R.delay-=1/60; if(_R.delay<=0){
_R.g.style.visibility=''; _R.g.style.opacity='0.8';
var _mY=(_R.orig.match(/translate\([^,]+,([\d.]+)/)||[])[1]; var _cy=_mY?parseFloat(_mY):170;
// spawn at the SVG's true TOP edge: convert the element's screen-top into viewBox coords via getScreenCTM
var _svg=_R.g.ownerSVGElement, _spawnSvgY=0;
if(_svg && _svg.getScreenCTM){
var _rect=_svg.getBoundingClientRect(), _p=_svg.createSVGPoint();
_p.x=_rect.left; _p.y=_rect.top;
_spawnSvgY=_p.matrixTransform(_svg.getScreenCTM().inverse()).y;
}
_R.startYoff=_spawnSvgY-_cy; // start at the SVG top, fall down into the basket
var _newLbl=REACH_LABELS[Math.floor(Math.random()*REACH_LABELS.length)];
var _lbl=[].slice.call(_R.g.children).filter(function(n){return n.tagName&&n.tagName.toLowerCase()==='text';})[0];
if(_lbl) _lbl.textContent=_newLbl; // set the fresh name BEFORE the drop, so no mid-fall flicker
var _ig=_R.g.querySelector('g'); // swap the icon to match the new task (no stale/mismatched icon)
if(_ig && ICONS[_newLbl]) _ig.innerHTML=ICONS[_newLbl];
_R.g.setAttribute('transform','translate(0,'+_R.startYoff.toFixed(1)+') '+_R.orig);
} continue; }
_R.t+=1/60;
var _rprog=THREE.MathUtils.clamp(_R.t/1.2,0,1);
var _yoff=(_R.startYoff||0)*(1-easeOutBounce(_rprog));
_R.g.setAttribute('transform','translate(0,'+_yoff.toFixed(1)+') '+_R.orig);
_R.g.style.opacity=(0.8+0.2*_rprog).toFixed(3); // 0.8 → 1.0 as it lands
if(_rprog>=1){ _R.g.setAttribute('transform',_R.orig); _R.g.style.opacity='';
_R.g.__rm=false; rains.splice(_rj,1);
}
}
renderer.render(scene, camera);
}
function resetScene(){
for(var _i=0;_i=0){
var g=tn.parentNode;
if(g.__lbl0==null) g.__lbl0=tn.textContent; // snapshot original task name once
else { tn.textContent=g.__lbl0; var _ig0=g.querySelector('g'); if(_ig0&&ICONS[g.__lbl0]) _ig0.innerHTML=ICONS[g.__lbl0]; } // restore original name + matching icon on later resets
g.style.visibility=''; g.style.opacity=''; g.__rm=false;
}
}); }
if(host){ [].slice.call(host.querySelectorAll('div')).forEach(function(d){ if(d.style&&d.style.zIndex==='30') d.remove(); }); } // stray carried-task overlays
assignActive=false; assignTimer=2.0; assignIndex=0; assignU=0;
assignHead.visible=false; assignTrail.forEach(function(s){ s.visible=false; });
delivHead.visible=false; delivTrail.forEach(function(s){ s.visible=false; });
coreFlash=0;
if(renderer) renderer.render(scene, camera);
}
function startScene(){ if(running||disposed) return; resetScene(); running=true; raf=requestAnimationFrame(tick); } // fresh from S1
function stopScene(){ running=false; if(raf) cancelAnimationFrame(raf); resetScene(); } // reset + pause
onActiveL=function(){ startScene(); }; onInactiveL=function(){ stopScene(); };
window.addEventListener('carbonium-card03-active', onActiveL);
window.addEventListener('carbonium-card03-inactive', onInactiveL);
resetScene(); // establish initial rest pose; stays paused until scrolled into view
if(window.__card03Active) startScene();
ro=new ResizeObserver(function(){
if(!hostRef.current) return; var w=host.clientWidth, h=host.clientHeight; if(!w||!h) return;
camera.aspect=w/h; camera.updateProjectionMatrix(); applyPan(); renderer.setSize(w,h);
});
ro.observe(host);
}).catch(function(e){ console.error('RealisticAtom load failed', e); });
return function(){
disposed=true;
if(raf) cancelAnimationFrame(raf);
if(onActiveL) window.removeEventListener('carbonium-card03-active', onActiveL);
if(onInactiveL) window.removeEventListener('carbonium-card03-inactive', onInactiveL);
if(ro) ro.disconnect();
if(renderer){ renderer.dispose(); var c=renderer.domElement; if(c&&c.parentNode) c.parentNode.removeChild(c); }
};
}, []);
return React.createElement('div', { ref:hostRef, style:{position:'absolute',top:'-20px',left:0,width:'100%',height:'135%',zIndex:8,pointerEvents:'none'} });
}
function AgentOrbitalVis() {
var ua1Ref=React.useRef(null), fa1Ref=React.useRef(null), h1Ref=React.useRef(null);
var wrapRef=React.useRef(null);
var hf1=[React.useRef(null),React.useRef(null),React.useRef(null),React.useRef(null),React.useRef(null)];
var ua2Ref=React.useRef(null), fa2Ref=React.useRef(null), h2Ref=React.useRef(null);
var hf2=[React.useRef(null),React.useRef(null),React.useRef(null),React.useRef(null),React.useRef(null)];
var wordIdxRef=React.useRef(0);
var headRef=React.useRef(null), exprRef=React.useRef('neutral');
var [expr,setExpr]=React.useState('neutral');
// ── "Life" reward cards hanging on the right wall (max 2), driven by task deliveries ──
var SLOT=[{x:516,y:40,arm:82,drop:7,tilt:-3},{x:516,y:120,arm:82,drop:7,tilt:4}]; // hooks on the RIGHT WALL; long horizontal string so cards hang toward mid-card (near the figure)
var [lifeCards,setLifeCards]=React.useState([{key:0,idx:0,slot:0,leaving:false}]); // seed one visible card
var lifeCardsRef=React.useRef(lifeCards);
React.useEffect(function(){ lifeCardsRef.current=lifeCards; },[lifeCards]);
var lifeCounterRef=React.useRef(1), lifeKeyRef=React.useRef(1);
function spawnLife(slot){
var idx=lifeCounterRef.current%10; lifeCounterRef.current++;
var key=lifeKeyRef.current++;
setLifeCards(function(prev){ return prev.concat([{key:key,idx:idx,slot:slot,leaving:false}]); });
}
function rewardLife(){
var staying=lifeCardsRef.current.filter(function(c){ return !c.leaving; });
if(staying.length>=2){
var oldest=staying[0], freed=oldest.slot; // oldest fades out first…
setLifeCards(function(prev){ return prev.map(function(c){ return c.key===oldest.key?Object.assign({},c,{leaving:true}):c; }); });
setTimeout(function(){ setLifeCards(function(prev){ return prev.filter(function(c){ return c.key!==oldest.key; }); }); },640);
setTimeout(function(){ spawnLife(freed); },360); // …then the new one swings into its slot
} else {
var used=staying.map(function(c){ return c.slot; });
spawnLife(used.indexOf(0)<0?0:1);
}
}
var rewardRef=React.useRef(null); rewardRef.current=rewardLife;
React.useEffect(function(){
function on(){ if(rewardRef.current) rewardRef.current(); }
window.addEventListener('carbonium-life-reward',on);
var sid='__life-cards';
if(!document.getElementById(sid)){
var st=document.createElement('style'); st.id=sid;
st.textContent='@keyframes lifeIn{0%{opacity:0;transform:rotate(-90deg)}14%{opacity:1}48%{transform:rotate(12deg)}70%{transform:rotate(-6deg)}86%{transform:rotate(3deg)}100%{transform:rotate(0)}}@keyframes lifeSway{0%,100%{transform:rotate(-2.3deg)}50%{transform:rotate(2.3deg)}}@keyframes lifeOut{0%{opacity:1;transform:rotate(0)}100%{opacity:0;transform:rotate(-34deg)}}';
document.head.appendChild(st);
}
return function(){ window.removeEventListener('carbonium-life-reward',on); };
},[]);
React.useEffect(function(){
var raf, start = performance.now(), T = 8500, figRunning=false;
function ease(u){ return u<0.5 ? 2*u*u : 1-Math.pow(-2*u+2,2)/2; }
function lerp(a,b,t){ return a+(b-a)*t; }
function reachP(ph){
if (ph<0.38) return 0.10+0.04*Math.sin(ph*12.566);
if (ph<0.50){ var u=(ph-0.38)/0.12; return 0.10+ease(u)*0.90; }
if (ph<0.57) return 1.0;
if (ph<0.73){ var u=(ph-0.57)/0.16; return 1.0-ease(u)*0.90; }
return 0.10+0.04*Math.sin(ph*12.566);
}
function headTilt(ph){
if(ph<0.40) return lerp(-12,1,ease(ph/0.40));
if(ph<0.57) return lerp(1,5,(ph-0.40)/0.17);
if(ph<0.80) return lerp(5,11,ease((ph-0.57)/0.23));
return lerp(11,0,ease((ph-0.80)/0.20));
}
function exprFor(ph,fc){
if(ph<0.06) return 'neutral';
if(ph<0.40) return 'surprised';
if(ph<0.57) return 'struggling';
if(ph<0.82){ var k=((fc%3)+3)%3; return k===0?'sad':k===1?'angry':'defeated'; }
return 'neutral';
}
var P1={Er:[74,88],Wr:[88,80],Ee:[82,84],We:[106,70]};
var P2={Er:[76,82],Wr:[90,72],Ee:[84,76],We:[108,60]};
var TGT=[150,64]; // figure's hands point UP-RIGHT toward the hanging life cards (showing them off)
var OA=[-42,-16,10,34], OL=[7.5,8.5,8,6.5], TOA=62, TOL=5;
var CA=[16,6,-4,-15], CL=[3,3.2,3.2,3], TCA=40, TCL=3;
function setArm(ua,fa,h,fg,P,p,open){
var Ex=lerp(P.Er[0],P.Ee[0],p), Ey=lerp(P.Er[1],P.Ee[1],p);
var Wx=lerp(P.Wr[0],P.We[0],p), Wy=lerp(P.Wr[1],P.We[1],p);
if(ua.current){ ua.current.setAttribute('x2',Ex.toFixed(1)); ua.current.setAttribute('y2',Ey.toFixed(1)); }
if(fa.current){ fa.current.setAttribute('x1',Ex.toFixed(1)); fa.current.setAttribute('y1',Ey.toFixed(1)); fa.current.setAttribute('x2',Wx.toFixed(1)); fa.current.setAttribute('y2',Wy.toFixed(1)); }
var faAng=Math.atan2(Wy-Ey,Wx-Ex);
var tgtAng=Math.atan2(TGT[1]-Wy,TGT[0]-Wx);
var dA=tgtAng-faAng; while(dA>Math.PI)dA-=2*Math.PI; while(dA<-Math.PI)dA+=2*Math.PI;
var handDeg=(faAng + dA*0.55*p)*180/Math.PI + 7*Math.sin(open*Math.PI);
if(h.current){ h.current.setAttribute('transform','translate('+Wx.toFixed(1)+','+Wy.toFixed(1)+') rotate('+handDeg.toFixed(1)+')'); }
for(var i=0;i<4;i++){
var f=fg[i]; if(!f||!f.current) continue;
var ang=(CA[i]+(OA[i]-CA[i])*open)*Math.PI/180;
var len=CL[i]+(OL[i]-CL[i])*open;
f.current.setAttribute('x2',(len*Math.cos(ang)).toFixed(1));
f.current.setAttribute('y2',(len*Math.sin(ang)).toFixed(1));
}
var th=fg[4];
if(th&&th.current){
var ta=(TCA+(TOA-TCA)*open)*Math.PI/180;
var tl=TCL+(TOL-TCL)*open;
th.current.setAttribute('x2',(tl*Math.cos(ta)).toFixed(1));
th.current.setAttribute('y2',(tl*Math.sin(ta)).toFixed(1));
}
}
function frame(now){
if(!figRunning) return; // gated on Card 03 visibility
var el=now-start;
var ph=((el%T)+T)%T/T;
var fullCyc=Math.floor(el/T);
var p=reachP(ph);
var open=Math.max(0,1-Math.abs(ph-0.53)/0.07);
setArm(ua1Ref,fa1Ref,h1Ref,hf1,P1,p,open);
setArm(ua2Ref,fa2Ref,h2Ref,hf2,P2,p,open);
var tilt=headTilt(ph);
if(headRef.current) headRef.current.setAttribute('transform','rotate('+tilt.toFixed(1)+' 54 84)');
var e=exprFor(ph,fullCyc);
if(e!==exprRef.current){ exprRef.current=e; setExpr(e); }
raf=requestAnimationFrame(frame);
}
function applyInitialPose(){
var p0=reachP(0), open0=Math.max(0,1-Math.abs(0-0.53)/0.07);
setArm(ua1Ref,fa1Ref,h1Ref,hf1,P1,p0,open0);
setArm(ua2Ref,fa2Ref,h2Ref,hf2,P2,p0,open0);
if(headRef.current) headRef.current.setAttribute('transform','rotate('+headTilt(0).toFixed(1)+' 54 84)');
var e0=exprFor(0,0); if(e0!==exprRef.current){ exprRef.current=e0; setExpr(e0); }
}
function startFig(){ if(figRunning) return; start=performance.now(); figRunning=true; raf=requestAnimationFrame(frame); } // fresh cycle
function stopFig(){ figRunning=false; if(raf) cancelAnimationFrame(raf); applyInitialPose(); } // reset to initial stressed pose
var onA=function(){ startFig(); }, onI=function(){ stopFig(); };
window.addEventListener('carbonium-card03-active', onA);
window.addEventListener('carbonium-card03-inactive', onI);
applyInitialPose(); // show the initial pose; stay paused until scrolled into view
if(window.__card03Active) startFig();
return function(){ if(raf) cancelAnimationFrame(raf); window.removeEventListener('carbonium-card03-active', onA); window.removeEventListener('carbonium-card03-inactive', onI); };
}, []);
// "YOU?" red arrows — cycle one at a time around the figure
var [arrowIdx, setArrowIdx] = React.useState(0);
var [arrowShown, setArrowShown] = React.useState(true);
React.useEffect(function(){
var t;
if (arrowShown) {
t = setTimeout(function(){ setArrowShown(false); }, 1900);
} else {
t = setTimeout(function(){
setArrowIdx(function(i){ return (i + 1) % 4; });
setArrowShown(true);
}, 1500);
}
return function(){ clearTimeout(t); };
}, [arrowShown, arrowIdx]);
// Single fixed arrow straight above the figure's head — always visible,
// never overlaps the "life" cards hanging on the right wall.
var YOU_ARROW = {line:'M302,26 C299,35 300,44 302,52', head:'M302,52 L295,44 M302,52 L309,44', tx:302, ty:17, rot:-3};
var YOU_ARROWS = [YOU_ARROW, YOU_ARROW, YOU_ARROW, YOU_ARROW];
// Falling "life" words the figure can't reach
var LIFE_WORDS = [
{t:'Travel', d:'travel', tilt:-4},
{t:'Sleep', d:'sleep', tilt:3},
{t:'Health', d:'health', tilt:-3},
{t:'Family', d:'family', tilt:5},
{t:'Freedom', d:'freedom', tilt:-2},
{t:'Hobbies', d:'hobbies', tilt:4},
{t:'Skill', d:'skill', tilt:-3},
{t:'Friends', d:'friends', tilt:3},
{t:'Peace', d:'peace', tilt:-4},
{t:'Food', d:'food', tilt:2},
];
var DOODLES = {
travel: (
),
sleep: (
),
health: (
),
family: (
),
freedom: (
),
hobbies: (
),
skill: (
),
friends: (
),
peace: (
),
food: (
),
};
var FACES = {
neutral: (
),
surprised: (
),
struggling: (
),
sad: (
),
angry: (
),
defeated: (
),
};
// ── Scroll trigger: start the whole Card 03 loop only when ~30% in view; reset + pause when it leaves ──
React.useEffect(function(){
var el=wrapRef.current;
if(!el || typeof IntersectionObserver==='undefined'){ window.__card03Active=true; window.dispatchEvent(new CustomEvent('carbonium-card03-active')); return; }
window.__card03Active=false;
var on=false;
var io=new IntersectionObserver(function(entries){
var e=entries[0]; if(!e) return;
var vis=e.isIntersecting && e.intersectionRatio>=0.3;
if(vis && !on){
on=true; window.__card03Active=true;
window.dispatchEvent(new CustomEvent('carbonium-card03-active'));
} else if(!vis && on){
on=false; window.__card03Active=false;
lifeCounterRef.current=1; lifeKeyRef.current=1;
setLifeCards([{key:0,idx:0,slot:0,leaving:false}]); // reset life cards to one seeded card
window.dispatchEvent(new CustomEvent('carbonium-card03-inactive'));
}
},{ threshold:[0,0.3,0.6] });
io.observe(el);
return function(){ io.disconnect(); };
},[]);
return (
{/* LEFT — figure with 5 task cards fallen on the ground behind */}
{/* spacer (vertical divider line removed) */}
{/* RIGHT — empty spacer; keeps the 50/50 split. The 3D canvas spans BOTH panels as an overlay below. */}
{/* Full-width 3D canvas spanning BOTH panels — fully transparent + pointer-events:none over the left art (shows through, stays clickable); orb stays over the right panel */}
';
}
sc.innerHTML=h;
}
function setImg(i){ for(var k=0;k=words.length){ if(caret) caret.style.opacity='0'; done&&done(); return; }
if(textEl) textEl.textContent += (i?' ':'')+words[i];
i++;
tId=setTimeout(next, 165);
})();
}
// ---- the product image detaches and is absorbed into the orb ----
function launchFlight(img, done){
if(!draftImgWrap||!orbEl){ done&&done(); return; }
var hostR=v2.getBoundingClientRect(), sR=draftImgWrap.getBoundingClientRect(), oR=orbEl.getBoundingClientRect();
if(sR.width<2){ done&&done(); return; }
var fly=document.createElement('div');
fly.className='v2-flyer';
fly.style.backgroundImage='url("'+img+'")';
fly.style.left=(sR.left-hostR.left)+'px';
fly.style.top=(sR.top-hostR.top)+'px';
fly.style.width=sR.width+'px';
fly.style.height=sR.height+'px';
v2.appendChild(fly);
// hide the draft's own image instantly so the flyer is the only copy
draftImgWrap.style.transition='none';
draftImgWrap.style.opacity='0';
var dx=(oR.left+oR.width/2)-(sR.left+sR.width/2);
var dy=(oR.top+oR.height/2)-(sR.top+sR.height/2);
var a=fly.animate([
{transform:'translate(0,0) scale(1) rotate(0deg)', opacity:1, filter:'drop-shadow(0 6px 14px rgba(0,0,0,.25))', borderRadius:'8px', offset:0},
{transform:'translate('+(dx*0.12)+'px,'+(dy*0.42-22)+'px) scale(1.05) rotate(-3deg)', opacity:1, filter:'drop-shadow(0 10px 18px rgba(0,170,255,.5))', borderRadius:'10px', offset:0.18},
{transform:'translate('+(dx*0.88)+'px,'+(dy*0.95)+'px) scale(0.30) rotate(3deg)', opacity:1, filter:'drop-shadow(0 0 16px rgba(0,205,255,.95))', borderRadius:'50%', offset:0.82},
{transform:'translate('+dx+'px,'+dy+'px) scale(0.04) rotate(6deg)', opacity:0, filter:'drop-shadow(0 0 26px rgba(120,225,255,1))', borderRadius:'50%', offset:1}
], {duration:1150, easing:'cubic-bezier(.5,0,.35,1)', fill:'forwards'});
// orb flashes as it absorbs the image
later(function(){ orbEl.classList.add('flash'); }, 980);
later(function(){ orbEl.classList.remove('flash'); }, 1380);
a.onfinish=function(){ if(fly.parentNode) fly.remove(); done&&done(); };
}
// ---- strict sequential cycle ----
function runCycle(i){
clearAll();
setImg(i);
renderPhone(pickPlatform(), IMAGES[i], PROMPTS[i]);
// reset every element to its hidden start state
draft.classList.remove('show');
if(draftImgWrap){ draftImgWrap.classList.remove('show'); draftImgWrap.style.transition=''; draftImgWrap.style.opacity=''; }
if(phoneEl) phoneEl.classList.remove('show');
if(btn) btn.classList.remove('click');
if(orbEl) orbEl.classList.remove('flash');
if(textEl) textEl.textContent='';
if(caret) caret.style.opacity='0';
function nextCycle(){ idx=(idx+1)%IMAGES.length; runCycle(idx); }
if(reduce){
draft.classList.add('show');
if(textEl) textEl.textContent=PROMPTS[i];
if(draftImgWrap) draftImgWrap.classList.add('show');
if(phoneEl) phoneEl.classList.add('show');
later(nextCycle, 4500);
return;
}
// 1 — draft card appears
later(function(){ draft.classList.add('show'); }, 60);
// 2 — typewriter types the caption word by word, then:
later(function(){
typeWords(PROMPTS[i], function(){
// 3 — product image fades/slides into the draft
later(function(){ if(draftImgWrap) draftImgWrap.classList.add('show'); }, 260);
// 4 — 'Create Post' button animates as if clicked
later(function(){ if(btn) btn.classList.add('click'); }, 260+560);
later(function(){ if(btn) btn.classList.remove('click'); }, 260+560+280);
// 5 — image detaches, flies to the orb, is absorbed (orb flashes)
var flyAt=260+560+280+280;
later(function(){
launchFlight(IMAGES[i], function(){
// 6 — iPhone mockup appears on the right
later(function(){ if(phoneEl) phoneEl.classList.add('show'); }, 220);
// 7 — pause 2s, then everything fades out and the loop restarts
later(function(){
draft.classList.remove('show');
if(draftImgWrap) draftImgWrap.classList.remove('show');
if(phoneEl) phoneEl.classList.remove('show');
}, 220+450+2000);
later(nextCycle, 220+450+2000+650);
});
}, flyAt);
});
}, 560);
}
function ccReset(){
clearAll();
var fl=v2.querySelectorAll('.v2-flyer'); for(var fi=0;fi";
var MI_STRUCT = "
AI live
Aisha · WhatsApp
C
@daniel · Instagram
C
Sara · Messenger
C
Omar · Telegram
C
";
function MI_SETUP(root){
var feed=root.querySelector('.cf'); if(!feed) return;
var threads=[].slice.call(feed.querySelectorAll('.cf-thread'));
var reduce=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var DATA=[
{cust:'Is the offer still on?', ai:'Yes! Still on until 9pm. Want me to book a table?', cust2:'Yes please, for 2 people at 8pm', ai2:'Done! Booking confirmed for 2 at 8pm \u{1F389}'},
{cust:'Can I get this in size M?', ai:'Yes, size M is available! Want me to reserve it for you?', cust2:'Yes reserve it please!', ai2:'Reserved! Check your DM for the payment link \u{1F6CD}\uFE0F'},
{cust:'Thanks, that was fast!', ai:'Always here for you \u{1F60A} Anything else I can help with?', cust2:'Do you ship internationally?', ai2:'Yes! Worldwide shipping in 3-5 days \u{1F30D}'},
{cust:'Where is my order?', ai:'Your order is on the way \u2014 arriving by 6pm today!'}
];
var TM=[], IV=[];
function st(fn,ms){var id=setTimeout(fn,ms);TM.push(id);return id;}
function clr(){TM.forEach(clearTimeout);TM=[];IV.forEach(clearInterval);IV=[];}
function type(el,caret,str,done){ if(caret)caret.style.opacity='1'; el.style.opacity='1'; el.textContent=''; var i=0; var iv=setInterval(function(){ i++; el.textContent=str.slice(0,i); if(i>=str.length){ clearInterval(iv); if(caret)caret.style.opacity='0'; done&&done(); } },40); IV.push(iv); }
function swap(el,str,done){ el.style.opacity='0'; st(function(){ el.textContent=str; el.style.opacity='1'; st(done,260); },260); }
function convo(idx){ var t=threads[idx], d=DATA[idx]; var ct=t.querySelector('.cf-ct'),cc=t.querySelector('.cf-caret'),orb=t.querySelector('.cf-orb'),at=t.querySelector('.cf-at'),ac=t.querySelector('.cf-caret2');
function start(){ type(ct,cc,d.cust,function(){ st(function(){ orb.classList.add('show'); st(function(){ type(at,ac,d.ai,function(){ if(d.cust2){ st(function(){ swap(ct,d.cust2,function(){ st(function(){ type(at,ac,d.ai2,function(){ st(loopRow,2200); }); },180); }); },1100); } else { st(loopRow,2600); } }); },360); },300); }); }
function loopRow(){ ct.style.opacity='0'; at.style.opacity='0'; st(function(){ ct.textContent=''; at.textContent=''; ct.style.opacity='1'; at.style.opacity='1'; start(); },320); }
start();
}
function reset(){ clr(); threads.forEach(function(t){ t.classList.remove('show'); t.querySelector('.cf-orb').classList.remove('show'); var ct=t.querySelector('.cf-ct'),at=t.querySelector('.cf-at'); ct.textContent='';at.textContent='';ct.style.opacity='1';at.style.opacity='1'; t.querySelector('.cf-caret').style.opacity='0'; t.querySelector('.cf-caret2').style.opacity='0'; }); }
root.__miStart=function(){ reset(); if(reduce){ threads.forEach(function(t,idx){ t.classList.add('show'); t.querySelector('.cf-ct').textContent=DATA[idx].cust; t.querySelector('.cf-orb').classList.add('show'); t.querySelector('.cf-at').textContent=DATA[idx].ai; }); return; } threads.forEach(function(t,idx){ st(function(){ t.classList.add('show'); convo(idx); }, 450*idx+200); }); };
root.__miStop=function(){ reset(); };
}
function MultiInboxVis({active}) {
var rootRef = React.useRef(null);
React.useEffect(function(){
var root = rootRef.current; if(!root) return;
if(!document.getElementById('mi-styles')){ var st=document.createElement('style'); st.id='mi-styles'; st.textContent=MI_CSS; document.head.appendChild(st); }
if(!document.getElementById('mi-symbols')){ var sv=document.createElement('div'); sv.id='mi-symbols'; sv.setAttribute('aria-hidden','true'); sv.style.cssText='position:absolute;width:0;height:0;overflow:hidden'; sv.innerHTML=MI_SYMBOLS; document.body.appendChild(sv); }
root.innerHTML=MI_STRUCT;
try { MI_SETUP(root); } catch(e){ console.error('MI_SETUP error', e); }
return function(){ if(root.__miStop) root.__miStop(); root.innerHTML=''; };
}, []);
React.useEffect(function(){
var root = rootRef.current; if(!root) return;
if(active===false){ if(root.__miStop) root.__miStop(); } else { if(root.__miStart) root.__miStart(); }
}, [active]);
return React.createElement('div', {ref:rootRef, style:{position:'relative',width:'100%',height:'100%'}});
}
function ChatVis({active}) {
var CONVOS = [
{user:'Hey, what are your prices?', bot:'Hi! Our plans start from $49/mo. Want me to send a full breakdown?'},
{user:'Do you offer free trials?', bot:'Yes! 14-day free trial, no card needed. Shall I set one up for you?'},
{user:'When can we get started?', bot:'Right away! I can book you in today. What time works best?'},
{user:'Is there a setup fee?', bot:'None at all — we handle the full onboarding. Ready to begin?'},
];
var [step, setStep] = React.useState(0);
var [showBot, setShowBot] = React.useState(false);
React.useEffect(function(){
if(active===false) return; // paused when scrolled out of view
var t;
if (!showBot) {
t = setTimeout(function(){ setShowBot(true); }, 1100);
} else {
t = setTimeout(function(){
setShowBot(false);
setStep(function(s){ return (s+1)%CONVOS.length; });
}, 2400);
}
return function(){ clearTimeout(t); };
}, [showBot, step, active]);
var convo = CONVOS[step];
return (
React.createElement('div', {style:{padding:'14px 14px 10px',display:'flex',flexDirection:'column',gap:'8px',width:'100%',boxSizing:'border-box'}},
React.createElement('div', {style:{display:'flex',alignItems:'center',gap:'7px',padding:'8px 11px',background:'rgba(255,255,255,0.75)',borderRadius:'10px',boxShadow:'0 0.5px 1px rgba(0,0,0,.06),0 2px 5px rgba(0,0,0,.06)'}},
React.createElement('div',{style:{width:'24px',height:'24px',borderRadius:'50%',background:'#25D366',display:'flex',alignItems:'center',justifyContent:'center',flexShrink:0}},
React.createElement('svg',{viewBox:'0 0 24 24',width:13,height:13,fill:'white'},
React.createElement('path',{d:'M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'})
)
),
React.createElement('div',{style:{flex:1}},
React.createElement('div',{style:{fontSize:'10px',fontWeight:700,color:'#1A1A1A',fontFamily:'DM Sans,sans-serif'}},'WhatsApp Business'),
React.createElement('div',{style:{fontSize:'9px',color:'#22C55E',fontFamily:'DM Sans,sans-serif',fontWeight:500}},'\u25cf AI Active')
)
),
React.createElement('div',{style:{display:'flex',justifyContent:'flex-end'}},
React.createElement('div',{style:{maxWidth:'82%',background:'#DCF8C6',borderRadius:'12px 12px 3px 12px',padding:'8px 12px',boxShadow:'0 1px 3px rgba(0,0,0,0.08)'}},
React.createElement('span',{style:{fontSize:'11px',color:'#1A1A1A',fontFamily:'DM Sans,sans-serif'}},convo.user)
)
),
showBot
? React.createElement('div',{style:{display:'flex',justifyContent:'flex-start'}},
React.createElement('div',{style:{maxWidth:'82%',background:'#fff',borderRadius:'12px 12px 12px 3px',padding:'8px 12px',boxShadow:'0 1px 3px rgba(0,0,0,0.08)'}},
React.createElement('div',{style:{fontSize:'8.5px',color:'#818CF8',fontFamily:'DM Sans,sans-serif',fontWeight:700,marginBottom:'3px'}},'⚡ AI Reply'),
React.createElement('span',{style:{fontSize:'11px',color:'#1A1A1A',fontFamily:'DM Sans,sans-serif'}},convo.bot)
)
)
: React.createElement('div',{style:{display:'flex',justifyContent:'flex-start',alignItems:'center',gap:'4px',padding:'6px 10px'}},
[0,1,2].map(function(j){
return React.createElement('div',{key:j,style:{width:'5px',height:'5px',borderRadius:'50%',background:'#BDBDBD',animation:'agentDot 1.2s ease '+(j*0.22)+'s infinite'}});
})
)
)
);
}
function AnimSvcCard({num,title,desc,visual,span2,visualRef,noMinH,pinText,cardRef,pauseClass,popVisual,fixedVisH,tightText,balanceText}) {
return (
{visual}
{num ?
{num}
: null}
{title}
{desc}
);
}
function AnimatedServices() {
var [card01Expanded, setCard01Expanded] = React.useState(false);
var [card01Active, setCard01Active] = React.useState(true);
var [card02Active, setCard02Active] = React.useState(true);
var [card04Active, setCard04Active] = React.useState(true);
var [card05Active, setCard05Active] = React.useState(true);
var card01VisRef = React.useRef(null);
var card01CardRef = React.useRef(null);
var card02CardRef = React.useRef(null);
var card04CardRef = React.useRef(null);
var card05CardRef = React.useRef(null);
React.useEffect(function(){
if (!card01VisRef.current) return;
var ro = new ResizeObserver(function(entries){
for (var ei = 0; ei < entries.length; ei++) {
setCard01Expanded(entries[ei].contentRect.height > 260);
}
});
ro.observe(card01VisRef.current);
return function(){ ro.disconnect(); };
}, []);
React.useEffect(function(){
var io = new IntersectionObserver(function(entries){
entries.forEach(function(entry){
var active = entry.isIntersecting;
if (entry.target === card01CardRef.current) {
setCard01Active(active);
} else if (entry.target === card02CardRef.current) {
setCard02Active(active);
} else if (entry.target === card04CardRef.current) {
setCard04Active(active);
} else if (entry.target === card05CardRef.current) {
setCard05Active(active);
}
});
}, { root: null, rootMargin: '0px', threshold: 0.2 });
var c1 = card01CardRef.current;
var c2 = card02CardRef.current;
if (c1) io.observe(c1);
if (c2) io.observe(c2);
if (card04CardRef.current) io.observe(card04CardRef.current);
if (card05CardRef.current) io.observe(card05CardRef.current);
return function(){ io.disconnect(); };
}, []);
React.useEffect(function(){
var id = '__as-kf';
if (!document.getElementById(id)) {
var s = document.createElement('style');
s.id = id;
s.textContent = '@keyframes asSpin{to{transform:rotate(360deg)}} @keyframes assDot{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-5px)}} @keyframes asSRow1{0%{transform:translateX(0)}100%{transform:translateX(-50%)}} @keyframes asSRow2{0%{transform:translateX(-50%)}100%{transform:translateX(0)}} @keyframes agentPulse{0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,0.5)}60%{box-shadow:0 0 0 5px rgba(34,197,94,0)}} @keyframes agentDot{0%,80%,100%{opacity:0.25;transform:scale(0.85)}40%{opacity:1;transform:scale(1.2)}} @keyframes taskFall{0%{transform:translateY(0) rotate(-6deg);opacity:1}70%{opacity:1}100%{transform:translateY(260px) rotate(9deg);opacity:0}} .vis-paused,.vis-paused *{animation-play-state:paused!important} @keyframes bundleShake{0%,100%{transform:translate(0px,0px) rotate(0deg)}18%{transform:translate(1.6px,-1.1px) rotate(0.9deg)}36%{transform:translate(-1.5px,1.2px) rotate(-1deg)}54%{transform:translate(1.2px,1.4px) rotate(0.7deg)}72%{transform:translate(-1.3px,-1.2px) rotate(-0.8deg)}90%{transform:translate(0.9px,-1.4px) rotate(0.5deg)}} @keyframes figureStrain{0%,100%{transform:translate(0px,0px) rotate(0deg)}25%{transform:translate(-0.9px,0.5px) rotate(-0.5deg)}50%{transform:translate(0.9px,-0.5px) rotate(0.5deg)}75%{transform:translate(-0.6px,0.7px) rotate(-0.4deg)}} .bundleShake{transform-box:fill-box;transform-origin:center;animation:bundleShake 0.238s linear infinite} .figureStrain{transform-box:fill-box;transform-origin:center;animation:figureStrain 0.29s linear infinite} @keyframes lifeWord{0%{transform:scaleY(0.08) rotate(0deg);opacity:0}6%{opacity:1}40%{transform:scaleY(1) rotate(-2deg);opacity:1}54%{transform:scaleY(1) rotate(-5deg);opacity:1}64%{transform:scaleY(0.93) rotate(-3deg);opacity:1}76%{transform:scaleY(1) rotate(2deg);opacity:1}87%{transform:scaleY(1) rotate(-3deg);opacity:1}94%{transform:scaleY(0.6) rotate(-1deg);opacity:0.5}100%{transform:scaleY(0.26) rotate(0deg);opacity:0}} .lifeWord{transform-box:fill-box;transform-origin:top;animation:lifeWord 8.5s ease-in-out forwards} @keyframes figureLunge{0%,38%{transform:translateX(0)}48%{transform:translateX(2px)}54%{transform:translateX(2.5px)}66%{transform:translateX(-1px)}80%{transform:translateX(0.5px)}100%{transform:translateX(0)}} .figureLunge{transform-box:fill-box;transform-origin:center;animation:figureLunge 8.5s ease-in-out infinite} @keyframes reachArm{0%,40%{transform:translate(0px,0px)}54%{transform:translate(4px,2.5px)}64%{transform:translate(6px,3.5px)}72%{transform:translate(-2px,-1px)}84%{transform:translate(3px,2px)}100%{transform:translate(0px,0px)}} .reachArm{transform-box:fill-box;transform-origin:center;animation:reachArm 8.5s ease-in-out infinite}';
document.head.appendChild(s);
}
}, []);
return (
OUR SERVICES
Your AI Marketing Engine — Built & Run For YOU.
Strategy, automation, custom builds, and the team to run them, all in one place.