Lego is an idea as much as it is a toy; if you try hard enough, you can fit the entire story of the last century of child’s play and the hopes and desires of every parent into one of its 9.6-millimeter-tall rectangular plastic bricks. Molded in a thermoplastic polymer, acrylonitrile butadiene styrene, Legos are known for their durability, which is why you can pull out the 30-year-old Legos stashed in your parents’ basement and, dated color schemes aside, they’ll be the same as they ever were. Not only will they look the same, but they will fit together with every other one Lego has ever made, even those going back to 1949, when a Danish toy-maker named Ole Kirk Kristiansen made his first plastic brick. Lego calls it the System of Play, and it is both a manufacturing principle, allowing the company to reuse the same molds to make infinite new sets, and a play proposition: The more bricks you own, the more you can build.

Like all 6,500 Lego elements — cubes, rectangles, octagons, wheel beds, arches, even the tiny semi-circular hands of yellow mini-figures — the standard brick has a variation of just 0.004 millimeters, which means Legos are more precisely crafted than your coffee­maker, your television, even your iPhone. It’s this precision that makes it possible to use Legos to build a 16-inch replica of the Taj Mahal (5,922 pieces) or a full-scale version of the X-Wing Starfighter (5,335,200 bricks).

Psychically, the Lego brick is also distinctly calibrated; it operates in a space shared by childhood imagination and parental ambition. For children, Legos allow them to build whole universes to their idiosyncratic specifications. For parents, Legos seem like the vegetable your kid actually requests and then eats in heaping mounds — a toy that’s also a building block for future creativity, a mechanics lesson that doesn’t feel like schoolwork, a wholesome embodiment of Scandinavian craftsmanship, something tactile in a world that is increasingly pixelated. It is the plastic plaything that even the parent most committed to natural, wooden toys will gladly buy. It is also more popular today than it has ever been, which is a surprise even to some at the company, since roughly a decade ago it was nearly bankrupt.

When Lego’s sales began to drop off in the 1990s, the company sought counsel from outside advisers, who warned of a dire future. Childhood was getting shorter, kids were abandoning toys sooner, and what little playtime was left was increasingly being consumed by video games. This was at the dawn of the internet, well before parents were worrying over “screen time” as they propped up iPads on the dinner table; the problem would only get worse for the brick, the advisers agreed.

Lego responded by diversifying its offerings. It expanded its Legoland theme parks and started making action figures and baby toys and things that were scarcely recognizable as Legos. If kids were uninterested in the bricks Lego was offering, they were even less interested in these new, random products. The effect was catastrophic. By 2003, the company was on the brink of financial collapse, just three years after Fortune had named it “Toy of the Century.”

In Lego lore, the crisis provoked a company­wide soul search. And where the soul was located was in the brick. Henceforth, the brick would be the center of everything it did, toy trends be damned. Lego handed the operation of Legoland to an outside company and stopped experimenting with non-brick lines. (It also, not insignificantly, reportedly laid off 1,200 employees, moved its U.S. factory to Mexico, and modernized its manufacturing operations.) The turnaround was as dramatic as the collapse: Since 2005, Lego has had double-digit growth every single year.

But the comeback wasn’t as simple as Lego makes it out to be. Even as Lego was telling the story of getting back to the brick, it was in crucial (and profitable) ways moving beyond it, partnering with movie studios and video companies to extend and delineate Lego’s brand, while cannily siphoning buzz from ubiquitous franchises. In effect, Lego had found a way to compete against the encroachment of screen time by being screen time. Instead of following toy trends, it was once again helping create them, becoming what academics call “transmedial.” The post-crisis company now sits at the center of a cross-platform, cross-branded intellectual-property octopus. SpongeBob SquarePants, Indiana Jones, Mickey Mouse, Batman, The Simpsons, Toy Story, Pirates of the Caribbean, the Disney princesses, and Lord of the Rings have all gotten the Lego treatment, while Lego’s own original licensed properties, like Ninjango and Legends of Chima, have found their way into movies and video games and onto clothing.

