The owner of Facebook and Instagram saw its revenues and profits soar more than 30 percent, but AI costs remain high and lawsuits remain a threat.