As Denis Molodtsov said, you could use SharePoint Framework to custom modern sites.
For your requirements, I would suggest you use the SPFx Applications Customiser CSS Injection and create your custom css/js file to change site layout/structure.
As Hugo Bernier says:
If you need to customize the look and feel of modern pages, you can
use custom tenant branding, custom site designs, and modern site
themes without incurring the wrath of the SharePoint gods.
If you want to go even further, you can use SharePoint Framework
Extensions and page placeholders to customize well-known areas of
modern pages. ...