Step 1
Preheat the oven to 350 degrees F (175 degrees C). Lightly grease two 9-inch cake pans and line with parchment paper.
Step 2
Whisk flour cocoa powder baking soda baking powder and salt together in a medium bowl.
Step 3
Combine sugars and butter in a large bowl; beat with an electric mixer until light and fluffy. Beat in eggs one at a time thoroughly mixing after each addition. Beat in vanilla extract.
Step 4
Mix 1/3 of the flour mixture into the butter mixture until just combined. Mix in 1/2 of the coffee and 1/2 of the sour cream until just combined. Add remaining flour mixture alternately with remaining sour cream and coffee. Do not overmix. Divide batter between the cake pans.
Step 5
Bake in the preheated oven until a toothpick inserted into the center comes out with just a few moist crumbs attached 25 to 30 minutes. Cool in the pans for 15 minutes. Run a knife around the edge of the pans before inverting cakes onto cooling racks. Peel off parchment paper. Cool cakes completely about 30 minutes.
Step 6
Make frosting while cakes cool. Beat butter with an electric mixer until light and fluffy. Beat in powdered sugar 1 cup at a time until incorporated. Mix in vanilla extract and salt. Add heavy cream. Beat frosting on medium speed until light and fluffy about 3 minutes. Add more heavy cream if needed to reach a spreadable consistency.
Step 7
Place 1/2 cup frosting into 2 separate bowls. Stir blue food coloring into one bowl and purple food coloring into the other. Place colored frostings into a piping bag fitted with a star tip.
Step 8
Place 1 cooled cake layer onto a cake plate. Top with 3/4 cup of white frosting. Place second cake layer on top. Frost the outside and top of the cake with remaining frosting.
Step 9
Divide the cake into 8 wedges by tracing a sharp knife through the frosting on the top; do not cut all the way through. Place 2 pink sprinkles in the innermost point to make unicorn's nostrils. Pipe the eyes and eyelashes near the upper portion of each wedge using the black decorating gel. Pipe blue and purple unicorn hair at the top of each wedge.
Step 9
Stretch marshmallow quarters into ear shapes and dip into pink sugar. Attach 2 ears to the edge of each slice. Pipe more hair around the ears. Place 1 candle into the hair for the horns. Keep cake refrigerated until ready to serve.