Prep the pan: Heat oven to 350°F (175°C). Line an 8-inch square pan with parchment, leaving overhang for easy lifting. Lightly grease the parchment.
Melt butter and chocolate: In a heatproof bowl, melt butter and chopped chocolate together over a saucepan of simmering water, stirring until smooth.
You can also microwave in 20–30 second bursts, stirring between each.
Whisk in sugars: Remove from heat. Whisk in granulated sugar and brown sugar while the mixture is still warm. It may look grainy at first; keep whisking until glossy.
Add eggs and vanilla: Whisk in the eggs and yolk one at a time, then add vanilla.
Whisk for 30–45 seconds to slightly aerate; this helps the shiny top.
Combine dry ingredients: In a small bowl, whisk flour, cocoa, salt, and espresso powder. Sift if your cocoa is lumpy.
Fold the batter: Using a spatula, fold the dry mixture into the wet until just combined. Stop when you no longer see dry streaks.
Fold in chocolate chips or chunks.
Bake: Spread batter evenly in the pan. Bake 22–28 minutes, until the edges are set and the center is just slightly soft. A toothpick should come out with a few moist crumbs, not wet batter.
Finish and cool: If using, sprinkle flaky sea salt on top right after baking.
Cool in the pan on a rack for at least 1 hour, then lift out and slice with a warm, clean knife.