/* global React, ReactDOM, Nav, Hero, WhoWeAre, Mission, Ecosystem, Journey, Future,
   Research, Agora, Careers, GlobalImpact, Manifesto, FinalCTA, Footer,
   MoiraDemo, StatBand, Team, Publications, Marquee,
   ScrollProgress, Roadmap, Matrix, FAQ, Newsletter,
   useTweaks, TweaksPanel, TweakSection, TweakSlider, TweakRadio, TweakColor, TweakToggle */
const { useEffect:useEffectApp } = React;

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "accent": ["#D4AF37","#C9A227","#A8821B","#E7D49B"],
  "motion": 1,
  "headingFont": "Cinzel",
  "particles": true
}/*EDITMODE-END*/;

const ACCENTS = [
  ["#D4AF37","#C9A227","#A8821B","#E7D49B"], // classic gold
  ["#E3C16F","#CBA24A","#9C7C2E","#F0DEA6"], // champagne
  ["#C9A07A","#B5835A","#8A613B","#E4CBAE"], // rose bronze
  ["#BFC3C9","#9AA0A8","#6E747C","#DDE0E4"], // platinum
];

function App(){
  const [t,setTweak]=useTweaks(TWEAK_DEFAULTS);
  useEffectApp(()=>{
    const r=document.documentElement.style;
    const a=t.accent||ACCENTS[0];
    r.setProperty('--gold-bright',a[0]);
    r.setProperty('--gold',a[1]);
    r.setProperty('--gold-deep',a[2]);
    r.setProperty('--gold-pale',a[3]);
    r.setProperty('--motion',String(t.motion));
    const headStacks={ 'Cinzel':"'Cinzel', 'Playfair Display', serif", 'Playfair Display':"'Playfair Display', serif", 'Cormorant':"'Cormorant Garamond', serif" };
    r.setProperty('--display', headStacks[t.headingFont] || headStacks['Cinzel']);
    document.body.classList.toggle('no-particles', !t.particles);
  },[t]);

  return React.createElement(React.Fragment,null,
    React.createElement(Nav,null),
    React.createElement('main',null,
      React.createElement(Hero,null),
      React.createElement(WhoWeAre,null),
      React.createElement(StatBand,null),
      React.createElement(Mission,null),
      React.createElement(Ecosystem,null),
      React.createElement(MoiraDemo,null),
      React.createElement(Journey,null),
      React.createElement(Future,null),
      React.createElement(Research,null),
      React.createElement(Agora,null),
      React.createElement(Publications,null),
      React.createElement(Roadmap,null),
      React.createElement(Matrix,null),
      React.createElement(window.HomeExchange),
      React.createElement(Team,null),
      React.createElement(Marquee,null),
      React.createElement(FAQ,null),
      React.createElement(Careers,null),
      React.createElement(GlobalImpact,null),
      React.createElement(Newsletter,null),
      React.createElement(Manifesto,null),
      React.createElement(FinalCTA,null)
    ),
    React.createElement(Footer,null),
    React.createElement(ScrollProgress,null),
    React.createElement(TweaksPanel,null,
      React.createElement(TweakSection,{label:'Accent'}),
      React.createElement(TweakColor,{label:'Metal',value:t.accent,options:ACCENTS,
        onChange:v=>setTweak('accent',v)}),
      React.createElement(TweakSection,{label:'Motion'}),
      React.createElement(TweakSlider,{label:'Intensity',value:t.motion,min:0,max:1.4,step:0.1,
        onChange:v=>setTweak('motion',v)}),
      React.createElement(TweakToggle,{label:'Floating particles',value:t.particles,
        onChange:v=>setTweak('particles',v)}),
      React.createElement(TweakSection,{label:'Typography'}),
      React.createElement(TweakRadio,{label:'Headings',value:t.headingFont,
        options:['Cinzel','Playfair Display','Cormorant'],onChange:v=>setTweak('headingFont',v)})
    )
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(React.createElement(App));

// dismiss splash
window.addEventListener('load',()=>{ setTimeout(()=>{ const s=document.getElementById('splash'); if(s)s.classList.add('gone'); },350); });
setTimeout(()=>{ const s=document.getElementById('splash'); if(s)s.classList.add('gone'); },2200);
