Preheat the oven to 180 C / Gas 4. Lightly grease two 23cm cake tins and line with baking parchment.
Whisk flour, cocoa powder, bicarbonate of soda, baking powder and salt together in a medium bowl.
Combine caster sugar, brown sugar 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.
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 soured cream until just combined. Add remaining flour mixture alternately with remaining soured cream and coffee. Do not overmix. Divide cake mixture between the two cake tins.
Bake in the preheated oven until a skewer inserted into the centre comes out with just a few moist crumbs attached, 25 to 30 minutes. Cool in the tins for 15 minutes. Run a knife around the edge of the tins before inverting cakes onto cooling racks. Peel off baking paper. Cool cakes completely, about 30 minutes.
To make the vanilla icing while the cakes cool: Beat butter with an electric mixer until light and fluffy. Beat in icing sugar, 100g at a time, until incorporated. Mix in vanilla extract and salt. Add cream and beat icing on medium speed until light and fluffy, about 3 minutes. Add more cream if needed to reach a spreadable consistency.
Place about 120g of the icing into 2 separate bowls. Stir blue food colouring into one bowl and purple food colouring into the other. Place coloured icing into a piping bag fitted with a star tip nozzle.
Place 1 cooled cake layer onto a cake plate. Top with some of the vanilla icing. Place second cake layer on top. Decorate the outside and top of the cake with remaining vanilla icing.
Divide the cake into 8 wedges by tracing a sharp knife through the icing 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.
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.
Use melted chocolate instead of black icing gel, if preferred.