This is a gray area. You can take college classes that are entirely dedicated to intellectual property, so I can’t give you a perfect answer just based on your question.
In general, if you are just imitating a particular art style, or using tropes from a specific genre then you are fine.
On the other hand, if you are planning on “copying” large parts of a specific work, like names, plot, art assets, music, etc. then you are probably be going to far.