// Main app — assembles sections + reveal-on-scroll

const App = () => {
  useParallax();
  React.useEffect(() => {
    const io = new IntersectionObserver((entries) => {
      entries.forEach(e => {
        if (e.isIntersecting) {
          e.target.classList.add('in');
          io.unobserve(e.target);
        }
      });
    }, { threshold: 0.12 });
    document.querySelectorAll('.section, .preboda, .gift, .footer').forEach(el => {
      el.classList.add('reveal');
      io.observe(el);
    });
    return () => io.disconnect();
  }, []);

  return (
    <>
      <Nav />
      <Hero />
      <Story />
      <Preboda />
      <Venue />
      <Timeline />
      <Buses />
      <Hospedaje />
      <Regalo />
      <RSVP />
      <Footer />
      <Tweaks />
    </>
  );
};

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