RIYADH, Saudi Arabia — Saudi Arabia is a country that is easier to write about from afar, where you can just tee off on the place as a source of the most austere, antipluralistic version of Islam — the most extreme versions of which have been embraced by the Islamic State, or ISIS. What messes me up is when I go there and meet people I really like and I see intriguing countertrends.

Last week I came here looking for clues about the roots of ISIS, which has drawn some 1,000 Saudi youth to its ranks. I won’t pretend to have penetrated the mosques of bearded young men, steeped in Salafist/Wahhabi Islam, who don’t speak English and whence ISIS draws recruits. I know, though, that the conservative clergy is still part of the ruling bargain here — some of the most popular Twitter voices are religious firebrands — and those religious leaders still run the justice system and sentence liberal bloggers to flogging, and they’re still in denial about how frustrated the world is with the ideology they’ve exported.

But I also ran into something I didn’t know: Something is stirring in this society. This is not your grandfather’s Saudi Arabia. “Actually, it’s not even my father’s Saudi Arabia anymore — it is not even my generation’s Saudi Arabia anymore,” the country’s 52-year-old foreign minister, Adel al-Jubeir, said to me.

For instance, I was hosted by the King Salman Youth Center, an impressive education foundation that, among other things, has been translating Khan Academy videos into Arabic. It invited me to give a lecture on how big technological forces are affecting the workplace. I didn’t know what to expect, but more than 500 people showed up, filling the hall, roughly half of them women who sat in their own sections garbed in traditional black robes. There was blowback on Twitter as to why a columnist who’s been critical of Saudi Arabia’s export of Salafist ideology should be given any platform. But the reception to my talk (I was not paid) was warm, and the questions from the audience were probing and insightful about how to prepare their kids for the 21st century.