As his wife teasingly plucked his first grey hair from his head, Wael Ghonim wondered what life in his 30s might hold in store for him. Like many of those waving goodbye to their 20s, Mr Ghonim felt a twinge of apprehension last December, as if he were expecting the end of an era.
He had his dream job as a regional head of marketing at Google, a wife, Ilka, whom he adored, and two children. They lived a life of comfort in a luxury villa in The Springs in Dubai.
The next decade, he reasoned, would spell stability and an end to the exciting unpredictability of his 20s, when he discovered his passion for new media and social networking and, better still, found a career that allowed him to indulge his obsession and travel the world.
"Dear 20s, I've enjoyed every moment with you. I'll miss the great times & I promise you: I'll still be crazy, passionate & full of energy," he wrote on Twitter as his birthday neared.
"Getting ready to join the 30s club soon. Wanna do ONE fun & crazy thing before I leave my 20s. Suggestions?"
What followed was probably more extreme than any hijinks Mr Ghonim could have imagined. One month after posting the message and telling his bosses at Google he had been called to a family emergency, he found himself at the epicentre of protests in Egypt calling for the immediate resignation of its president, Hosni Mubarak.
Arrested and jailed three days after the initial wave of demonstrations on January 25, he spent 12 days languishing in a prison cell, blindfolded and repeatedly questioned by state interrogators.
What led this young entrepreneur, part geek, part patriot, part activist but for the most part, a slight, bespectacled, unassuming family man who spent far too much time on the internet - much to his wife's chagrin - to become the voice of a generation, galvanising hundreds of thousands into calling for change?
When he emerged from captivity, dishevelled, unshaven and with a haunted look in his eye, he seemed bewildered by his new-found status.
"I am no hero," he told Mona al Shazly, the Egyptian TV presenter often described as Egypt's Oprah. "I was asleep for 12 days. The heroes were the ones who were in the streets, those who got beaten up, those who got arrested and put their lives in danger.
"What happened to me made me regret not being with these people. I came back from the Emirates to participate in this demonstration."
Mr Ghonim did more than participate. He was an important initial organiser, who issued a clarion call to fellow Egyptians to show their love for their country by gathering in Tahrir Square, where clashes among protesters, Mubarak supporters and police eventually led the death of at least 200. Duty-bound to speak up for fellow Egyptians, he wrote on Twitter on January 25: "To all Egyptians silence is a crime now!"
Thousands flocked to the public square on the back of a Facebook campaign called We Are All Khaled Said, in honour of a blogger who, it was alleged, was beaten to death by Egyptian police. The memorial page was created anonymously last summer and became a rallying cry for the recent demonstrations. As 400,000 dissidents signed up, disillusioned with Mr Mubarak's regime, the page's creator, eventually acknowledged as Mr Ghonim, preferred to hide behind his online pseudonym, El Shaheed, meaning "the martyr".
He also created the official campaign website for Mohamed ElBaradei, an opposition leader and Nobel Peace Prize winner.
There is little doubt he was vocal online and extremely passionate about his homeland, which he left to go to Dubai in 2007, leaving his mother and younger brother, Hazem, in Egypt and his half-blind father in Saudi Arabia.
Within six months of creating the Khaled Said campaign site, Mr Ghonim went from posting messages from his villa in The Springs to throwing himself into the lion's den. He moved from silence to words to action, maintaining modesty.
He said on his release: "Some of us are very rich; we live in great homes and drive great cars; I want for nothing. All of us endangered our lives but every single one of us who was at risk was not doing this for a personal agenda. All I did I was type away on my keyboard - that is not heroic.
"I could have stayed by my swimming pool in my house in the UAE and enjoyed my life, got paid, got raises, let the country burn - that is what I would say if I was a traitor."
The seeds of his transformation into a people's hero were sown, it seems, at an early age. He excelled in his computer engineering degree course at Cairo University, during which time he met Ilka, an American Muslim, online and married her at the age of 20 (he joked online that he "met my first wife through my second wife, which is the Internet"). They went on to have a daughter, Isra, now eight, and son Adam, two.
Mr Ghonim earned a master's in business administration at the American University of Cairo, where he impressed the dean of the business school, Sherif Kamel.
The professor, who invited Mr Ghonim back to lecture students at a conference in October last year, said: "He was one of our brightest students and extremely academic. He was inspired by the internet revolution and was very active in class, never holding back from expressing his opinions and encouraging others to participate.
"We stayed in contact because, as a professor, I want to maintain links with people who make their mark and he certainly did. I admired his thinking and ideas. We knew he was going places and would make something of himself."
While studying, Mr Ghonim worked as a marketing manager for Gawab.com, a Middle Eastern e-mail service provider, then went on to launch Mubasher.info in 2005, an Arabic online investment service.
Having honed his technical skills, he joined Google in November 2008 as a regional marketing manager, going on to become head of marketing a year ago at the office in Media City.
Nagi Salloum, a friend who worked with him at Google, said: "He is a hard-working, smart guy and very internet savvy, with expertise beyond most people, but he is also very honest and loyal. He was connected 24 hours a day - whenever you saw him, he was online."
Mr Ghonim - who never wore a suit, only T-shirts with logos - would often survive on four hours' sleep a night to surf the net, causing rows between him and his wife. Even trips to the park with his children were an opportunity to catch up on e-mail.
He even tweeted last December: "I enjoy working during vacation. It's very productive and stress free," and admitted during his television interview: "My social life was destroyed. My wife was going to divorce me because I did not spend time with her."
His prolific Twitter stream gives the biggest indication about how he resolved to turn what he termed "an Internet revolution" into a real one.
In June last year, he empathised with protesters in Alexandria campaigning for Said: "Wished that I was in Alex today for: silent protest at 2:00pm and the Kournich [sic] youth silent hour" and was impressed with one man who stood in the sea to make his voice heard: "Egyptians are speaking up!"
In July, he fumed: "A government so scared of its own young citizens is a clear evidence of corruption and dictatorship."
Did he plan what came next or did the swathe of dissidents following in his wake take him as much by surprise as the government?
"Trust me, in the next few weeks Mubarak will be trending again but for a different reason ;)", which he tweeted in August, seems a portent of what was to come.
But while the Khaled Said campaign was increasingly taking up his time, Mr Ghonim's online stream of consciousness reflected his usual preoccupations closer to home: his delight in his hi-tech gadgets (Bose speakers for his sound system, a MacBook Pro and a MacBook Air, a Samsung Galaxy Tablet, an iPad and a BlackBerry); his music (Tamer Husni and Justin Bieber while he saved the pianist Omar Khairat for long relaxing drives); and his obsession with famous quotes and trivia.
His heroes were, predictably, Bill Gates, Steve Jobs and Warren Buffett; his favourite hangout Starbucks or the Iranian cafe near his home.
But his messages took a more serious tone at the end of last year as he contemplated the flawed Egyptian elections: "We all know [they] will be massively frauded but I hope that no one dies today as a price of being part of this ugly show" and "everyone on the globe should be more aware of the corrupted regime".
Mr Ghonim, his friends and mentors have pointed out, could not sit back and do nothing if he saw an example of injustice. He had already launched a Google campaign to help orphans in Egypt and was outspoken when he saw employees in a coffee shop being prevented from joining Friday prayers: "Making people act against their beliefs is simply disgusting."
Mostafa Gamrah, the chief executive of Technowireless software development firm and a friend of Mr Ghonim, met him over a coffee on Thursday. "We exchanged opinions about how things are going. I feel very safe now. He's very realistic and says he is going to lead the revolution to an end with a proper victory that it deserves."
Mr Gamrah described Mr Ghonim as a "clean-hearted person. If he sees something he thinks is wrong, he says it straight to your face.
"He is calling this Revolution 2.0 - the social network revolution. I have not been surprised by his rise in all this. Wael is a proud Egyptian and the internet has given this a global dimension."
Mr Ghonim "is so convinced in all this that he says he will die for the cause", his friend said. "He said he is suffering because 40 million Egyptians are suffering."
Little surprise, then, that Mr Ghonim finally resolved on Twitter last month: "Despite all the warnings I got from my relative and friends, I'll be there on Jan 25 protests."
"We are all ready to die" was his last, ominous tweet on January 28, shortly before his arrest. And it was the first thing he said on his release, holding aloft a sheet of paper - the power of attorney signing over his assets to his wife.
Nor did it take him long to rise to his new-found status. Just 48 hours after his release, the haunted look had gone and he was back in Tahrir Square, clean-shaven and enraged on behalf of his people and speaking in more elegiac terms than ever.
And, of course, he had the last word on Twitter: "I said 1 year ago that Internet will change the political scene in Egypt and some friends made fun of me . Jan 25 proved you wrong. Revolution can be a Facebook event that is liked, shared & tweeted."