/* Main app composition + tweaks panel */

const HERO_COPY = [
  {
    label: "Advised → Shipped",
    headline:
      'AI systems — <em>advised</em>, written, shipped.<span class="accent-mark"></span>',
    sub: "ROZUMCODE is an AI engineering firm. Our practice covers strategic advisory, software development, and embedded systems for companies, SMEs, and regulated enterprises across the EU and UK.",
  },
  {
    label: "Advise · Plan · Execute",
    headline:
      'We advise.<br/>We <em>plan</em>.<br/>We execute.<span class="accent-mark"></span>',
    sub: "Advisory, software development, AI engineering, integration, and operational support are delivered by a single accountable team. Compliance with ISO/IEC 42001 and the EU AI Act is built into the engagement model from the outset.",
  },
  {
    label: "Full market",
    headline:
      'AI solutions for the<br/><em>full market</em>.<span class="accent-mark"></span>',
    sub: "ROZUMCODE serves companies, SMEs, and regulated enterprises. We develop custom software, agentic systems, and embedded hardware, and integrate them with the systems already in place.",
  },
  {
    label: "Strategy + Code + Hardware",
    headline:
      'Strategy. <em>Code</em>. Hardware.<br/>One delivery team.<span class="accent-mark"></span>',
    sub: "Reference architectures, custom software, agentic AI, and embedded hardware including ESP32 and FPGA prototypes. The team that designs the system is the team that deploys it. Compliance documentation is produced during the build, not after.",
  },
];

const ACCENTS = {
  red: "#ff3b00",
  green: "#00b864",
  yellow: "#ffcc00",
  blue: "#0066ff",
  ink: "#0a0a0a",
  rust: "#a04515",
  magenta: "#d4145a",
  cyan: "#00b8c4",
  violet: "#6633ff",
  amber: "#ff8800",
};

const TYPE_PAIRS = {
  archivo: {
    label: "Archivo + Inter + JetBrains Mono",
    display: '"Archivo", "Helvetica Neue", system-ui, sans-serif',
    body: '"Inter", "Helvetica Neue", system-ui, sans-serif',
    mono: '"JetBrains Mono", ui-monospace, monospace',
  },
  spaceGrotesk: {
    label: "Space Grotesk + Inter + IBM Plex Mono",
    display: '"Space Grotesk", "Helvetica Neue", system-ui, sans-serif',
    body: '"Inter", "Helvetica Neue", system-ui, sans-serif',
    mono: '"IBM Plex Mono", ui-monospace, monospace',
  },
  anton: {
    label: "Anton + Inter Tight + JetBrains Mono",
    display: '"Anton", "Helvetica Neue", system-ui, sans-serif',
    body: '"Inter Tight", "Inter", system-ui, sans-serif',
    mono: '"JetBrains Mono", ui-monospace, monospace',
  },
};

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "accent": "amber",
  "heroCopy": 0,
  "meshVariant": "brain",
  "meshIntensity": 0.6,
  "typePair": "archivo"
}/*EDITMODE-END*/;

function App() {
  // Values are locked — no tweak panel exposed
  const t = TWEAK_DEFAULTS;

  // Apply accent CSS var live
  React.useEffect(() => {
    document.documentElement.style.setProperty("--acc", ACCENTS[t.accent] || ACCENTS.red);
  }, [t.accent]);

  // Apply type pair
  React.useEffect(() => {
    const pair = TYPE_PAIRS[t.typePair] || TYPE_PAIRS.archivo;
    const r = document.documentElement.style;
    r.setProperty("--ff-display", pair.display);
    r.setProperty("--ff-body", pair.body);
    r.setProperty("--ff-mono", pair.mono);
  }, [t.typePair]);

  // Apply mesh variant + intensity
  React.useEffect(() => {
    const tryApply = () => {
      const m = window.__rozumMesh && window.__rozumMesh.instance;
      if (m) {
        m.setVariant(t.meshVariant);
        m.setIntensity(t.meshIntensity);
      } else {
        setTimeout(tryApply, 150);
      }
    };
    tryApply();
  }, [t.meshVariant, t.meshIntensity]);

  const copy = HERO_COPY[t.heroCopy] || HERO_COPY[0];

  return (
    <>
      <Nav />
      <Hero headline={copy.headline} sub={copy.sub} />
      <Services />
      <Privacy />
      <Methodology />
      <Industries />
      <Compliance />
      <TechStack />
      <NumbersBand />
      <Contact />
      <Footer />
    </>
  );
}

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