Text this: Green regioselective synthesis and theoretical insights into photo- and thermochromic spiro heterocycles: toward optical and thermal sensing applications