* {
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', cursive;
    color: #34d415;
    text-shadow: 2px 2px darkgreen;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    line-height: 1.6;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #12111c;
}

.container {
    background: #12111c;
    display: flex;
    height: 100vh;
    width: 100%;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.1);
    padding-left: 40px;
    position: relative;
}

.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    height: auto;
    z-index: 5;
}

.left {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-right: 40px;
    padding-bottom: 30px;
}

.left h1, .left p, .left button, .grid-box, .grid-box p, .bottom-left div, .bottom-left span {
    overflow: hidden;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end 5;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #008529 }
}

.left h1 {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.1;
    color: white;
}

.left p {
    margin: 15px 0;
    font-size: 15px;
}

.left button {
    background: white;
    color: #12111c;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    width: -webkit-fill-available;
}

.grid-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
    height: 100%;
}

.grid-box {
    border: 2px solid #008529;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
    font-weight: bold;
    padding: 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.grid-box:hover {
    background-color: rgb(49, 47, 63);
}

.grid-box p {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #34d415;
    transition: opacity 0.3s ease;
    opacity: 0;
    max-width: 60%;
}

.grid-box button {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    transition: opacity 0.3s ease;
    opacity: 0;
    max-width: 60%;
}

.grid-box.expanded button {
    display: block;
    opacity: 1;
    position: static;
    transform: none;
    margin-top: 10px;
}

.popup-overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    transition: opacity 0.3s ease;
    opacity: 0;
    max-width: 60%;
}

.grid-box.expanded .popup-overlay {
    display: block;
    opacity: 1;
    position: static;
    transform: none;
    margin-top: 10px;
}

.grid-box.expanded p {
    display: block;
    opacity: 1;
    position: static;
    transform: none;
    margin-top: 10px;
    min-height: fit-content;
}

.grid-box.expanded {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: rgb(49, 47, 63);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding: 20px;
    text-align: center;
    max-width: -webkit-fill-available;
    max-height: -webkit-fill-available;
}

.grid-box .grid-image {
    position: absolute;
    bottom: 0px;
    left: -100px;
    z-index: 20;
    width: 200px;
    height: 200px;
    background-size: contain;
    animation: walk 5s linear infinite;
    display: none;
}

.grid-box .grid-p-image {
    bottom: 0px;
    z-index: 20;
    background-size: contain;
    display: none;
}

.grid-box.expanded .grid-image {
    display: block;
}

.grid-box.expanded .grid-p-image {
    display: block;
}

.bottom-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    
}

.back-button {
    display: none;
    position: absolute !important;
    top: 25px !important;
    left: 30px !important;
    padding: 10px;
    background-color: #c91383 !important;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px darkgreen;
    font-size: 1rem;
}

.back-button:hover {
    background-color: #28a745;
}

.grid-box.expanded .back-button {
    display: block;
}

@keyframes walk {
    0% {
        left: -100px;
    }
    100% {
        left: 100%;
    }
}

@media (max-width: 450px) {
    .back-text {
        display: none;
    }

    .back-button{
        min-width: 50px !important;
    }
}



@media (max-width: 830px) {
    html, body {
        overflow: auto;
        scroll-behavior: smooth !important;
    }

    .grid-box{
        max-height: 95px;
    }

    .bottom-left{
        justify-content: space-around;
        align-items: anchor-center !important;
    }

    .container {
        flex-direction: column;
        padding: 20px;
        padding-top: 350px !important; /* Adjusted padding-top */
        overflow: auto;
    }

    .grid-box.expanded .grid-image {
        display: block !important;
    }

    .grid-box.expanded {
        position: fixed !important;
        justify-content: flex-start !important;
        max-width: -webkit-fill-available;
        max-height: -webkit-fill-available;
        top: 0; /* Ensure the expanded grid box is positioned at the top */
    }

    .grid-box.expanded p{
        display: contents !important;
    }

    .logo {
        z-index: 5;
    }

    .left {
        width: 100%;
        padding-right: 0;
        padding-bottom: 20px;
    }

    .left h1 {
        font-size: 1.5rem;
    }

    .left p {
        font-size: 1rem;
    }

    .left button {
        font-size: 1rem;
    }

    .grid-right {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: 10px;
        align-content: center;
        margin: 10px;
    }

    .grid-box {
        font-size: 1rem;
        padding: 15px;
        border-left-width: 2px !important;
        border-right-width: 2px !important;
    }

    .grid-box p {
        font-size: 0.75rem;
    }

    * {
        font-size: 0.75rem;
    }
}

.glitch-image {
    width: 100vw;
    height: 100vh;
    background-image: url('glitch.jpg');
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0;
}

@keyframes glitch {
    0%, 99.8%, 100% {
        opacity: 0;
        z-index: -1;
    }
    99.9% {
        opacity: 1;
        z-index: 100;
    }
}

.glitch-image {
    animation: glitch 15s infinite;
}

/* Pop-up Form Styles */
.popup-form {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.popup-content h2 {
    text-align: center;
}

.popup-content form {
    display: flex;
    flex-direction: column;
}

.popup-content label {
    margin-top: 10px;
}

.popup-content input,
.popup-content textarea {
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.popup-content button {
    margin-top: 20px;
    padding: 10px;
    background-color: #34d415;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.popup-content button:hover {
    background-color: #28a745;
}

.open-popup-btn {
    margin-top: 20px;
    padding: 10px;
    background-color: #34d415;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.open-popup-btn:hover {
    background-color: #28a745;
}

.buttons{
    display: flex;
    gap: 10px;
}

.buttonlink {
    margin-top: 20px;
    padding: 10px;
    background-color: #34d415;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px darkgreen;
    font-size: 1rem;
}

.buttonlink:hover {
    background-color: #28a745;
}

.highlight {
    color: white;
}

.qxCTlb{
    min-width: 83px;
}

.ProjectLogo{
    max-height: 400px;
}