How to mask a spline

I am trying to create a two tone outline but part of it is being masked by a polygons so it doesn't show. I created a copy of the planar transform for the polygon. This is the closet I came to getting it to work but the polygon tracks but for some reason moves and doesn't track correctly when connected in the rest of the node tree. Can someone help me figure out the best way to accomplish what I'm trying to do?