Prep the pan and oven: Heat the oven to 350°F (175°C). Grease a 9-inch round cake pan and line the bottom with parchment.
Lightly dust the sides with cocoa powder.
Mix the dry ingredients: In a large bowl, whisk the gluten-free flour, almond flour, cocoa powder, granulated sugar, brown sugar, baking powder, baking soda, and salt until well combined and lump-free.
Add the wet ingredients (except coffee): Whisk in the eggs, buttermilk, oil, and vanilla until smooth. Don’t overmix—just blend until no dry streaks remain.
Stir in the hot liquid: Pour in the hot coffee (or water) and whisk gently. The batter will look thin; that’s correct.
Fold in chocolate chips if using.
Bake: Pour the batter into the prepared pan and smooth the top. Bake for 28–34 minutes, or until a toothpick inserted in the center comes out with a few moist crumbs.
Cool: Let the cake cool in the pan for 10 minutes, then invert onto a wire rack, peel off the parchment, and cool completely.
Make the frosting (optional): Beat the butter until creamy. Sift in cocoa and mix.
Add powdered sugar, milk, vanilla, and salt. Beat until fluffy, adding more milk for a spreadable consistency.
Frost and serve: Once the cake is cool, spread frosting over the top and sides, or simply dust with powdered sugar. Slice and enjoy.