:root {
    --primary-bg-color: #40204c4f;
    --accent-color-light: #9f6fb063;
    --accent-color-dark: #5f416b;
    --text-color: #e0e0e0e7;
    --text-color-focus: #e0e0e0;
    --text-color-nofocus: #e0e0e080;
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: var(--primary-bg-color);
    color: var(--text-color);
}

#webgl-canvas {
    z-index: -3;
}

#background-img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('res/bg.png');
    background-size: cover;
    background-position: center;
    z-index: -2; 
}

#background-frost {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
}

.header-container {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    min-height: 226px;
}

header {
    position: absolute;
    top: 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 40px;
    background-color: var(--accent-color-light);
    box-shadow: 0px 8px 12px #00000018;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: padding 0.3s ease-in-out, gap 0.3s ease-in-out
}

.header-logo {
    padding-top: 10px;
    position: relative;
    width: 150px;
    height: 150px;
    transition: width 0.3s ease-in-out, height 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.header-logo:hover {
    transform: scale(1.1);
}

.header-logo img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.logo-full {
    width: 150px;
    height: 150px;
    opacity: 1;
}

.logo-small {
    width: 60px;
    height: 60px;
    opacity: 0;
}

.logo-full, .logo-small {
    filter: 
        drop-shadow(0 0 3px #473050d7);
}

.header-container header.scrolled .header-logo {
    width: 50px;
    height: 50px;
}

.header-container header.scrolled .logo-small {
    opacity: 1;
}

.header-container header.scrolled .logo-full {
    opacity: 0;
}

.header-nav {
    z-index: 5;
}

.header-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    justify-content: center;
    gap: 20px;
    color: var(--text-color);
}

.header-nav ul li {
    transition: transform 0.2s ease-in-out;
}

.header-nav ul li:hover {
    transform: scale(1.1);
}

.header-nav a {
    text-decoration: none;
    font-family: "kodomonoji", sans-serif;
    font-size: 1.1em;
    padding: 10px 15px;
    border-radius: 7px;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.header-nav a:hover {
    background-color: var(--accent-color-dark);
    color: var(--text-color);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'basic-sans', sans-serif; 
    gap: 20px;
}

section {
    width: 80%;
    max-width: 1600px;
    padding: 20px;
}

section[id] {
    scroll-margin-top: 90px;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #2a1533; 
    z-index: 9999; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s ease-out;
}

#loader.hidden{
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    width: 100px;
    height: auto;
    animation: pulse 2s infinite ease-in-out;
}

/* Here the main contents */
.hero-section {
    width: 100%;
    height: 70vh;
    background-color: #00000036;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.418);
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 20px;
    filter: 
        drop-shadow(0 0 3px #00000059);
}

.hero-content p {
    font-size: 1.4em;
    padding: 0;
    margin: 0;
    padding-bottom: 15px;
    padding-top: 5px;
}

h1 {
    font-size: 4em;
    color: var(--text-color-focus);
    text-align: center;
    margin: 0;
    font-weight: 700;
}

a#hero-button {
    display: inline-block;
    background-color: #9f6fb0d7;
    padding: 10px 25px;
    font-size: 1.3em;
    color: var(--text-color-focus);
    border-radius: 30px;
    font-weight: 500;
    font-family: "kodomonoji", sans-serif;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, filter 0.3s ease-in-out, transform 0.2s ease-in-out;
}

a#hero-button:hover {
    background-color: #9f7dac96;
    color: #e0e0e0ee;
    filter: 
        drop-shadow(0 0 3px #c286d59a) 
        drop-shadow(0 0 8px #aa72bb63);
    transform: scale(1.1);
}

a {
    text-decoration: none;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 12%;
    animation: bob 2s infinite ease-in-out;
    opacity: 0.7;
    z-index: 4;
    transition: opacity 0.3s ease;
}

.scroll-down-arrow:hover {
    opacity: 1;
}

h2 {
    font-family: "kodomonoji", sans-serif;
    font-size: 2.8em;
    padding: 0;
    margin: 0;
}

.main-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.main-block:last-of-type {
    padding-bottom: 50px;
}

.main-block.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sub-block {
    background-color: #ffffff17;
    border-radius: 10px;
    width: 100%;
    min-height: 200px;
    height: auto;
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow: hidden;
    transition: transform 0.2s ease-in-out;
}

.sub-block:hover {
    transform: scale(1.02);
}

.update-text {
    width: 60%;
    height: 100%;
    padding: 20px;
    color: #e0e0e0c4;
}

.update-image {
    width: 40%;
}

h3 {
    padding: 0;
    margin: 0;
    font-family: 'basic-sans', sans-serif;
    font-weight: 700;
    font-size: 1.5em;
}

.update-text p {
    font-family: 'basic-sans', sans-serif;
    font-size: 1.1em;
}

.date {
    font-family: 'basic-sans', sans-serif;
    font-size: 0.7em;
    color: #e0e0e0a6;
    margin-top: 5px;
}

.update-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.project {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 10px;
    max-height: 300px;
}

.project-image {
    width: 20%;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    box-shadow: 0px 0px 15px #00000028;
    transition: transform 0.3s ease-in-out;
}

.project-image img:hover {
    transform: scale(1.05)
}

.project-text {
    width: 100%;
}

.project-text h4 {
    font-family: 'basic-sans', sans-serif;
    font-weight: 800;
    font-size: 2em;
    margin: 0;
}

.project-text p {
    font-family: 'basic-sans', sans-serif;
    font-size: 1.1em;
    text-align: justify;
    padding-right: 10px;
}

.about-profile {
    padding: 30px;
    width: 50%;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.about-profile img {
    border-radius: 50%;
    height: 200px;
    width: 200px;
    box-shadow: 0px 0px 15px #00000028;
}

.about-profile h4 {
    font-family: "kodomonoji", sans-serif;
    font-size: 1.7em;
    font-weight: 500;
    padding: 0;
    margin: 0;
}

.about-profile h5 {
    font-family: 'basic-sans', sans-serif;
    padding: 0;
    margin: 0;
    font-size: 1.3em;
    opacity: 0.6;
}

.about-profile p {
    font-family: 'basic-sans', sans-serif;
    padding-top: 5px;
    margin: 0;
    font-size: 1.1em;
    opacity: 0.8;
}

.contact-block {
    width: 100%;
    padding: 20px 30px;
    display: grid; 
    grid-template-rows: 1fr auto 1fr; 
    grid-gap: 20px;
}

.contact-sub-block {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.contact-sub-block h4 {
    font-family: 'basic-sans', sans-serif;
    font-weight: 800;
    font-size: 2em;
    padding: 10px;
    margin: 0;
}

.contact-divider {
    width: 100%;
    height: 5px;
    background-color: #ffffff4f;
    border-radius: 3px;
    margin: 0;
}

.social-button {
    display: inline-flex; 
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 40px; 
    font-weight: 700;
    color: rgba(224, 224, 224, 0.904);
    transition: transform 0.3s ease-in-out, color 0.3s ease-in-out;
    box-shadow: 0px 5px 15px #00000028;
}

.social-button:hover {
    color: rgb(224, 224, 224);
    transform: scale(1.05);
}

.social-button img {
    height: 40px;
    width: 40px;
}

#social-yt {
    background-color: #ff3030c7;
}

#social-tiktok {
    background-color: #2c2c2cde;
}

#social-email {
    background-color: #777777d0;
}

#social-discord {
    background-color: #7289dab9;
}


