Preheat the oven to 350°F (175°C). Line a standard 12-cup muffin pan with cupcake liners.
Sift together the cake flour and baking powder into a medium bowl. Whisk in the ground pistachios, baking soda, sea salt, and optional cardamom until evenly combined.
In a large bowl, beat the softened butter and granulated sugar on medium-high speed for 4–5 minutes, until very pale, fluffy, and airy.
Beat in the oil until fully incorporated.
Add the eggs one at a time, beating well after each addition and scraping down the bowl as needed.
Mix in the vanilla extract, almond extract (if using), and pistachio paste until smooth and creamy.
Beat in the sour cream until fully combined.
Add the dry ingredients in three additions, alternating with the milk, beginning and ending with the dry ingredients. Mix on low speed just until combined, then gently fold the batter with a rubber spatula to ensure there are no pockets of flour.
Divide the batter evenly among the cupcake liners, filling each about ⅔ full (approximately 3 tablespoons of batter).
Bake for 18–22 minutes, or until the tops spring back lightly and a toothpick inserted into the center comes out with a few moist crumbs attached.
Let the cupcakes cool in the pan for 5 minutes before transferring them to a wire rack. Cool completely before frosting.