';}).join('');
var nums=box.querySelectorAll('.num');
reveal('dC3',function(){
nums.forEach(function(n,i){var d=data[i],t0=null,dur=1300;
function step(ts){if(!t0)t0=ts;var pr=Math.min((ts-t0)/dur,1);n.textContent=Math.round(pr*d.v)+d.suf;if(pr<1)requestAnimationFrame(step);}
setTimeout(function(){requestAnimationFrame(step);},i*120);
});
});
})();
/* CHART 4: CONTEXT-SWITCH COST — horizontal bars */
(function(){
var svg=root.querySelector('#d4svg'),tip=root.querySelector('#d4tip');
var W=640,H=340,xL=230,xMax=590,yT=34,rowH=46,gap=18;
var bars=[
{n:'Sustained single domain',v:22,note:'
Lowest cost. Staying in one lane \u2014 e.g. a full block of financial work \u2014 loads one mental model and holds it. This is how deep work protects the tank.'},
{n:'Occasional switching',v:48,note:'
Moderate cost. A few domain switches a day. Each one forces you to unload and reload a mental model \u2014 ~23 min to fully refocus each time.'},
{n:'Constant cross-domain (the founder day)',v:92,note:'
Highest cost. The default founder rhythm: finance \u2192 people \u2192 product \u2192 legal, all interrupting each other. The research calls this maximally depleting.'}
];
var maxV=100;
function bw(v){return (xMax-xL)*v/maxV;}
bars.forEach(function(b,i){
var y=yT+i*(rowH+gap);
// wrap long label
var words=b.n.split(' ');var line1=b.n,line2='';
if(b.n.length>18){var mid=Math.ceil(words.length/2);line1=words.slice(0,mid).join(' ');line2=words.slice(mid).join(' ');}
var tx=el('text',{x:xL-10,y:y+rowH/2+(line2?-2:4),fill:'#eaf0ff','font-size':11,'font-weight':600,'text-anchor':'end'});tx.textContent=line1;svg.appendChild(tx);
if(line2){svg.appendChild(el('text',{x:xL-10,y:y+rowH/2+12,fill:'#a9b6d6','font-size':10,'text-anchor':'end'})).textContent=line2;}
svg.appendChild(el('rect',{x:xL,y:y,width:xMax-xL,height:rowH,rx:7,fill:'rgba(255,255,255,.05)'}));
var col=i===0?'#3fd08a':(i===1?'#f7a008':'#f75008');
var bar=el('rect',{x:xL,y:y,width:0,height:rowH,rx:7,fill:col,style:'cursor:pointer'});svg.appendChild(bar);
var val=el('text',{x:xL+6,y:y+rowH/2+5,fill:'#fff','font-size':13,'font-weight':900,opacity:0});val.textContent=b.v;svg.appendChild(val);
function show(){tip.innerHTML=b.note;tip.style.left=((xL+bw(b.v)/2)/W*100)+'%';tip.style.top=((y-6)/H*100)+'%';tip.style.opacity=1;tip.style.whiteSpace='normal';tip.style.maxWidth='240px';}
bar.addEventListener('mouseenter',show);bar.addEventListener('mousemove',show);bar.addEventListener('mouseleave',function(){tip.style.opacity=0;});
bar.addEventListener('touchstart',function(e){e.preventDefault();show();},{passive:false});
b._bar=bar;b._val=val;b._w=bw(b.v);
});
svg.appendChild(el('text',{x:(xL+xMax)/2,y:H-8,fill:'#a9b6d6','font-size':10.5,'font-weight':700,'text-anchor':'middle'})).textContent='RELATIVE COGNITIVE COST \u2192';
reveal('dC4',function(){
bars.forEach(function(b,i){setTimeout(function(){
b._bar.style.transition='width .8s cubic-bezier(.2,.7,.2,1)';b._bar.setAttribute('width',b._w);
b._val.style.transition='opacity .4s .4s';b._val.setAttribute('x',xL+b._w-26);b._val.setAttribute('opacity',1);
},i*160);});
});
})();
/* CHART 5: DECISION-TIER 2x2 MATRIX */
(function(){
var svg=root.querySelector('#d5svg'),tip=root.querySelector('#d5tip'),note=root.querySelector('#d5note');
var W=640,H=380,mx=90,my=40,gw=440,gh=270;
// axes
svg.appendChild(el('line',{x1:mx,y1:my,x2:mx,y2:my+gh,stroke:'rgba(255,255,255,.25)','stroke-width':1.5}));
svg.appendChild(el('line',{x1:mx,y1:my+gh,x2:mx+gw,y2:my+gh,stroke:'rgba(255,255,255,.25)','stroke-width':1.5}));
// axis labels
svg.appendChild(el('text',{x:mx+gw/2,y:my+gh+34,fill:'#a9b6d6','font-size':11,'font-weight':700,'text-anchor':'middle'})).textContent='REVERSIBILITY \u2192 (reversible \u2192 irreversible)';
var yl=el('text',{x:mx-30,y:my+gh/2,fill:'#a9b6d6','font-size':11,'font-weight':700,'text-anchor':'middle',transform:'rotate(-90 '+(mx-30)+' '+(my+gh/2)+')'});yl.textContent='STAKES \u2192 (low \u2192 high)';svg.appendChild(yl);
var cw=gw/2,ch=gh/2;
var quads=[
{r:0,c:1,col:'#5b8def',t:'Decide fast',s:'Reversible · Low stakes',note:'
Decide fast (or default it). Which tool, which phrasing, which low-risk vendor. Spend the minimum coins to avoid an obvious error \u2014 speed is the correct posture. Never let these eat your prime hours.'},
{r:0,c:2,col:'#f7a008',t:'Protect for morning',s:'Irreversible · High stakes',note:'
Protect these. Key hires, partnerships, funding terms, pivots. Schedule for the morning, prepare properly, and invoke a 48-hour rule if they surface under acute stress.'},
{r:1,c:1,col:'#3fd08a',t:'Delegate',s:'Reversible · Low stakes',note:'
Delegate or automate. Recurring, low-consequence calls belong to systems or your team \u2014 not your reservoir. Every one you remove buys back judgment for what matters.'},
{r:1,c:2,col:'#f75008',t:'Slow down',s:'Irreversible · Mid-high stakes',note:'
Slow down deliberately. Consequential and hard to undo. Written docs over verbal briefings, morning slot, second opinion. This is what your best brain is for.'}
];
// grid positions: col1 left, col2 right; r0 top(high stakes), r1 bottom(low)
quads.forEach(function(q,i){
var x=mx+(q.c-1)*cw, y=my+q.r*ch;
var rect=el('rect',{x:x+6,y:y+6,width:cw-12,height:ch-12,rx:12,fill:'rgba(255,255,255,.04)',stroke:q.col,'stroke-width':2,opacity:0,style:'cursor:pointer'});svg.appendChild(rect);
var t1=el('text',{x:x+cw/2,y:y+ch/2-6,fill:'#fff','font-size':15,'font-weight':900,'text-anchor':'middle',opacity:0,style:'pointer-events:none'});t1.textContent=q.t;svg.appendChild(t1);
var t2=el('text',{x:x+cw/2,y:y+ch/2+16,fill:q.col,'font-size':10.5,'font-weight':700,'text-anchor':'middle',opacity:0,style:'pointer-events:none'});t2.textContent=q.s;svg.appendChild(t2);
function pick(){note.innerHTML=q.note;tip.style.opacity=0;}
rect.addEventListener('click',pick);rect.addEventListener('mouseenter',pick);
rect.addEventListener('touchstart',function(e){e.preventDefault();pick();},{passive:false});
q._r=rect;q._a=t1;q._b=t2;
});
reveal('dC5',function(){
quads.forEach(function(q,i){setTimeout(function(){
q._r.style.transition='opacity .5s';q._r.setAttribute('opacity',1);
q._a.style.transition='opacity .4s .1s';q._a.setAttribute('opacity',1);
q._b.style.transition='opacity .4s .1s';q._b.setAttribute('opacity',1);
},i*150);});
});
})();
/* CHART 6: REACTIVE VS BATCHED — paired bars */
(function(){
var svg=root.querySelector('#d6svg'),tip=root.querySelector('#d6tip'),note=root.querySelector('#d6note');
var W=640,H=340,xL=60,yT=30,yB=255;
var groups=[
{n:'Vendor',reactive:88,batched:34,note:'
Vendor decisions. Scattered across the week, each email reloads the context. Batched into one Monday block, the model loads once \u2014 far cheaper and more accurate.'},
{n:'Financial',reactive:92,batched:38,note:'
Financial reviews. Reactive finance questions mid-product-work are brutally costly. One weekly review block builds the mental model once and applies it to everything.'},
{n:'People',reactive:85,batched:36,note:'
People decisions. Interpersonal calls demand a totally different mode. Grouping 1:1s and team calls protects the rest of your day from the switch.'},
{n:'Product',reactive:80,batched:32,note:'
Product decisions. Deep, creative work that fragments badly. A protected product block is where batching pays off most.'}
];
function Y(v){return yB-(yB-yT)*v/100;}
[0,25,50,75,100].forEach(function(g){var y=Y(g);svg.appendChild(el('line',{x1:xL,y1:y,x2:600,y2:y,stroke:'rgba(255,255,255,.06)','stroke-width':1}));svg.appendChild(el('text',{x:xL-8,y:y+4,fill:'#a9b6d6','font-size':10,'text-anchor':'end'})).textContent=g;});
var gW=(600-xL)/groups.length, bw=26;
groups.forEach(function(g,i){
var gx=xL+i*gW+gW/2;
var xR2=gx-bw-4, xB=gx+4;
var rBar=el('rect',{x:xR2,y:yB,width:bw,height:0,rx:5,fill:'#f75008',style:'cursor:pointer'});svg.appendChild(rBar);
var bBar=el('rect',{x:xB,y:yB,width:bw,height:0,rx:5,fill:'#3fd08a',style:'cursor:pointer'});svg.appendChild(bBar);
svg.appendChild(el('text',{x:gx,y:yB+18,fill:'#eaf0ff','font-size':11,'font-weight':600,'text-anchor':'middle'})).textContent=g.n;
function show(){tip.innerHTML=g.note;tip.style.left=(gx/W*100)+'%';tip.style.top=((Y(g.reactive)-10)/H*100)+'%';tip.style.opacity=1;tip.style.whiteSpace='normal';tip.style.maxWidth='240px';}
[rBar,bBar].forEach(function(b){b.addEventListener('mouseenter',show);b.addEventListener('mousemove',show);b.addEventListener('mouseleave',function(){tip.style.opacity=0;});b.addEventListener('touchstart',function(e){e.preventDefault();show();},{passive:false});});
g._r=rBar;g._b=bBar;g._rh=(yB-Y(g.reactive));g._bh=(yB-Y(g.batched));g._ry=Y(g.reactive);g._by=Y(g.batched);
});
// legend
svg.appendChild(el('rect',{x:xL+40,y:H-20,width:12,height:12,rx:3,fill:'#f75008'}));
svg.appendChild(el('text',{x:xL+58,y:H-10,fill:'#eaf0ff','font-size':11})).textContent='Reactive (scattered)';
svg.appendChild(el('rect',{x:xL+230,y:H-20,width:12,height:12,rx:3,fill:'#3fd08a'}));
svg.appendChild(el('text',{x:xL+248,y:H-10,fill:'#eaf0ff','font-size':11})).textContent='Batched (blocked)';
reveal('dC6',function(){
groups.forEach(function(g,i){setTimeout(function(){
g._r.style.transition='height .8s cubic-bezier(.2,.7,.2,1),y .8s cubic-bezier(.2,.7,.2,1)';
g._r.setAttribute('height',g._rh);g._r.setAttribute('y',g._ry);
setTimeout(function(){
g._b.style.transition='height .8s cubic-bezier(.2,.7,.2,1),y .8s cubic-bezier(.2,.7,.2,1)';
g._b.setAttribute('height',g._bh);g._b.setAttribute('y',g._by);
},200);
},i*160);});
});
})();
/* RELATED + FAQ */
root.querySelector('#relatedGrid').innerHTML=[
{k:'Scaling',t:'The Founder Bottleneck',d:'Why every decision routes through you in the first place.',u:'https://lonelyentrepreneur.com/founder-bottleneck-2026/'},
{k:'Health',t:'The Founder Sleep Debt',d:'How short sleep quietly degrades the judgment this whole piece depends on.',u:'https://lonelyentrepreneur.com/founder-sleep-debt-2026/'},
{k:'Time',t:'The Founder Time Trap',d:'The daytime crunch that jams 300 decisions into too few hours.',u:'https://lonelyentrepreneur.com/founder-time-trap-2026/'},
{k:'Psychology',t:'The Founder Impostor Trap',d:'Why the fear of being wrong makes every decision heavier than it should be.',u:'https://lonelyentrepreneur.com/founder-impostor-syndrome-2026/'}
].map(function(r){return '
'+r.k+''+r.t+'
'+r.d+'
';}).join('');
root.querySelector('#tFaq').innerHTML=[
['What is decision fatigue?','Decision fatigue is the measurable decline in the quality of your decisions after a long run of decision-making. It draws on the same finite pool of mental energy used for self-control and judgment, so the more choices you make, the worse the later ones get \u2014 and it happens silently, without any felt warning.'],
['How many decisions does a founder make in a day?','Practitioner estimates put it at 300+ business decisions a day, spread across every domain \u2014 legal, financial, operational, cultural, product, commercial \u2014 versus roughly 50 for a corporate manager working inside a single domain. Adults overall make an estimated 35,000 remotely conscious decisions daily, most of which we\u2019re not even aware of.'],
['Why is decision quality worse in the afternoon?','Because your cognitive reservoir depletes as the day goes on. Studies of judges, doctors, and chess players all show the same pattern: morning decisions are slower but more accurate, afternoon decisions faster but worse, with the brain defaulting to shortcuts. Founder research puts the total quality drop at up to 40%, steepest on complex, high-stakes calls.'],
['Why do founders burn out cognitively faster than others?','It\u2019s the cross-domain switching. Neuroscience shows that jumping between different types of demanding tasks \u2014 finance, then people, then product \u2014 depletes resources faster than sustained work in one lane, and it can take ~23 minutes to fully refocus after each switch. The founder\u2019s day is built around exactly this maximally costly pattern.'],
['How do you fix decision fatigue?','Design around it rather than trying to power through. Protect your mornings for irreversible, high-stakes calls; make reversible, low-stakes ones fast; delegate or default the rest; batch decisions by domain to stop paying the context-switching tax; eliminate trivial recurring choices with defaults and automation; and protect sleep. New routines take a median of ~66 days to feel automatic, so guard the blocks until they hold.']
].map(function(f){return '
'+f[0]+'
'+f[1]+'
';}).join('');
})();