html,
body {
    overflow-x: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Ubuntu', sans-serif;
}

#experience{
    position: fixed;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    overflow: hidden;
}

#experience-canvas{
    width: 100%;
    height: 100%;
}

.hidden{
    display: none;
}

canvas {
    touch-action: none;
}

.modal{
    z-index: 200;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
    background-color: rgb(209, 223, 239);
    border: 2px solid white;
    transition: all 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
}

.modal-wrapper{
    padding: 20px;
}

.modal-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    background-color: #c5d8eb;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


/* Projects Section */
.projects-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #267a9e;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    z-index: 200;
    overflow-y: auto;
    max-height: 90vh;
}

.projects-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.projects-container h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #000;
}

.projects {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.projects-header {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.projects-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 1em;
}

.projects-exit-btn {
    background: #f2bc855e;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.projects-exit-btn:hover {
    background: #f2bc8592;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.projects-header .title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'BBH Sans Bogle', sans-serif;
}

.card {
    width: 260px;
    background-color: #f1e9db;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
}


.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.25);
    background-color: #e0d8c5;
}

.card .title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #222;
    transition: color 0.3s ease;
}

.card:hover .title {
    color: #005f7f;
}

.card .content {
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
    flex: 1;
}

.card:hover .content {
    color: #333;
}

.visit-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid black;
    color: black;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.visit-btn:hover {
    background-color: #ccc;
    color: #000;
    transform: translateY(-2px);
}


.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.modal-visit-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #52abbf;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    align-self: center;
}

.modal-visit-btn:hover {
    background-color: #3f92a5;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}



/* Welcome Section */

.welcome {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #EBF5EE;
    justify-content: center;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;

}
.modal-proj-desc iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-exit-button {
    background-color: #f2bc85;
    color: #222;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-exit-button:hover {
    background-color: #e1a869;
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-proj-desc {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-size: 1.3rem;
    color: black;
    font-family: "Ubuntu", sans-serif;
    text-align: justify;
}

@media (max-width: 600px) {
    .modal {
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal-proj-desc {
        padding: 0.8rem;
    }

    .modal-content {
        max-height: calc(95vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
    }
    #music {
        width: 56px;
        height: 56px;
        top: 16px;
        right: 16px;
    }

    #music i {
        font-size: 1.5rem;
    }

    .jh-btn {
        margin-bottom: 5vh;
    }
    .projects {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: 90%;
    }
}

/* Enter Button */
.jh-btn {
    border-radius: 100px;
    padding: 0.5rem 3rem;
    cursor: pointer;
    margin-bottom: 3vh;
    font-size: 2em;
    font-weight: 200;
    border: none;
    color: #333;
    background-color: #cce7f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: inline-block;
    text-align: center;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.jh-btn:hover {
    background-color: #b0d9e5;
}

.jh-btn .text {
    display: inline-block;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
    font-family: "BBH Sans Bogle", sans-serif;
}

.jh-btn .text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;    
    height: 3px;
    background-color: #005f7f;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.jh-btn:hover .text {
    transform: scale(1.1);
    color: #005f7f;
}

.jh-btn:hover .text::after {
    transform: scaleX(1);
}


#music {
    position: fixed;
    top: 2em;
    right: 2em;
    z-index: 4000;
    display: grid;
    place-items: center;
    cursor: pointer;
    width: 64px;
    height: 64px;
    background: rgba(239, 238, 238, 0.9);
    border: none;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.3s ease;
    backdrop-filter: blur(6px);
}

#music:active {
    transform: scale(0.9);
}


.welcome>.msg {
    width: 70%;
    height: fit-content;
}

#wel_title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
}

#wel_text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #3a3a3a;
    text-align: left;
    margin-bottom: 2rem;
}

#music i {
    font-size: 1.8rem;
    color: #555;
    pointer-events: none;
}

.hidden {
    display: none;
}


/* Fade-in animation for Enter button */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jh-btn {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    margin-bottom: 2em;
}

.jh-btn.visible {
    animation: fadeInUp 0.8s ease forwards;
}

/* scrollable welcome section on mobile */
@media (max-width: 768px) {
    .welcome {
        position: relative;
        min-height: 100vh;
        height: auto;
        overflow-y: auto;
        justify-content: flex-start;
        padding-bottom: 3rem;
    }

    .jh-btn {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .projects-container {
        max-height: 100vh;
        overflow-y: auto;
    }

    .welcome .msg {
        width: 90%;
    }
}