In both Griffiths and Jackson, Ampere's Law (or conversely the curl of the magnetic field) is derived by applying Stokes' Theorem to the surface integral of the current density J. The argument relies on the fact that $$I_{enc} = \int_{S} J \cdot da$$ but I am struggling to see how this could be true in general for any current density and any surface bounded by $\partial{S}$.
Of course this will be true for a straight wire passing through the center of an Amperian loop, when the vector J is parallel to the normal vector of the simplest surface enclosed by the loop, but what if the wire is angled slightly with respect to the plane? Using the same flat surface, the current enclosed will now be
$$\int_{S} I\hspace{.12cm}\delta(x)\begin{bmatrix} x \\ y \\ z \\ \end{bmatrix} \cdot \hat{n} \hspace{.12cm} da$$ which is clearly not the same value. So does Ampere's Law only account for the magnetic field produced by vectors parallel to the normal?
And my second question is this. How does Stokes' Theorem hold in the second case, where the curl is only non-zero along a single line? Wouldn't a different surface extending into a third dimension with a normal that is parallel to the current at the intersection give a different value for the surface integral, since the actual area of the surface doesn't matter? Obviously there is a serious flaw in my mathematical understanding of the material, but it isn't obvious to me.
Thanks