01 - Whisk together flour, cocoa powder, powdered sugar, and salt in a large bowl. Cut in cold butter until mixture resembles coarse crumbs. Add egg yolk and 2 tbsp cold water, mixing until dough just comes together. Add an extra tablespoon of water if needed. Shape into a disc, wrap in plastic, and refrigerate for 30 minutes.
02 - Preheat oven to 350°F. Roll out dough on a lightly floured surface to fit a 9-inch tart pan. Press into pan, trim edges, and prick base with a fork. Line with parchment and fill with pie weights or dried beans. Bake for 15 minutes. Remove weights and bake for 8-10 minutes more until firm. Cool completely.
03 - Heat milk in a saucepan until just simmering. Whisk egg yolks, sugar, and cornstarch in a bowl until pale and smooth. Slowly pour hot milk into yolk mixture, whisking constantly. Return to saucepan and cook over medium heat, whisking until thick and bubbling for 2-3 minutes. Remove from heat and stir in vanilla and butter until smooth. Transfer to a bowl, cover with plastic wrap directly on surface, and refrigerate until cold.
04 - Spread cooled pastry cream evenly in tart shell. Arrange raspberries on top in concentric circles. If desired, gently melt jam and brush over raspberries for a glossy finish. Drizzle with melted dark chocolate if using.
05 - Refrigerate tart for at least 30 minutes before slicing. Serve chilled.