For parents, Legos seem like the vegetable your kid actually requests and then eats in heaping mounds.

All of these themed sets are both bricks and not bricks. Since 2005, there have been some 40 Lego video games and dozens and dozens of Lego television shows and TV movies, not to mention the big movie — The Lego Movie — which was basically the CGI manifestation of Lego’s cross-branding strategy, in which many of Lego’s franchised properties appeared together in what Lego sometimes calls a “multiverse.” In February, Lego will have its second big movie launch, The Lego Batman Movie. If playing with Lego is an exercise in world-building, then it is increasingly the company doing the building, constructing a world in which everything is Lego.

Even as its move into the transmedial has made it wildly successful — it is now the second-largest toy company in the world — Lego still tries to project the image of itself primarily as a pile of bricks used to make stuff and justifies its forays into licensed properties as a way to get kids to build who would otherwise pick up an iPad. For good reason: The conviction that building toys in general, and building with Lego in particular, is actually good for you is central to Lego’s incredible success.

And yet there’s evidence that in moving across platforms, Lego and other toy-makers have changed the nature of how kids play. A few years ago, Seth Giddings, a media researcher and a parent, began studying how his kids played with Lego Racers 2 — the video game — and whether it affected the way they interacted with their Lego vehicles. What he noticed was that they now play with physical Legos as if they were the video game, reenacting their races with the plastic pieces. This isn’t to say that Legos aren’t still good toys, or that there’s anything necessarily wrong with imaginary play mimicking the experience of a video game, but it’s certainly different from what most parents imagine they’re buying in a box of Legos. The question is whether that difference matters.

Billund, Denmark, was cow pasture when Kristiansen molded his first Lego. And 67 years later, despite being the world headquarters of a multibillion-­dollar multinational company, it is now essentially cow pasture with just over 6,000 residents, a corporate campus, and a sizable manufacturing plant plunked in the middle of it. There is an awful lot of sky.

On Lego’s campus, the international Danish architecture firm BIG is building a brand house, constructed from offset white cubes proportioned in the ratios of a two-by-four Lego brick. Around the corner is Lego’s original low-slung brick factory, which now houses a company museum.

There, in an upstairs conference room, I got a private viewing of the DC Super Hero Girls, a new line launching this month in the U.S., which perfectly embodies the complicated, bifurcated, continually evolving nature of Lego’s current identity. Bastiaan Gijsbrecht Brederode, a lanky Lego designer with shaggy hair and thick stubble, wheeled them over from the design studio shrouded under a silky blue magician’s cloth, for secrecy. Lego has a rabid following of grown-up enthusiasts, who refer to themselves as AFOLs, “adult fans of Lego,” and who fill message boards and fan sites with obsessive documentation of all the company’s doings, so the precaution isn’t totally unwarranted. Plus, though Lego is unrivaled in our imaginations, the original brick itself hasn’t been patent-protected since 1975. Its main competitive advantages, then, are the quality of its bricks, hence the obsessive precision; the designs of its models; and its exclusive licensed properties.

The IPs work in two directions: Lego has an internal department dedicated to finding interesting IPs to Lego-ize, but brands also seek out Lego. A few years ago, Warner Bros. came to Lego with the idea for a new scripted cartoon in which it had recast the female superheroines from across the DC franchise — Wonder Woman, Batgirl, Supergirl, Harley Quinn, Lashina, and Bumblebee — as classmates at Super Hero High.

What Warner Bros. got out of the deal is pretty clear: A Lego toy would fuel interest in the cartoon. For Lego, the DCSHG line, which would be geared toward 7-to-12-year-olds, represented a new play proposition. Lego had had superhero boys’ lines for a few years and action-adventure lines geared toward boys for three decades, but it had never explicitly created a play experience for girls with what it calls “conflict play” at its core: that is, play where the story line centers on good guys versus bad guys.

