/* ============================================================
   SplineScene — static-site compatible version of the shadcn
   /components/ui/splite.tsx component.

   This project is React + Babel over CDN, not TypeScript/shadcn,
   so we use the official <spline-viewer> web component instead of
   importing @splinetool/react-spline from a bundler.
   ============================================================ */
function SplineScene({ scene, className = '', style = {}, viewerStyle = {} }) {
  return (
    <div className={`spline-scene ${className}`} style={{ position: 'relative', width: '100%', height: '100%', ...style }}>
      <div className="spline-loader" aria-hidden="true">
        <span className="loader"></span>
      </div>
      {React.createElement('spline-viewer', {
        url: scene,
        loading: 'eager',
        // Viewer export supports full-window interactions when the scene uses
        // Spline global mouse events. The parallax wrapper in Hero also reacts
        // to page-level pointer movement for a stronger landing-page feel.
        'events-target': 'global',
        logo: 'false',
        style: { width: '100%', height: '100%', display: 'block', ...viewerStyle },
        'aria-label': 'Interactive 3D Tayhami Labs robot scene',
      })}
    </div>
  );
}

Object.assign(window, { SplineScene });
