/* ─── Sterna landing — root app ─── */

const HEADLINE = {
  h: 'Reconcile what should <em>already</em> match.',
  l: 'Sterna is a focused suite of tools for the office of the CFO. Start with Nexus — automated intercompany matching and bank-vs-ledger reconciliation, with mismatches explained line by line.',
};

const SUITE_TOOLS = [
  { name: 'Nexus',   live: true,  status: 'Available · Trial', statusClass: 'available',
    desc: 'Intercompany matching and statement reconciliation. Multi-entity, multi-currency, with field-mapping memory.', eta: 'Released' },
  { name: 'Atlas',   live: false, status: 'In preparation', statusClass: 'preparation',
    desc: 'Group consolidation companion — automate elimination entries from Nexus matches and roll them up across the chart of accounts.', eta: 'ETA · Q4 2026' },
  { name: 'Echo',    live: false, status: 'In preparation', statusClass: 'preparation',
    desc: 'Variance analysis and commentary drafting. Highlights what moved, by how much, and why — straight into your board pack.', eta: 'ETA · Q1 2027' },
  { name: 'Compass', live: false, status: 'Exploring', statusClass: 'exploring',
    desc: 'Full textual disclosure of financial results with linked tables and charts in Word, PowerPoint, PDF or HTML format. iXBRL tagging also supported.', eta: 'Concept' },
];

function App() {
  const [openModal, setOpenModal] = React.useState(null);
  const [toast, setToast]         = React.useState('');

  const showToast = (msg) => { setToast(msg); setTimeout(() => setToast(''), 3500); };

  return (
    <React.Fragment>
      <TrialBanner />
      <Nav
        onSignIn={() => setOpenModal('signin')}
        onRegister={() => setOpenModal('register')}
      />
      <Hero
        headline={HEADLINE.h}
        lede={HEADLINE.l}
        onRegister={() => setOpenModal('register')}
      />
      <Product />
      <HowItWorks />
      <Suite tools={SUITE_TOOLS} onSignIn={() => setOpenModal('signin')} />
      <FeedbackSection onSubmit={showToast} />
      <Footer onSignIn={() => setOpenModal('signin')} onRegister={() => setOpenModal('register')} />

      {openModal === 'signin' && (
        <SignInModal onClose={() => setOpenModal(null)} onSwap={() => setOpenModal('register')} />
      )}
      {openModal === 'register' && (
        <RegisterModal onClose={() => setOpenModal(null)} onSwap={() => setOpenModal('signin')} />
      )}

      <Toast message={toast} />
    </React.Fragment>
  );
}

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