Lego, like many toy companies, has had a rough time with marketing to girls, and by extension the parents of girls. In the 1960s and ’70s, Lego was explicitly sold as unisex. Its most iconic ad was of a pigtailed redhead holding up a blocky abstract creation. But after the company introduced themed sets, like space and castles, in the late ’70s, the sets, along with the rest of the toy world, began to feel more gendered, and the marketing followed.

By the mid-aughts, girls represented only 10 percent of Lego’s market. Then, in 2008, the company undertook a four-year ethnographic study analyzing how girls play. It found that girls did want to build but were bored by mini-figures, which were too blocky and plain. They wanted more lifelike figures, blocks with brighter color schemes, and more interior details in the sets.

The study resulted in the launch, in 2012, of the Friends line, which was marketed specifically to girls, using brighter colors, including, yes, pinks, and later introducing mini-dolls, which are taller and more recognizably human, with hair made of a slightly softer, more buoyant plastic.

Any beloved company in the internet era has to contend with very public consumer ire for perceived missteps, and Lego is no exception. Feminist parents wanting to break down the walls of the pink aisle demanded to know why girls needed a special category of toys and scrutinized the tacit messages about girls’ opportunities embedded in such sets as Butterfly Beauty Shop. It’s not that any of these sets were all that different from anything else offered to little girls, but that they were coming from Lego, the virtuous toy. Some of these parents started online petitions demanding Lego commit to gender neutrality. Other parents defended the toys as a back door to getting girls who’d rather play with Bratz dolls than build a bulldozer into construction toys. What’s inarguable is that kids loved the Friends line. Sales exploded.

Brederode had thought he’d seen some Lego fans wandering the halls, so he waited until the door was closed to reveal the new sets. The new mini-dolls were, as promised, exceptionally detailed for tiny bits of plastic — Batgirl even has back pockets on her tiny black pants. And there was a motorcycle-repair shop for Wonder Woman’s invisible motorcycle. The centerpiece was Super Hero High School, which has little shooters on the roof for when the school goes into “defense mode” and a cafeteria only reachable by flying that makes it clear it’s a “super-school.”

Brederode walked me through the “play triggers” he was especially proud of — a lever that when pushed exploded a front window and another that launched a motorcycle down a hidden ramp. There were little Gremlin-like critters called Kryptomites that looked like anthropomorphic crystals. “We put them in each set to provide conflict in every box,” Brederode explained.

Lego is nothing if not self-serious. It has a Lego Foundation that has spent 30 years studying children’s play, and it has long explanations on its website of why correctly deployed conflict play, the kind that doesn’t use violence for violence’s sake, can be healthy for child development, for instance, by allowing children to play out fantasies of overcoming negative forces, or to work cooperatively against a common adversary. Plus, the Kryptomites had proved extremely popular with DCSHG’s target audience in testing. The Lego designers had found that monsters that were too scary tended to turn off girls, but adorably pesky ones were a hit.

Nothing in the design and launch of a new Lego line is left to chance. When the girls couldn’t read Harley Quinn, who in the cartoon is cast as a heroine and not a villain, as she is in the comics, they adjusted the play scenario to make it clearer that she was a good guy. Kids are so essential to their process that the designers often talk about the design process as “co-creation.” Warner Bros., too, co-creates the sets with Lego. After seeing Lego’s Kryptomites, Warner added them to the cartoon, and the design of Batgirl’s Bat Jet was passed back and forth between the cartoon artists and Lego’s designers until their visions converged.

Lego’s new DC Super Hero Girls: Harley Quinn, Batgirl, Poison Ivy and Lashina. Photo: Courtesy of Lego

“Convergence” is how the toy industry describes the cross-platform programming that many contemporary toy companies are mining. And for kids, convergence seems to come naturally; they slide between one world and the other. It’s not video-game Lego and real-life Lego. It’s Lego, one holistic, multimedia universe.

