Statistics and topology of fluctuating ribbons