Step 1In the bowl of a stand mixer using a paddle attachment, or in a large bowl using a hand mixer, cream the butter with sugar until light and fluffy, 3 to 5 minutes, scraping the sides of the bowl periodically.
Step 2Gently fold the ground hazelnuts into the butter mixture until evenly combined, then fold in the ground almonds thoroughly.
Step 3Stir in the vanilla. Gently add the flour, 1 cup at a time, until thoroughly mixed. Slowly add the cocoa until combined. The dough will be very thick at this point, and you should easily be able to roll a small amount into a ball.
Step 4Shape the dough into a flat disc and wrap tightly in plastic wrap. Refrigerate dough at least two hours, but preferably overnight.
Step 5Heat the oven to 325 degrees. Roll the dough to one-half-inch thickness between 2 sheets of parchment paper or plastic wrap (this keeps the dough from sticking to the rolling pin and alleviates the need for flouring). Cut hearts or other-shaped cookies approximately 2 1/2 inches in diameter, and place the cookies on a parchment-lined baking sheet. Bake the cookies until puffed slightly and set on top, about 15 minutes. Rotate the cookies halfway through for even heating and coloring.
Step 6Remove the cookies, still otheir sheets, to a rack to cool completely before serving (they're fragile just out of the oven and will crumble if moved while still warm).