What are we — the hyperconnected citizenry of 2016, clutching our smartphones as close as a lover — to believe if Facebook cannot be trusted to deliver news with the cold, unblinking logic of a machine? How did we start thinking Facebook performed in the same robotic manner as the toaster?

As the journalist Virginia Heffernan writes in “Magic and Loss: The Internet as Art,” we too often conflate the internet with the worlds of commerce or science rather than with creativity. “For years technology had seemed to be the masculine form of the word culture,” she writes. “If you wanted to sell men on a culture story, you did well to frame it as a tech story — a story about the plumbing or stock price of Netflix rather than a story about the pixels that constitute ‘Bloodline.’ Technology is built stuff that aims to be elegant and engaging. Apps are founded on science in the same sense that a watercolor is founded on science, where the chemistry of pigments and the physics of brush strokes are the science. But the resulting painting, if successful, hints at transcendence or at least luminous silence, something whereof we cannot speak.”

Heffernan is seeking an understanding of the aesthetic and animating spark of the greatest enterprise of our time. To do that she focuses on the building blocks of the internet — design, text, images, video and music — while meditating on themes of magic and loss. For every invention destined to change everything (again!), what do we lose in the fire?

We follow Heffernan through the Smithsonian Natural Museum of Internet History, as she annotates the exhibits: the Kindle, with its lithe design and endless supply of books, usurper of the printed word; the MP3, compressing the rapture and idiosyncrasies of your favorite music, destroyer of the music business and the listening experience; YouTube, standing among the smoldering wreckage of the linear-minded ­entertainment industries, triumphant in its mesmerizing stunts, obscure clips and unboxing videos.

This could be a somber exercise, examining the ashes of Pompeii rather than glimpsing the City on the Edge of Tomorrow. But Heffernan is a gleeful trickster, a semiotics fan with an unabashed sweet tooth for pop culture, who believes we shouldn’t confuse grief over the passing of our favorite technology with resentment because some digital alchemy failed to preserve analog experiences: ­“Whether or not we admit it, the internet and its artifacts are not just like their cultural precedents. They’re not even a rough translation — or a strong misreading — of those precedents.”

Loss means plenty to mourn — at one point Heffernan trips into a memory hole for the cord-tangling days of gabbing on the house phone. That nostalgia feels outmoded in places, dwelling on the universality of Twitter as the network’s audience stagnates, or discussing YouTube as the standard for user-created video as venues like Snapchat redefine the norms of uninhibited expression.

But magic brings joy. And Heffernan is enthralled by the web, always stopping short of the techno-utopianism that leads “innovators” to speed past the consequences as humanity colonizes the future. In one breath she juxtaposes the socioeconomic divide between using apps or the ad-supported web with the phenomenon of “white flight,” the next she’s punctuating a theory on visual literacy with an entire paragraph dedicated to the seductive wonders of each of Instagram’s filters.

That’s what makes “Magic and Loss” hold together: It embraces the internet as a work in progress. It’s an enjoyable snapshot, perhaps imperfect, but always dangerously close to receding from view as we scroll onto whatever’s next.

Justin Ellis is a former writer for the Nieman Journalism Lab and currently a senior editor at ESPN the Magazine.