Preheat oven to 350°F. Grease a 9×13-inch pan and line the bottom with parchment for easy lifting. Set aside.
Whisk the dry ingredients: flour, cocoa, baking powder, baking soda, salt, and espresso powder (if using).
In a large bowl, whisk the sugar and eggs until slightly thick and pale, about 2 minutes. Stream in the oil, then whisk in vanilla and sour cream until smooth.
Add the dry ingredients in two additions, alternating with the hot coffee, beginning and ending with dry. Mix just until combined, then scrape the bowl and fold a few times. Let the batter rest 5 minutes to hydrate.
Pour into the prepared pan and bake 27–32 minutes, or until a toothpick in the center comes out with a few moist crumbs. Cool on a rack for 15 minutes.
Poke holes all over the cake about 1 inch apart using the handle of a wooden spoon. Warm the hot fudge 45–60 seconds until pourable; stir well. Spoon half over the cake, let absorb 5 minutes, then spoon on the rest, spreading evenly. Sprinkle a pinch of flaky sea salt if using. Cool to room temperature, then refrigerate 20 minutes to set the fudge.
Whisk the pudding mix with cold milk for 2 minutes. Let stand 1 minute to thicken slightly, then spread over the cake. Chill 20–30 minutes, until the pudding is fully set.
For the topping, chill a mixing bowl and whisk/beaters for 10 minutes. Beat the heavy cream on medium speed to soft peaks. With the mixer running, gradually add the hot chocolate mix and continue whipping to stiff peaks, 30–60 seconds more.
Spread the hot-cocoa whipped cream over the pudding in swoops. Drizzle 2–3 tablespoons warmed fudge over the top and finish with dark chocolate shavings or curls.
Refrigerate 30 minutes before slicing into 16 squares for the cleanest layers.