:root {
    --black: rgb(3, 3, 2);
    --black-opacity: rgba(3, 3, 2, 0.8);

    --dark-gray: #0d0f0a;
    --gray: #3d3e38;

    --color: #697565;
    --color-strong: #56754c;
    --white: #f7eedf;
    --true-white: #fff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--black);
    color: var(--white);
    margin: 0;
    padding: 20px;
    padding-top: 0px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

a {
    color: var(--color);
}

nav {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

nav a {
    text-decoration: none;
    font-size: 18px;
    padding: 10px;
}

a:hover {
    color: var(--white);
}

.logo {
    width: 230px;
    height: 34px;
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
}

.logo * {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.flex-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
    justify-content: space-between;
}

h1 {
    text-align: center;
    color: var(--white);
    margin-bottom: 40px;
}

.low-margin {
    margin: 5px;
}

.category {
    margin-bottom: 40px;
}

.category h2 {
    border-bottom: 2px solid var(--white);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--white);
}

.project {
    display: flex;
    background-color: var(--black-opacity);
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid var(--gray);
}

.project-text {
    flex: 0.8;
    padding: 20px;
}

.project-text h3 {
    margin-top: 0;
    color: var(--white);
}

.project-text p {
    color: var(--white);
    text-align: left;
}

.project-image {
    height: auto;
    width: 100%;
    max-width: 40%;
    max-height: 35vh;
    margin-left: auto;
    margin-right: 0;
    display: flex;
}

.project-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.project-image video {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .project {
        flex-direction: column;
    }
    .project-image {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    nav {
        display: none;
    }
    .low-margin {
        margin: 5px;
        font-size: 1.25em;
    }
    .project-image {
        max-height: 100vh;
    }
}

body > .flex-nav {
    margin-top: 20px;
}

/* Rain effect */
#rain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.container-left {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
}

.container-right {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
}

.toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
    padding-left: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--white);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-text {
    padding-right: 10px;
}

.switch input:not(:checked) + .slider:before {
    background-color: var(--black);
}

/* width */
::-webkit-scrollbar {
    width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background: var(--black);
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--gray);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: var(--color);
}

.darken {
    background-color: rgba(0, 0, 0, 0.75);
}

.behind {
    z-index: -2
}

.fill {
    height: 100%;
    width: 100%;
}

.absolute {
    position: absolute;
    top: 0px;
}

.round-container {
    border-radius: 10px;
    max-width: fit-content;
}

/* ==================== Starry Sky CSS START ==================== */

#stars, #stars-layer2, #stars-layer3, #stars-layer4, #stars-layer5, #stars-galaxy {
    background-position: bottom center;
    background-size: cover;
    background-repeat: repeat-x;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    height: 1px;
    background: transparent;
    z-index: -3;
    pointer-events: none;
    border-radius: 100%;
    transform-origin: center center;
}

#stars {
    animation: twinkling 2s infinite;
}

#stars-layer2 {
    animation: twinkling 3s infinite;
    animation-delay: 1s;
}

#stars-layer3 {
    animation: twinkling 4s infinite;
    animation-delay: 2s;
}

#stars-layer4 {
    animation: twinkling 5s infinite;
    animation-delay: 3s;
}

#stars-layer5 {
    animation: twinkling 5s infinite;
    animation-delay: 5s;
}

#stars-galaxy {
    animation: twinkling 5s infinite;
    animation-delay: 6s;
}

.rotating-stars > #stars {
    animation: rotate 720s linear infinite, twinkling 2s infinite;
    animation-delay: 0s;
}

.rotating-stars > #stars-layer2 {
    animation: rotate 720s linear infinite, twinkling 3s infinite;
    animation-delay: -144s;
}

.rotating-stars > #stars-layer3 {
    animation: rotate 720s linear infinite, twinkling 4s infinite;
    animation-delay: -288s;
}

.rotating-stars > #stars-layer4 {
    animation: rotate 720s linear infinite, twinkling 5s infinite;
    animation-delay: -432s;
}

.rotating-stars > #stars-layer5 {
    animation: rotate 720s linear infinite, twinkling 6s infinite;
    animation-delay: -576s;
}

.rotating-stars > #stars-galaxy {
    animation: rotate 720s linear infinite, twinkling 5s infinite;
    animation-delay: -576s;
}

@keyframes twinkling {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

.rotating-stars > [id^="stars"] {
    position: fixed;
    left: 50%;
    background: transparent;
    z-index: -3;
    pointer-events: none;
    border-radius: 100%;
    transform: translate(-50%, -50%) rotate(0deg); /* Center the layers */
    /* Ensure transform-origin is centered */
    transform-origin: center center;
}

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

/* ==================== Starry Sky CSS END ==================== */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top: 8px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.center * {
    padding: 5px;
}

.counter {
    display: flex;
    bottom: 0;
    right: 0;
    background-color: black;
    position: absolute;
}

.profile-img {
    border-radius: 50%;
    border: 4px solid var(--white);
    width: 256px;
}
