// Recreated product mockups in pure HTML/CSS — these stand in for the real product screenshots // Scale-to-fit wrapper: locks children to a design width and CSS-scales them // proportionally to the container. Avoids reflow + preserves visual fidelity. const MockupFit = ({ designWidth = 880, mobileMaxWidth = 720, children }) => { const wrapRef = React.useRef(null); const innerRef = React.useRef(null); const [scale, setScale] = React.useState(1); const [innerH, setInnerH] = React.useState(null); React.useEffect(() => { const update = () => { const w = wrapRef.current?.clientWidth ?? designWidth; // only scale below threshold; above, render at natural width if (w >= mobileMaxWidth) { setScale(1); setInnerH(null); return; } const s = w / designWidth; setScale(s); const ih = innerRef.current?.scrollHeight ?? 0; setInnerH(ih * s); }; update(); const ro = new ResizeObserver(update); if (wrapRef.current) ro.observe(wrapRef.current); if (innerRef.current) ro.observe(innerRef.current); window.addEventListener('resize', update); return () => { ro.disconnect(); window.removeEventListener('resize', update); }; }, [designWidth, mobileMaxWidth]); return (