import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.jsx';
import './styles/theme.css'; // global variables, fonts, resets — imported ONCE here

const bootstrapRedirect = () => {
  const params = new URLSearchParams(window.location.search);
  const redirect = params.get('redirect');

  if (!redirect) return;

  if (!redirect.startsWith('/')) return;

  window.history.replaceState({}, '', redirect);
};

bootstrapRedirect();

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