You need to match the engine and transmission.
Not really, you just need to be aware that a '68-up engine used with a '67-down transmission requires a filler ring to take up the space between the early small-diameter torque converter nose and the late large-diameter crankshaft rear flange bore, and that a '68-up transmission cannot be used behind a '67-down engine without a custom torque converter. Also, if you use an engine out of something other than a '60-'66 A-body car (Valiant, Lancer, Barracuda, Dart), you need to swap on an oil pan and pickup pipe/screen from a '60-'66 A-body engine (such as the one already in the car).
A "correct" engine would be 1963-1967.
If by "correct" we mean it will mate up with a pre-1968 automatic transmission without any adaptation required, then there is no reason to exclude '62, and '61 engines from this list. '60 engines, too, though there are a few minor differences (placement of alternator bracket) that will have to be accounted for.
The matching and "correct" transmission would be 1963-1965
Here again, if "correct" means "no adaptation", then the transmission needed depends on what we're doing for a shifter. If we're using pushbuttons, then it's '60-'64 for the transmission, the pushbutton control assembly, and the cables. If we're using a lever shifter (either on the floor or on the steering column) then it's either got to be a '65 transmission and a '65 shifter and cables, or a '66-'67 transmission and linkage rods with a '66 or later shifter—this, as you note, would also require a driveshaft change.
no 1965's had dash pushbuttons and the whole dash layout changed. But, they used the same cable-shift transmission
…with valve body differences that make '65 transmissions incompatible with pushbutton shifters and '60-'64 transmissions incompatible with lever shifters, unless you swap valve bodies or component parts to match the type of shifter you're using.
the driveshaft may need to be shorter for an automatic
Nope, same length driveshaft for 3-speed manual, 4-speed manual, and automatic.
The front "ball and trunnion" (aka "Detroit") "sliding U-joint" is strong and reliable, but parts are getting rare.
Parts are still readily available, just not in every auto parts store.
Andy Bernbaum has boot kits, rebuild kits, and complete assemblies.
You can also have a custom sliding yoke fab'ed.
This is the smart way to proceed if the front universal joint needs anything beyond a new boot. Full writeup is
here.