Heian period (770–1185), and deployed to help defend the shores of Kyūshū from the Mongol invasions of the 13th century, reached its climax in the 1330s, during the Nanboku-chō period. Chihaya Castle and Akasaka castle, permanent castle complexes containing a number of buildings but no tall keep towers, and surrounded by wooden walls, were built by Kusunoki Masashige to be as militarily effective as possible, within the technology and designs of the time. The Ashikaga shogunate, established in the 1330s, had a tenuous grip on the archipelago, and maintained relative peace for over a century. Castle design and organization continued to develop under the Ashikaga shogunate, and throughout the Sengoku period. Castle complexes became fairly elaborate, containing a number of structures, some of which were quite complex internally, as they now served as residences, command centres, and a number of other purposes. Sengoku The Ōnin War, which broke out in 1467, marked the beginning of 147 years of widespread warfare (called the Sengoku period) between daimyōs (feudal lords) across the entire archipelago. For the duration of the Ōnin War (1467–1477), and into the Sengoku period, the entire city of Kyoto became a battlefield, and suffered extensive damage. Noble family mansions across the city became increasingly fortified over this ten-year period, and attempts were made to isolate the city as a whole from the marauding armies of samurai that dominated the landscape for over a century. As regional officials and others became the daimyōs, and the country descended into war, they began to quickly add to their power bases, securing their primary residences, and constructing additional fortifications in tactically advantageous or important locations. Originally conceived as purely defensive (martial) structures, or as retirement bunkers where a lord could safely ride out periods of violence in his lands, over the course of the Sengoku period, many of these mountain castles developed into permanent residences, with elaborate exteriors and lavish interiors. The beginnings of the shapes and styles now considered to be the "classic" Japanese castle design emerged at this time, and castle towns (jōkamachi, "town below castle") also appeared and developed. Despite these developments, though, for most of the Sengoku period castles remained essentially larger, more complex versions of the simple wooden fortifications of centuries earlier. It was not until the last thirty years of the period of war that drastic changes would occur to bring about the emergence of the type