Complexity twin for resilient ecosystems