@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nosifer&family=Special+Elite&display=swap');

/* Removed the old @font-face for "Saiyan Sans" 
  and replaced it with the Google Fonts import above.
*/

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    /* Changed the default font to Creepster */
    font-family: "Creepster", cursive;
}

:root {
    --pastel-pink: #ad8671;
    --pastel-blue: #717dad;
    /* New theme colors for the maze modal */
    --maze-stone-bg: #4a3f35; /* Dark, earthy stone color */
    --maze-parchment-bg: #d7c6a9; /* Aged parchment paper */
    --maze-text-color: #312a22; /* Dark brown text */
    --maze-border-color: #2b231c; /* Darker border for depth */
}

.light-theme {
    --default-bg: var(--pastel-pink);
}

.dark-theme {
    --default-bg: var(--pastel-blue);
}

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

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

/* Utility */
.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--default-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 12px solid white;
    z-index: 1000;
}

.loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 42px; /* Slightly increased for the new font */
    letter-spacing: 2px;
}

.enter-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 36px;
    background: var(--default-bg);
    border: 3px solid white;
    padding: 8px 20px;
    opacity: 0;
    letter-spacing: 1.5px;
}

.enter-button:hover {
    cursor: pointer;
    background-color: #fff;
    color: var(--default-bg);
}

.instructions {
    z-index: 1000;
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 28px; /* Slightly increased for the new font */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
}

/* ############################################# */
/* #        MODAL REDESIGN STARTS HERE         # */
/* ############################################# */

/* Modal background overlay */
.modal-bg-overlay {
    z-index: 750;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    backdrop-filter: blur(4px); /* Adds a mysterious blur effect */
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* The main modal container - styled like an ancient artifact */
.model {
    z-index: 999;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; /* Responsive width */
    max-width: 600px;
    background-color: var(--maze-parchment-bg); /* Aged paper background */
    border: 4px solid var(--maze-border-color);
    border-radius: 8px; /* Slightly sharp corners like cut stone */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0,0,0,0.3); /* Outer glow and inner shadow for depth */
    color: var(--maze-text-color);
    font-size: 22px;
    padding: 20px;
    padding-top: 60px; /* Add extra padding at top for exit button space */
    letter-spacing: 1px;
}

/* Adding corner decorations using pseudo-elements */
.model::before, .model::after, .model-wrapper::before, .model-wrapper::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    /* Inlined SVG for a mysterious spiral corner design */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 50,50 m -45,0 a 45,45 0 1,1 90,0 a 45,45 0 1,1 -90,0' stroke='%232b231c' stroke-width='6' fill='none'/%3E%3Cpath d='M 50,50 m -25,0 a 25,25 0 1,1 50,0 a 25,25 0 1,1 -50,0' stroke='%232b231c' stroke-width='6' fill='none'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
}

.model::before { top: 10px; left: 10px; }
.model::after { top: 10px; right: 10px; transform: rotate(90deg); }
.model-wrapper::before { bottom: 10px; left: 10px; transform: rotate(-90deg); }
.model-wrapper::after { bottom: 10px; right: 10px; transform: rotate(180deg); }

.model-wrapper{
    padding: 20px;
    position: relative; /* Added for better positioning context */
}

.model-header{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    /* A double line border, like an old manuscript */
    border-bottom: 3px double var(--maze-text-color);
    margin-bottom: 12px;
    position: relative; /* Added for exit button positioning */
}

.model-title {
    /* Set title font to Nosifer for a dripping, dangerous look */
    font-family: "Nosifer", cursive;
    font-size: 38px; /* Increased size for impact */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    flex-grow: 1; /* Allow title to take up available space */
}

.model-exit-button {
    background-color: transparent;
    color: var(--maze-border-color);
    border: 2px solid var(--maze-border-color);
    border-radius: 5px;
    width: 80px; /* Slightly smaller for better proportion */
    height: 36px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Ensure the 'X' uses a more standard font for clarity */
    font-family: sans-serif;
    position: absolute; /* Position absolutely within the modal */
    top: -50px; /* Position above the modal content */
    right: 10px; /* Align with modal's right edge */
    z-index: 10; /* Ensure it's above other elements */
}

.model-exit-button:hover {
    background-color: var(--maze-border-color);
    color: var(--maze-parchment-bg);
    transform: scale(1.1); /* Slight scale effect on hover */
}

.model-content {
    margin-top: 20px;
    text-align: center;
}

.model-project-description {
    /* Set description font to feel like a creepy typewriter */
    font-family: "Special Elite", cursive;
    font-size: 22px; /* Adjusted for readability */
    line-height: 1.6; /* Increased for better spacing */
    color: var(--maze-text-color);
}

.model-project-visit-button {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background-color: var(--maze-stone-bg);
    color: var(--maze-parchment-bg);
    border: 2px outset var(--maze-border-color); /* Engraved stone look */
    border-radius: 5px;
    text-align: center;
    font-size: 24px;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 2px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.model-project-visit-button:hover {
    background-color: #3d332a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ########################################### */
/* #         MODAL REDESIGN ENDS HERE        # */
/* ########################################### */

/* Toggle Theme Button */
.theme-mode-toggle-button {
    z-index: 500;
    position: absolute;
    top: 32px;
    right: 32px;
    background: var(--default-bg);
    height: 48px;
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid white;
    padding: 8px;
    cursor: pointer;
    transition: background 0.4s ease-in;
    transition-delay: 0.1s;
}

/* Toggle Audio Button */
.audio-toggle-button {
    z-index: 500;
    position: absolute;
    top: 32px;
    right: 96px;
    background: var(--default-bg);
    height: 48px;
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid white;
    padding: 8px;
    cursor: pointer;
    transition: background 0.4s ease-in;
    transition-delay: 0.1s;
}

.second-icon,
.second-icon-two {
    display: none;
}

/* Media Queries */
@media (max-width: 519px) {
    .enter-button,
    .instructions {
        font-size: 24px;
    }
    .model-title {
        font-size: 28px;
    }
    .model-project-description {
        font-size: 20px;
    }
    
    /* Adjust exit button for mobile */
    .model-exit-button {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: -6px;
        right: -6px;
    }
}