Very good answer, Joe.
But?
I would contact my local HVAC engineer for an ambient temperature to use. That's where we get those things from here in the office. Even in a residential attic, the temp's are probably up in the 150-160 F range. How many people derate for the lighting conductors installed there? For 90 Deg C wire, the temp derate is at 0.41 for 160 Deg F. That means your #12 wire is good for about 15 Amps., with a 20 Amp breaker ahead of it. Legal? As Joe pointed out, any part derates the entire length of conductor.
Just a few thoughts, and the kind of things we in the design end of things have to consider also.