/* ---------------------------- */
/* Reset & Body Setup           */
/* ---------------------------- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #d3d3d3;
    color: var(--text-color, #000);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    overflow-x: hidden; /* desktop scroll ok */
}

/* ---------------------------- */
/* Theme Variables              */
/* ---------------------------- */
:root {
    --bg-black: #000;
    --bg-white: #fff;
    --text-white: #fff;
    --text-black: #000;
}

body.black-theme {
    --bg-color: var(--bg-black);
    --text-color: var(--text-white);
}

body.white-theme {
    --bg-color: var(--bg-white);
    --text-color: var(--text-black);
}

/* ---------------------------- */
/* Header                       */
/* ---------------------------- */
header {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    font-family: 'StardosStencil', sans-serif;
    font-weight: normal;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    user-select: none;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

header a {
    cursor: pointer;
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
    color: #000;
}

header a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

header a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

header a[aria-current="page"] {
    text-decoration: underline;
    font-weight: 600;
}

/* ---------------------------- */
/* Canvas Wrapper & Container   */
/* ---------------------------- */
#canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 400px;
    height: 400px;
}

#square-bg {
    width: 280px;
    height: 280px;
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0,0,0,0.08);
    z-index: 0;
}

canvas {
    z-index: 1;
    display: block;
    outline: none;
}

/* ---------------------------- */
/* Footer                       */
/* ---------------------------- */
footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

footer a img {
    width: 20px;
    height: 20px;
    filter: invert(0);
    transition: transform 0.2s ease;
}

footer a img:hover {
    transform: scale(1.2);
}

/* ---------------------------- */
/* Mobile overrides ONLY        */
/* ---------------------------- */
@media (max-width: 700px) {
    /* Remove scroll bar on mobile */
    body {
        overflow: hidden;
    }

    /* Canvas & cubes */
    #canvas-container {
        width: 90vw;
        height: 90vw;
        max-width: 400px;
        max-height: 400px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #square-bg {
        width: 70vw;
        height: 70vw;
    }

    /* Header adjustments for mobile */
    header {
        flex-direction: row;       /* inline headers */
        justify-content: center;
        flex-wrap: wrap;           /* allows wrapping if needed */
        gap: 1rem;
        font-size: 1rem;           /* slightly smaller */
    }

    header a {
        font-size: 0.95rem;       /* fit inline on small screens */
    }
}
