For the custard, gently heat the milk, cream, vanilla pods and vanilla seeds in a saucepan.
In a bowl, whisk the sugar and egg yolks until pale and creamy.
When the milk mixture is just about to boil, pour it onto the egg mixture, whisking continuously until all of the liquid has been incorporated. Return the mixture to the pan and cook over a low heat, whisking all the time, until the custard has thickened enough to coat the back of a wooden spoon.
Strain the custard into a bowl and set aside to cool. Once cool, chill in the fridge for at least an hour.
Meanwhile, for the pistachio sponge, preheat the oven to 200C/180C Fan/Gas 6. Grease a 23cm/9in springform cake tin with a little melted butter, dust the insides with flour, then line the base with a circle of baking parchment.
Whisk the eggs and sugar in a large bowl for 4-5 minutes, or until pale, thick and creamy. Whisk in the pistachio paste and mix for a further minute, until completely incorporated.
Quickly but carefully, fold the flour and melted butter into the mixture. Pour the cake batter into the prepated tin and bake for 20-25 minutes, or until golden-brown and cooked through. (The cake is cooked through when a skewer inserted into the centre comes out clean.) Allow to cool in the tin for 10 minutes, then turn out onto a wire rack and set aside until competely cool.
Meanwhile, in a food processor, blend 300g/10½oz of the raspberries to a purée with two tablespoons of cold water. Set aside.
Toast the flaked almonds for a few seconds in a small, dry frying pan set over a medium heat. When they start to brown, tip them onto a plate to stop them from cooking further.
Whip the cream with the icing sugar until soft peaks form when the whisk is removed.
Cut the cooled pistachio cake into 2cm/1in-thick slices.
To assemble the trifle, arrange a layer of sponge pieces in the bottom of a large glass serving bowl. Drizzle over a little kirsch, then spread over some of the raspberry purée and sprinkle a handful of raspberries on top. Pour over a little of the cold custard. Repeat the layering process until all of the ingredients have been used up.
To finish, top the trifle with the whipped cream and sprinkle over the extra raspberries, the flaked almonds and the chopped pistachios. Serve immediately, or chill until ready to serve.