https://www.literatureandlatte.com/scrivener/overview

The only authoring software worth writing home about. It suits any writing style, from methodical plotter to seat of pants scribbler, and any format, from fiction to non-fiction, screenplays to book series. It has a great outlining feature, including a corkboard-like layout, and you can just re-order and drag and drop sections of the work around with ease. When you’re happy with the words, you can compile the work up for whatever target you choose – print book, ebook, PDF, whatever.

A small point – the setup notes say that it doesn’t support the MacOS filesystem but I’ve been storing the data files on iCloud without any problems so far.