In the bowl of a stand mixer fitted with the paddle attachment, cream together the butter and sugar until light and fluffy, about 4 minutes. Add in the eggs one at a time, beating to blend after each addition and scraping down the sides of the bowl as necessary. Add the dry ingredients to the bowl in 3 additions, alternating with the chocolate mixture. Divide the batter evenly between the two greased pans and smooth the tops.
Bake the cakes until a tester inserted into the centers comes out clean, about 35 minutes. Transfer to wire racks and let cool in cake pans for 10 minutes. Run a knife around the cakes to loosen and then invert onto wire racks. Peel off the paper and let cool completely. Turn cakes over. If needed, use a long serrated knife to cut off any bumps or dome from the top of each cake so that it is flat and even.
For the caramel ganache, place the chocolate and salt in a medium bowl. Stir the sugar and ¼ cup of water in a medium saucepan over medium-low heat. Cook until the sugar dissolves. Increase the heat and cook, swirling occasionally, until the sugar is deep amber, about 9 minutes. Remove from the heat and whisk in the cream. Return to the heat, stirring until caramel dissolves. Pour over the chocolate. Add the vanilla and stir until smooth. Let cool slightly.
Spoon the filling over the chilled ganache in the pan. Smooth the top. Gently top with the second cake layer. Cover tightly with plastic wrap and chill until cream is set, at least 6 hours or overnight.
Rewarm the remaining ganache until it is just pourable (not scalding!). Pour the ganache over the cake so that it drips down the sides. Chill until ganache is set, about 1 hour. Sprinkle cake with flaky sea salt before serving.
For the cake
For the caramel ganache
For the filling and assembly