/* Torre Auro — Home (editorial, ecosystem-led, 6 sections) */ /* ─── S1 · HERO ─── */ function S1Hero() { const [showVideo, setShowVideo] = useState(false); const [videoFailed, setVideoFailed] = useState(false); const iframeRef = useRef(null); useEffect(() => { const start = () => { setTimeout(() => setShowVideo(true), 1200); }; if (document.readyState === 'complete') start(); else window.addEventListener('load', start, { once: true }); return () => window.removeEventListener('load', start); }, []); // If the iframe never fires its load event within 8s, treat as failed useEffect(() => { if (!showVideo || videoFailed) return; const t = setTimeout(() => { const ifr = iframeRef.current; if (!ifr || !ifr.dataset.loaded) setVideoFailed(true); }, 8000); return () => clearTimeout(t); }, [showVideo, videoFailed]); function handleVideoLoad(e) { e.target.dataset.loaded = '1'; } function handleVideoError() { setVideoFailed(true); } return (
{showVideo && !videoFailed && (