Complementary mechanisms for upright balance during walking