Preheat oven to 350°F (175°C). Line a 12-cup muffin tin with liners.
In a medium bowl, whisk together flour, baking powder, baking soda, and salt.
In a large bowl, beat butter and sugar until light and fluffy. Add eggs one at a time, mixing well after each.
Mix in vanilla, lemon zest, and lemon juice.
Add the dry ingredients in two batches, alternating with sour cream. Mix until just combined.
Gently fold in raspberries with a spatula.
Divide batter evenly among cupcake liners.
Bake for 16–18 minutes, or until a toothpick inserted in the center comes out clean or with moist crumbs.
Let cool in pan for 5 minutes, then transfer to a wire rack to cool completely.
For the frosting, beat butter and cream cheese until smooth. Add powdered sugar, lemon juice, and vanilla, then beat until fluffy.
Frost cooled cupcakes and garnish with lemon zest or fresh raspberries if desired.