Just a mental exercise

There are all kinds of electromechanical gizmos available out there. Servos, screw jacks, hydraulics, etc. Draw some engineering diagrams and determine where you want everything to be at certain stages of movement. Then look around for appropriate electromechanical devices. You might need to fabricate some levers to increase or decrease motion ranges. Start with accurate drawings.