Engineered modular biomaterial logic gates for environmentally triggered therapeutic delivery