An extravagant, ultramodern, spec-built mansion in the pricy foothills above L.A.’s ever-chic Sunset Strip, privately marketed to prequalified buyers with an eye-popping $40 million price tag, has sold for $31.5 million. Well-connected real estate insiders swear the new owner, whose identity is shielded behind an impenetrable blind trust, is powerhouse film and television writer-producer Simon Kinberg.

The flashy, finely finished manse, a collection of white-stucco volumes joined by vast glass walls designed by modern mansion specialist Paul McClean and built in partnership with McKillen Developments, is perched on a slightly more than one-acre promontory with panoramic views from downtown to the Pacific Ocean. Interior spaces span more than 12,000 square feet. The mansion’s seven bedrooms and 10 bathrooms include a glass-walled master suite that seems to float above the city with two bathrooms, one with a soaking tub daringly positioned next to a wall of floor-to-ceiling windows.

The lavishly appointed residence offers leisure amenities that include a state-of-the-art screening room and a fitness suite with marble steam room and dry sauna. The area steps down to a terrace with a fire pit and a 100-foot-long, half-moon-shaped pool cantilevered over the steep hillside.

The London-born and L.A.-based “X-Men” franchise writer and producer, nominated for an Oscar for 2015’s “The Martian,” additionally owns a not quite 7,500-square-foot cedar-shingled residence in Pacific Palisades that he picked up in late 2012 for $8.6 million. He also has a home in the Bird Streets neighborhood above the Sunset Strip acquired in late 2015 for $8.4 million and currently available at $8.5 million.