Nanoscale Reconfigurable Intelligent Surface Design and Performance Analysis for Terahertz Communications