01 - Preheat oven to 350°F. Grease and flour two 9-inch round cake pans or line with parchment paper.
02 - Whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg in a large bowl until thoroughly blended.
03 - Beat granulated sugar, brown sugar, oil, eggs, and vanilla in a separate bowl until well combined and slightly pale in color.
04 - Gradually add dry ingredients to wet mixture, mixing just until incorporated. Avoid overmixing to prevent dense texture.
05 - Fold in grated carrots, chopped walnuts, crushed pineapple, and raisins if using, until evenly distributed throughout batter.
06 - Divide batter evenly between prepared pans. Smooth tops with spatula for even baking.
07 - Bake for 35-40 minutes until toothpick inserted into center comes out clean. Rotate pans halfway through baking.
08 - Let cakes cool in pans for 10 minutes, then invert onto wire rack to cool completely before frosting.
09 - Beat softened cream cheese and butter until smooth and creamy. Gradually add powdered sugar, vanilla, and salt, beating until fluffy and spreadable.
10 - Spread frosting layer on top of one cooled cake. Place second layer on top and frost top and sides evenly.
11 - Decorate with additional chopped walnuts or carrot curls if desired. Serve immediately or refrigerate until ready to serve.