You're so good, Josh! You ask all the right questions.
First, Kant is what is called a transcendental idealist which is kind of like the via media between empiricism and rationalism. In particular, Kant says that there are some things which we can conceive without any perception of them. Like the example I mentioned before, 7+5=12 is true, and I can formulate that truth mentally, without ever actually having a group of 7 things and a group of 5 things and counting them up. To put it one way, we can rationally conceive of big concepts without particulars, or, as Plato might say, the Forms of objects without their actual physical instantiation.
You're wrong about logic and mathematical functions, though- those are part of the world of rational reasoning, not empirical observation. Logic is math, and functions don't happen in sequence in time and space; they both happen all at once, or, to put it more correctly but esoterically, they don't happen at all. The conclusions of every logical discourse are held in the definitions of the ideas themselves, and the truth of the logic is not proved in following the chain of arguments, but rather exists as true or false in the ideas already. This seems a little counterintuitive at first, because in our practice it seems like we have to work through the order of operations in a math problem or puzzle out a function, but regardless of time, or if you even solve the equation, the answer or conclusion to the problem is contained in said problem, regardless of time and space.
Modern philosophy treats the conflict between empiricism and rationalism very differently today, largely due to Kant, but I have a feeling you might line up with the neo-empiricists anyway.