/* font */
@font-face {
    font-family: "leeaf-display";
    src: url("fonts/leeaf_display.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: fallback;
}


/* variables */
:root {
    --bg-color: #558366;                    
    --content-color: white;
    --grid-size-rem: 3rem;
    --font-display: "leeaf-display", monospace;
}

/* elements */
html {
    background: var(--bg-color);
}

body {
    margin: 0;
    cursor: crosshair;
}

a {
    text-decoration: none;
}

.symbol, .btmbtn {
    cursor: ne-resize;
}

/* grid background, from https://stackoverflow.com/a/76142833 */
.grid-paper {
    position: fixed;
    inset: 0;
    z-index: -1;

    background-color: var(--bg-color);
    background-image:
        linear-gradient(to right, var(--content-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--content-color) 1px, transparent 1px);
    background-size: var(--grid-size-rem) var(--grid-size-rem);

    /* 
    --radius: 250px;
    -webkit-mask-image: radial-gradient(circle var(--radius) at var(--x, 50%) var(--y, 50%), black, transparent);
    mask-image: radial-gradient(circle var(--radius) at var(--x, 50%) var(--y, 50%), black, transparent);
    */
}

.title {
    width: 17rem;
    height: 5rem;
    padding: 0.5rem;
    margin: var(--grid-size-rem) 0 0 var(--grid-size-rem);
    position: fixed;

    background-color: var(--content-color);
    color: var(--bg-color);
    font-family: var(--font-display);
    text-align: center;
}

.title h1 {
    margin: 0;
    font-size: 60px;
}

.title p {
    margin: -0.7rem 0 0;
    font-size: 25px;
}

#construction {
    position: fixed;
    inset: 40vh 0 auto;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;

    background: #f3e820;
    font-family: var(--font-display);
    font-size: clamp(10px, 2vmin, 28px);
}


.symbol {
    position: fixed;
    left: var(--left);
    top: var(--top);
    transform: translate(-50%, -50%);
}

.symbol .glyph {
    --size: clamp(20px, 2vmin, 40px);

    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--size);
    height: var(--size);

    border: 4px double var(--content-color);
    border-radius: 50%;
    background: var(--bg-color);
    color: var(--content-color);
    font-size: clamp(14px, 4vmin, 40px);

    --nudge: 0px;
    padding: calc(1.5rem + var(--nudge)) 1.5rem calc(1.5rem - var(--nudge));
}

.symbol .label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 100%);

    display: none;
    justify-content: center;
    box-sizing: border-box;
    height: var(--grid-size-rem);
    padding: 0.3em 0.5rem 0;

    background: var(--content-color);
    color: var(--bg-color);
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1;
    white-space: nowrap;
}

.symbol:hover {
    z-index: 10;
}

.symbol:hover .label {
    display: flex;
}

.btmbtn, #mailbtn {
    position: fixed;
    
    width: var(--grid-size-rem);
    height: var(--grid-size-rem);

    border: none;
    background-color: var(--content-color);
    color: var(--bg-color);
    font-size: 20px;
}

#mailbtn {
    top: var(--grid-size-rem);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: ne-resize;
    box-sizing: border-box;
    padding-top: 5px;
}

.btmbtn {
    top: calc(round(up, 100vh, var(--grid-size-rem)) - 2 * var(--grid-size-rem));
}

#randomColor, #mailbtn {
    left: calc(round(up, 100vw, var(--grid-size-rem)) - 2 * var(--grid-size-rem));
}

#reshuffleSymbols {
    left: var(--grid-size-rem);
}

/* mobile layout */
@media (max-width: 600px) {
    .title {
        box-sizing: border-box;
        width: 9rem;
        height: 6rem;
        padding-top: 1.2rem;
    }

    .title h1 {
        font-size: 40px;
    }

    #symbols {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
        gap: var(--grid-size-rem) 0.5rem;
        padding: calc(3.5 * var(--grid-size-rem)) 1rem calc(3 * var(--grid-size-rem));
    }

    .symbol {
        position: static;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .symbol .label {
        position: static;
        transform: none;
        display: flex;
        height: auto;
        padding: 0.4rem 0.5rem;
        font-size: 24px;
        white-space: normal;
        text-align: center;
        border: 4px double var(--bg-color)
    }

    #construction { 
        position: fixed; 
        font-size: 8px;
        width: 100%;
    }
}