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 additional water if needed. Shape into a disc, wrap in plastic, and refrigerate for 30 minutes.
02 - Preheat oven to 350°F. Roll dough on lightly floured surface to fit a 9-inch tart pan. Press into pan, trim edges, and prick base with fork. Line with parchment and fill with pie weights. Bake for 15 minutes, remove weights, and bake 8-10 minutes more until firm. Cool completely.
03 - Heat milk in saucepan until just simmering. Whisk egg yolks, sugar, and cornstarch until pale and smooth. Slowly pour hot milk into yolk mixture while 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 directly on surface, and refrigerate until cold.
04 - Spread cooled pastry cream evenly in tart shell. Arrange raspberries in concentric circles on top. Gently melt jam and brush over raspberries for glossy finish if desired. Drizzle with melted dark chocolate if using.
05 - Refrigerate assembled tart for at least 30 minutes before slicing. Serve chilled.