Season the chicken with salt and freshly ground pepper and set aside.
Heat the oil or clarified butter in a heavy skillet or sauté pan over medium heat. Add the diced onion and cook, stirring occasionally, until soft and translucent, about 5 minutes.
Remove the onions to a plate. Add the chicken, skin side down, to the pan and brown on one side; turn and brown the other side, about 10 to 15 minutes total.
Return the onions to the pan, add the garlic, minced ginger and turmeric, and cook, stirring, about 1 minute. Pour in 2 cups (500 ml) water, cover, and simmer until the chicken is cooked through, about 30 minutes.
Remove the chicken from the pan and let cool. Continue to simmer the cooking liquid over medium heat until reduced by half.
Beat the 4 eggs in a bowl. Slowly stream the eggs into the warm reduced liquid, stirring constantly, until the eggs form soft scrambled curds, about 3 minutes. Remove from heat and transfer the egg mixture to a bowl.
Remove and discard the chicken skin, shred the meat, and stir the shredded chicken into the egg mixture.
Pulse the blanched almonds in a food processor to a coarse grind (almost paste). Add the powdered sugar and 1/8 teaspoon cinnamon and pulse a couple times, then mix the ground almonds into the chicken and egg mixture along with the orange flower water, lemon zest and lemon juice, chopped parsley and cilantro. Taste and season with salt and pepper as needed.
Preheat the oven to 375°F (190°C) and butter a 12-inch (30 cm) baking dish.
Unwrap the filo and keep it covered with a damp towel. Line the baking dish with one sheet of filo, brush with melted butter, then add three more sheets, brushing each with butter except the last one of the four.
Spread the chicken and almond filling evenly in the dish. Fold the overhanging filo edges over the filling and brush any exposed pastry with melted butter.
Top with the remaining three sheets of filo, brushing each sheet with melted butter as you layer them. Tuck or fold the top edges under the pie and trim if needed. Brush the top generously with butter.
Bake the basteeya for 30 to 40 minutes, until the top is well browned and crisp.
Remove from the oven and dust liberally with powdered sugar mixed with a pinch of cinnamon before serving.