Ingredients

2cupsall purpose flour

2tbspsugar

½tspsalt

3tbspcocoa

12tbspcold unsalted butter

½tspvanilla extract,optional

1½cupshalf and half

3large egg yolks

¾cupdark brown sugar

1tbspcornstarch

2tbspcocoa powder

1tspsalt

4ozbittersweet chocolate,finely chopped

3tbspunsalted butter

1½tspvanilla extract

¾cupheavy cream

5tsppistachio paste

2tspsugar

1tbsppistachios,finely chopped

chocolate shavings,optional for garnish

Preparation

Stir together flour, sugar, salt, and cocoa in a large bowl. Use a pastry blender or a fork to cut in butter until the mixture resembles coarse meal with pea-size bits of butter throughout. (Or combine dry ingredients in a food processor, then pulse in butter.)

Drizzle in 1 to 2 tablespoons of ice water at a time (up to 6 tablespoons total), tossing after each addition, and using only enough water to make dough clump together when squeezed. Add vanilla (if using).

Pat dough into a 4-inch circle, tightly cover with plastic wrap or parchment, and chill for 30 minutes or up to 2 days (or freeze for up to 3 months).

Preheat oven to 400 degrees F. Cut cold dough into 4 pieces and grate into a 9-inch pie plate using large holes of a box grater; work quickly to keep dough cold.

Press dough into bottom, sides, and along the rim of pan to uniform thickness. Trim excess dough; crimp edges. Chill 20 minutes.

Line shell with parchment paper and fill with rice or pie weights. Bake 10 to 12 minutes; remove rice and paper and bake until crust is cooked through, 8 to 10 more minutes. Cool on a rack.

Whisk half-and-half, yolks, brown sugar, cornstarch, cocoa, and salt in a medium saucepan. Cook over medium-high heat, stirring constantly, until it thickens and bubbles. Cook 1 minute more; remove from heat.

Stir in bittersweet chocolate, butter, and vanilla. Pour into pie shell; cool completely. Transfer to refrigerator to set, at least 2 hours or up to 2 days.

When serving, make a topping by beating heavy cream, pistachio paste, and sugar (if using) in a cold bowl to soft peaks. Sprinkle pie with pistachios and chocolate shavings (if using); add a dollop of pistachio cream to each slice.