/* ============================================================
   APP — composes the full page + scroll-reveal observer
   ============================================================ */

function useScrollReveal(){
  React.useEffect(()=>{
    const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    const els = document.querySelectorAll('.reveal:not(.in)');
    if (reduce){ els.forEach(e=> e.classList.add('in')); return; }
    const io = new IntersectionObserver((entries)=>{
      entries.forEach(en=>{
        if (en.isIntersecting){
          en.target.classList.add('in');
          io.unobserve(en.target);
        }
      });
    }, { rootMargin: '0px 0px -10% 0px', threshold: 0.05 });
    els.forEach(el=> io.observe(el));
    return ()=> io.disconnect();
  });
}

function App(){
  useScrollReveal();
  return (
    <>
      <Nav/>
      <main>
        <Hero/>
        <ValueStrip/>
        <FeaturePillars/>
        <Industries/>
        <DemoStrip/>
        <Climate/>
        <BlogTeaser/>
        <NewsletterBand/>
      </main>
      <Footer/>
    </>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<App/>);
