For Google executive Forrest Timothy Hayes, heroin was the killer app.

From the way the Santa Cruz cops talk about it, the security camera video that captured a reputed high-price call girl injecting the 51-year-old tech veteran with a fatal dose of the drug aboard his yacht in Santa Cruz was surely horrific. But it was particularly chilling for another reason:

While the seven-minute-long death scene drew a final curtain on the life of the father of five, it raised another on a dark and largely hidden side of Silicon Valley in 2014. With a booming startup culture cranked up by fiercely competitive VPs and adrenaline-driven coders, and a tendency for stressed-out managers to look the other way, illicit drugs and black-market painkillers have become part of the landscape here in the world’s frothy fountain of tech.

“I’ve had them from Apple, from Twitter, from Facebook, from Google, from Yahoo, and it’s bad out there,” says Cali Estes, a Miami-based addictions coach who has helped 200 tech workers — many of them high-level executives — struggling with everything from cocaine and heroin to painkillers like oxycodone and stimulants like Adderall, a prescription drug used to treat attention-deficit disorders.

“And it’s a lot worse than what people think because it’s all covered up so well,” says Estes. “If it gets out that a company’s employees are doing drugs, it paints a horrible picture.”

Hayes’ overdose last November — alleged call girl Alix Tichelman was arrested in connection with his death — felt like an eerie tap on the shoulder. Most Bay Area residents tend to marvel at the innovation unfolding around them from the red-hot tech revival and do not fret about the shadowy behavior that might help propel it all.

While precise numbers of techie drug users are impossible to come by, most treatment and addiction experts see evidence of a growing problem borne of a potent cocktail: newly minted wealth, intense competition between companies and among their workers, the deadline pressure of one product launch after another and a robust regional black-market drug pipeline.

“There’s this workaholism in the valley, where the ability to work on crash projects at tremendous rates of speed is almost a badge of honor,” says Steve Albrecht, a San Diego consultant who teaches substance abuse awareness for Bay Area employers. “These workers stay up for days and days, and many of them gradually get into meth and coke to keep going. Red Bull and coffee only gets them so far.”

Furthering the problem, many tech companies do little or no drug testing because, as Albrecht put it, “they want the results, but they don’t want to know how their employees got the results.”

Drug abuse in the tech industry is growing against the backdrop of a national surge in heroin and prescription pain-pill abuse. Treatment specialists say the over-prescribing of painkillers, like the opioid hydrocodone, has spawned a new crop of addicts — working professionals with college degrees, a description that fits many of the thousands of workers in corporate Silicon Valley.

Increasingly, experts see painkillers as the gateway drug for addicts, and they are in abundance. “There are 1.4 million prescriptions … in the Bay Area for hydrocodone,” says Alice Gleghorn with the San Francisco Department of Public Health. “That’s a lot of pills out there.”

Patients prescribed opioids for back pain or injuries can easily become addicted; others get opioids on a thriving black market, or easier yet, from the medicine cabinet of a family member or friend.

Dr. Norman Wall, a Calistoga detox specialist who works with employees from iconic companies such as Apple, says the progression up the addiction ladder is predictable: uppers like Adderall to keep up with production demands and 12-hour days, then downers like oxycodone, another powerful opioid, to take the edge off when you get home. “It’s not a big leap to get hooked on oxycodone,” he says.

Dave Marlon, president of Nevada-based treatment center Solutions Recovery Inc., which has treated tech workers from across the country, says, “Some people say they need to take opioids in the morning just to function and go to work. It’s like drowning and you need air.”

But when the pills are no longer enough, people turn to heroin — first to smoke or snort, and then to inject, because they build a tolerance and need an ever-greater dose to get the same high.

“People graduate to doing things that they never thought they would have done,” says Michael Johnson, executive director of The Camp Recovery Center, a rehab center in Scotts Valley.

Heroin is also an opioid, so the mind and body respond much in the same way they do to painkillers, but it’s much cheaper — about $20 for a half a gram, whereas some painkillers run $60 or more a pop, according to the Drug Enforcement Agency. And over the last five or six years, heroin has become more available throughout the Bay Area.

“Fifteen years ago, if you’re shooting heroin, you had to had to go to some pretty dark places and deal with dark characters and engage in some dark deeds,” Johnson says. “Not so much anymore.”

