The makers of Gravity won't really come back down to Earth till the awards season is over, but even if the movie doesn't win any Baftas or Academy Awards, there is a sense of triumph in their simply having got the film made. They can also console themselves with the wall-to-wall acclaim and the $700m-odd in worldwide box office, but it's inarguable that, more than any other movie of the past year, Alfonso Cuarón's space epic pushed back the frontiers of film-making – to the extent that most viewers couldn't fathom how on earth (or elsewhere) the film was even made. What is easy to forget is that, initially, Cuarón and his team didn't have the slightest idea how to make it either.

Compared with your standard movie project, Gravity was more like trying to land somebody on the moon. It was, after all, a vast collective effort aimed at getting a couple of people into space for a short while. Nobody had done something like it before; nobody knew if it was possible given the available technology and the allotted timeframe. It was a genuine leap into the unknown.

"Every day, we thought: 'This is not going to work,'" says Cuarón. "It was a process of trial and error, and little, little hints of hope, and also a lot of mistakes. The only test screening that we had, months before the film was finished, was a disaster."

Sandra Bullock agrees: "We had no idea if it would be successful. You'd explain that it was an avant-garde, existential film on loss and survival in space and everyone would be like: 'OK …' It didn't sound like a film people would be drawn to."

Alfonso Cuarón and Sandra Bullock. Photograph: Alberto E. Rodriguez/Getty Images

Cuarón remembers watching the moon landings live on TV. As a boy, he dreamed of being an astronaut. But he never set out to reinvent the wheel with Gravity. "The thing is, I'm not a technological person," he explains. "When I finished the screenplay, I thought: 'We can do this in about a year.' [It took four-and-a-half years.] It's a simple story of a woman in space alone. For me it was a small, intimate film – yes, with some visual effects, but that was it."

He didn't even plan to make a space movie. "Before the story, you start with the theme," Cuarón says. And in a word, that theme was "adversity". Long before space was ever mentioned, Cuarón was discussing survival scenarios with his son and co-writer Jonás. Their reference points were two utterly un-spacey films: Steven Spielberg's Duel and Robert Bresson's A Man Escaped – both propulsive, stripped-down thrillers with an existential dimension. "A Man Escaped is not about a man escaping from prison, it's about a man transcending the metaphysical walls of his existence," Cuarón says. They talked about hostile, isolated locations, such as the desert (Jonás had just written a desert movie, Desierto, which he recently started shooting). "Then we said: 'OK, let's take it to an extreme place where there's nothing.' I had this image of an astronaut spinning into space away from human communication. The metaphor was already so obvious."

Adversity became more than just the theme once they started trying to figure out how to make Gravity. Cuarón already had a reputation for pushing beyond accepted norms. Despite his gentle demeanour, the 52-year-old director can be a taskmaster on set, according to colleagues. There's a story that when he was directing Harry Potter and the Prisoner of Azkaban, he wasn't satisfied with Buckbeak the hippogriff – a digitally modelled eagle/horse creature. Cuarón thought it looked far too clean. He told the effects people to go back and show him a hippogriff after it had just been mating in the woods. Sure enough, he got a convincingly wild beast rather than a nice bit of animation. If you look closely, you can even see Buckbeak casually shitting on the forest floor the first time Harry meets him.

Gravity was a new set of challenges: simulated weightlessness, the physics of space, replicating complex machinery – all compounded by ambitiously long takes. "When I realised it was going to be so technological, I was turned off, because that's not the process I wanted to get into," says Cuarón. "But then you realise all that technology is just a tool for the cinematic expression you want to convey. We explored every single available technology and saw it would not apply, but then you think: 'OK, if I combine this with this...'"

Explaining in detail how Gravity was made will take several discs of a deluxe DVD box set, but in brief, Cuarón credits the ingenuity of his crew, particularly cinematographer Emmanuel Lubezki and effects supervisor Tim Webber. "I don't understand that distinction where people want to put art like a religious experience above everything else. Before 19th-century romanticism, humanity and art and technology were one and the same. So I consider a lot of these people to be artists in their own right."

Lubezki had a eureka moment at a Peter Gabriel gig. He was inspired by the LED stage lighting to put the actors inside a giant light box. Screens on the inside walls of this 9ft cube matched the lighting on the actors' faces to the virtual environment that they would eventually be spinning around in – once it was digitally rendered, months later. Only one actor could fit inside, usually suspended on a special wire harness like a human puppet, occasionally supported by a clamp around one leg, or some other medieval-sounding device. Robotic arms adapted from the car industry moved both actors and camera in pre-programmed moves to match the computer animation.

George Clooney and Sandra Bullock are hooked up together on the set of Gravity. Photograph: Sam Jones

