Ahh, this is pretty easy. You need to modify 2 files
The phtml template file is setup to do nested UL/LI navigation. So modify it as you see fit to get your top level HTML the way you want. It also calls “$this->drawItem($_category)” The $this is a reference to the Block/Navigaiton.php file that I listed above. It recursively calls drawItem() to print more nested LIs. So you have to rewrite that function to only print the current category and none of its children.
Now you have a row of just top level categories.
To do the sub categories, you probably want to continue coding on the top.phtml file. It might be better to split this up into two files, but that would involved changing some XML and more template files. You can do that later if you want.
At the very end of the file, you want to loop through all the top level categories again in a foreach. If the category is active “$this->isCagegoryActive($_category)” then grab all its children “$_category->getChildren()”, do a nested foreach of those, and print them however you want.
Just two files… there’s better ways to do these customizations, but once you get your changes in, then you can start looking at how to move your changes around to protect them against upgrades.