Make the caramel first. In a small saucepan over medium heat, melt the butter with the brown sugar, stirring, until it bubbles and looks smooth, about 2 minutes.Carefully pour in the heavy cream (it will bubble up) and simmer for 3 to 4 minutes, stirring often, until slightly thickened. Remove from the heat, stir in the fine sea salt and vanilla, and let it cool for 20 minutes to thicken.
Preheat your oven to 350°F (175°C) and line an 8x8 inch baking pan with parchment paper, leaving an overhang on two sides.
Melt the butter and dark chocolate together in a large microwave-safe bowl in 30 second bursts, stirring each time. Whisk in both sugars, let cool for 5 minutes, then whisk in the sour cream and vanilla until glossy.
In a separate bowl, whisk the flour, cocoa powder, baking soda and salt. Fold into the chocolate mixture just until combined, then spread the batter evenly into the pan.
Drizzle about half of the caramel over the batter in lines, then drag a toothpick through it to swirl it slightly. Save the rest of the caramel for the topping.
Bake for 28 to 32 minutes, until the edges are set and a toothpick inserted in the center comes out with moist crumbs. Let cool completely in the pan, about 2 hours.
Rewarm the remaining caramel for a few seconds if it has become too thick, then drizzle it over the brownies. Sprinkle with flaky sea salt, let set for 10 minutes and cut into 16 squares.