Cookie controlled element disappears on mobile break

Hi all, I am trying to achieve a very specific behavior on the following page:

I am trying to make it so that when users click either the videos or the documentation buttons, they see a signup modal first, and then upon clicking the go back button on the form success state, the modal buttons get hidden and they can click the video and documentation buttons normally. The modal buttons are being controlled by the users cookies, so right now the buttons start with display:none and if no cookie is found they are switched to display:block. A cookie is stored when they click the go back button, so if the user has finished the form the cookie is found and the buttons stay hidden.

Everything is working normally except the fact that when resizing the window, the modal buttons disappear after passing the breakpoint. Does anyone know why this behavior is occurring?

Also, would it be possible to change the behavior of the cookie so that the buttons start with display:block and are only hidden if a cookie is found?

Here is my public share link: