I went to see Waitress on a total whim, expecting it to be nothing more than a light and fluffy summer-night diversion. By the time I left the theater, I realized that it was a strong, early contender for my favorite film of 2007.

Waitress transcends the diner kitschfest that I (and many others) anticipated, attaining the magical quality with which the best classic Hollywood movies are imbued. It shares with those films a likable and virtuous protagonist (Keri Russell, radiant as Jenna), who instantly wins over the audience. A waitress at “Joe’s Pie Diner,” Jenna is stuck in a suffocating marriage with a jealous, needy, and abusive husband, Earl (Jeremy Sisto, exhibiting impressive emotional range). Her only joy in life is creating delicious, whimsical pies with names like “Marshmallow Mermaid” and “I Hate My Husband.” Though Earl demands that she give him all of her tip money at the end of each shift, she manages to sock some of it away and fantasizes about winning $25,000 in a pie competition, in the hopes of saving enough to leave him. An unwanted pregnancy further complicates Jenna’s situation, forcing her to keep another secret from Earl and bringing a cute but awkward young obstetrician into her life.

You might think you know where this is going. Well, think again. While (spoiler!) dearly departed writer-director Adrienne Shelly does give us a happy ending, it isn’t the one she sets us up to expect. I won’t reveal the specifics, but I will say that the ending is completely appropriate. Though it masquerades as a carefree confection, Waitress is a serious and important film. It doesn’t give us easy answers, making her characters deal with the consequences of their actions. Romantic love doesn’t conquer all, because sometimes there are more important things in life. Sometimes relationships simply don’t work out because practical concerns prevent them from doing so.

The film’s characters, too, seem at first to conform to Hollywood stereotypes. Slowly, though, Shelly erodes these one-dimensional representations. Earl is a controlling, abusive husband, but he truly loves Jenna, and his behavior stems from the fear that she doesn’t love him as he loves her. Though Becky (Cheryl Hines), who waits tables with Jenna, is a snarky, subtlely superior bottle blonde, she is fiercely loyal to her friends and refuses to leave her invalid husband. Powerful performances on the part of every actor, most of whom were playing against type (check out Andy Griffith as a fussy curmudgeon with a good heart) are essential to fleshing out Shelly’s complex cast of characters. The filmmaker herself proves a triple threat, rounding out the triumvirate of waitresses as single, self-conscious Dawn.

Waitressis far from the best movie ever made. Still I consider it a perfect film. Not a single shot or line is wasted. Shelly’s directorial choices are impeccable. Every scene, especially those overhead shots of Jenna baking ever more exotic pies, lives up to its aesthetic and dramatic potential. The movie succeeds entirely on its own deeply, yet subtley, subversive terms. Waitress is that rare film that moves the medium forward without alienating mainstream audiences. Cinema, and the world as a whole, I think, has lost an important, powerful, humanist voice in Adrienne Shelly.