For us grown-ups, with our less adaptive minds, it can be hard to comprehend. Tell an adult between the ages of 20 and 45 that you’re writing a story about Lego, and prepare to hear how different the company was in their day, when Lego was just a big tub of blocks, no themed sets, no instructions, a pure imaginative experience — no matter that Lego started including instructions in 1964 and introduced themed sets in 1978. In The New York Times Magazine, Clive Thompson suggested that even the computer game Minecraft was a better building experience, quoting a veteran game designer who argued that physical Legos no longer encourage the kind of open-ended play that’s the hallmark of a “good” toy: “It’s ‘Buy the box, open the box, turn to the instruction sheet, make the model, stick it on the shelf, buy the next box.’ ”

Lego argues that the instructions serve as a way to teach children how the toys work. “If we gave you a piano, there’d be very few people who could immediately play something that is, like, fantastic and creative,” said Lego press officer Rude Roar Trangbaek. “You need to learn the notes to play the piano.”

Lego has a lot riding on the notion that it’s still a source of creative play; the idea has been baked into its company philosophy for at least 60 years. “Our idea has been to create a toy that prepares the child for life,” wrote Godtfred Christiansen, Ole’s son, in 1955, “appealing to its imagination and developing the creative urge and joy of creation that are the driving forces in every human being.” During the Vietnam War, Lego took it a step further, connecting the child’s “excitement of making something with your hands” to parents’ own desires for their children: “Peace: There is, in this nervous world, one toy that does not shoot or go boom or bang or rat-tat-tat-tat. Its name is Lego,” went an ad that ran in The New Yorker. “Let somebody else’s child build a bomb shelter in the hollow of an old tree. Remember when the hollow of an old tree was just fun? Heck, war isn’t very adventurous anymore. We think there’s more adventure in a medical lab, or at the U.N.”

What’s amazing about this ad copy isn’t just its implication that buying Legos will keep your kid from getting killed in Vietnam; it also sums up what is still Lego’s prevailing appeal to parents, even if today’s parents’ anxiety for their children’s futures has more to do with their being conscripted into a life of economic uncertainty rather than the military. And instead of toys that go rat-tat-tat-tat, today the toys that provoke parental consternation tend to be the ones that ping.

Lego has managed to maintain its status at the toy for future doctors and ambassadors, even as what constitutes a “good” toy has evolved. In the late ’90s, toy-makers responded to parents’ increasing desire for enriching toys by producing more overtly educational ones: interactive toys meant to teach spelling, math, and shape recognition. For a few years, those toys were the fastest-growing ones in the industry, until they weren’t. Child-development experts began to argue that they made children too passive and might actually hamper learning. Plus, as one toy-maker put it to me, “kids can smell an educational toy a mile away.”

Instead, play researchers argued that toys should foster more open-ended creativity and exploration — toys that forced the child to do the work, like Lego. Promoting creativity appealed to parents too; here was a skill that robots will never take over. Lego’s own research has shown that the newest generation of parents — the millennials who are just now having kids — are increasingly sensitive to what their toys can do for their children and value creativity in particular.

Whether Lego actually does foster creativity is almost impossible to say. It’s proved awfully tough to figure out how play, not least toys, actually contribute to smarts. There is research showing that kids who play regularly with blocks and Legos have higher standardized-test scores and higher math achievement. But there’s ammunition for the other side, too: A competing study suggested that Legos, by being prescriptive, can impede creativity. The authors went so far as to contend that even standard blocks might give kids too much information — arches, after all, suggest their use. (They argue for building with uniform planks.) Marvin Minsky, the MIT scientist who helped pioneer artificial intelligence, has even said that “the decline of American inventiveness” can be traced to the rise of Lego, arguing that by becoming the most common construction toy, it’s pushed out construction toys like Tinker Toys and Erector sets that can get kids building simple machines.

But what became clear on my visit to Billund is that for all the building talk, Lego isn’t just a construction toy; it is also a form of pretend play and storytelling — which, in the age of its transmedial expansion, is more true than ever before. The educational psychologist Doris Bergen has found that story lines that move across media can cut both ways, prompting imagination but also crowding out kids’ own generative abilities: “If they are not totally immersed in that culture, their play tends to start with one of those themes and then diverge into their own experiences,” like making the superhero go home for supper. The problem arises when these themes become so ubiquitous that they’re inescapable.

