I recommend making the custard the day before you assemble the bougatsa and refrigerating it overnight. This gives the flavours a chance to intensify and makes it easy to split the prep over two days. While the filo is thawing, bring the custard to room temperature as well.
Make the custard. In a mixing bowl, combine the eggs, sugar and semolina and whisk till well combined. Set aside.
In a sturdy pot or saucepan, combine the milk and vanilla and heat on medium-low, stirring often, until hot but not boiling, 4 to 5 minutes. Turn off the heat. Pour 1/3rd cup of the hot milk slowly into the egg mixture, whisking as you go. This tempers the eggs so they warm up slowly and don't scramble when added to the rest of the hot milk.
Pour this warm egg mixture back into the same pot with the remaining milk and turn the heat down to low. Whisking continuously, let the custard cook until thick enough to coat the back of a spoon, about 5 minutes. It will go from runny to thick quite suddenly so watch the pot like a hawk and don't stop whisking.
Transfer to a clean bowl (you can pass it through a sieve if you see lumps) and stir in the butter and salt, if using. Mix slowly till the butter has melted and incorporated into the custard, then stir in the orange zest. Cool to room temperature and then refrigerate it overnight. You can use it once it's cooled down as well, but chilling improves flavour.
Assemble the pie. Thaw the filo sheets at room temperature for about 2 hours and during that time, let the chilled custard sit out as well.
Preheat the oven to 175 C. Lightly butter an 8 inch square pan and line it with non-stick baking paper, leaving an overhang for easy removal. The butter will help the paper stick.
Keep the custard, melted butter and a brush next to the pan and then unwrap the filo sheets. They dry out quickly and need to be buttered individually in the pan, so if you're working with filo for the first time, keep the unused sheets covered with a damp kitchen towel so you can go slowly if needed.
Place one sheet of filo in the lined pan. They're usually large enough to spill out of the pan, which is what we want here. Brush liberally with melted butter, then place another one on it and repeat for a total of 5 sheets. See photos below.
Spread the custard over the fifth layer and fold the extra filo around the edges over it. Depending on the size of the filo, it may or may not cover the custard entirely and that's ok.
Now tear the remaining sheets of filo into smaller pieces and scrunch them with your hands, placing them over the custard layer. Brush these with melted butter as well.
Bake for 20 to 25 minutes until the top is a beautiful golden-brown. To get the base to become brown and crisp, I found moving the pan to the lower rack for about 10 minutes was needed. Though the base cooks through on the standard middle rack, the filo remains soft and is harder to slice so moving it closer to the lower roads helps. I found it even more effective to carefully remove the bougatsa from the pan using the paper overhang, placing it directly on the baking tray and then continuing to bake on the lower rack which also gives the sides a chance to crisp up.
Let the bougatsa cool at room temperature for about 15 minutes, then transfer to a cutting board and slice (that crunch is SO satisfying!) into 9 pieces. Dust with powdered sugar and cinnamon before serving, don't skip this. Best eaten with your hands and the filo shards flying everywhere!
Bougatsa is best when freshly baked but you can store leftover pieces in an airtight tin in the fridge for 3 to 4 days and reheat them in the oven to crisp the top up again. Happy baking!