Heat olive oil in a large skillet over medium heat. Add minced garlic and diced onion, cooking until fragrant and softened, about 3-4 minutes. The garlic should turn light golden, not brown, because burnt garlic tastes bitter and ruins the whole thing. I learned that the hard way years ago.
Stir in the fresh spinach, cooking until completely wilted and any excess moisture evaporates, roughly 2-3 minutes. You'll notice the spinach shrinks down significantly—that's exactly what you want. Most people don't cook it long enough, which leaves water in the dip and makes it watery instead of luxurious.
Add the chopped artichoke hearts to the skillet and cook for another 2 minutes, stirring constantly. This warms them through and helps them integrate with the spinach and garlic. The reason we warm the artichokes first is because cold artichokes won't meld as smoothly into the cream cheese base.
Remove from heat and stir in the softened cream cheese, sour cream, mozzarella, and Parmesan until completely combined. Use a wooden spoon and be patient here—cream cheese needs 2-3 minutes to fully incorporate. I usually count to 180 in my head while stirring because rushing this step leaves lumps.
Add lemon juice, salt, and black pepper, stirring well. Taste the mixture before baking—this is your chance to adjust seasonings. I honestly taste it three times because the flavors shift once it bakes.
Transfer the mixture to a baking dish. Bake uncovered at 375°F for 25-30 minutes until the top turns golden and the edges start to bubble. You'll know it's ready when you see small bubbles breaking the surface around the edges.