My CSS art broke when I resized the browser, here is what fixed it
I was making this little pixel-style sunset scene with box shadows and gradients, all in one div. It looked perfect at full screen on my monitor, but when I shrank the browser down to preview it on mobile, the whole thing collapsed into a mess of overlapping rectangles. The sun ended up behind the mountains and the gradient banding went crazy. I spent about 45 minutes in my kitchen, coffee going cold, tweaking clamp() and vw units piece by piece. The key was switching from fixed pixel sizes to percentage-based positioning for the main layers, then using min() for the shadow spread. Now it holds up from 320px all the way to 2560px, which feels like a small victory. Has anyone else had a layout that breaks specifically when the viewport hits a certain width, like 768px or something weird like that?