The "stepping down" by semitones to get from the Gm7 (the II chord) to the F (root) chord seems quite natural, but classical theory would typically go from Gm7 to F via C7 rather than F#7.
What we see here is called tritone substitution. The chord F#7 has been substituted for the C7. Note that C and F# are a tritone (three whole tones) apart.
How is it that we can substitute F#7 for C7? The connection between the two chords lies in their thirds and sevenths. The third of a C7 chord is E, which is also the seventh of the F#7 chord. The third of the F#7 chord is A#, which is enharmonically the same as the seventh of the C7 chord (the Bb). If we were to play only the third and seventh, which chord is being played?
By substituting the tritone dominant 7th chord, we hear chromatic shifts that can sound smoother and more interesting than a 'classical' II-V-I progression.
Mark Levine, in The Jazz Piano Book, notes that the early bebop musicians extended the concept of tritone substitution to also precede the substituted V chord with its II chord. So in our fragment above, we could precede the F#7 chord with C#m7:
In this case, the F in the melody on the top of the C#m7 chord (which does not have its third in this example) renders the chord as C#7 rather than C#m7.
As a final example, I have used the third and seventh of the substitute II chord under the melody, resulting in a chord with a minor 9th in it - the result looks more like a substitute IVm(b9) chord, and sounds quite interesting.