Remember the beginning of

The Incredibles

? Superheroes banned from performing their crime-fighting, life-saving stunts because of law suits from disgruntled citizens, costly damages incurred in the line of rescue, accusations that the caped crusader with the X-ray vision was a Peeping Tom?

Well, the Will Smith title-character in Hancock has the same problem. Here's a guy who can pinky-lift tractor-trailers, leap tall buildings in a single bound, rocket through the skies and bounce bullets off his chest - basically all that Superman stuff - and yet the public hates him.

He's rude, surly, indifferent. He ties up traffic. Sure, he stops bad guys and saves lives, but he destroys millions of dollars' worth of city infrastruture and private property in the process. Tossing a beached whale back into the Pacific, he accidentally hurls the behemoth straight into an unsuspecting sailboat. He's a screw-up.

And Hancock, deftly directed by Peter Berg from a screenplay by Vy Vincent Ngo and Vince Gilligan - and not based on a comic book, but certainly inspired by more than a few - wastes no time in showing the guy at his worst: First seen, he's curled up on a street bench, ringed by empty bottles of cheap whiskey. When a kid tries to wake him to tell him about a high-speed chase on an L.A. freeway, Hancock, hungover, sneers.

A rollicking tale of rehabilitation and redemption, rife with cool special effects, Hancock is smart and surprisingly raunchy (for a PG-13). It boasts yet another terrific turn from Smith. The homegrown superstar (his production company is named Overbrook) brings querulous humor and a palpable pathos to the role of a problem-plagued superhero. When he meets, and saves, Ray Embrey (Jason Bateman), a PR exec whose car gets stuck on a railway crossing, Hancock, who's led a lonely, angry life, discovers what friendship, family and personal responsibility is all about.

If that sounds corny, it is - and isn't. Hancock mixes its sappier sentiments and moral uprightness with doses of edgy, dark comedy, literal and visual profanity and, midway through, a major, major surprise twist. There's a scene in Embrey's house in which Hancock drops in and picks up various kitchen utensils and frying pans, that's both a slapstick feat and a slap-in-the-face for anyone who thought they knew where Hancock was heading.

Berg, the actor-turned-director (Friday Night Lights, The Kingdom), has been handed a funny, intelligent screenplay that feels like the origin story of a long-lost comic book series. Bateman - whose character is described as "the Bono of PR" because of his championing of good causes - plays earnest with an archness that's just right. And Charlize Theron, in the role of Embrey's wife, does much more than merely keep house and tend to the kid. Watch out when she puts on her makeup. Awesome.

Hancock succeeds, too, where The Incredible Hulk and even the whopping great Iron Man let down a bit: its CG and visual effects work - the zooming aerial sequences, the stopping of an oncoming train, the "parking" of a gang's getaway car atop Hollywood's landmark Capitol Records building - are supremely well-executed, fitting pretty much seamlessly into the fabric of the film. If Hancock has any flaws, it's in the tricky balance of its darker elements - the guy's a suicidal alcoholic, after all. But more often than not, the filmmakers manage to find just the right tone.

Smith, the box office boy wonder of the July 4 weekend (Independence Day, the Men In Blacks) has long been drawn to stories that address serious issues (poverty in The Pursuit of Happyness, eco-apocalypse in I Am Legend). And Hancock, for all its superhero hijinks, has a weightier side. It's a story about mythic heroes - gods, even - and why humankind needs to have them kicking around.

Thanks to Smith, it's a story about movie stars - and why the multiplex-going humankind needs to have them kicking around, too.

Contact movie critic Steven Rea at 215-854-5629 or srea@phillynews.com. Read his blog, "On Movies Online," at http://go.philly.com/onmovies.