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 tablespoons cold water; mix until dough just comes together, adding extra water if needed. Shape into a disc, wrap in plastic, and chill for 30 minutes.
02 - Preheat oven to 350°F. Roll out dough on 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. 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 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; stir in vanilla and butter until smooth. Transfer to bowl, cover with plastic wrap directly on surface, and chill until cold.
04 - Spread cooled pastry cream evenly in tart shell. Arrange raspberries on top in concentric circles. If desired, melt jam gently and brush over raspberries for glossy finish. Drizzle with melted dark chocolate if using.
05 - Chill tart for at least 30 minutes before slicing. Serve chilled.