t.bottom)return;if(!e.deltaY)return;const s=1===e.deltaMode?16:2===e.deltaMode?n.clientHeight:1;e.preventDefault(),n.scrollTop+=e.deltaY*s},{passive:!1}),requestAnimationFrame(()=>{n.scrollTop=M(),E(0,!1)}),a(i,()=>i.classList.add("in"),.25)}(),function(){const n=String(o().teamTitle||"Us.").replace(/\.$/,"");e("#teamTitle").innerHTML=t(n)+'.';const s=o().teamColors||{},i=e("#teamSec").style;i.setProperty("--tm-body",s.body||"#fff"),i.setProperty("--tm-name",s.name||"var(--champagne)"),i.setProperty("--tm-role",s.role||"var(--gold)");const r=e("#teamRow"),l=e("#teamBio"),c=e("#teamDots"),d=e("#teamSec");r.innerHTML="",c.innerHTML="";let u=-1,p=null,h=!1,m=!1,v=null,f=null;function g(e){[...r.children].forEach((t,n)=>{t.classList.toggle("lit",n===e),t.classList.toggle("dim",e>=0&&n!==e)}),[...c.children].forEach((t,n)=>t.classList.toggle("on",n===e))}function y(e){const n=o().team[e];if(!n)return;const s=("“"+n.quote+"”").split(" ").map((e,n)=>''+t(e)+"").join(" ");l.innerHTML=''+s+'
'+t(String(n.name).replace(/\./g,""))+'. — '+t(n.role)+"
"}function L(e){u=e,g(e),y(e),l.offsetWidth,l.classList.add("show")}function w(e){clearTimeout(p),clearTimeout(f),g(e);const t=[...l.querySelectorAll(".bio-quote span")];if(t.length&&l.classList.contains("show")){t.forEach((e,n)=>{e.style.transitionDelay=.0125*(t.length-1-n)+"s",e.style.transitionDuration=".22s",e.style.transitionTimingFunction="cubic-bezier(.33,0,.2,1)"}),l.classList.remove("show");const n=12.5*(t.length-1)+220+200;f=setTimeout(()=>{L(e),b(e)},n)}else L(e),b(e)}function b(e){clearTimeout(p),m||(p=setTimeout(()=>w((e+1)%o().team.length),1e4))}(o().team||[]).forEach((e,n)=>{const s=document.createElement("div");s.className="team-card",s.style.transitionDelay=.15*n+"s",a(s,()=>setTimeout(()=>s.style.transitionDelay="",900)),s.innerHTML=''+t(String(e.name).replace(/\./g,""))+'.
'+t(e.role)+'
“'+t(e.quote)+'”
— '+t(e.role)+"
";const o=()=>{clearTimeout(v),m=!0,clearTimeout(p),n!==u?w(n):(clearTimeout(f),g(n),l.classList.contains("show")||(y(n),l.offsetWidth,l.classList.add("show")))};s.addEventListener("mouseenter",o),s.addEventListener("click",o),s.addEventListener("mouseleave",()=>{s.classList.remove("still"),clearTimeout(s._still),clearTimeout(v),v=setTimeout(()=>{m=!1,b(u)},1e3)}),s.addEventListener("pointermove",()=>{s.classList.remove("still"),clearTimeout(s._still),s._still=setTimeout(()=>s.classList.add("still"),2e3)}),r.appendChild(s);const i=document.createElement("button");i.className="carousel-dot sm",i.addEventListener("click",()=>{clearTimeout(v),m=!1,n!==u?w(n):b(n)}),c.appendChild(i)});const M=()=>{const e=l.offsetWidth;if(!e)return;const n=document.createElement("div");n.className="team-bio show",n.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:-9999px;width:"+e+"px;min-height:0;",d.appendChild(n);let s=0;(o().team||[]).forEach(e=>{n.innerHTML='“'+t(e.quote)+'”
'+t(e.name)+" — "+t(e.role)+"
",s=Math.max(s,n.offsetHeight)}),n.remove(),l.style.minHeight=s+"px"};requestAnimationFrame(M);let E=null;addEventListener("resize",()=>{clearTimeout(E),E=setTimeout(M,150)}),a(d,()=>{d.classList.add("in"),h||(h=!0,w(0))},.3),new IntersectionObserver(e=>{e[0].isIntersecting?h&&u>=0&&(clearTimeout(p),p=setTimeout(()=>w((u+1)%o().team.length),1e4)):clearTimeout(p)},{threshold:.05}).observe(d)}(),A(),H(),function(){const n=o().creed,s=e("#creedSec");if(n&&n.body&&n.body.length){if(s.style.display="",e("#creedBody").innerHTML=n.body.map(e=>""+t(e)+"
").join(""),a(e("#creedHead"),()=>e("#creedHead").classList.add("in"),.6),document.querySelectorAll("#creedBody p").forEach((e,t)=>a(e,()=>setTimeout(()=>e.classList.add("in"),90*t),.3)),matchMedia("(pointer: coarse)").matches){let t=null;e("#creedHead").addEventListener("touchstart",()=>{s.classList.remove("press"),s.offsetWidth,s.classList.add("press"),clearTimeout(t),t=setTimeout(()=>s.classList.remove("press"),2300)},{passive:!0})}}else s.style.display="none"}(),function(){const n=o().begin||{},s=o().footer||{},i=n.email||s.email||"paul@manicsky.com",r=s.phone||"(480) 201-9085",l=e=>String(e).split(/(?=[@ ])/).map(e=>""+t(e)+"").join("");e("#brMail").innerHTML=l(i),e("#brPhone").innerHTML=l(r);const c=(t,n)=>{const s=e(t),a=e(n),o=[...a.querySelectorAll("span")];let i=!1;const r=()=>{o.forEach((e,t)=>e.style.transitionDelay=.05*t+"s"),a.classList.add("on")},l=()=>{o.forEach((e,t)=>e.style.transitionDelay=.05*(o.length-1-t)+"s"),a.classList.remove("on")};return s.addEventListener("mouseenter",()=>{i||r()}),s.addEventListener("mouseleave",()=>{i||l()}),s.addEventListener("click",()=>{s._press?s._press():(i=!i,i?r():l()),s.classList.remove("pop"),s.offsetWidth,s.classList.add("pop")}),{show:()=>{i=!0,r()},hide:()=>{i=!1,l()}}},d=c("#bwMail","#brMail"),u=c("#bwPhone","#brPhone");let p=!1;e("#beginBtn").onclick=()=>{p=!p,p?(d.show(),u.show()):(d.hide(),u.hide())},["mouseenter","focus","click"].forEach(t=>e("#beginBtn").addEventListener(t,()=>e("#beginWays").classList.add("in"))),matchMedia("(pointer: coarse)").matches&&(a(e("#beginSec"),()=>e("#beginWays").classList.add("in"),.05),d.show(),u.show(),e("#bwMail")._press=()=>{R(i),D("email copied.","mailto:"+i,"open mail")},e("#bwPhone")._press=()=>{R(r),D("number copied.","tel:"+r.replace(/[^+0-9]/g,""),"call")})}(),function(){const t=e("#rail");t.innerHTML="";const n=[];let s=-1;function a(e){n.forEach(([,t],n)=>t.classList.toggle("on",n===e))}function o(){if(s>=0)return void a(s);const e=scrollY+innerHeight/2;let t=0,o=1e9;n.forEach(([n],s)=>{if(!n)return;const a=n.getBoundingClientRect(),i=a.top+scrollY+a.height/2,r=Math.abs(i-e);r=document.body.scrollHeight-4&&(t=n.length-1),a(t)}[[null,"home"],["#journeySec","process"],["#teamSec","us"],["#groupHost","portfolio"],["#gallerySec","stills"],["#creedSec","creed"],["#beginSec","begin"]].forEach(([o,i])=>{const r=o?e(o):null;if(o&&!r)return;const l=document.createElement("button");l.type="button",l.innerHTML=''+i+".";const c=n.length,d=e=>{e.preventDefault(),s=c,a(c);let t=0;r&&(t=r.getBoundingClientRect().top+scrollY-Math.round(innerHeight/8),t=Math.max(0,Math.min(t,document.body.scrollHeight-innerHeight))),"begin"===i&&(t=document.body.scrollHeight),W(t)};l.addEventListener("pointerdown",d),l.addEventListener("click",d),t.appendChild(l),n.push([r,l])}),["wheel","touchstart","keydown"].forEach(e=>addEventListener(e,e=>{(!e||"ArrowUp"!==e.key&&"ArrowDown"!==e.key)&&s>=0&&(s=-1,o())},{passive:!0}));const i=e(".frame");let r=null;const l=n=>{if(n&&(t.style.transition="opacity 0.5s cubic-bezier(0.33, 0, 0.2, 1)",clearTimeout(r),r=setTimeout(()=>{t.style.transition="none"},560)),e("#pipBack").classList.contains("open")||e("#csBack").classList.contains("open"))return t.style.opacity="0",void(t.style.pointerEvents="none");const s=document.querySelector("#groupHost.perfopen .stage.open");if(s){const e=s.getBoundingClientRect();if(e.bottom>.25*innerHeight&&e.top<.75*innerHeight)return t.style.opacity="0",void(t.style.pointerEvents="none")}let a=1;if(i){const e=innerHeight/2-(t.offsetHeight||156)/2-8-i.getBoundingClientRect().bottom;a=Math.max(0,Math.min(1,e/150))}a=Math.min(a,Math.max(0,Math.min(1,(scrollY-24)/150))),t.style.opacity=a.toFixed(3),t.style.pointerEvents=a>.05?"auto":"none"};addEventListener("keydown",t=>{if("ArrowUp"!==t.key&&"ArrowDown"!==t.key)return;if(t.repeat)return;if(e("#pipBack").classList.contains("open")||e("#csBack").classList.contains("open")||document.querySelector("#groupHost.perfopen"))return;const s=n.findIndex(([,e])=>e.classList.contains("on"));if(s<0)return;t.preventDefault();const a=Math.max(0,Math.min(n.length-1,s+("ArrowDown"===t.key?1:-1)));a!==s&&n[a][1].dispatchEvent(new Event("pointerdown"))}),addEventListener("scroll",()=>l(!1),{passive:!0}),addEventListener("resize",()=>l(!1)),window.MSRAIL=()=>l(!0),l(!1),addEventListener("scroll",o,{passive:!0}),o()}()},heroGo:E}}();