I am currently a final-year student on a BSc Mathematics programme in the UK. For the first two years of my degree I've mostly adopted a '2:1 will do' approach and didn't focus on my studies all too much, sometimes even cramming in an entire course the night before the exam. As a result, my grade distribution is extremely uneven: for example, last semester, my lowest grade was 40% and the highest was 89%. I'm not sure about other degrees, but from my experience people tend to score fairly consistently in maths. Overall, I currently have a 60% average.
Last semester, however, I took an introductory logic class and was really intrigued by the subject. The 89% referred to earlier was for that logic course, which was otherwise considered fairly demanding. It may sound somewhat cliche, but I believe I've found my academic 'passion', however niche it may be. Over the summer I've worked my way through a couple of mathematical logic books, and am currently in the process of writing my bachelors thesis which is on a fairly advanced topic in model theory. With that my attendance has improved and I've found other maths classes more enjoyable, too. I'm rambling here, but the point is that my interest in this particular area is pretty serious.
Now, to my question: with this in mind, I've started thinking of possibly going on to do a PhD in the future. Problem is, I'm afraid the first two years of my Bachelors will drag me down to the point of not being able to gain acceptance into a decent programme. I will most likely end up getting a First Class degree in the end, and the university I go to is in the Top-100 across all major rankings, but then again I know people who have close to a 95% average. Would you say it's still worth trying, or should I just take the safe route and re-orientate my studies towards something more practical?