Preheat oven to 350°F (175°C). Grease and line two 8-inch round cake pans with parchment paper.
Grind pistachios in a food processor to a fine meal (like almond flour). Do not overprocess into a paste.
In a bowl, whisk ground pistachios with flour, baking powder, and salt.
In a large bowl, beat eggs and granulated sugar until pale, thick, and ribbony (about 3–4 minutes). Mix in melted butter and vanilla just until combined.
Fold dry ingredients into the egg mixture in two additions. If using food coloring, add a drop or two now.
Divide batter evenly between pans and smooth tops. Bake 22–25 minutes, until a toothpick inserted in the center comes out clean. Cool 10 minutes in pans, then turn out onto wire racks to cool completely.
For the raspberry filling: In a small saucepan over medium heat, combine raspberries, 1/2 cup sugar, and lemon juice. Cook, stirring, until berries break down. Stir in cornstarch slurry and simmer 1–2 minutes until thick and glossy. Cool completely; refrigerate to set.
For the cream cheese frosting: Beat cream cheese and 1/2 cup softened butter until smooth and fluffy. Gradually add powdered sugar, then beat in vanilla until light and spreadable.
Assemble: Place one cake layer on a serving plate. Pipe or spread a thin frosting ring around the edge to create a dam. Spread a generous layer of raspberry filling inside the ring, then a thin swipe of frosting on top.
Top with the second cake layer. Apply a thin crumb coat of frosting over the cake and chill 20–30 minutes.
Finish with a final coat of frosting. Decorate with chopped pistachios, fresh raspberries, and optional white chocolate shavings or gold leaf.
Chill until ready to serve. For clean slices, warm and wipe the knife between cuts.