Heat the oven to 180°C/160°C fan/gas 4. Spread the pistachios over a baking tray and roast for 4 minutes, ensuring they don’t brown. Remove from the oven and cool, then chop finely. Mix with 50g of the sugar; divide into 3 equal amounts. Turn down the oven temperature to 160°C/140°C fan/gas 3.
Put the butter in a small pan and set over a very low heat until melted and the solids have settled at the bottom. Slowly pour the clear butter into a bowl, discarding the cloudy liquid – you should end up with about 200g clarified butter.
Unroll the pastry, piling the sheets in a stack. Lay the tin or dish on the stack and use it as a template to cut out the filo sheets so they’ll fit snugly into the base. You’re aiming to have 28 filo layers, so you may need to slightly overlap and join together some of the larger trimmings to create further layers. Stack the layers on top of each other, cover with a slightly damp tea towel and set aside.
Brush the base and sides of the tin with clarified butter. Put a layer of pastry in the base, then brush with more butter. Repeat until you have 10 pastry layers.
Scatter a third of the sugared pistachios in an even layer over the top, then cover with another 3 layers of buttered filo. Repeat once more, then scatter over the remaining sugared pistachios and cover with the remaining 12 filo layers, buttering between each sheet.
Using a large, very sharp knife, cut the baklava lengthways into 4 or 5 even strips, then across at an angle to make small diamonds. Drizzle over any remaining butter.
Bake the baklava for 1 hour until crisp and golden. Meanwhile, make the syrup. Put the remaining sugar, pared lemon zest and 350ml water in a pan, then stir over a low heat until the sugar has dissolved. Bring to the boil and cook until the syrup reaches 107-108°C on a sugar thermometer. Remove the lemon zest with a slotted spoon, add the lemon juice and set to one side.
As you take the baklava out of the oven, bring the lemon syrup back up to the boil. Increase the oven temperature to 180°C/160°C fan/gas 4. Run a knife along the cuts to make sure the pieces are separate, then pour over the boiling syrup. Return to the oven for 5 minutes.
Remove the baklava from the oven and leave it to cool completely. Run a knife along the cuts again, then use a palette knife to carefully remove the baklava from the tin, one piece at a time.