Rayleigh–Taylor instability in complex stratifications