Preheat the oven to 350°F (175°C) and line a 12-cup muffin tin with cupcake liners.
In a medium bowl, whisk together the flour, cocoa powder, baking powder, baking soda, and salt. Set aside.
In a large mixing bowl, whisk together the sugar, brown sugar, egg, and vanilla extract until smooth and creamy.
Gradually add the dry ingredients to the wet ingredients, mixing just until combined.
Stir in the milk and brewed espresso until the batter is smooth.
Fold in the melted butter until well incorporated.
Divide the batter evenly among the cupcake liners, filling each about 2/3 full.
Bake for 18-20 minutes, or until a toothpick inserted into the center of the cupcakes comes out clean. Let the cupcakes cool completely on a wire rack.
For the salted caramel buttercream: In a saucepan, melt the butter over medium heat. Stir in the brown sugar and bring to a boil.
Once boiling, let it cook for 2-3 minutes while stirring, then add the heavy cream and vanilla extract. Stir until smooth and the mixture thickens.
Remove from heat and allow the caramel to cool to room temperature.
In a large mixing bowl, beat the cooled caramel with an electric mixer until smooth. Gradually add powdered sugar, 1/2 cup at a time, until the frosting reaches a thick, creamy consistency.
Stir in the sea salt and mix until combined.
Pipe or spread the salted caramel buttercream onto the cooled cupcakes.