As Islamabad draws attention on the global stage, it grapples with economic problems and surging terrorism back home.