Poster child for what I'm always saying about "framework stupid" making you write twice the code you should; using bad practices like ignoring the separation of concerns; and in general having been CREATED by people who never learned enough HTML, CSS, or JavaScript to be using any of the above.
I mean let's go down the list of woes and issues.
1) You've WRITTEN at least twice or more the JavaScript needed to do the job, relying on jQuery's fat bloated idiotic redundant "eye cans haz teh intarwebs" library so you're deploying many, many, MANY times more code than necessary.
2) You're manipulating appearance from the JS. We have stylesheets, use them. Your screen media style even if set form JS means NOTHING to non-screen users! That's why style in the JS is as dumbass and broken as style in the markup. NO matter what frauds like Otto, Thornton, and Wathan might tell you.
3) jQ has suckered you into using HTML in the JS, instead of just using the DOM like a good little doobie.
4) Slopping style on the markup is bad enough, without sharting PX on it telling users with accessibility needs to go F*** themselves.
5) Which of course also makes your code fragile since by not leveraging the power of EM, your margins are fixed in pixels further flipping the bird at the most basic of accessibility minimums.
Try this on for size:
https://codepen.io/jason-knight/pen/WNmbrGW
717 bytes of JS vs. your 2k, no library / framework idiocy. Even if you include the external style? It's STILL half the code once you figure in your markup bloat as well.
Again, as I've said since the day I first encountered jQuery something like a decade and a half ago, the ONLY thing you can learn from it is how NOT to use HTML, CSS, or JavaScript properly. Just like every other framework since. THIS is why the very word "framework" should be a warning sign for any competent developer to go running the opposite direction!
I have NEVER seen anything "real" or useful built with jQuery that wasn't at least one of these three things:
1) Didn't belong on a website or app in the first place.
2) Could be done by HTML and CSS without JavaScript whatsoever
3) Could be done in half the code or less without jQuery, not counting the size of jQuery itself against that total!
I'm not holding that against you, I'm holding it against a community that keeps propping up this fraudulent incompetent half-assed framework lunacy as the best thing since dark chocolate orange slices. Web development on the whole with this endless "Framework stupid" is shitting its own bed with ignorance, incompetence, and ineptitude.
Ooh... dark chocolate oranges... 'tis the season.