:root {
    --text-color: #060809;
    --background-color: rgba(255, 255, 255, 0.5);
    --nav-text-color: #dddddd;
    --nav-background-color: #232323;
    --footer-background-color: #f4f4f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #CCCCCC;
}

::-webkit-scrollbar {
    width: 12px;          /* scrollbar width */
    height: 12px;         /* horizontal scrollbar width */
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 3px solid #f0f0f0;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

::-webkit-scrollbar-button {
    display: block;
    background: #f0f0f0;
    border: 1px solid #ccc;
    height: 12px;
    width: 12px;
}

::-webkit-scrollbar-button:vertical:decrement {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="6,2 2,8 10,8" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

::-webkit-scrollbar-button:vertical:increment {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="6,10 2,4 10,4" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

h1 {font-size: 2.5em; margin-bottom: 10px;}

ul {list-style-position: inside;}

p {font-size: 1.2em; line-height: 1.6; margin-bottom: 15px;} 

section {margin-top: 20px;}

section h2 {font-size: 1.8em; margin-bottom: 8px;}

a.betterA {
    color: var(--text-color); 
    text-decoration: underline;
    text-decoration-color: var(--text-color);
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    cursor: pointer; 
    transition: color 0.3s ease, text-decoration-color 0.3s ease; 
}

a.betterA:hover {
    color: color-mix(in srgb, var(--text-color) 50%, white);
    text-decoration-color: color-mix(in srgb, var(--text-color) 50%, white);
    text-decoration-thickness: 2px;
}



.major-container {
    overflow-x: clip;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0px;
    min-height: 100vh;
}

nav.top-bar {
    z-index: 100;
    position: sticky;
    top: 0;
    display: flex;
    background-color: var(--nav-background-color);
    color: var(--nav-text-color);
    padding-left: 1rem;
    padding-right: 1rem;
    align-items: center;
    height: max-content;

    a {
        color: var(--nav-text-color);
        text-decoration: none;
        margin: 2px;
        font-size: 20px;
    }

    .nav-logo {
        font-size: 28px;
        margin-right: auto;
    }

    .nav-button {
        border: solid var(--nav-text-color);
        border-width: 0px 1px;
        display: flex;
        white-space: nowrap;
        flex-direction: row;
        align-items: center;
        text-overflow: ellipsis;
        text-align: center;

        div {
            display: flex;
            border: solid var(--nav-text-color);
            border-width: 0px 1px;
            box-sizing: border-box;
            justify-content: center;
        }
        a {
            color: var(--nav-text-color);
            text-decoration: none;
            padding: 0.5rem 1rem;
            transition: background-color 0.3s;
            cursor: pointer;
            text-align: center;
            white-space: nowrap;
            margin-top: 0;
            margin-bottom: 0;
        }
        a:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .not-enough-space-signin-up-button {
            display: none; /* hidden by default until not enough space */
        }
        /* Dropdown styles */
        div.dropdown {
            border: solid var(--nav-text-color);
            border-width: 0px 1px;
        }
    }

    .nav-overflow-button {
        display: none; /* hidden by default until button overflows */
        border: none;
        background: transparent;
        color: var(--nav-text-color);
        font-size: 20px;
        cursor: pointer;
        padding: 0.5rem 1rem;

    }

    .nav-toggle {
        display: none; /* hidden by default on desktop */
    }

    .signin-up-button {
        margin-left: auto;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }
    /* Dropdown styles */
    div.dropdown {
        position: relative;
        display: flex;
        flex-direction: column;
        border: none;

        a.dropbtn {
            border: none;
        }

        a.dropbtn:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background-color: var(--nav-background-color);
            min-width: 250px;
            max-width: 300px;
            width: fit-content;
            box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
            padding: 12px 16px;
            z-index: 1;
            top: 100%;
            left: 0;
            border: 1px solid var(--nav-text-color);

            a {
                color: var(--nav-text-color);
                padding: 12px 16px;
                white-space: wrap;
                text-decoration: none;
                display: block;
                transition: background-color 0.3s;
                margin: 0;
            }

            a:hover {
                background-color: rgba(255, 255, 255, 0.3);
            }
        }
    }
    div.dropdown:hover .dropdown-content {
        display: block;
    }
}






.container {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 0px;
    color: var(--text-color);
}

.main-content {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
.main-content > div {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
}

footer {
    background: var(--footer-background-color);
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.footer-links li {
    display: inline;
    margin-right: 10px;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { transform: translateY(3.1415926px); }
    to   { transform: translateY(0); }
}

.main-content > div[class*="-page"] {
    animation: fadeIn 0.4s ease-out;
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;

    button:not(.form-link-button) {
        margin-left: auto;
        margin-right: auto;
        position: relative;
        display: block;
        width: fit-content;
        height: 50px;
        font-size: 1.2em;
        margin-top: 20px;
        cursor: pointer;
        align-self: center;
        padding: 0 15px;
        border-radius: 10px;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Target all elements that normally contain text */
    :is(
        p, h1, h2, h3, h4, h5, h6,
        span, a, li, div, pre, code,
        blockquote, em, strong, b, i, u, s,
        mark, small, big, sub, sup, q, cite,
        dfn, var, samp, kbd, output, time,
        abbr, acronym, address, article, aside,
        footer, header, nav, section, figure,
        figcaption, details, summary, table,
        caption, th, td, tr, tbody, thead, tfoot,
        form, label, input, textarea, select,
        button, optgroup, option, fieldset, legend
    ) {
        user-select: text;
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
    }

    .notice {
        text-align:center;
        width: 100%;
        margin: auto;
        position: relative;
        white-space: pre-line;
        word-break: break-word;
    }
}

/* particles.js background container */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1; /* ensure background is behind content */
}

/* ---------- Responsive ---------- */
@media (max-width: 400px) {
    nav.top-bar {
        .signin-up-button {
            display: none;
        }
        .nav-button {
            .not-enough-space-signin-up-button {
                display: flex;
                align-items: center;
                white-space: nowrap;
                margin-top: auto;
            }
        }
    }
}

@media (max-width: 768px) {
    * {
        max-width: 100vw;
    }
/* Mobile / Tablet styles */
    nav.top-bar {
        max-width: 100vw;
        width: auto;
        justify-content: end;

        .nav-button {
            display: none; /* hidden by default on mobile */
            position: fixed;
            top: 10px; /* adjust according to nav height */
            right: 0;
            width: 320px;
            max-width: 100vw;      /* avoid exceeding viewport width */
            height: 100%;
            background: var(--nav-background-color);
            flex-direction: column;
            align-items: flex-start;
            padding-top: 1rem;
            padding-bottom: 2rem;
            border-right: none;
            box-shadow: -8px 0 24px rgba(0,0,0,0.2);
            z-index: 1000;
            overflow-y: auto;
            transform: translateX(100%);
            transition: transform 0.28s ease;

            a {
                display: block;
                padding: 0.9rem 1.2rem;
                width: 100%;
                font-size: 1.0rem;
                border-bottom: 1px solid rgba(255,255,255,0.06);
                white-space: wrap;
            }

            div {
                width: 100%;
                border: none;
                box-sizing: border-box;
            }
            div.dropdown .dropdown-content {
                border: 1px solid var(--nav-text-color);
                display: block;
            }   
        }

        /* When open, slide in */
        .nav-button.open {
            display: flex;
            transform: translateX(0);
            overflow-x: hidden;
        }


        .nav-toggle {
            display: inline-block;
            margin-left: 1rem;
            background: transparent;
            color: var(--nav-text-color);
            border: none;
            font-size: 1.6rem;
            cursor: pointer;
        }

        #navOverflowButton {
            display: none; /* hidden on mobile */
        }
        .signin-up-button {
            white-space: wrap;
            width: auto;
        }

        div.dropdown {
            justify-content: flex-start;
            a.dropbtn {
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            }
            .dropdown-content {
                top: 0;
                padding: 0;
                display: none;
                position: relative;
                overflow: hidden;
                border: none;
                min-width: 0;
                max-width: none;
                width: 100%;

                a {
                    color: var(--nav-text-color);
                    padding: 12px 16px;
                    text-decoration: none;
                    display: block;
                    transition: background-color 0.3s;
                    margin: 0;
                }
            }
        }
        
    }
    .main-content > div[class$="-page"] {
        margin-left: 12px;
        margin-right: 12px;
        max-width: none;
        border-radius: 8px;
    }

    footer {
        padding: 5px;
        min-height: min-content;
        text-align: center; 
        ul {
            white-space: wrap;
            li a {
                white-space: nowrap;
            }
        }
    }

    h1 { font-size: 1.6rem; }
    section h2 { font-size: 1.2rem; }

    p { font-size: 1rem; }
    .aWeirdThing { display: none !important;}

    /* disable heavy background on mobile */
    #particles-js { display: none; width: 0; height: 0; }

    img { max-width: 100%; height: auto; display: block; }

    input[type="text"], body.wrapped input[type="email"], body.wrapped textarea, body.wrapped select {
        width: 100%;
        box-sizing: border-box;
        padding: 0.6rem;
        font-size: 1rem;
    }

    button { 
        touch-action: manipulation; 
        padding: 0px;
    }
}