html {
    box-sizing: border-box;
    scroll-padding-top: 72px;
    scroll-behavior: smooth;
    font-size: 16px;
}

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

:root {
    --h3-color: rgb(255, 255, 255);
    --body-background: white;
    --navigation-background: rgba(255, 255, 255, 0.5);
    --themeIcon-rotation: rotateX(0deg);
    --language-background: rgba(255, 255, 255, 0.5);
    --language-background-hover: #00aaff;
    --header-background: #44CCEE;
    --about-background-light: linear-gradient(to bottom,
            white 0%,
            #009dff 50%,
            #009dff 100%);
    --services-background-light: linear-gradient(to bottom,
            #009dff 0%,
            #0068a9 50%,
            #0068a9 100%);
    --projects-background-light: linear-gradient(to bottom,
            #0068a9 0%,
            #ffffff 50%,
            #ffffff 100%);
    --contact-background-light: linear-gradient(to bottom,
            #ffffff 0%,
            #009dff 50%,
            #009dff 100%);
    --footer-background-light: linear-gradient(to bottom,
            #009dff 0%,
            white 10%,
            white 100%);
    --projects-button-color: black;
    --projectsButton-border-color: black;
    --svg-color: invert(1);
    --projects-h3-color: white;
    --background-light: 1;
    --background-dark: 0;
}

.dark {
    --h3-color: rgb(59, 131, 246);
    --body-background: black;
    --navigation-background: rgba(0, 0, 0, 0.5);
    --themeIcon-rotation: rotateX(180deg);
    --language-background: rgba(0, 0, 0, 0.5);
    --language-background-hover: #13008c;
    --header-background: #000000;
    --about-background-dark: linear-gradient(to bottom,
            #090041 0%,
            #0c005c 50%,
            #0c005c 100%);
    --services-background-dark: linear-gradient(to bottom,
            #0c005c 0%,
            #06002e 50%,
            #06002e 100%);
    --projects-background-dark: linear-gradient(to bottom,
            #06002e 0%,
            #0f0072 50%,
            #0f0072 100%);
    --contact-background-dark: linear-gradient(to bottom,
            #0f0072 0%,
            black 50%,
            black 100%);
    --footer-background-dark: linear-gradient(to bottom,
            black 0%,
            black 10%,
            black 100%);

    --projects-button-color: white;
    --projectsButton-border-color: white;
    --svg-color: none;
    --projects-h3-color: rgb(59, 131, 246);
    --background-light: 0;
    --background-dark: 1;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--body-background);
    opacity: 0;
    transition: background 1s ease, opacity 0.4s ease;
}

body.loaded {
  opacity: 1;
}

.no-scroll {
  overflow: hidden;
  height: 100vh;
}

.montserratFont {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
}

.codeFont {
    font-family: "Fira Code", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

/* sections-settings - start */
nav,
header {
    transition: background-color 1s ease;
}

/* Linear Backgrounds - Start */
#about::before,
#services::before,
#projects::before,
#contact::before,
footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: var(--background-light);
    transition: opacity 1s ease;
}

#about::before {
    background: var(--about-background-light);
}

#services::before {
    background: var(--services-background-light);
}

#projects::before {
    background: var(--projects-background-light);
}

#contact::before {
    background: var(--contact-background-light);
}

footer::before {
    background: var(--footer-background-light);
}

#about::after,
#services::after,
#projects::after,
#contact::after,
footer::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: var(--background-dark);
    transition: opacity 1s ease;
}

#about::after {
    background: var(--about-background-dark);
}

#services::after {
    background: var(--services-background-dark);
}

#projects::after {
    background: var(--projects-background-dark);
}

#contact::after {
    background: var(--contact-background-dark);
}

footer::after {
    background: var(--footer-background-dark);
}

/* Linear Backgrounds - End */

header h1 {
    color: white;
    font-size: 3.5625rem;
    line-height: 0.912;
    font-weight: 800;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
}

