Preheat the oven to 180°C (160°C fan) / 350°F and line a muffin tin with paper cupcake cases.
In a mixing bowl, sift together the flour, cocoa powder, baking soda, baking powder, and salt. Whisk to combine and set aside.
In a separate bowl, or in the bowl of a stand mixer, combine the melted butter with both the granulated and brown sugars. Beat until the mixture is smooth. Add the eggs one at a time, beating well after each addition and scraping down the sides of the bowl to ensure everything is incorporated. Add the vanilla extract and mix until combined.
Begin incorporating the dry ingredients by adding one-third of the flour mixture to the wet ingredients. Gently stir until just combined. Then add half of the buttermilk and mix gently again. Repeat this process, alternating between the remaining flour mixture and buttermilk, ending with the flour. Be careful not to overmix—the batter should be just combined to avoid dense or tough cupcakes.
Spoon the batter into the prepared cupcake cases, filling each about two-thirds full. Bake in the preheated oven for approximately 18–23 minutes, rotating the pan halfway through baking to ensure even cooking. The cupcakes are done when a skewer inserted into the center comes out with just a few moist crumbs.
Allow the cupcakes to cool in the tin for 5 minutes, then transfer them to a wire rack to cool completely.