It was only a few days ago that Shane Carruth, software engineer-turned-filmmaker, was ready to walk away from the money on the table and keep his movie--78 minutes' worth of cheapo celluloid that had, in a Utah instant, become as valuable as strands of gold. He had stopped answering his cell phone, stopped checking e-mails. He had stopped listening to the offers, stopped crunching the numbers, stopped trusting the promises. He'd had it up to here with the chitchat and the backslaps. Maybe he'd just keep his first movie and good off and make his second. To hell with Sundance. To hell with movie distributors. To hell with awards. Enough already. His weird little movie, about inventors and time travel and greed and God knows what else, cost only $7,000 and was going to sell for more than that, but maybe, just maybe, it wasn't worth it.

That was how he felt a week ago, sitting in his Addison apartment during a day cold and gray enough to match his mood. The buzz of being the surprise hit of the Sundance Film Festival at the end of January, where the 31-year-old Carruth's Primer had won the fest's most prestigious prize, had given way to the throbbing hangover this first week of February.

Despite being selected as the festival's Grand Jury Drama Prize winner, an accolade that's gone to such films as American Splendor, You Can Count on Me, Welcome to the Dollhouse and Blood Simple, Primer had not yet been sold to a distributor. That was no big deal; plenty of Sundance sensations have gone wanting over the years, only to wind up in theaters. But the process was getting to Carruth. Last week he was already thinking about distributing the movie himself or just putting it on a shelf. He, like the two men in Primer who invent coffin-sized boxes that allow them to travel a few hours back in time, wishes he knew in early January what he knows now, most of all how hard it would be to sell your firstborn.

"See, I never thought about that," Carruth says. "I hoped, like everyone hopes, that somebody wants the film enough to buy it and put the money that it takes to distribute it, but I never thought about the fact I was gonna have to sell it to somebody and lose it and give up that control. And I think that's part of what's making these talks last so long, the fact I am having a hard time giving it up."

Those talks are over now: On February 6, just a day after Carruth and I spent hours talking about the good and bad things that come with being the film world's latest overnight sensation, an oral agreement was reached between Carruth and ThinkFilm, the Toronto-based distribution company that has handled films such as The Dangerous Lives of Altar Boys and the Oscar-nominated documentary Spellbound. The terms of the deal have not been disclosed, but Cassian Elwes, the William Morris agent who brokered the deal, says it's "pretty innovative and spectacular."

The deal took a relatively long time to finalize, in Sundance terms. Films that enter the fest with a buzz are usually snapped up before a single screening; the comedy Garden State, written and directed by and starring Scrubs' Zach Braff, was bought by Miramax and Fox Searchlight for $5 million early in the festival. Those movies that win its highest honors usually leave with a hefty check, though not always; it took months for Henry Bean's 2002 Grand Jury Prize-winning The Believer, about a Jewish kid who becomes a skinhead, to find its way out of the orphanage. Primer's not quite the controversial film The Believer is, but it comes with its own set of issues, chief among them that the movie's about as easy to follow as a raindrop in a hurricane.

It's not unusual to hear the movie described as "inscrutable," "puzzling" or "enigmatic," even among those involved with Primer, in which Aaron (Carruth) and Abe (David Sullivan) find they can go back in time just enough to make money, right some wrongs and, eventually, go a little nuts. Apparently, everything that happens in Primer makes sense if you watch the movie enough times--or watch it extremely high--but its languor may infuriate some who suffered through the movie but once. Some viewers will be enamored of its impenetrability; they will love figuring out which is the "real" Aaron and which is his time-traveling doppelganger. Others will lose patience; the film certainly has no tolerance for the casual viewer. Both Hollywood Reporter and Variety insisted Primer will have difficulty finding an audience outside the film-festival circuit.

Elwes, the man who infamously brokered multimillion-dollar deals for Robert Duvall's The Apostle and Billy Bob Thornton's Sling Blade, insists Primer's air of incomprehensibility had nothing to do with the deal's delay. It was, rather, Carruth who held up the proceedings by sweating over every detail before giving his OK. Carruth was never going to make a fortune off Primer--even though it cost only $40,000 to make and transfer from 16mm to 35mm--but damned if he was going to give it away to somebody who might not treat it with the proper respect and, at the very least, leave him enough to pay off cast and crew.

"If they were offering $50 million, I could find a way to part with it," Carruth said, a day before the deal was done. "Two million, I could find a way to part with it. But they're not. I'm not cocky, and I feel fortunate. If I get to make another film, I think that's gonna be awesome. But at the same time, I've got stories now I have to make. I really think they're gonna be good. So what I'm thinking about is the DVD boxed set that comes out in 10 years, and I don't wanna be hassling with these guys for the rights to this film."

The most amazing thing about all of this is that Carruth, who has a bachelor's degree in mathematics from Stephen F. Austin State University, did not know how to make a movie when he started work on Primer. A J.J. Pearce High School graduate and the son of an Air Force sergeant, Carruth was a software engineer only four years ago, consulting for out-of-town companies for whom he set up intranet databases and e-mail systems. He did not know how to accomplish even the most basic tasks of moviemaking, so he taught himself cinematography, sound mixing, editing, scoring. He used a 35mm camera to storyboard the movie and learned the mathematic principles involved in cinematography--in other words, he basically figured it out as though shooting a film were a math problem for which only he could find the solution.

"Oh, no!" Carruth says, feigning horror at the suggestion. "Here we go! Here's the angle. No, no. Maybe. Maybe. That's the thing. Yeah. It's probably true. A lot of math isn't just the numbers. It's the fact that there is this problem that is seemingly unsolvable in front of you, and yet if you take it apart, it can be solved. Learning that lesson over and over again in college probably had something to do with it. To be honest, now I look back at it, and I don't know why I thought I could do this. I don't know what I was thinking, but for whatever reason, I thought I could do it."

