HAVANA: In 2008 Raul Castro took over a country where most people couldn't own computers or cellphones, leave without permission, run most types of private businesses or enter resort hotels.
Castro set about re-engineering the system he had helped create and Cuba opened dramatically over his decade in office.
But when Castro steps down Thursday after two terms as president he will leave his successor a host of problems that are deeper than on the day his brother Fidel formally handed over power.
Cuba has nearly 600,000 private entrepreneurs, more than 5 million cellphones, a bustling real estate market and one of the world's fastest-growing airports.
Limited internet use is expanding fast, with thousands of Cubans installing new home connections this year.
Foreign debt has been paid.
Tourism numbers have more than doubled since Castro and President Barack Obama re-established diplomatic relations in 2015, making Cuba a destination for nearly 5 million visitors a year, despite a plunge in relations under the Trump administration.
On the other side of the ledger, Cuba's Soviet-style command economy still employs three of every four Cuban workers but produces little.
Private sector growth has been largely frozen.
The average monthly state salary is USD 31, so low that workers often live on stolen goods and handouts from relatives overseas.
Foreign investment remains anaemic.
The island's infrastructure is falling deeper into disrepair.
The break with Washington dashed dreams of detente with the US, and after two decades of getting Venezuelan subsidies totalling more than USD 6 billion a year, Cuba's patron has collapsed economically with no replacement in the wings.
Castro's inability or unwillingness to fix Cuba's structural problems with deep and wide-ranging reforms has many wondering how a successor without Castro's founding father credentials will manage the country over the next five or 10 years.
"People in Cuba really haven't processed yet what it means to have a government without Raul or Fidel leading it," said Yassel Padron Kunakbaeva, a prolific 27-year-old blogger who writes frequently from what he describes as a Marxist, revolutionary perspective.
"We're entering unknown territory."
Tens of thousands of highly educated professionals are abandoning the island each year, leaving Cuba with the combination of third-world economy and the demographics of a graying European nation.
After a 2016 recession, Cuba said growth was 1.6 per cent last year, although official accounts remain opaque and questioned by experts.
The single-party government controls virtually all forms of expression and organization, with near-zero tolerance of public criticism or dissent.
The mood on the street is pessimistic, with few expecting a better future anytime soon.
"The political future of whoever takes over in April depends on the economic question," said Jose Raul Viera Linares, a former first deputy minister of foreign affairs.
"It's the possibility for young people to dream, to design their own future.That's all based in the material wealth that this country is able to achieve."
The greatest immediate challenge for Castro's expected successor '57-year-old Vice President Miguel Diaz-Canel Bermudez' is unwinding a byzantine dual-currency system featuring one type of Cuban peso worth 4 cents and another that is nearly a dollar.
The system was designed to insulate a state-run, egalitarian internal market using "national money" from trade with the outside world denominated in "convertible pesos."
The barrier between the two worlds swiftly collapsed and the system has fostered big economic distortions.
Inefficient state enterprises receive mammoth subsidies by obtaining expensive convertible pesos for the price of the cheaper "Cuban peso."
The dual-currency system also allows private businesses to receive subsidized goods and services like water and electricity in Cuban pesos, then turn around and charge their relatively wealthy clients in convertible pesos at a significant profit.
Castro called for elimination of the dual currencies from the beginning of his presidency, but never got around to it.
Unlike his brother Fidel, who extended his time in office until illness forced him to retire, Raul has long made clear that he would step down as president in 2018 as part of a coordinated handoff to a new generation of leaders.
He will remain first secretary of the Communist Party, the country's guiding body, but many Cubans expect him to move into semi-retirement in Santiago, the largest city in Cuba's east, where he was born and led rebel troops in the country's 1959 revolution.
"We've risen up economically. The new possibilities have changed my life, of course," said Yanelis Garcia, a 44-year-old mother of three who saved money from raising pigs in her backyard to slowly build a prosperous six-room bed-and-breakfast and taxi business in the central city of Santa Clara.
"I've always liked having my own business to be able to provide for my family. It's been really good."
Cubans fill thousands of flights a year to Miami, Panama and Cancun, where they cram duffel bags with gym socks and Xboxes for the vibrant private sector and rising middle class.
But last August, the Cuban government froze new licenses for private bed-and-breakfasts, restaurants and other popular businesses, leaving many Cubans questioning how their government envisions a path to prosperity.
"We've seen necessary reforms and I think that in the future there will have to be more," said Norma Chiang, a 77-year-old state accountant and auditor.
"Self-employment needs to be broadened, little things like bakeries or food stands that can be in the hands of individuals and not the state."