Question: do spells count as ranged attacks?
Answer: A "ranged attack" is any attack that fits the "ranged" category, meaning it can be a weapon attack or a spell attack, as long as it's ranged.