Carruth shot the film over a month in 2001, then spent the next two years in his apartment learning how to edit, overdub and score the film on his home computer. When he finished in August 2003, he went to Los Angeles and cold-called publicists, agents and managers, 100 a day for almost a week. Finally, a publicist named Mark Pogachefsky watched the film and liked it enough to pass it along to an agent at William Morris, Craig Kestel, and to call Geoffrey Gilmore, the director of the Sundance festival. Kestel was "ecstatic" after seeing Primer and showed it to Elwes and his partner, who decided they could sell the movie, which Carruth had, by then, entered into Sundance.

Primer entered the festival as its "runt," Carruth likes to say. It had no stars (no Kevin Bacon, say), no buzz, no distributors all that interested. Only ThinkFilm was, ahem, thinking of buying the movie before it won the Grand Jury Drama Prize; others entered the bidding later. But the movie was one of those snowflakes that turns into an avalanche in the Utah mountains: With every screening, and there were five spread throughout the festival, more and more people showed up, and more and more stayed for the Q&A sessions with Carruth after the screening. At one, Faye Dunaway ran up and told Carruth she was prepping her directorial debut and that she wanted some tips and, God, could she get his phone number?

Audience reaction to the movie was, by all accounts, decidedly mixed. "I trolled around to see what people thought," says Magnolia Pictures President Eamonn Bowles, who was trying to acquire the film. "What I heard, a couple of people didn't like it. And, yeah, a lot of people are gonna come out scratching their heads. But I thought it was bracing, really intelligent."

On January 23, Primer won its first award of the festival: the Alfred P. Sloan Prize, which goes to the film that best shows science and technology and comes with a $20,000 cash award. Carruth figured that was all he'd win and went to the next night's award ceremony expecting nothing. Then Danny Glover got to the jury's award for dramatic film, and when he started talking about the winner's "unique voice," Kestel turned to a colleague and said, "He's talking about Primer." He was.

"I really was convinced that the winners knew they had won beforehand," Carruth says. "Since nobody had come and told me I had won something, I just assumed it's all figured out, and I am going to enjoy the show, and oh, here's Danny Glover, he's famous, that's cool. That's the biggest reason why I was stunned. I hadn't seen any of the other films, but I find it hard to believe it would be easy to look at all 16 and go, 'Oh, yeah, Primer's the best.' Like, I really doubt that happened."

So, if Primer is so inscrutable, so unlikely to find much success outside the film-fest circuit, then why did it win?

Maybe it's because Primer is the kind of film upon which Sundance made its rep--and the kind of film no longer celebrated or rewarded at Sundance, where coveted prizes and multimillion-dollar deals are given to Hollywood product scuffed up just enough to look "indie" to outsiders. And it stumbled into Sundance just as the festival's reputation was taking its biggest beating yet, with the publication of Peter Biskind's Down and Dirty Pictures: Miramax, Sundance, and the Rise of Independent Film, in which the author accuses the fest of selling out to the very system Sundance was meant to transcend or, better still, demolish. Just maybe, Carruth happened to be the right guy with the right film at the right price in the right place at the right time.

He is asked: Why do you think it won?

"Yeaaaah, that's the thing, isn't it?" He sounds as though he's been asked the question a lot. But he hasn't, not by others.

"No, it's my own subconscious that asks that," he says. "I mean, I haven't seen the other films, but I hear great things about at least five or six of them, so I know that they were a good set of films. The only reason I even have this question is because of this book and because of what's happening in independent film. I am sure a lot of people look at this and go, 'Sundance is worried about their image, because they're starting to look like a showcase and not so much a festival for independents, so, hey, they just happened to pick the cheapest film in competition and say that's their winner.'...I didn't set out to be the poster boy for independent film."

In the end, all five members of the jury--revered indie-film producer Ted Hope, actors Danny Glover and Maggie Gyllenhaal, writer-director Lisa Cholodenko (Laurel Canyon) and cinematographer Frederick Elmes--loved the movie and thought it deserved the accolade. Period.

"People have accused the jury of voting with our political mandate, which is inaccurate," says Hope, who produced last year's Grand Jury winner, American Splendor, based on the life and work of underground comix icon Harvey Pekar. "The films we awarded were the least expensive, but we addressed the films on their own terms, which didn't take into account whether someone had a comfortable means of production or limited means of production."

Hope says the jury was indeed unanimous in its decision, after some five hours of discussion; other films were well-liked, among them The Woodsmen with Kevin Bacon as a pedophile and the comedy Napoleon Dynamite, but Primer was much-loved. Hope also liked that Carruth wasn't from Los Angeles or New York; his win brought Sundance back to its roots as a fest that celebrated "regional" filmmaking.

"You could feel Shane's enthusiasm for what he was doing coming through in every aspect of that movie," Hope says. "He is the filmmaker in that group--OK, one of maybe two--that I most look forward to seeing his next movie."

And now that the deal is complete, Carruth can get on to the making of that film, which he thinks will cost some $2 million to produce the right way. In between, he will go to Los Angeles, meet with studios, maybe talk to some directors who've won the prize in the past and try to convince himself that winning this prize doesn't mean a damned thing.

"I am finishing a script now that I really wanna make, and the prize comes up," he says, deadpan. "When I am thinking about the writing, I am like, 'Wow, now I'm this award winner; now I gotta punch this up.'" He pauses, then cracks a slight smile. "That's a joke. I can't wait to actually get started with the filmmaking. I look forward to that."