In the end, Brain was lured by a job - in Utah - where real estate was more reasonable. He and his family traded their tree-lined street for panoramic mountain views and a job near Provo in 2012. Moving to California that year, even when U.S. home affordability was at a record, would have meant paying double for a smaller place, he said.

"The value just wasn't there," said Brain, 44. "I had to start thinking about where that put us by retirement. Throwing another couple million into housing just didn't make sense."

As the residential real-estate market and the economy rebound, home prices and borrowing costs are rising, while income gains lag behind and new mortgage rules make getting a loan more costly. If forecasts bear out, the National Association of Realtors' affordability index will fall this year by the most in data going back to 1970.

Unless incomes improve, the result could be a cooling in the housing recovery, especially in areas that have seen prices jump over the last two years, said NAR Chief Economist Lawrence Yun.

Home prices in the United States climbed 7.3 percent in 2012 and are projected to have jumped 11.5 percent last year, the biggest gain since 2005, according to CoreLogic Inc. Private-sector earnings, meanwhile, have climbed an average of 2 percent annually since 2011. Adjusted for inflation, they've barely grown at all.

That's putting homeownership out of reach for many Americans, particularly those in bigger cities.

The issue is most acute in San Francisco, where the median home sold for $779,000 in the third quarter of 2013. Only 16 percent of new and existing homes were within the means of households earning the median income of $101,200, making the area the nation's least affordable, according to the National Association of Homebuilders.

In Provo, where the median income is $61,900, the median home price is $241,000, two-thirds less than in Silicon Valley. The differential is helping a Utah business coalition lure technology companies and workers to the area's so-called Silicon Slopes. In the year ended July 1, Utah's population growth in percentage terms was second only to North Dakota's, according to data from the Census Bureau.

Brain sold his 2,800-square foot home in Seattle's Queen Anne neighborhood for $1.1 million. For $950,000, he got views of the ski slopes outside Provo and 4,800 square feet for him, his wife and their two children. The kids ski after school and Brain, vice president of engineering at Qualtrics, has an easy commute.

At Qualtrics - a venture-backed technology firm that mirrors Silicon Valley companies in every way except geography - young engineers make enough to buy homes even if they don't earn as much as they would at places such as Amazon.com Inc., his former employer, Brain said.

"I have employees at Qualtrics working a year out of school and buying a house," Brain said. To become a homeowner in San Francisco, a worker would have to hit pay dirt at a successful start-up, he said, "and you might never pull that winning ticket."

The Realtors' Home Affordability Index fell 9.7 percent last year to 177 and is projected to fall 22.6 percent to 137 in 2014, the biggest slump in data going back four decades.

While some cities may suffer, accessibility hasn't been totally dashed. The gauge is coming off a record 196 reached in 2012. Readings greater than 100 mean a household earning the median income can afford the median-priced home at current mortgage rates. The most affordable U.S. metro area in the third quarter of 2013 was Kokomo, Indiana, according to the NAHB.

And most homes have yet to regain the luster they lost after the boom. California property values are 21 percent below their peak and Utah homes are off 15 percent, according to CoreLogic. Values are 10 percent or more below boom prices in 29 states.

"There's still a fair amount of room for appreciation," CoreLogic Chief Economist Mark Fleming said. Price and rate increases "will reduce affordability, taking it back toward normal, not necessarily making it unaffordable by historic standards."

Nonetheless, there's no question the affordability window is starting to close, he said.

"If you're considering buying a home this year, buy sooner rather than later," Fleming said. "I can guarantee it will only be more expensive to buy a home later."

Nationally, 55 percent of homes located in metropolitan areas are affordable, meaning household income is high enough to pay the mortgage, taxes and insurance on a median-priced house, according to data from Freddie Mac.

If the rate on a 30-year fixed mortgage, which averaged 4.41 percent in the week ended Jan. 16, reaches 5.5 percent and prices gain 5.2 percent, as Yun forecasts, only a third of homes will be affordable, according to Freddie Mac. If incomes rise 3.5 percent, the share improves to 40 percent.

"The median family should be able to afford a house, that's part of the social contract in the U.S.," said Phillip Swagel, a former assistant secretary at the Treasury. Should the disparity in income gains seen over the past five years continue, that "would translate into a concern about affordability," he said.

New lending laws also could change the economics of buying a house. The qualified mortgage rule, which took effect Jan. 10, gives an advantage to borrowers with top credit ratings and low debt. Those with less-perfect borrowing histories will be considered higher risk and pay more for a loan.

"They could get a non-qualifying mortgage, but it will have a higher interest rate," said Steven Rick, senior economist at the Credit Union National Association.

To make the numbers work, more homebuyers are taking out adjustable-rate mortgages, or ARMs, which have low starting rates that rise over time. After all but disappearing during the housing bust, ARMs accounted for 18 percent of mortgages at the end of December, more than double their share at the end of 2012 and approaching the 20 percent they held in 2007, according to Mortgage Bankers Association data.

For now, in Utah at least, there are homes to be had.

"It's one of the best places I've lived," Brain said. "It's very affordable. Maybe we should keep it quiet."