Do I have still have a chance to go to a good school?

I am a sophomore in a very highly ranked public high school in the bay area. However, this semester was a disaster as I got two Cs (Honors Chem and Honors Alg 2), 2 Bs (Ap Spanish Lang and US Govt), and 2 As (AP Computer Science A and English). My current unweighted gpa is a 3.11 and my weighted is a 3.67. My SAT score is a 1400. Provided I get straight As and a better SAT score, could I still attend an Ivy League school or another school of that caliber? (If it matters. I am very STEM oriented)

To be honest, if you’re very STEM oriented, why not look at some of the schools that emphasize that? Why must it be Ivy?

It seems to me that your grades are good, but perhaps not good enough for good odds at an Ivy.