Heat olive oil in a large skillet over medium heat. Add the onion and cook until soft and lightly golden, then stir in the garlic for extra aroma. Add chopped spinach gradually and cook until wilted, then let the mixture cool slightly so the filling stays creamy instead of watery.
In a large bowl, combine feta cheese, ricotta, eggs, dill, parsley, black pepper, salt, and nutmeg. Stir everything together until smooth and evenly mixed. Fold the cooled spinach mixture into the cheese mixture so every bite gets balanced flavor.
Carefully unroll the phyllo dough and cover it with a lightly damp towel to prevent drying out. Brush the baking dish with melted butter before placing the first sheet inside. Continue layering several sheets while brushing butter between each layer for a flaky texture.
Spread the spinach and cheese mixture evenly over the prepared phyllo base. Use a spatula to smooth the surface so the pie bakes evenly throughout. Make sure the filling reaches the corners for full flavor in every slice.
Layer the remaining phyllo sheets over the filling one at a time, brushing melted butter between each sheet. Tuck the edges inward neatly to keep the filling secure while baking. Lightly score the top with a knife to make slicing easier after baking.
Bake the pie in a preheated 375°F oven for about 40–45 minutes. The top should become deeply golden and crisp while the filling sets completely. Allow the pie to cool for at least 10 minutes before slicing to help the layers stay intact.