/* Global Font */
* {
    font-family: 'JetBrains Mono', monospace;
}

/* Gooey nav color variables */
:root {
    --color-1: #8A25C4;
    --color-2: #9B04F0;
    --color-3: #76369C;
    --color-4: #ffffff;
    --linear-ease: linear(
        0,
        0.068,
        0.19 2.7%,
        0.804 8.1%,
        1.037,
        1.199 13.2%,
        1.245,
        1.27 15.8%,
        1.274,
        1.272 17.4%,
        1.249 19.1%,
        0.996 28%,
        0.949,
        0.928 33.3%,
        0.926,
        0.933 36.8%,
        1.001 45.6%,
        1.013,
        1.019 50.8%,
        1.018 54.4%,
        1 63.1%,
        0.995 68%,
        1.001 85%,
        1
    );
}

/* Header Styles */
.site-header {
    background-color: var(--color-deep-dark, #001E3D);
    color: #fff;
    padding: 1rem 2rem 1rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Intro animation modifier for home only */
.site-header--intro {
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 1.8s ease-out, transform 1.8s ease-out;
}

.site-header--intro.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-logo {
    margin-left: 0;
    margin-right: auto;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-logo a:hover {
    opacity: 0.8;
}

.logo-img {
    height: 52px;
    width: auto;
    display: block;
}

/* Navigation Button Container */
.nav-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

/* Navigation Menu Button */
.nav-menu-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--color-primary, #8A25C4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2000;
}

.nav-menu-text {
    font-size: 0.75rem;
    color: #fff;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.nav-menu-button.active + .nav-menu-text {
    opacity: 0.8;
}

.nav-menu-button:hover {
    background-color: var(--color-accent, #9B04F0);
    transform: scale(1.1);
}

.nav-menu-button.active {
    background-color: var(--color-secondary, #76369C);
}

.nav-icon-img {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
    transition: all 0.3s ease;
}

.nav-menu-button.active .nav-icon-img {
    opacity: 0.8;
    transform: rotate(90deg);
}

/* Navigation Widget Overlay */
.nav-widget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-widget-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-widget {
    background-color: var(--color-deep-dark, #001E3D);
    border: 2px solid var(--color-primary, #8A25C4);
    border-radius: 12px;
    padding: 0;
    min-width: 600px;
    min-height: 600px;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.8);
    transform-origin: center center;
    transition: transform 0.3s ease, opacity 0.5s ease-out;
    overflow: hidden;
}

.nav-widget-overlay.active .nav-widget {
    transform: scale(1);
}

.nav-widget.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    max-width: 600px;
    max-height: 600px;
    margin-left: -300px;
    margin-top: -300px;
    border-radius: 12px;
    z-index: 3000;
    transform-origin: center center;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: expandToFullscreen 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes expandToFullscreen {
    0% {
        top: 50%;
        left: 50%;
        width: 600px;
        height: 600px;
        margin-left: -300px;
        margin-top: -300px;
        border-radius: 12px;
    }
    100% {
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        margin-left: 0;
        margin-top: 0;
        border-radius: 0;
        border: none;
    }
}

/* 3D Container for Three.js */
.nav-3d-container {
    width: 100%;
    height: 100%;
    min-width: 600px;
    min-height: 600px;
    cursor: grab;
    position: relative;
}

.nav-3d-container:active {
    cursor: grabbing;
}

.nav-widget-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-widget-close:hover {
    background-color: var(--color-primary, #8A25C4);
    transform: rotate(90deg);
}

/* Gooey nav styles */
.gooey-nav-container {
    position: relative;
}

.gooey-nav-container nav {
    display: flex;
    position: relative;
    transform: translate3d(0, 0, 0.01px);
}

.gooey-nav-container nav ul {
    display: flex;
    gap: 2em;
    list-style: none;
    padding: 0 1em;
    margin: 0;
    position: relative;
    z-index: 3;
    color: white;
    text-shadow: 0 1px 1px hsl(205deg 30% 10% / 0.2);
}

.gooey-nav-container nav ul li {
    border-radius: 100vw;
    position: relative;
    cursor: pointer;
    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
    box-shadow: 0 0 0.5px 1.5px transparent;
    color: white;
}

.gooey-nav-container nav ul li a {
    display: inline-block;
    padding: 0.6em 1em;
    text-decoration: none;
    color: inherit;
}

.gooey-nav-container nav ul li:focus-within:has(:focus-visible) {
    box-shadow: 0 0 0.5px 1.5px white;
}

.gooey-nav-container nav ul li::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    z-index: -1;
}

.gooey-nav-container nav ul li.active {
    color: black;
    text-shadow: none;
}

.gooey-nav-container nav ul li.active::after {
    opacity: 1;
    transform: scale(1);
}

.gooey-nav-container .effect {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    opacity: 1;
    pointer-events: none;
    display: grid;
    place-items: center;
    z-index: 1;
}

.gooey-nav-container .effect.text {
    color: white;
    transition: color 0.3s ease;
}

.gooey-nav-container .effect.text.active {
    color: black;
}

.gooey-nav-container .effect.filter {
    filter: blur(7px) contrast(100) blur(0);
    mix-blend-mode: lighten;
}

.gooey-nav-container .effect.filter::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background: transparent;
}

.gooey-nav-container .effect.filter::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    transform: scale(0);
    opacity: 0;
    z-index: -1;
    border-radius: 100vw;
}

.gooey-nav-container .effect.active::after {
    animation: pill 0.3s ease both;
}

@keyframes pill {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.particle,
.point {
    display: block;
    opacity: 0;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    transform-origin: center;
}

.particle {
    --time: 5s;
    position: absolute;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    animation: particle calc(var(--time)) ease 1 -350ms;
}

.point {
    background: var(--color);
    opacity: 1;
    animation: point calc(var(--time)) ease 1 -350ms;
}

@keyframes particle {
    0% {
        transform: rotate(0deg) translate(calc(var(--start-x)), calc(var(--start-y)));
        opacity: 1;
        animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
    }

    70% {
        transform: rotate(calc(var(--rotate) * 0.5)) translate(calc(var(--end-x) * 1.2), calc(var(--end-y) * 1.2));
        opacity: 1;
        animation-timing-function: ease;
    }

    85% {
        transform: rotate(calc(var(--rotate) * 0.66)) translate(calc(var(--end-x)), calc(var(--end-y)));
        opacity: 1;
    }

    100% {
        transform: rotate(calc(var(--rotate) * 1.2)) translate(calc(var(--end-x) * 0.5), calc(var(--end-y) * 0.5));
        opacity: 1;
    }
}

@keyframes point {
    0% {
        transform: scale(0);
        opacity: 0;
        animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
    }

    25% {
        transform: scale(calc(var(--scale) * 0.25));
    }

    38% {
        opacity: 1;
    }

    65% {
        transform: scale(var(--scale));
        opacity: 1;
        animation-timing-function: ease;
    }

    85% {
        transform: scale(var(--scale));
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header {
        padding: 1rem;
    }

    .header-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-widget {
        min-width: 90vw;
        min-height: 90vw;
        max-width: 90vw;
        max-height: 90vh;
    }

    .nav-3d-container {
        min-width: 90vw;
        min-height: 90vw;
    }
}
