// Resident Portal — homepage app shell. Hero handles the dog-license conversation inline;
// suggestion chips on the home page (and the "Register a dog" tile) hand off via initialQuery.

function PortalHome() {
  const t = window.tokens;
  const [initialQuery, setInitialQuery] = React.useState('');

  const handleAsk = (q) => {
    setInitialQuery(q);
    window.scrollTo({ top: 0, behavior: 'smooth' });
  };

  return (
    <div style={{ background: t.color.bg, minHeight: '100vh', color: t.color.text, fontFamily: t.font.sans }}>
      {/* Top header lives as static HTML in Resident Portal - Home.html (above #root)
          so it renders instantly on load and is byte-identical to the static header
          on Resident Portal - Apply.html. Browser repaints it in place across the
          navigation — no blank flash, no re-mount. Don't render <PortalHeader/> here. */}
      <PortalHero initialQuery={initialQuery} />
      <PortalPopularServices onAsk={handleAsk} />
      <PortalFooter />
    </div>
  );
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<PortalHome />);
