Heat the oven to 350°F/175°C with convection. Line and grease an 8-inch/20 cm square pan with parchment.
Place the chopped dark chocolate in a heatproof bowl. In a saucepan, melt the butter over medium heat until foamy, then cook, stirring, until golden brown and nutty, about 5 minutes. Pour over the chocolate, rest for 1 minute, and stir until smooth. (For a parve version, melt the margarine and chocolate together instead.)
In a stand mixer fitted with a whisk, beat the eggs and both sugars on medium speed until pale and thick, about 8 minutes. Fold in the chocolate mixture. Sift in the cocoa, then add the almond flour and matzo meal. Fold gently until just combined. Stir in the chopped chocolate.
Pour into the pan, smooth the top, and sprinkle with chopped chocolate and flaky salt. Bake until set at the edges but soft in the center, 30 to 35 minutes. Cool completely, then chill until firm. Cut into squares and serve cold.