Sift together the flour, baking powder, and salt in a medium bowl, breaking up any lumps. Set aside. This step ensures even distribution of the leavening agents throughout the dough, which gives you consistent, tender cookies. While you're at it, remove your egg from the refrigerator so it can come to room temperature—this helps it incorporate smoothly into the butter mixture.
In a large bowl, beat the softened butter and sugar together on high speed for 3 minutes until the mixture is pale, fluffy, and noticeably lighter in color. This creaming process incorporates air into the dough, which helps your cookies rise slightly and achieve a tender crumb. Don't skip the full 3 minutes—it makes a real difference in texture.
Add the room-temperature egg, vanilla extract, and almond extract to the creamed butter mixture. Beat on medium speed for 1 minute until fully combined and the mixture looks smooth and emulsified. I like to add a tiny pinch of salt here along with the extracts—it rounds out the sweetness and makes the vanilla flavor pop.
Add the dry ingredient mixture from Step 1 to the wet ingredients from Step 3, then mix on low speed just until the dough comes together. Stop mixing as soon as you no longer see streaks of flour—overmixing develops gluten and makes cookies tough. Turn the dough out onto a piece of parchment paper, shape it into a disk, and wrap tightly. Refrigerate for at least 2 hours (or up to 24 hours) so the dough firms up and the flavors meld.
Preheat your oven to 350°F. Remove the chilled dough from Step 4 and roll it between two pieces of parchment paper to an even 1/4-inch thickness. Cut into heart shapes using a cookie cutter, place on parchment-lined baking sheets about 1 inch apart, and bake for 11–12 minutes until the edges are just barely golden but the centers still look slightly underbaked. Let the cookies cool on the baking sheet for 5 minutes, then transfer them to a wire rack to cool completely before decorating.
In a large bowl, combine the sifted confectioners' sugar, meringue powder, 9 tablespoons of water, fine sea salt, and lemon juice. Beat on high speed for 1.5–2 minutes until the icing reaches stiff peaks that hold their shape. Start with 9 tablespoons of water; if the icing is too thick, add the remaining tablespoon one teaspoon at a time. I use Wilton meringue powder because it gives me the most reliable, glossy results every single time.
Divide the royal icing from Step 6 into separate bowls and tint each with gel food coloring as desired, stirring well to ensure even color. Pipe icing borders around the edges of each cooled cookie, then fill in the centers with icing in contrasting colors or white. Let the base layer set for 2 hours, then pipe your Valentine's messages or designs with red icing and allow them to dry for another 2–3 hours. The cookies are now ready to give as gifts or enjoy yourself!