Can a 22 year old in NY flirt with a 17 yo from Philly who is about to turn 18?

So I’m a 22 yo (f) from NY and my (m) friend is now 18. (He’s from Philly). When we started liking each-other he was still 17 going on 18 in 1.5 months. We didn’t do anything and we are not dating but we definitely had some chemistry and I was just wondering if I could’ve gotten in trouble for flirting with him or being sexual (which I didn’t, nor did he) but hypothetically speaking if we were could I have gotten in trouble? I don't know why I’m worried about something that didn’t happen since he’s already way past 18 and I’m almost 23, the exact age gap is 4 years and 6 months. I searched up the ages of consent in both states and one is 17, the other is 16. We were not planning on doing anything and we maintained a strictly platonic relationship all the way until now but for some reason I’m wondering if I could’ve gotten myself into trouble if I had decided to flirt or be extra with him shortly before he turned 18. Again, didn’t happen but I feel guilty for some reason!

Updates
+1 y
For extra context, he was dishonest about his age 6 months ago bc he liked me and he was almost 18 but really was 17. He was afraid I’d stop talking to him if I knew he was still 17 but eventually then came clean weeks after (still before turning 18) I was devastated by the deception but regardless saw him as a good person who just felt scared and rn to this day many months later we are best friends. Just some extra context so nobody thinks I just went for a 17 yo specifically. It just happened
Can a 22 year old in NY flirt with a 17 yo from Philly who is about to turn 18?
Post Opinion