The first time Mark Zuckerberg put on the awkward headset he knew. This is ready, he thought. This is the future.

On the outside, the Oculus Rift didn’t look like much: a matte-black box, roughly the size of a brick, that hung from his face like giant ski goggles, a tangle of cords running from the back of his head to the back of a small desktop computer. It looked futuristic, but not pretty—the kind of thing a teenager might create to approximate his vision of the future, which, in fact, is exactly how this particular device had come into being. The Rift’s creator, Palmer Luckey, was a 17-year-old sci-fi geek when he started building the prototype in his parents’ garage, in Long Beach, California. He took it to the crowd-funding platform Kickstarter, where he raised an astonishing $2.4 million, and then to Silicon Valley, and now, just four years later, here it was sitting on the face of the most powerful man in the technology world.

Zuckerberg was in the Menlo Park Facebook headquarters, in the office of C.O.O. Sheryl Sandberg, with his deputies, chief product officer Chris Cox and chief technology officer Mike Schroepfer. They’d picked Sandberg’s office because it had blinds, unlike the glass rectangle where Zuckerberg works. Zuckerberg’s fishbowl office makes sense for a man who has dedicated his career to helping people share aspects of their lives, but the sight of the Facebook C.E.O. with a screen on his face was at that point best kept a secret.

In a sense Zuckerberg was not in Sandberg’s office anyway. He was in another universe entirely. His attention was on a ruined mountainside castle as gleaming snowflakes fell all around him. Wherever he looked, the scene moved as his head did. Suddenly he was standing face-to-face with a giant stone gargoyle spouting lava.

“Wow,” Zuckerberg said, removing the headset. “That was pretty awesome.”

It was January 2014, and the Facebook C.E.O. was preparing to celebrate two milestones: Facebook’s 10-year anniversary and his own 30th birthday. For years, Zuckerberg had pushed, almost single-mindedly, for growth. With Sandberg’s help he had transformed Facebook into a communications platform that hundreds of millions of people essentially keep open on their phones all the time. “When you get started as a college student you limit your scope,” he says. At first, “it’s like, ‘I’m going to build this thing for the community around me.’ Then it’s ‘I’m going to build this service for people on the Internet.’ But at some point you get to a scale where you decide we can actually solve these bigger problems that will shape the world over the next decade.”

Lately he’d been thinking about what should come next. What, he’d been asking, is the next great computation platform? What comes after the smartphone? Zuckerberg believed that the answer was headsets that provide “immersive 3-D experiences”—movies and television, naturally, but also games, lectures, and business meetings. These headsets would eventually scan our brains, then transmit our thoughts to our friends the way we share baby pictures on Facebook today. “Eventually I think we’re going to have technology where we can communicate our full sensory experience and emotions to someone through thought,” he told me in an interview in his office. Then he added, helpfully, “There’s a lot of interesting research into that, where people have some band on their head…. You can look into it if you’re interested.”

It sounded a little bit insane, but Zuckerberg wasn’t joking. “There are certain things in the future that you know will happen,” he continued. “The real challenge is figuring out what’s possible now and how exactly do you make it.”