see my comments
Early bird-dino types had long straight bony tails used to prop upright while static on ground and perch upright on tree branches. Their long necks allowed them to sleep with the head swivelled back between the arms/wings, giving them ability to see behind & above while resting, advantage against predators which normally attack from the rear or above. This tucked-back posture (seen also in giraffes & geese) has resulted in many fossil birdinos found in this position, the "death pose", because they died asleep on the ground, perhaps in buried hollows or underbrush during sandstorms.
When these 'birdinos' developed bristle filament protofeathers on the caudal ventral surface, it allowed better perching while on branches, the feather tips and edges acting like velcro or fingertip ridges, the long fan of feathers giving part-circumferential anchorage, from bone to bark, while the long curved hyperextended toes were above the branch, the other toes clamped from below. Eventually a side toe moved sidewards, then reversed, giving better traction and reducing need for a long heavy tail, so they replaced the bony tail with long tail feathers and short pygostyle, while shrinking the long neck (except in waders/surface feeders) and replacing teeth with lightweight beaks, improving aerial traits. Non-aquatic arboreal birds greatly shortened the body axis, grounded birds less so.
Compare arboreal (carni-frugi?) birdinos to tupaia tree shrews:
Nocturnal pen-tailed tree shrew (Ptilocercus lowi) with bony feather-fan tail which drinks wine from bertram palm and hops when on the ground (compare to early birdinos with long bony tail with feather fans):
(Tree shrews are very small insectivore/frugivore/nectarivores, close cousins to primates, niche habits similar to early birdinos? (cf drunken monkey hypothesis and Asian Flush reaction to nectar-fruit-yeast alcohol consumption on metabolism re sugar/carb/aldehyde/diabetes.)
Diurnal mountain tree shrew with fluffy squirrel tail which after feeding on pitcher plant nectar exudates then deposits Nitrogenous poo into the loo, the bowl of the pitcher plant, and runs swiftly while on the ground:
Coelecanth - dinosaur fish that swam on 4 legs, uses trimtab tail rudder
Petro city Monstrosity: Cities have become havens for engines, not humans.