At one point a fortress guarding the border between Catalonia and the Kingdom of France, it was a very innovative piece of military infrastructure for its time, and unique for the fact that it sat at the transition between medieval castle architecture and more modern fortresses.
It was designed to be nearly un-takeable, with many hidden architectural features aimed at making life hell for anyone who dared to assail it and could withstand long sieges with spring water feeding the fortress directly and enough men and supplies to last months.