In large skillet, melt 1 stick butter over medium-high heat (yes, an entire stick). Saute chicken thighs in batches, until browned on both sides but not completely cooked. Remove to bowl as batches are done.
Add onions to pan and saute until translucent but not brown. Add parsley, cilantro, ginger, turmeric salt, pepper, and water, then bring to boil. Nestle chicken pieces into pan and pour accumulated juices over. Simmer slowly, covered, until chicken is tender, about 45 minutes. Taste broth and add salt if necessary. Cool in pan (can be held overnight at this point).
Meanwhile, saute almonds in olive oil until lightly browned. Remove to paper towels to drain and cool. Whirl toasted almonds in food processor until pieces are 1-2 mm. Mix in sugar and cinnamon and set aside.
Remove chicken from pan; strain and reserve broth. Discard bones from chicken pieces. Use fingers to separate meat into bite-sized pieces. Cut skin into tiny bits, add to bowl with shredded chicken and set aside.
Skim fat from strained broth. Measure 1-½ c broth (add any remaining broth to bowl with shredded chicken). In nonstick saucepan, heat the broth with ¼ cube of butter, medium heat, until steaming. Whisk eggs in bowl, then pour into hot broth. Stir egg mixture slowly until soft, creamy curds form, like scrambled eggs. Remove from heat, salt to taste, and reserve. Do not discard any liquid that seeps out of eggs.
Use small pan to clarify remaining butter.
Preheat oven to 450 degrees. Brush bottom and sides of heat-safe 14” frying pan (sloped sides) with a few tablespoons of clarified butter. Place two sheets of filo dough in pan, covering bottom with edges hanging over side of pan. Brush with a little clarified butter, then put another two sheets of filo over the first, rotated a bit to cover more of the pan. Brush with butter. Continue layering filo and brushing with butter until no gaps remain between filo sheets covering pan.
Stir any seeped liquid back into eggs. Spoon ¾ of the egg mixture into filo-lined pan, spreading into even layer. Sprinkle half of almond mixture evenly over egg layer. Top with half of chicken. Layer remaining eggs, then almonds, then chicken. Fold overhanging edges of filo over filling. Depending on the size of your filo sheets, you may need to layer additional sheets on top (2 at a time, brushed with butter), tucking around edges so filling is completely enclosed. Brush top with butter.
Set pan on cookie sheet and bake 25 minutes. Carefully brush top again with butter and reduce heat to 425. Continue baking until pie is evenly browned and slightly puffed, another 10-20 min until internal temperature is between 120 and 125 degrees. Remove pan from oven and let cool 10 minutes (pie will be too hot to eat otherwise. Dust top with powdered sugar just before serving. Note: traditionally, this Moroccan dish is eaten communally with fingers (fun, but make sure to poke holes in top to let steam out before trying it). Pie can also be cut into wedges and served in individual pieces.
