To make the pastry, sift the flour, icing sugar and cocoa powder together in a bowl. Add the butter and rub together with your fingers until it matches the consistency of breadcrumbs. Add the egg yolks and mix with your fingers until it forms a soft paste. You may need to add a little iced water. You can do this in a food processor, pulsing the ingredients together if you prefer. Wrap the pastry in cling film and put in the fridge for at least 1 hr to rest. Can be made 2 days ahead.
Take the pastry from the fridge and roll out on a lightly floured surface, to the thickness of a £1 coin. Use it to line a 23cm loose-based tart tin, making sure you work the pastry right into the crease and have it slightly overlapping the rim. Chill the pastry for 1 hr more.
Heat oven to 190C/170C fan/gas 5. Line the chilled tart base with baking parchment, then fill with baking beans or rice and bake for 20 mins. Remove the pastry from the oven, take out the baking beans and parchment, and cook for a further 15-20 mins or until the base is crisp. Leave to cool.
Once cooled, use a sharp knife to trim the excess pastry to leave a smooth edge. Spread the caramel over the base of the tart and place the whole thing in the freezer for at least 1 hr. Can be prepared to this stage up to 1 week ahead.
The next day, heat oven to 140C/120C fan/ gas 1. To make the chocolate filling, melt the chocolate in a bowl set over a pan of simmering water until just melted and set aside. In a separate pan, bring the milk and cream to the boil, stirring to make sure it doesn’t burn at the bottom. In a large bowl, whisk the eggs until frothy, then pour the hot cream onto the eggs while whisking. Pass this mixture through a sieve onto the melted chocolate and mix fairly quickly.
Take the tart out of the freezer and pour the chocolate custard on top of the caramel. Bake in the oven for 20-25 mins until there is only a slight wobble. Remove from the oven and leave to cool for at least 2 hrs, or chill in the fridge for 1 hr before slicing. Can be done the day before.
Meanwhile, make your frosted pistachios. Put the sugar and 30ml water in a pan, bring to the boil, then reduce by half – but don’t let it caramelise. Add the nuts and stir to crystallise the sugar. Tip onto a sheet of baking parchment and leave to cool.
To make the rum cream, put the cream and sugar in a large bowl and whisk to soft peaks, then pour in the rum and whisk until firm. Place in the fridge to chill.
When you’re ready to serve, crush the frosted nuts roughly with a pestle and mortar, then scatter over the top. Add neat spoonfuls or quenelles of the cream on top, then coat the tart in a layer of finely grated chocolate, and serve.