Teaching at an inner city middle school can be stressful, but Dan Dunne (Ryan Gosling) handles the kids under his tutelage with ease, engaging them in classroom discussions, bantering about their lives, even coaching the girls' basketball team. He's the kind of teacher you wish all your middle school teachers had been -- interesting, fair, and not condescending to his students just because they're kids. Yes, Dan is the perfect teacher, while he's on the job. It's after work, when he brings out the crack pipe, that his dark side comes out.

Dan, the protangonist of Half Nelson, is living a double life: Responsible schoolteacher by day, crackhead by night. An idealistic young man caught in the throes of a reality he doesn't know how to handle, Dan deals with his stressors by making them go away for awhile. He thinks he's got it all under control, and, like a lot of addicts, maintains the illusion of control on the surface, for awhile -- until the day one of his students, Drey (newcomer Shareeka Epps), walks in on him in the locker room post-game, prone on the floor, crack pipe in hand.

p>If that happened in my suburban neighborhood, the kid would probably freak out, but Drey is older than her years, and life in her drug-dealer populated neighborhood has made her immune to the shock value that the sight of a teacher with a crack pipe might have for a lot of kids. And thus begins a complex relationship between teacher and student that merges the lines between adult and child, as Drey struggles to make sense of the contradiction of her white, middle-class teacher lying helplessly on the floor like a homeless crackhead.

Epps, who attends an inner city arts school in real life, handles this role with an ease that belies her age and experience. When Drey looks at Dan, her eyes seem to bore through him and see into his very soul. Drey has the world-weariness of a child who's grown too fast and seen too much, and when she finds her favorite teacher on the locker room floor, emotions flit beneath the surface of her guarded expression: Shock, betrayal, sorrow and acceptance. In that moment, Drey and Dan will become allies or enemies -- maybe a little of both -- and the teacher watches his student blearily through his crack haze, trying desperately to pull himself together.

It's an interesting idea for a story, and director Ryan Fleck brings this sumptuously layered screenplay (which he co-wrote with Anna Boden) to delicious life, thanks largely to the performances of the two main actors. I never would have thought of Gosling for a role like this, to be honest, but he does a stellar job of portraying a complex character, walking the ridgepole between idealistic, responsible molder of young minds and blithering drug addict; it's a performance that could very well generate some Oscar buzz.

Why would someone who seemingly has everything easy -- middle class family, college education, a job he loves -- resort to using street drugs -- especially crack? What are the demons Dan is fighting? The script doesn't bang us over the head with obvious or stereotypical reasons for Dan's drug use, other than his disillusionment over his once deeply held belief that he could change the world. Dan looks around and sees that the world is going to hell in a handbasket, and he no longer believes in himself and his own ability to do any good, fighting the good fight in the battlefield of an inner city middle school. Life is pain, as a Buddhist might say, and for Dan, the blissful, albeit temporary, oblivion of a crack haze makes it seem better, at least for awhile.

Dan has the duplicitous nature of a lot of drug addicts: At once charming and chameleon-like in his ability to conceal his addiction when he needs to, while beneath the surface simmers the shifty mistrust and deceit of the demon of addiction. Dan has reached that pivotal point where his demon has him firmly in its grip (hence, the title of the film); he's jeopardizing not only his job and the relationships with other adults in his life, but now also with one of the very kids he set out to save when he became a teacher. The realization of the state of his moribund ideals gives him a sense of desperation.

Tight direction by Fleck keeps the tension where it needs to be, and he guides his key actors through the intricacies of the script with an even hand. There's never any suggestion of an inappropriate sexual relationship between Dan and Drey, although there is certainly a crossing of boundaries between teacher and student. The heart of the story, though, is about a young girl trying to help the one adult (outside her overworked mother) who has tried to throw a lifeline into the darkness of her life, and the narrowness of the line between light and dark.

Dan believes in his students, so Drey believes in him, with a child's ability to accept without judging, and she tries to help him in the only way that makes sense for her.You may find yourself exasperated, as I was, by Dunne's inability to get a handle on the addiction that has him in its clutches (especially if you've ever had an addict in your own life), but you're sure to walk away from Half Nelson feeling affected by the story and impressed by the excellent performances and direction.