Get the very first parent for undefined nested children

I’m looking for a way to get the very first parent of child pages. Children can be nested with unknown depth and some are nested several levels deep. The very first parent can have different templates.
In the past, I believe with Kirby 1, I used something like $site->uri()->path(1) to get the first segment of the uri and thus the slug of the very first parent.
What would be the best way to do this now?
Using this, for example, to show an optional submenu or to show the parent above a submenu.

if ($page->depth() > 1) {
  $firstParent = $page->parents()->last();

Elegant, thank you.