If this giant lightbox was Gravity's Apollo capsule, Bullock and George Clooney were its test pilots, and most of the time they were flying blind. "At least they had the moon to look at when they landed on it!" says Bullock. "We couldn't see what we were supposedly looking at. We saw blackness, we saw white light boxes, we saw machinery, maybe pieces of pod or Soyuz. We had to imagine it all."

Bullock's working day on the shoot sounds more like a complex medical procedure than an acting gig. She describes it as a "morose headspace". She was strung or strapped inside the lightbox for up to 10 hours a day. She was usually in complete silence, save for instructions coming through an earpiece, and observed only by a camera on the end of a robotic arm. It was as if she was acting in total privacy, she says: "The only people I'd see was if someone came in to adjust the rig or fix something. Everything else was behind this black curtain on this vast black sound stage. Often I would just stay in whatever apparatus I was in because it was too long to get in and out of it. You learn to zone out. I don't know if meditation is the right word but it was that principle. I would either play music or just close my eyes and stay where I was – until the end of the day where you'd put your own head back on and go outside and have the benefit of sunshine."

At least it was an asset in the "adversity" department. "My situation was somewhat like the situation the character was in," she says, laughing. "There's no one around, you're frustrated, nothing works, you're in pain, you're lonely, you want someone to fix everything for you but they can't – all those things I was feeling."

And when she wasn't literally hanging around, Bullock had to manoeuvre through precisely choreographed moves, to synch with the virtual environment she would be inserted into. "That was the most frustrating part," she says. "You thought you'd executed it properly then you'd hear 'Sandy …' in the earpiece, and either Alfonso or Tim would say: 'At 16.5 seconds, your hand was three inches too far forward, it needs to come back. Literally, if you were one inch out of place you had to start over. If you were two seconds too long in the scene, you had to start over. It was so angering and nerve-racking, but you just kept doing it till you got it right."

With all the physical strain, Bullock required regular visits from a physiotherapist to "put me back together," she says. She twisted her pelvis and suffered multiple bruises and cuts, but she bore it better than her co-star. Having sustained a serious back injury in 2005 (while making Syriana), Clooney found the harness contraptions agonising. "He's always in an extreme amount of pain," Bullock says, "and he had to get into that rig every day. He was only there for three weeks, but George had a lot more to deal with than I did."

The fact that the two are old friends helped. Bullock is unsurprised by Clooney's recent webchat where he joked: "Sandy drinks so much that oftentimes it's just hard to keep her upright."

"In order to tolerate George I need to consume large amounts of alcohol," she fires back. "So I only really drank for three weeks, to be honest – while he was there."

Bullock describes the British crew, though, as "civilised". "I think half the time they felt sorry for me, so they were extra gentle and extra kind. My priority was my son, Louis, so they created an entire jungle for him to play in, all inside this concrete jungle. So all I had to do was step off the soundstage and see this wonderul place they had made for him. They didn't have to do that but they did."

Eyebrows have been raised by Gravity's nominations for the Bafta for outstanding British film, as if Britain were desperately reclaiming the movie, now that it's a hit. But as Bullock points out, she and Clooney were the only non-Britons involved. Even Cuarón is an honorary Brit. He came to London to make Harry Potter, 12 years ago, and has lived and worked here ever since. It's a better place to bring up his two children, he says, and when he began to realise the complexity of Gravity, he decided he could only do it with Tim Webber and Framestore, the London-based effects house, with whom he worked on Harry Potter and Children Of Men. "I consider myself part of the British film community," he says.

Gravity wasn't simply an exercise in addressing and overcoming adversity; the whole idea was borne out of it, too, Cuarón says. The reason he was thinking about adversity was because he was beset by it in his own life. At the time of writing Gravity, he had recently been through a divorce, and was reeling from the collapse of another project, a children's film starring Charlotte Gainsbourg. "I went through one of those things that when it rains, it shits," he says. "Suddenly every single angle around your life becomes very challenging and very painful: personal, work, health, everything."

Out of this world: Gravity. Photograph: Sportsphoto Ltd/Allstar

Bullock has had her own issues in recent years. After winning an Oscar in 2010 for The Blind Side, she went through a fairly public divorce from her husband, motorbike builder Jesse James. She had also just adopted her baby son. She took a two-year break from acting, saying she felt "sad and scared".

"We all have adversity. It's there," Bullock says. "You can bring all your adversity to work, but if it has no bearing on the way the story's being told, you just have to leave your life behind and put yourself in her shoes."

"When you're working, you have more detachment than in your life," says Cuarón. "So the way of addressing adversity at work starts informing how to address adversity in life. Being able, like Sandra's character, to put your feet on the ground is very gratifying. It's like Schopenhauer said, people tend to believe that adversity is this extraordinary thing in humanity; adversity is the norm. It is extraordinary when you don't experience adversity. Adversity shapes who you are and how you deal with life."