Heroin use more than doubled nationally from 2002 to 2012, according to a study of people age 12 and older by the federal Substance Abuse and Mental Health Services Administration, and is now the second-most common drug, after alcohol, reported by patients at treatment facilities in San Francisco. The DEA has reported an increase in heroin seizures in Santa Clara and surrounding counties from 6.3 pounds in 2012 to 22 pounds for the first half of this year.

The current surge of illicit drug use is hardly the Bay Area’s first. The Sixties, of course, were legendary. But it was the dot-com era when the unique marriage of illicit drugs and tech-work really started to click, with fast money fueling the frenzy.

Those days appear to be back now with a vengeance, says Eddy, a longtime Valley tech worker and recovering addict who attends Narcotics Anonymous meetings in Los Gatos and doesn’t want his real name used because of the group’s allegiance to anonymity.

“What I’m seeing at meetings is a lot of people getting hooked, courtesy of their doctors,” he says. “You see very few of the old-school addicts; most of these are college-educated folks who either started abusing pain meds after an injury, or because of the stress of these tech jobs they start doing cocaine to stay up and oxycodone to relax. Working 80-hour weeks and making crazy money extracts a horrible toll on you.”

As the executive director of Morningside Recovery in Newport Beach, Joel Edwards has seen what he calls “an influx in the last six or seven years of tech-related clients abusing Adderall.” Another popular prescription upper is Provigil, normally used to treat narcolepsy and raved about in online chat rooms by tech workers who say the drug helps them stay up for 20 hours straight.

“They’re using these drugs to work late into the night, under extreme deadlines, with tons of stuff on their plates,” says Edwards. “Even the campuses are set up to keep you on site so you can always be working. You hear the same thing over and over from clients: ‘There’s always somebody else to take my place.'”

Drug problems are not confined to employees. Founders who once had a neat project with a few buddies find themselves with hundreds of employees to manage, IPOs to prepare for, media to answer to and investors to woo — and sometimes turn to drugs to cope.

“If your life is spinning out of control and is highly charged with stress, you may believe you can take control by self-medicating, but that’s a delusion,” says Byron Kerr, who sits on the board of LifeRing, a sobriety program that recently began organizing meetings in Santa Clara County.

Experts say that while some tech companies make efforts to help employees with substance abuse problems, it’s not nearly enough. Most of the large tech firms offer counseling, but employees often avoid these confidential services for fear they could lose their jobs if word got out about their drug habits, according to counselors and recovering addicts.

This newspaper contacted about a dozen large tech firms with questions about substance abuse among workers; only Cisco and Google responded. Both offer counseling through employee assistance programs, and a Google spokeswoman said employees “can discuss a wide range of issues with the on-site licensed clinical counselors.”

Marina London, a licensed clinical social worker who ran employee assistance programs at several tech companies, said some firms pay for counseling as window dressing but fail to deal with the underlying problems.

Many employers, including Twitter co-founder Jack Dorsey, advocate moderation for their workers, but some hard-charging techies are equally hard-partying.

Wall says his clients go to parties and see “coke in the room or some pretty girl is passing around a bowl of something that could be Ecstasy or oxycodone.”

Part of the problem, experts say, is that our society often encourages young people to self-medicate, starting as early as grammar school. By the time software-savvy kids hit their teens, the valley’s “hackathons” provide a stage for drug abuse 1.0. These nonstop coding sessions feature tables covered with Red Bull and Monster Energy drinks, which can contain huge quantities of sugar that is addictive and fires up the brain and body much like opioid drugs do.

“There is a reason addiction centers by and large do not allow Red Bull and Monster on site,” said Joyce Marvel-Benoist, program coordinator for The Exclusive Hawaii, a luxury treatment center.

Therapists describe a well-trodden path from teen hackathons all the way up the corporate ladder. One client of Estes’ said Friday morning board meetings included a plate of cocaine being passed around the table. “He told me, ‘I don’t want to offend them, but I can’t do this — I have a heart problem.'”

Estes advised him to decline, which he did. The following Friday, two others also declined.

“The next Friday,” she says, “three more declined and eventually the practice stopped. It must have been a peer-pressure thing.”

Contact Patrick May at 408-920-5689 or follow him at Twitter.com/patmaymerc