Perhaps Jeff Bezos had a crystal ball.

Two decades ago, he foresaw a future when a click would conjure anything from pet food to caviar; malls would fade in popularity; and shops would have to offer entertainment or convenience to survive.

Then he built an empire in that image.

Amazon, which he founded in 1994, is now vying to become the world's first trillion dollar company, having transformed from niche second-hand book seller to global jack-of-all trades.

But Mr Bezos, now the world's richest person, claims higher aims than just reshaping the world's retail market.

He privately owns the Washington Post newspaper. His aerospace firm, Blue Origin, plans to sell tickets for space travel next year. He has also hinted he will announce philanthropic plans this summer.

Years ago, his high-school girlfriend told Wired that she had always expected him to make a fortune, tracing his drive to an early dream of exploring outer space.

"It wasn't about money itself. It was about what he was going to do with the money, about changing the future," she told the magazine.

Space colonies
Signs of Mr Bezos's ambitions emerged decades ago.

The child of teen parents who quickly divorced, he was raised largely in Texas and Florida by his mother Jackie, and his step-father Mike Bezos, an Exxon executive who had fled Cuba as a teenager after Fidel Castro came to power.

He displayed an early inclination for engineering and science, dismantling his crib with a screwdriver at the age of three, according to a 2013 biography by Brad Stone.

In a high school graduation speech, he outlined a vision for establishing colonies in outer space.

At Princeton University, Mr Bezos studied engineering and computer science, later using his skills at financial companies in New York, where he met his wife MacKenzie, now a novelist, at the hedge fund, DE Shaw.

At the age of 30, he quit after coming across a statistic about the rapid growth of the internet.

In a 2010 speech at Princeton, Mr Bezos recalled his decision to head west and start Amazon as the "less safe path".

"I decided I had to give it a shot. I didn't think I'd regret trying and failing. And I suspected I would always be haunted by a decision to not try at all," he said.

Cybercommerce king
Mr Bezos's gamble, funded with more than $100,000 in personal and family money, quickly paid off.

Within a month of Amazon's 1995 launch, it had already shipped orders to all 50 states and 45 countries, according to Mr Stone's book, The Everything Store: Jeff Bezos and the Age of Amazon.

In Amazon's first five years, customer accounts jumped from 180,000 to 17 million. Sales skyrocketed from $511,000 to more than $1.6bn.

Big-name investors flocked to the company amid the first wave of dot com enthusiasm. It went public in 1997, raising $54m and turning Mr Bezos, who once helped to box up the book orders, into one of the world's richest men before the age of 35.

In 1999, Time Magazine named him one of its youngest ever 'People of the Year', dubbing him the "king of cybercommerce".

Experimental
Known for being an exacting boss, Mr Bezos has guided Amazon with what he describes as a long-term strategy and "heads down" focus on the customer.

In practice, that has meant the firm is willing to spend money to make money, foregoing annual profit for 10 out of 23 years as it cut prices, offered free shipping and spent years developing new devices like its Kindle e-reader.

But Amazon also hasn't hesitated to save where it could, making headquarters employees pay for parking, battling with suppliers, opposing efforts to organise labour unions at its warehouses, and avoiding taxes as much as possible.

The firm experienced some failures, like early investments in sites like Pets.com that later lost money. But today even those look like a sign of its relentless competitive spirit and willingness to experiment.

Amazon reported nearly $53bn in sales in the three months ended in June, with record quarterly profit of $2.5bn.

The firm is expected to account for roughly half of all online shopping sales in the US this year - and nearly 5% of the country's overall retail market, according to research firm eMarketer.

It employs more than 575,000 people - a force nearly the size of Luxembourg's population.

It provides logistics, storage, loans and a selling platform to hundreds of thousands of third-party merchants and its profitable cloud computing division, which hosts huge swathes of the corporate world on its data servers, is the industry's global leader.

Nor is Amazon's thirst for new ventures sated.

Last year, it purchased upmarket grocer Whole Foods. This year, it announced the takeover of an online pharmacy. Executives say they are scouting for other deals.

Backlash
Amazon's rise, as former retail stalwarts like Sears, Toys 'R' Us and Barnes & Noble struggle, has drawn critics concerned about its monopoly power, its tax and labour practices - even its responsibility for driving up housing costs in its hometown of Seattle.

When the firm announced last year it would build another major campus in North America, local officials scrambled to win the firm's commitment, even as protesters, angry about the prospect of tax incentives going to one of the world's most successful companies, mounted anti-Amazon campaigns.

In the face of those critics, Mr Bezos has started to cultivate a more public presence on Twitter, where he shares photos of his parents and videos of dog sledding in Norway.

Amazon has also fought back with cash, more than doubling its spending on lobbying since 2014 to about $13m last year, according to OpenSecrets.org.

Twitter target
Despite those efforts, the company has a high-profile critic: US President Donald Trump, who has accused Amazon of winning unduly low shipping rates from the US Postal Service and kept alive the threat of regulation by attacking it on Twitter as a monopoly.

Mr Trump also frequently ties Amazon's activities to that of the Washington Post, although the newspaper is an independent, private investment by Mr Bezos, who purchased it in 2013.

With a fortune worth about $150bn, the 54-year-old Mr Bezos has also faced questions about his relatively limited philanthropic activity.

He recently hinted he will increase his giving, with an announcement expected later this summer.

Last year, while soliciting ideas, Mr Bezos said he expected to approach philanthropy differently than he does his businesses, focusing on immediate impact, rather than the long-term.

The world will be waiting to see if the new strategy still means success.