/* Define the custom font */
@font-face {
    font-family: 'GraphikFont';
    src: url('/graphik.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Basic body and canvas styling to cover the entire viewport */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'GraphikFont', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Three.js canvas styling to fill the background */
canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* Place canvas behind UI */
}

/* Container for all UI elements. Flexbox makes it responsive by distributing content. */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Place UI on top of canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none; /* Allow mouse events to pass through */
}

/* Top bar for "Graphik" and X button. Uses flexbox for horizontal layout. */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.graphik-text {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Text should not be clickable */
}

.x-button {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease-in-out;
    pointer-events: all; /* Make button clickable */
}

.x-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Center content with the huge 'G'. Flexbox is used to center it vertically and horizontally. */
.center-content {
    flex-grow: 1; /* Takes up available vertical space */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* The font size is set in viewport units (vw) which makes it scale with the browser width. */
.huge-g {
    color: white;
    font-size: 10vw; /* Responsive font size */
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
}

/* Bottom bar for the "Community" button. Uses flexbox for horizontal centering. */
.bottom-bar {
    display: flex;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.community-button {
    pointer-events: all; /* Make button clickable */
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    padding: 1.25rem 3rem;
    border-radius: 9999px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.community-button:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Loading state message */
.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    text-align: center;
    z-index: 3;
}

/* --- Media Queries for Mobile Responsiveness --- */

/* Adjust padding and font sizes for smaller screens */
@media (max-width: 768px) {
    .top-bar {
        padding: 1rem;
    }

    .graphik-text {
        font-size: 1.5rem;
    }

    .x-button {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    .community-button {
        font-size: 1rem;
        padding: 1rem 2rem;
    }
}