footer {
    background-color: var(--accent-color-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    margin: 0;
    gap: 5px;
} 

.footer-socials {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-top: 10px;
    align-items: center;
}

.footer-socials a {
    transition: opacity 0.3s ease-in-out;
    opacity: 0.5;
}

.footer-socials a:hover {
    opacity: 0.8;
}

.footer-socials img {
    height: 30px;
    width: auto;
    transition: transform 0.3s ease-in-out;
}

.footer-socials img:hover {
    transform: scale(1.1);
}

#tiktok {
    height: 26px;
}

#email {
    height: 28px;
}

#discord {
    transform: translateY(2px);
}

footer p {
    color: var(--text-color-nofocus);
    font-size: 0.9em;
    font-family: 'basic-sans', sans-serif;
    padding-bottom: 5px;
    margin: 0;
}

/* WebGL Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 2.8em;
    }

    h2 {
        font-size: 2.2em;
    }

    section {
        width: 90%;
        padding: 15px 10px;
    }

    section[id] {
        scroll-margin-top: 80px;
    }

    .header-container {
        min-height: auto; 
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        gap: 15px;
        transition: none;
    }
    
    .header-logo,
    .header-container header.scrolled .header-logo {
        width: 50px;
        height: 50px;
        padding-top: 0;
        transition: none;
    }

    .logo-small,
    .header-container header.scrolled .logo-small {
        opacity: 1;
    }

    .logo-full,
    .header-container header.scrolled .logo-full {
        opacity: 0;
    }

    .header-nav ul {
        gap: 5px;
        justify-content: flex-end;
    }

    .header-nav a {
        font-size: 1em;
        padding: 8px 10px;
    }

    .hero-section {
        padding-top: 30px;
        height: 60vh;
    }
    
    .hero-content p {
        font-size: 1.2em;
    }

    a#hero-button {
        font-size: 1.1em;
        padding: 10px 20px;
    }

    .sub-block {
        flex-direction: column;
    }

    .update-text,
    .update-image {
        width: 100%;
        box-sizing: border-box;
    }
    
    .update-image img {
        height: 250px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        transform: translateY(5px);
    }

    .project {
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-height: none; 
        gap: 15px;
        padding: 20px 10px;
        width: auto;
    }

    .project-image {
        width: 60%;
        max-width: 200px;
    }

    .project-text {
        width: 100%;
        padding-left: 7px;
    }
    
    .project-text h4, .project-text p,
    .contact-sub-block h4, .contact-sub-block p {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .scroll-down-arrow {
        display: none;
    }

    .project-text p {
        text-align: justify; 
        padding-right: 10px;
    }

    .about-profile {
        width: 100%;
        box-sizing: border-box;
        padding: 20px 10px;
    }
    
    .about-profile img {
        width: 150px;
        height: 150px;
    }

    .contact-block {
        padding: 10px;
        width: auto;
    }

    .social-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .social-button img {
        height: 30px;
        width: 30px;
    }
}

/* Animation */
@keyframes bob {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}