Heat oven to 350°F. Grease and line two 8-inch round pans with parchment.
Whisk flour, baking powder, salt, and espresso powder in a medium bowl.
Cream softened butter with brown sugar and granulated sugar until pale and fluffy, 2–3 minutes.
Beat in the eggs a little at a time, then mix in vanilla and sour cream until smooth.
Add dry ingredients in two additions, alternating with the cooled coffee. Mix just until combined.
Divide batter between pans and smooth the tops. Tap pans once to release bubbles.
Bake 28–32 minutes, until a toothpick in the center comes out clean.
Cool 10 minutes in pans. Turn out onto racks and cool completely before frosting.
Make frosting: Beat butter until creamy. Slowly add powdered sugar and brown sugar; whip until light.
Beat in espresso, vanilla, and salt. Add heavy cream as needed for a smooth, spreadable texture.
Frost one cake layer, stack the second, then cover the top and sides. Swirl to finish.