In a large bowl, cream the butter and sugar until light and fluffy. Beat in the egg, vanilla, and almond extract (if using).
In a separate bowl, whisk together flour, ground almonds, and salt. Gradually mix into the butter mixture until just combined.
Divide dough in half, flatten into discs, and chill for 1 hour.
Preheat oven to 350°F (175°C). Line baking sheets with parchment.
Roll dough on a lightly floured surface to about 1/8-inch thick. Cut out heart shapes with a cookie cutter.
For half of the cookies, cut a small heart out of the center to create the “window” tops.
Place cookies on prepared sheets and chill for 10 minutes.
Bake for 10–12 minutes, or until edges are just starting to turn golden. Let cool completely.
In a small saucepan, heat the raspberry jam and water over low heat until smooth and slightly thickened, about 2–3 minutes. Strain if needed for extra clarity. Let cool to room temperature.
Dust the “window” cookies with powdered sugar.
Spoon about 1/2 teaspoon of raspberry jam onto the flat side of each solid cookie. Top with the windowed cookie and press gently to sandwich.