"It's not all lost," AB de Villiers said after South Africa were bowled out for 162 in their first innings, and he was right. While the game was gone on day two and energy had been sucked out of them on day three, Aiden Markram salvaged something out of day four, something that has offered a glimpse into a future that does not fall off a cliff when de Villiers, Faf du Plessis and Hashim Amla retire.

His second-innings century shone shards of sunlight on South Africa's chase, which started with an air of inevitably that 417 was impossible, crashed towards the realms of embarrassment at 49 for 4, and then stuttered and sparked into life, even threatening a fairy-tale end.

There were moments when it seemed Markram might just pull it off, moments when he was leaning into his drive or guiding the ball late, moments when was playing against the turn, moments when he managed to tame the wild child in Quinton de Kock and channel his focus into a forming a big partnership... moments of magic.

Watching from his home in Johannesburg, Ali Bacher, the last captain to lead South Africa to a series win over Australia at home, was so excited. Speaking to ESPNcricinfo, he offered an analysis: "A South African cricketing star has been born. The two best batting techniques in South African cricket that I have seen came from Barry Richards and Jacques Kallis. Aiden's batting technique is as good as theirs. His hundred today is one of the best I have seen from a South African batsman. It was scored under extreme pressure and against an Australian bowling attack which is one of the best I have seen in world cricket for many years. His temperament under constant Aussie pressure was excellent."

Put technique aside for a moment and let's zone in on the pressure, because there was plenty. From his end, Markram watched Dean Elgar defeated by pace and unable to withdraw his bat in time to avoid the edge, Hashim Amla get rapped on the pads by Josh Hazlewood - the sixth time this bowler has accounted for him in Tests - and AB de Villiers run out after advancing halfway down the pitch before seeing Markram was not interested (and then he had to hear about it too).

Australia spent the morning session reminding Markram "of what he had done and trying to get him off his game", which, Tim Paine admitted, "didn't work". Markram actually enjoyed parts of it because it "keeps me in the game", something that had been missing from his game over the one-day series against India, when he was given the captaincy just two caps into his career.

"It [captaining against India] was quite a tricky stage for me because I was trying to establish myself in the side and along with that trying to lead a strong side against a very strong Indian side. It was very challenging for me," Markram said. "I found myself, in terms of batting, not all that much in the moment. I felt very rushed and a lot like a blur. For what reason I am not so sure, I haven't worked it out just yet. Captaincy did have a bit to do with it."

But now he has shown real leadership, with an innings of stature. Comparisons to Graeme Smith, who is well respected for his abilities in the second-innings, will abound, not least because Markram, despite the results against India, is still captaincy material. And unlike Smith's batting style, Markram's is pleasing on the eye. "His technique is outstanding. He gets his head over the ball and plays straight," Bacher said. "When they bowl short, he gets up high on his toes and he doesn't square cut, he drives the ball off the back foot through the covers. He is the complete batsman."

"His hundred today is one of the best I have seen from a South African batsman. It was scored under extreme pressure and against an Australian bowling attack which is one of the best I have seen in world cricket for many years"
Former South Africa captain Ali Bacher on Aiden Markram

Which is what South Africa will need not only if they are to compete in this series, against this attack, but also as they go forward, when the big guns really do go. The senior batsmen are all under pressure after letting the side down in this Test, and in important matches over the last year or so their form has become a topic of much discussion. The new concern is whether the younger players are ready to take over; murmurs around the local traps was that they were nowhere near.

Talk to those who keep a close eye on the first-class competition and a sense of gloom seeps through their words. Despite the consistency of players like Vaughn van Jaarsveld, Rassie van der Dussen, Pieter Malan, Rudi Second and Zubayr Hamza, there is a pessimism that franchise players can't make the step up to the international game these days.

Coach Ottis Gibson has added to the feeling by questioning the strength of the domestic game after the T20 series against India."The gulf between domestic cricket and international cricket is still quite a wide one," he said. But Markram, who has come through the ranks and spent seasons in the provincial set-up before earning a franchise contract, is proof that the gulf can be breached, even now, even when standards seems to have dropped.

So "all" is not lost, even if this match almost certainly is. South Africa can take one massive victory out of it because their most-talented newcomer has passed his hardest test. Markram's first two Test hundreds against Bangladesh and Zimbabwe were tasters, taken off attacks that a player of his quality would be upset not to have scored heavily against. His 94 against India in Centurion was proof there is was something there and this hundred has showed South Africa what that something is. All is not lost and Aiden Markram has definitely been found.

Firdose Moonda is ESPNcricinfo's South Africa correspondent