AB de Villiers hit 98 not out as South Africa reached 334-6 at stumps on the opening day of the third Test against Pakistan at Centurion.