How does it calculate restful vs light sleep?

The only exception to the rule about fitness trackers using just heart rate and movement is the UP3, that uses galvanic skin response (skin conductance) which changes depending on what state you're in.