For a change, a summer blockbuster with brains.