Preheat the oven to 200°C (400°F).
Cut the puff pastry sheet into small squares, about 2.5 cm (1 inch).
Grease a large baking sheet with the butter, then transfer the puff pastry squares to it.
Bake the squares until crisp and golden brown, about 15–20 minutes. Set aside to cool.
Combine the almonds, pine nuts, raisins, and desiccated coconut in a bowl.
Fill the bottom of each ramekin with the puff pastry squares, filling them about a quarter (¼) of the way up.
Divide the mixed nut mixture equally over the puff pastry squares.
Heat the milk, sugar, heavy cream, and mastic gum (if using) in a saucepan. Whisk constantly and bring to a gentle boil.
Pour the hot liquid mixture equally into the ramekins, completely covering the pastry and nuts.
Bake the ramekins until the top is puffed and beautifully browned in spots, about 15 minutes. Serve warm!