he climbed higher and higher into the mountains , and finally when all hope had left him and the thin air had muddled his thinking , he found the entrance to the hermitage , almost covered in a great snowdrift .