Prep the pan and oven. Heat the oven to 350°F (175°C).
Grease and line a 9x13-inch baking pan with parchment, leaving a little overhang for easy removal.
Make the pistachio streusel. In a bowl, combine 1/2 cup all-purpose flour, 1/3 cup light brown sugar, a pinch of salt, 1/2 teaspoon ground cardamom (optional), and 4 tablespoons cold unsalted butter, cut into small cubes. Use your fingers to rub the butter into the dry ingredients until it forms moist clumps. Stir in 3/4 cup chopped pistachios.
Chill while you mix the batter.
Whip up the cream cheese filling. In a small bowl, beat 8 ounces softened cream cheese with 1/4 cup granulated sugar and 1 teaspoon vanilla until smooth. Set aside.
Mix the dry ingredients for the cake. In a medium bowl, whisk 2 1/2 cups all-purpose flour, 1 1/2 teaspoons baking powder, 1/2 teaspoon baking soda, 1/2 teaspoon kosher salt, and 1/2 teaspoon ground cardamom (optional).
Cream the butter and sugar. In a large bowl, beat 3/4 cup (12 tablespoons) softened unsalted butter with 1 cup granulated sugar until light and fluffy, 2–3 minutes.
Add eggs and flavorings. Beat in 3 large eggs, one at a time, scraping the bowl as needed. Mix in 2 teaspoons vanilla and 1/4 teaspoon almond extract (if using).
Finish the batter. Stir in 3/4 cup sour cream.
Add the dry ingredients in two additions, alternating with 1/2 cup whole milk. Mix just until smooth; don’t overbeat. Fold in 1/2 cup chopped pistachios for extra texture.
Layer the cake. Spread about half the batter into the pan (it will be thick).
Dollop the cream cheese mixture over the batter and gently spread it to the edges. Top with the remaining batter, spreading carefully to cover the filling.
Add the streusel. Sprinkle the chilled pistachio streusel evenly over the top, pressing lightly so it adheres.
Bake. Bake 35–42 minutes, or until the top is golden and a toothpick inserted near the center (into the cake, not the cream cheese) comes out clean or with a few moist crumbs.
Cool and glaze. Let the cake cool in the pan for 20–30 minutes. For a simple glaze, whisk 1/2 cup powdered sugar with 1–2 teaspoons lemon juice or milk until pourable.
Drizzle over the warm cake. Cool fully before slicing for neat layers.