h1+p {
    color: white;
    font-size: 1.375rem;
    line-height: 1.27;
    margin-bottom: 24px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

section {
    padding: 64px 0;
}

h2 {
    color: #f5f5f5;
    font-size: 2.8125rem;
    line-height: 1.155;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0px 0px 4px #0000006d;
}

h3 {
    color: var(--h3-color);
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 600 !important;
    margin-bottom: 16px;
    text-shadow: 0px 0px 4px #0000006d;
}

h3+p {
    color: #f5f5f5;
    font-size: 1.375rem;
    line-height: 1.27;
    text-align: justify;
    margin-bottom: 8px;
    text-shadow: 0px 0px 4px #0000005c;
}

h4 {
    font-size: 1.75rem;
    line-height: 1.286;
    font-weight: 600;
    font-style: normal;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0px 0px 4px #0000006d;
}

h4+p {
    color: #E8E8E8;
    font-size: 1.375rem;
    line-height: 1.27;
    text-align: justify;
    margin-bottom: 32px;
}

h5 {
    font-size: 1.5rem;
    line-height: 1.286;
    font-weight: 600;
    font-style: normal;
    color: black;
    margin-bottom: 8px;
    text-shadow: 0px 0px 4px #0000006d;
}

/* sections-settings - end */

.about-container,
.services-container,
.contact-container,
.projects-container {
    padding: 0 24px;
    width: 100%;
    max-width: 1248px;
}

/* ******************** NAVIGATION SECTION - START ******************** */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 72px;
    background-color: var(--navigation-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.nav-container {
    position: relative;
    width: 100%;
    padding: 0 24px;
    max-width: 1248px;
    /* padding-y: +48px */
    display: flex;
    align-items: center;
}

/* Navigation Logo - Start */
#navLogo {
    display: inline-block;
    width: 48px;
    margin-right: auto;
    pointer-events: none;
    filter: var(--svg-color);
    transition: filter 1s ease;
}

/* Navigation Logo - End */

/* Navigation Menu and Menu Button - Start */
#navMenu {
    display: flex;
    gap: 16px;
    list-style: none;
    margin-right: 32px;
}

#navMenu a {
    display: inline-block;
    color: black;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0.15px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.dark #navMenu a,
.dark #languageToggle {
    color: white;
}

#navMenu a:hover {
    background-color: rgba(59, 131, 246, 0.15);
}

#navMenu a.active {
    color: white;
    background-color: rgb(59, 131, 246);
}

#menuButton {
    display: none;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 24px;
    filter: var(--svg-color);
}

#menuIcon {
    width: 48px;
}

/* Navigation Menu and Menu Button - End */

/* Theme Button - Start */
#themeButton {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 600px;
}

.themeIcon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.sunUp,
.sunDown {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    backface-visibility: hidden;
    pointer-events: none;
}

.sunUp {
    transform: rotateX(0deg);
}

.sunDown {
    transform: rotateX(180deg);
    filter: var(--svg-color);
}

.themeIcon-wrapper {
    transform: var(--themeIcon-rotation);
}

#themeButton:hover .themeIcon-wrapper {
    transform: rotateX(180deg);
}

.dark #themeButton:hover .themeIcon-wrapper {
    transform: rotateX(0deg);
}

/* Theme Button - End */

/* Language Button - Start */
#languageSwitcher {
    position: absolute;
    top: 80px;
    right: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 19;
    overflow: hidden;
    transition: opacity 0.4s;
}


#languageToggle {
    position: relative;
    background-color: var(--language-background);
    height: 50px;
    min-width: 88px;
    text-align: center;
    color: black;
    padding: 12px 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    transition: background-color .3s ease, color .3s ease;
    overflow: hidden;
    z-index: 20;
}


#languageToggle:hover {
    color: white;
    background-color: var(--language-background-hover);
}

#languageToggle.active {
    color: white;
    background-color: rgb(59, 131, 246);
}

#languageOptions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    z-index: 999;
    left: 100%;
    z-index: 20;
    opacity: 0;
    transition: left 0.4s ease, opacity 0.4s ease;
}

#languageOptions.show {
    display: flex;
    left: 0;
    opacity: 1;
}

#languageOptions button {
    color: white;
    padding: 8px 16px;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s;
    text-decoration: none;
}

.nonActiveLanguage {
    background-color: rgba(255, 50, 50, 0.5);
}

.nonActiveLanguage:hover {
    background-color: rgb(255, 90, 90);
}

.activeLanguage {
    background-color: rgb(0, 98, 255);
    pointer-events: none;
}

/* Language Button - End */

/* ******************** NAVIGATION SECTION - END ******************** */

/* ******************** HEADER SECTION - START ******************** */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--header-background);
    min-height: calc(100vh - 72px);
    margin-top: 72px;
    overflow: hidden;
}

#header-container {
    display: grid;
    position: relative;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    padding: 32px 24px;
    width: 100%;
    max-width: 1248px;
}

.hero-visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeUp 0.6s ease-out forwards;
}

/* left column - start */
#header-left {
    z-index: 7;
}

#headerLinks {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
}

#headerLinks a {
    transition: transform 0.3s ease;
}

#headerLinks a:hover {
    transform: scale(1.2);
}

#headerButton {
    display: inline-block;
    padding: 16px 64px;
    color: white;
    background-color: #3B82F6;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#headerButton:hover {
    background-color: #649FFF;
}

#headerButton:active {
    background-color: #2F68C6;
}

#header-left {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* left column - end */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* clouds - start */
.clouds {
    position: absolute;
    display: inline-block;
    width: 100%;
    bottom: -100px;
    opacity: 0;
    transition: bottom 1s ease-out, opacity 1s ease-out;
    pointer-events: none;
}

