@import url('https://fonts.googleapis.com/css2?family=Ruda:wght@400..900&display=swap');

@import url('./styles/windows.css');
@import url('./styles/specificWindows.css');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    font-family: "Red Hat Display", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

:root {
    --main-color: rgb(255, 255, 255);
    --main-font-color: rgb(0, 0, 0);
    --weak-inverse-main-color: rgba(0, 0, 0, 0.03);
    --weak-font-color: rgba(0, 0, 0, 0.2);

    --window-border-radius: 10px;
    --distance-from-corners: .5rem;
    --svh100: 100vh;

    --window-panel-color: rgb(67, 67, 67);
    --gray-color: rgb(67, 67, 67);
    --bright-gray-color: rgb(80, 80, 80);
    --window-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    --weak-box-shadow: 0px 0px 3px gray;
    --buttons-mobile-color: rgba(255, 255, 255, 0.5);
    --window-background-color: rgba(255, 255, 255, 1);

    --title-author-text-shadow-color: rgba(0, 0, 0, 0);
    --main-window-button-hover-color: rgb(0, 0, 0);
    --main-window-button-hover-text-shadow-color: rgba(255, 98, 0, 0);
}

@supports (height: 100svh) {
    :root {
        --svh100: 100svh;
    }
}

.window .content h1,
.window .content h2,
.window .content h3,
.window .content h4,
.window .content h5,
.window .content h6 {
  font-family: "Ruda", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

button:focus, a:focus { outline: none; }
button:hover, a:hover { cursor: pointer; }

* {
    color: var(--main-font-color)
}

img {
    user-select: none;
}

#glcanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
}

html, body {
    width: 100vw;
    height: var(--svh100);
    max-width: 100vw;
    max-height: var(--svh100);
    position: relative;
    overflow: hidden;
}

html {
    font-size: 1.4rem;
}

meta[name="theme-color"] {
    content: var(--window-background-color);
}

/* Override black screen on page opened */
#override {
    position: fixed;
    inset: 0;
    z-index: 3;
    background-color: black;
    animation: override-disappear 1s ease-in forwards;
    pointer-events: none;
}

@keyframes override-disappear {
    from {
        opacity: 1;
    } to {
        opacity: 0;
    }
}

#centered {
    pointer-events: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#centered > * {
    pointer-events: initial;
}

#music-illustration-btn {
    background-color: transparent;
    border: none;
    -webkit-user-drag: none;
    position: absolute;
    width: 150px;
    right: 20px;
    top: -110px;
    filter: brightness(70%);
    transition: filter 0.1s linear;
}

#music-illustration-btn img {
    width: inherit;
    -webkit-user-drag: none;
}

.desktop #music-illustration-btn:hover,
.screen #music-illustration-btn:active {
    filter: brightness(100%);
    cursor: pointer;
}

.desktop #music-illustration-btn:hover::before,
.screen #music-illustration-btn:active:before {
    content: '';
    user-select: none;
    background: radial-gradient(rgba(255, 255, 255, .08), transparent 50%);
    position: absolute;
    inset: -30px;
    filter: brightness(70%);
}


.main-window-music-particle {
    position: absolute;
    color: var(--weak-font-color);
    z-index: -1;
    animation: music-particle-disappear 3s linear;
}

@keyframes music-particle-disappear {
    0% {
        font-size: 2rem;
        opacity: 1;
    }
    100% {
        font-size: 1rem;
        opacity: 0;
    }
}

#music-illustration-btn img.music-illustration-animation {
    animation: music-illustration-anim 0.2s ease-out;
}

@keyframes music-illustration-anim {
    0% {
        transform: scaleY(1.1);
    }
    100% {
        transform: scaleY(1);
    }
}

.top-right {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: var(--distance-from-corners);
    right: var(--distance-from-corners);
}

.ui-btn {
    width: 60px;
    height: 60px;
    border: none;
    background-color: transparent;
    font-size: 1.7rem;
    transition: font-size 0.2s linear;
}

#music-btn, #sound-btn {
    position: relative;
}

#music-btn {
    display: none;
}

#music-btn.disabled::before, #sound-btn.disabled::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: calc(.5rem / 3);
    transform: translateY(-50%) translateX(-50%) rotate(45deg);
    border-radius: 10px;
    background: var(--gray-color);;
    transition: all .2s ease-in-out;
}

.desktop #music-btn.disabled:hover::before,
.screen #music-btn.disabled:active::before, 
.desktop #sound-btn.disabled:hover::before,
.screen #sound-btn.disabled:active::before {
    transform: translateY(-50%) translateX(-50%) rotate(30deg);
}

#music-btn i, #sound-btn i {
    color: var(--gray-color)
}

#night-mode-btn {
    position: absolute;
    top: var(--distance-from-corners);
    left: var(--distance-from-corners);
    font-size: 1.7rem;
    transition: all .3s ease;
}

.desktop #night-mode-btn:hover,
.screen #night-mode-btn:active, 
.desktop #music-btn:hover,
.screen #music-btn:active, 
.desktop #sound-btn:hover,
.screen #sound-btn:active {
    scale: 1.1;
    font-size: 2rem;
}

.btn-animation {
    display: inline-block;
    animation: btn-anim 0.3s ease-out forwards;
}

@keyframes btn-anim {
    0% {
        rotate: 50deg;
        scale: 0;
    }
    100% {
        top: 0px;
        scale: 1;
        rotate: 0deg;
    }
}

#night-mode-btn i {
    color: var(--gray-color)
}

.image-content {
    margin: 0px !important;
    padding: 0px !important;
    overflow-y: hidden !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-content img {
    display: block;
    margin: 0 auto !important;
    max-width: 100%;
    max-height: 100%;;
}

.open-in-window:hover {
    cursor: pointer;
}

#cursor-glow {
    width: 1500px;
    height: 1500px;
    position: absolute;
    z-index: 2;
    transform: translateX(-50%) translateY(-50%) scaleX(.5);
    background: radial-gradient(rgba(255, 255, 255, .005), transparent 50%);
    animation: cursor-glow-anim 15s linear infinite;
    pointer-events: none;
    user-select: none;
}

.screen #cursor-glow {
    background: transparent;
}

@keyframes cursor-glow-anim {
    from {
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    } to {
        transform: translateX(-50%) translateY(-50%) rotate(360deg);
    }
}

@media (max-width: 932px) {
    html {
        font-size: 1.15rem;
    }

    #discord-btn::before {
        display: none !important;
    }
    
    #discord-btn::after {
        font-size: 1rem !important;
        transform: translateX(calc(-50% + 25px)) translateY(100px) !important;
    }

    #music-btn {
        display: block;
    }

    #music-illustration-btn {
        display: none;
    }

    .main-window-music-particle {
        display: none;
    }
}

@media (max-height: 500px) {
    .top-right {
        flex-direction: row;
    }
}

@media (max-width: 500px) and (max-height: 450px) {
    html {
        font-size: 0.9rem;
    }

    .ui-btn {
        width: 40px;
        height: 40px;
    }
}