Prepare the Pan and Oven: Preheat the oven to 350°F (175°C). Grease a loaf pan or an 8 × 8-inch square pan with butter and flour, or coat it with baking spray. Line the prepared pan with parchment paper.
Grind the Pistachios: If using whole pistachios instead of pistachio flour, place them in a food processor along with the all-purpose flour and process until finely ground. Adding the flour helps prevent the pistachios from clumping.
Cream the Butter Mixture: Combine the sugar, room-temperature butter, lemon zest, vanilla extract, and sea salt in a bowl. Beat with a hand mixer for 3–5 minutes, until the mixture becomes very light and fluffy.
Add the Eggs: With the mixer running, add the eggs one at a time, beating until each egg is incorporated before continuing.
Combine the Dry Ingredients: Add the finely ground pistachios, all-purpose flour, and baking powder to the butter mixture.
Fold the Batter: Use a spatula to gently fold the pistachio, flour, and baking powder mixture into the wet ingredients until the batter is evenly combined.
Fill the Pan: Transfer the batter to the prepared pan and spread it into an even layer.
Bake the Cake: Bake until a cake tester inserted into the cake comes out clean. In a loaf pan, bake for approximately 30–35 minutes; in an 8 × 8-inch square pan, bake for approximately 20–25 minutes. The finished cake should rise slightly and form a flat, even layer.
Cool and Slice: Allow the cake to cool completely. For a square pan, cut the cake straight down the middle to create two layers. For a loaf pan, slice it horizontally into two layers. Trim the edges if desired.
Prepare the Fruit Juice: For the glaze, press the pomegranate arils or thawed raspberries through a fine-mesh sieve to release their juice.
Make the Glaze: Add the sifted powdered sugar and a pinch of sea salt to the released fruit juice. Mix until combined and smooth.
Glaze the First Layer: Place the first cake layer with the top facing upward. Spread an even layer of glaze over the surface.
Assemble the Cake: Place the second cake layer on top with its top side facing downward, then spread the glaze over the upper surface.
Garnish and Finish: Sprinkle the glazed cake with pistachios, pomegranate seeds, and/or dried rose petals as desired.