.clouds.animate {
    bottom: 0;
    opacity: 1;
    animation: cloudFloat 6s ease-in-out infinite;
}

#c1.animate {
    animation-delay: 0s;
}

#c2.animate {
    animation-delay: 0.5s;
}

#c3.animate {
    animation-delay: 1s;
}

#c1 {
    z-index: 1;
}

#c2 {
    z-index: 2;
}

#c3 {
    z-index: 3;
}

#c4 {
    z-index: 4;
}

#c5 {
    z-index: 5;
}

#c6 {
    z-index: 6;
}

#c7 {
    z-index: 7;
}

#c8 {
    z-index: 8;
}

/* clouds - end */
@keyframes cloudFloat {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(20px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ******************** HEADER SECTION - END ******************** */

/* ******************** PROJECTS SECTION - START ******************** */
/* Project Settings - Start */
#projects {
    position: relative;
    display: flex;
    justify-content: center;
}

.projects-container>h3 {
    color: var(--projects-h3-color);
}

.projectShowcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

/* Project Settings - End */

/* Project - Start */
.project {
    display: grid;
    flex-direction: column;
    background-color: black;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.25);
    width: 100%;
    min-height: 520px;
    padding-bottom: 24px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.project:hover {
    transform: scale(1.01);
    box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.6);
}

.project> :not(img:first-child) {
    /* Not selecting img the first child */
    padding-left: 24px;
    padding-right: 24px;
}

.project>img {
    width: 100%;
    margin-bottom: 16px;
}

.project>p {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 300;
    letter-spacing: 0.15px;
    color: #E8E8E8;
    text-align: justify;
    margin-bottom: 16px;
}

.projectGithubLink {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 0 !important;
    margin-left: 24px;
    margin-top: auto;
    margin-bottom: 16px;
    font-weight: 300;
}

.projectGithubLink:hover {
    opacity: 0.7;
}

.projectGithubLink:active {
    opacity: 0.7;
}

.projectGithubLink>img {
    width: 24px;
}

.projectWebsiteLink-wrapper {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.projectWebsiteLink {
    display: inline-block;
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 16px;
    background-color: white;
    color: black;
    font-weight: 600;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

.projectWebsiteLink:hover {
    transform: scale(1.02);
    opacity: 0.8;
}

.projectWebsiteLink:active {
    opacity: 0.8;
}

/* Project - End */
/* ******************** PROJECTS SECTION - END ******************** */

/* ******************** FOOTER SECTION - START ******************** */
footer {
    position: relative;
    display: flex;
    justify-content: center;
}

.footer-container {
    width: 100%;
    max-width: 1248px;
    padding: 48px 24px;
    display: flex;
    align-items: center;
    color: black;
    transition: color 1s ease;
}

.dark .footer-container {
    color: white;
}

.footer-container>div {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.footer-container div>a {
    transition: transform 0.3s ease;
}

.footer-container div>a:hover {
    transform: scale(1.1);
}

/* ******************** FOOTER SECTION - END ******************** */

/* fade-up - start */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease, color 1s ease;
    will-change: opacity, transform;
}

.show-fade-up {
    opacity: 1;
    transform: translateY(0);
}

/* fade-up - end */

@media (max-width: 1199.98px),
(max-height: 639.99px) {
    #header-left {
        z-index: 10;
    }
}

@media (max-height: 588.99px) {
    html {
        font-size: 14px;
    }

    /* header - start */
    #header-container {
        grid-template-columns: 1fr;
    }
    /* header - end */

}

@media (max-width: 767.98px) {
    html {
        font-size: 14px;
    }

    /* header - start */
    #header-container {
        grid-template-columns: 1fr;
    }

    /* header - end */

    /* nav - start */
    #navMenu {
        position: fixed;
        top: 72px;
        right: -100%;
        margin-right: 0;
        width: 160px;
        background-color: var(--navigation-background);
        flex-direction: column;
        gap: 16px;
        padding: 24px 24px;
        transition: right 0.5s ease-in-out;
        z-index: 20;
        border-bottom-left-radius: 8px;
        transition: right 1s ease, background-color 1s ease;
    }

    #navMenu.menu-open {
        right: 0;
    }

    #navMenu.menu-open + #themeButton + #menuButton + #languageSwitcher {
        opacity: 0;
    }

    #menuButton {
        display: flex;
    }

    #themeButton:hover .themeIcon-wrapper {
        transform: rotateX(0deg);
    }

    .dark #themeButton:hover .themeIcon-wrapper {
        transform: rotateX(180deg);
    }

    /* nav - end */

    /* projects - start */
    .projectShowcase {
        grid-template-columns: 1fr;
    }

    .project {
        min-height: auto;
    }

    /* projects - end */
}

@media (max-width: 575.98px) {
    html {
        font-size: 12px;
    }
}