Kellie Castle, near St Monance and Pittenween, Fife.
Kellie Castle is one of those Scottish castle homes that really was a defensive castle. So many were designed to simply look like. It was discovered by James Lorimer, Professor of Law at Edinburgh University, in the 1870s, but he recognised its potential and when the family moved in in 1878, it was still effectively a ruin. He had entered into a long term lease with the Earl of Mar with the condition that the Earl would have external repairs carried and Lorimer would restore the castle interior. The arrangement with the Lorimer family continued long after this death James Lorimer. When his son died in 1936 it again became neglected and its contents ere auctioned off. Hew Lorimer took over the lease in 1937 and with his wife Mary he set about bringing Kellie Castle back to life once more. In 1957 the Earl of Mar and Kellie died, and his successor offered Kellie Castle for sale to the Lorimers: so after renting the castle for 70 years they finally became its owners. Hew Lorimer was a successful sculptor and his hand in the design can be see, but so too can that of the architect Sir Robert Lorimer, who was a frequent visitor.
This explains what you see today. It now belongs to the National Trust of Scotland. My photograph shows the sundial in the walled garden with the castle beyond. The garden is prominent in the Historic Environment Scotland description which you read in more detail in the first link below.
But the history of the castle goes back much earlier. There appears to have been a castle here from about the 12th century. The estate passed from Helena Siward, Lady of Kellie, to her cousin Walter Oliphant, in 1360. The Oliphants would own Kellie Castle for over 250 years, and by the time the 5th Lord Oliphant sold the castle in 1613, it was substantially complete as you see it today.