The lengths of the folding section get a little tricky.
Top section can be the length of the hatch cover less enough to allow the door to close into the opening. The middle section can only be long enough to close into the opening when folded, so the smart move is to get on top with the hatch closed and determine and even test that length. (don't ask how I know). Remember, most of the strength of the hinged joint comes from the 2 board ends coming together. The hinge design is job specific, and strap hinges won't work.
Once you have the top 2 sections together and functional the floor section becomes easy. Just remember, it folds opposite to the middle section.
It's much easier to just build a ladder that can ride the hatch cover on rollers that you shove up into the attic before closing the hatch. A pair of scrap garage door tracks and 4 rollers do a good job on this system.