But when play itself is considered something of an endangered species, it’s also easy to argue that type of play is less important than the fact that they’re playing at all. “Play’s positive pleasure typically transfers to our feelings about the rest of our everyday existence and makes it possible to live more fully in the world,” wrote the play scholar Brian Sutton-Smith, “no matter how boring or painful or even dangerous ordinary reality might seem.” Play is succor for living, which can be especially necessary when the world seems darkest.

The infinitely customizable mini-figure. Photo: Bobby Doherty/New York Magazine

In mid-November, weighted with all six of the DC Super Hero Girls sets, I paid a visit to my neighbors, Naomi, 9, Eli, 7, and Shaina, 5, and their dad, Matt, a New York City schoolteacher, for an afternoon of Lego-building. Their 4-year-old cousin Nils and his dad, Chad, came by, too. Soon everyone was building. Nils and Chad worked through Bumblebee’s helicopter, Naomi and Eli took on the Super Hero High School, and Shaina and Matt set up on the coffee table to tackle Wonder Woman’s dorm room.

At Lego I had heard about the way the company had consciously designed sets to capture every age group from the 18-month-old playing with Duplo sets (larger, softer versions of the classic bricks) to the grown-ups spending a long weekend constructing a 4,016-piece Star Wars Death Star, and here seemed to be living proof that their strategy worked. Later, as Matt explained to Shaina how Wonder Woman’s lasso of truth functioned, I remembered how one Lego marketing executive had told me an unexpected value to the transmedial strategy: Lego had found that the Super Hero Girls line seemed to encourage dads to play more with their daughters, since the characters were ones they remembered from their own childhoods. And when Naomi asked if she could work on a different set, because Eli wouldn’t share, I thought about the value of conflict play.

I thought, too, about early ads for Lego — not the Vietnam-era one, but others in which Legos were marketed as the quiet toy, because for the next two hours, as the kids constructed their models, first sorting them by color, then following the directions, they said hardly a word. Occasionally someone would miss a step and ask for help, and Shaina was fond of the triumphant “Ta-da!” whenever she completed a big component. But mostly, the children were silent, heads down, fingers in constant motion.

I asked if they always started with the directions. They do. “The pieces are too specific,” Matt said. Most kids wouldn’t know what to do with them without instructions. “They’re not like they were when we were kids.” Chad joked that they were Ikea assembly kits for kids, down to the wordless illustrated instruction books. And what about when they were done? Usually, there would be a few days of playing with them, until the models started to shed pieces, then they’d end up on the Lego shelf in the toy closet. Shaina led us upstairs to the pile of models delicately laid out, surrounded by an assortment of tiny bricks that had fallen off. Still, Matt felt that there was value to the building experience, the sense of accomplishment, the spatial reading. And even if the models didn’t get much use, the mini-figures had a longer life. Eli especially liked to carry them around, engaging in epic battles.

In America, we are into our third true generation of Lego enthusiasts. Now when we give our kids a Lego set, we aren’t just giving them a toy, we’re giving them a piece of our childhood, and because Lego’s high-grade plastic holds up remarkably well, that might even be literally true.

One of my favorite bits of Lego scholarship is by Robert Buerkle, of California State University, Fullerton, who argued that it’s not just that Lego is a form of nostalgia, it’s that Lego allows us to see the world as we did when we were children. It saws off its edges and reduces everything to understandable parts. It’s a worldview, which might be the real reason for the bottomless desire to turn everything into Legos. “Lego acts as a signifier for childhood,” he wrote. It allows even the most jaded adult to remember what it was like to be a kid.

Eventually, when it was clear Shaina didn’t need much help, Matt suggested we work on the Bat Jet together. Naomi finished Harley Quinn’s plane and came over to show us how it shot out nets. Shaina finished Wonder Woman’s dorm and was now putting her to bed. Hours passed, and the universe was still under construction.

*This article appears in the November 28, 2016, issue of New York Magazine.