* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #F8F4E3;
    color: #2A2A2A;
    position: relative;
    margin: 0;
    padding: 20px;
    font-weight: 500;
}

.gradient-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg, #f5818b, #5c6f81, #6181cc, #3558a0, #b456b1);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    z-index: -1;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.content {
    text-align: center;
    background-color: #FFE66D;
    padding: 3rem;
    border: 3px solid #2A2A2A;
    border-radius: 0;
    box-shadow: 8px 8px 0px #2A2A2A;
    transform: translateY(0);
    max-width: 90%;
    width: 500px;
    position: relative;
    transition: all 0.2s ease;
}

.content:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0px #2A2A2A;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: #2A2A2A;
    text-transform: uppercase;
    letter-spacing: -1px;
    font-weight: 800;
    text-shadow: 4px 4px 0 #FF6B6B, 
                6px 6px 0 #2A2A2A;
    transform: rotate(-2deg);
    margin-top: -10px;
    line-height: 1;
}

.redirect-box {
    margin-top: 2rem;
}

.redirect-box p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

#redirect-button, #study-button, #accept-warning-button {
    background-color: #FF6B6B;
    border: 3px solid #2A2A2A;
    color: #2A2A2A;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 5px 5px 0px #2A2A2A;
    margin: 0 5px;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

#redirect-button:hover, #study-button:hover, #accept-warning-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px #2A2A2A;
}

#redirect-button:active, #study-button:active, #accept-warning-button:active {
    transform: translate(4px, 4px);
    box-shadow: 1px 1px 0px #2A2A2A;
}

.study-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
}

.study-content iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    min-height: 0;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95);
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}

.study-content h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    background: linear-gradient(to right, #4b6cb7, #182848);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(75, 108, 183, 0.3);
}

@media (max-width: 768px) {
    .content {
        padding: 2rem;
        width: 90%;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}

/* Modal Styles */
.modal {
    display: flex; /* Always use flex for centering */
    position: fixed;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal.is-visible .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content {
    transform: scale(0.9) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #A8E6FF;
    color: #2A2A2A;
    padding: 35px 30px 30px;
    border: 3px solid #2A2A2A;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 10px 10px 0px #2A2A2A;
    text-align: center;
    margin: 0;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #2A2A2A;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.2s ease;
}

.close-button:hover {
    transform: rotate(90deg);
    color: #FF6B6B;
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    color: #2A2A2A;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    text-shadow: 3px 3px 0 #FF6B6B, 
                 5px 5px 0 #2A2A2A;
    transform: rotate(-1deg);
    display: inline-block;
    padding: 0 15px;
    background: #A8E6FF;
    border: 3px solid #2A2A2A;
    box-shadow: 5px 5px 0px #2A2A2A;
    margin-bottom: 2rem;
}

.modal-content p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.watermark {
    position: relative; /* Needed for cat positioning */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #2A2A2A;
    pointer-events: none;
    z-index: 10;
    padding: 8px 24px;
    white-space: nowrap;
    background-color: #FFE66D;
    border: 2px solid #2A2A2A;
    box-shadow: 4px 4px 0px #2A2A2A;
    max-width: 90%;
    box-sizing: content-box;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.walking-cat {
    position: absolute;
    bottom: 100%;
    left: -40px; /* Start off-screen */
    font-size: 24px;
    animation: walk 15s linear infinite;
}

.walking-cat::before {
    content: '🐈';
}

@keyframes walk {
    0% {
        left: -40px; /* Start off-screen left */
        transform: translateX(0) scaleX(1);
    }
    48% {
        left: 100%;
        transform: translateX(-100%) scaleX(1);
    }
    50% {
        left: 100%;
        transform: translateX(-100%) scaleX(-1); /* Flip direction */
    }
    98% {
        left: -40px;
        transform: translateX(0) scaleX(-1);
    }
    100% {
        left: -40px;
        transform: translateX(0) scaleX(1); /* Return to original direction */
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .redirect-box p {
        font-size: 1rem;
    }
    
    #redirect-button {
        padding: 10px 25px;
        font-size: 1rem;
    }
}