First, make the pastry by mixing the dry ingredients (flour, sugar and salt) in a food processor then add the butter and pulse until you get a fine breadcrumb texture. Add the egg yolks, pulse again to mix and bring together in a ball. Wrap in plastic wrap/cling film and refrigerate for 30 minutes - this helps to avoid the pastry shrinking when you bake it.
While the pastry is cooling, make the filling by melting the butter in a small pan until just starting to smell nutty and light brown in color. Remove form the heat and melt the chocolate with the residual heat from the pan and allow to cool slightly.
In a small bowl, mix the almond flour, sugar, cardamon, egg and vanilla. Add the butter-chocolate mixture and mix well.
Once pastry has cooled, preheat the oven to 375F/190C.
Roll out the pastry to around ⅛in/2-3mm thick and line 4 small tart moulds. Blind bake the pastry (by lining with parchment paper and filling with baking beans) for 15mins until starting to dry. Remove the parchment paper and beans, allow the pastry to cool slightly then put some of the filling in each and spread carefully across the bottom. Press some raspberries, open side down into the filling (as many as you like, but around 8 per tart) then bake for around 30 minutes until the filling looks like it is fairly dry and feels springy-firm rather than soft. Serve warm or cold.
NB I used 2 ¾in tart moulds for this and the mixture was enough for 4 of these individual tartlets with a little spare pastry.