Sugar Free Summer Escape Set
(function(){function init(){var root=document.querySelector('.syl');if(!root)return;var targets=[7,0.30,210,50,0,0,50,3,2,100,30];var counts=root.querySelectorAll('.count');counts.forEach(function(el,i){var t=targets[i];if(t===undefined)return;el.setAttribute('data-count-to',t);el.textContent='0';});function animate(el){var to=parseFloat(el.getAttribute('data-count-to'))||0;var dec=(to%1!==0);var dur=1200,start=performance.now();function step(now){var p=Math.min(1,(now-start)/dur);var e=1-Math.pow(1-p,3);var v=to*e;el.textContent=dec?v.toFixed(2):Math.round(v);if(p<1)requestAnimationFrame(step);else el.textContent=dec?to.toFixed(2):String(to);}requestAnimationFrame(step);}var seen=new WeakSet();var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(!e.isIntersecting)return;var el=e.target;if(seen.has(el))return;seen.add(el);el.classList.add('is-in');el.querySelectorAll('.count[data-count-to]').forEach(animate);if(el.matches&&el.matches('.count[data-count-to]'))animate(el);io.unobserve(el);});},{threshold:0.18});root.querySelectorAll('.reveal').forEach(function(el){io.observe(el);});root.querySelectorAll('.count[data-count-to]').forEach(function(el){if(!el.closest('.reveal'))io.observe(el);});root.querySelectorAll('a[href^="#"]').forEach(function(a){a.addEventListener('click',function(ev){var id=a.getAttribute('href').slice(1);var t=document.getElementById(id);if(t){ev.preventDefault();window.scrollTo({top:t.offsetTop-80,behavior:'smooth'});}});});}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();})();




