Double yellow lines on an unlikely country road are a cryptic clue. The answer is Portencross, a hidden gem on the Hunterston peninsula, round the corner from the power stations and once a symbol of a different kind of power.

The tiny natural harbour is little more than a gully between the rocks but the safe haven was reason for siting a stronghold longer ago than we have accurate records. For more than 600 years, the present stone keep has stood guard over this spot, once the departure point for the bodies of the Kings of Scotland on their way to burial on Iona.

Wild garlic foams in pungent waves at the edge of the path, jostling with pink campions and bluebells in the old wood. The stone walls which keep the sea winds out of the gardens are interrupted only for the brick pillar which houses the post box, the one and only public utility in this tiny hamlet.

The buildings divided haphazardly into separate dwellings and in the traditional seaside manner each neighbour marks out his territory with different-coloured paint. Just 18 households, including a literal handful of elderly farmers and fishermen who have lived here all their lives, make up this community. On a wet, midweek day, humans are easily outnumbered by horses, exotic poultry, and the garden birds which chatter from every bush.

The massive car park tells of a different story at weekends when the population is hugely outnumbered by the visitors who obey an instinct to return to the sea at weekends. That explains the double yellow lines and why, without really trying, the Portencross Association gathered 1000 signatures to their petition to keep the castle as ''a stabilised romantic ruin'' rather than sold to the highest bidder by BNFL Magnox Generation.

Anywhere else it would be called a fighting fund but the #13,000 raised from the 18 households in Portencross, plus their friends and supporters in West Kilbride, is more of an insurance premium against the old keep becoming some rich man's castle home.

If necessary, they will offer it for the stony relic at the heart of their community but they would be reluctant owners. For people who could never compete on the open market for a fourteenth-century castle, this is a substantial sum - however derisory compared with other bids - and token of their seriousness of purpose.

Such buildings, however uninhabitable, are coveted. Michael Jones of Bell-Ingram recalls acting for an American offering ''tens of thousands'' for one in Fife which had no roof, only two of its four walls, and was being used as a cattle shelter. It sold for #100,000.

Ann McLachlan describes her neighbours as ''a very individual bunch''. Instead of the usual Nimby association to keep others out, their campaign is to keep welcoming others to the simple pleasures of this odd little community. Most of them arrived as incomers willing to put their backs into restoring the old houses which had been derelict since the SSEB bought the land in preparation for the building of the proposed Hunterston C power station and which were sold off when that plan changed in the early 80s.

Now they have formed the Friends of Portencross Castle in order to have a responsible body to take it over ''if the worst comes to the worst'', they say.

''It is a bit of Scottish history which should not be lost,'' said Walter Aktsinov-Kolon. ''We are not interested in developing the building but are concerned with safeguarding public access to the castle and the foreshore which is about one-third of the foreshore in front of the village.

''Last weekend, I met an 84-year-old lady sitting on a chair in the car park just enjoying the scenery because she had been coming to this spot since she was a little girl, when she used to walk out here from Dalry with her parents.

''Our concern is that all that will end if it is bought as private property by some individual whose ego demands he puts up fences to keep the public out.''

Mr Aktsinov-Kolon and his wife first glimpsed Portencross Castle from the paddle steamer Waverley on a voyage to Ailsa Craig. As a Californian new to Scotland, he was very keen on visiting castles at the time and arranged a land expedition as soon as possible. There just happened to be a house for sale. ''Some places just embrace you and that's the way the entire community seemed to us,'' he said.

It has not embraced British Nuclear Fuels Ltd. ''When we took over from Magnox Electric, we had to make a decision about who we were and what we were trying to achieve,'' said Robin Thornton of BNFL Magnox Electric. ''The answer is that we are electricity generators and not castle owners and so we had to make up our minds what we were going to do with the properties we had inherited.

''We had already had some inquiries from people as far afield as North America and the Far East and so when we decided to sell we told all the people who had expressed an interest at the same time, although it has not yet been advertised. We want everyone who is interested to submit not just bids but comments to the agents, Strutt and Parker. At the closing date, we will consider them all together and make a decision.''

He points out that anyone who wants to develop it will not only require substantial funds but planning permission as well as permission from Historic Scotland to alter a scheduled ancient monument. The real issue is that when BNFL acquired the assets of Magnox it undertook to dispose of the surplus land and property portfolio as soon as possible in a manner which secures the best return for the taxpayer.

''That is what we are obliged to do by the DTI,'' said Mr Thornton, who insists they are trying to strike a balance between their commercial integrity which requires them to realise the market value for their assets and their responsibility to the community.

''We have to protect our commercial reputation as a company but we are not bound to sell to the highest bidder.''

He acknowledges that having acquired it in a job lot with the Hunterston A power station which they are in the process of decommissioning, the maintenance bill for the castle has amounted to little more than keeping an eye on the place.

Councillor Elizabeth McLardy, the only Independent on North Ayrshire Council, has been at the forefront of a campaign to bring commercial life back to West Kilbride, where many shops have been turned into houses. She regards Portencross Castle as one of the main assets of West Kilbride, which has formed a development group to attract both businesses and visitors and supports Portencross Association's argument that BNFL could act in the best interest of the taxpayer by keeping the castle in public ownership rather than raising its monetary value.

Public opinion - even backed by a charitable trust - is not, of course, sufficient to secure a property. Castle Tioram is a cautionary tale. A thirteenth-century keep on an island in Loch Moidart, it has been the archetypal romantic ruin since it was destroyed in 1715 by the MacDonalds of Clanranald to prevent it being taken over by the Hanoverians after their chief was killed at the battle of Sheriffmuir.

An appeal to the MacDonald diaspora raised sufficient to make a bid but not enough to secure it last year, when it was sold for substantially over the guideline of #100,000 to a Scot.

James Carnegy-Arbuthnott of sellers, Brodies, said: ''The key factors were location, which was on an island only accessible at low tide, you could not have a more romantic position, and that it was a building of historic importance. The biggest market is always for those castles which can be restored to become a private house. In this case, Historic Scotland categorically said they would not allow that to be done and that did deter some people.''

It is not who owns the castle but how it is stewarded which worries the residents of Portencross and their many supporters in the adjacent communities of West Kilbride and Seamill and the visitors who come from the larger town of Ardrossan and Largs and Dalry for lungfuls of sea air and a good walk at weekends.

Their threefold aim is to retain the castle within a form of public ownership by way of a trust administered by a board of trustees, to maintain a listed, historic monument as a romantic ruin, and to ensure public access to the foreshore.

As Mr Aktsinov-Kolon puts it: ''It is rather ironic that BNFL as a public company should sell it off but we think the strength of opposition has taken them aback.

''We are at the stage of suggesting to them that since they inherited it when they took over Hunterston, it is unlikely that any money was involved in acquiring it and if this is the case, they could do something priceless to gain the goodwill of the community by gifting the castle to the people of Scotland.''