Mao was born during the Heian Period (794 - 1185 CE) when Buddhism, Taoism and other influences were flooding into the island country from China. Most importantly however a new teaching also arrived- Onmyodo, the way of yin and and yang, a school of philosophy pioneered by Abe no Seimei that taught about the interactivity between the five elements of wood, fire, earth, metal, water and wood.
Mao was seen as a modest talent and caught the eye of his master who elevated him over more deserving candidates to become his successor and marry his daughter, Sana. In the wake of these decisions the temple was attacked by Byoki, a demonic cat that had been Sana's pet. In the mayhem Byoki's head was decapitated and his body was merged with Mao giving him powers far beyond what he had before. Unknown to Mao five of his colleages had already been set against him, tasked with assassinating him and becoming the true inheritor of the onmyodo order.
In modern times Nanoka is a high school student who lost her family when their car crashed into a sinkhole caused by a gas main explosion. When she investigates the accident she is pulled back in time to the 1920s where she meets Mao who was made immortal in the wake of his temple's destruction centuries earlier. Now these two time-lost orphans work together to unravel the connection between them, their ties to Byoki the cat demon and the conspiracy of Mao's past other friends turned foes arrive to carry out their vengence against him.