It's been thoroughly scrubbed from every corner of the Internet, so you probably wouldn't be able to see it now. But about two weeks ago, a Nine Inch Nails fan made a widely circulated video to accompany “Everything,” the band's terrifyingly perky new song. The video featured a smiling Trent Reznor riding a unicorn, surrounded by rainbows and Pikachu, that most adorable Pokémon. It was ridiculous on its face — Reznor has probably never even met Pikachu, and there are no reported instances of him ever smiling — but it neatly summarized fans' collective unease about NIN's first new album in five years, “Hesitation Marks.”

Express Newsletters

Get the latest news, sports and food features sent directly to your inbox.

“Everything,” a great, unashamedly poppy new wave song, dropped before anyone had heard the album in full, and it seemed to confirm everyone's worst fears — that, after a decade spent examining his misery from every possible angle, the '90s god of Sturm und Drang had been made soft by the giant-slaying trifecta of sobriety, fatherhood and middle age. The song's lyrics (“Wave goodbye/ Wish me well/ I've become something else”) did not engender confidence.

“Everything,” it turns out, is an anomaly (or Reznor trolling everyone, which seems less likely). “Hesitation Marks” is otherwise as grim as a reasonable person might have hoped for. It's grand and disquieting, creepy and meticulously realized, minimalist and overstuffed. It's one of the best albums of the year and NIN's finest work since at least 1999's “The Fragile.”

Reznor had spent the years since NIN's last record, the 2008 release “Slip,” working on a variety of soundtracks and one-offs, mostly with partner Atticus Ross, with whom he won an Academy Award for the score for “The Social Network.”

“Hesitation Marks” serves as a great example of how a legacy rock star can grow older: Keep your defining characteristics and marry them to enough new ideas so as not to sound like a nostalgia act. But not so many that you sound as if you are chasing trends.

The album lacks the dark lyrical heart of, say, “The Downward Spiral” (which it often resembles). But Reznor, now 48 and married with two young sons, still mines the same old resentments, demons and gripes, to almost the same lacerating effect. “Hesitation Marks” is less interior than any of his past work and more even-tempered, with fewer cathartic eruptions. But the familiar underpinnings are there: swelling synths; aggressive electric guitars — provided in part by Lindsey Buckingham and Adrian Belew; the omnipresent background clicks and scratches; the out-of-nowhere snatches of disco and ambient pop; the chorus-heavy electro-new-wave songs that lurch and throb like vintage NIN and rumble like weather systems — all secured by what are essentially very traditional pop melodies.

“The ghosts of who I used to be/ I can feel them come for me,” Reznor sings on “Find My Way,” which evokes his work on “The Social Network,” though the falsettos and piano also suggest Radiohead. “Satellite” is one of a raft of tracks that owe a debt to both funk and rap. Its reference to “data trails” seems to both prefigure recent revelations about the NSA (it was presumably conceived pre-Edward Snowden) and hark back to “Year Zero,” NIN's little-heralded concept album about government oppression. “Copy of A” and “Came Back Haunted” are familiar, golden-era NIN odes to torment and doubt.

“Hesitation Marks” lacks a certain passionate intensity, as though Reznor made it because he thought making an album might be nice, but most great '90s bands have come back weaker or not at all. It's perhaps not a bad thing that Reznor's misery seems more precisely calibrated than before, more consciously relatable, that he recognizes that the demons haunting Oscar-winning rock stars may also haunt high-schoolers, carpooling moms and recovering '90s alt-rock fans. Think of “Hesitation Marks” as the anti-“Yeezus” — challenging but not impenetrable, crafted by Reznor with one eye toward the marketplace. Challenging enough for him but accessible enough for us, it strikes just the right balance between what he knows you want to hear and what he's prepared to give away.