Just watched the replay. You definitely need to scout more. You had no idea he was seiging up his 4 tanks at your base. And you were not prepared to counter.  He out-macroed you, having a lot more units. You only had one tank. I'm not saying you build is wrong but you should scout more so you know what and when he is coming.