U.S. stocks hit fresh records as tech rally lifts S&P 500, Nasdaq