@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --header-height: 3rem;
    --font-semi: 600;

    --first-color: #4070F4;
    --second-color: #0E2431;
    --text-color: #ffffff;
    --text-color-light: #a8a8a8;
    --background-color: #0E2431;
    --surface-color: #1c2e3d;
    --border-color: #2c3e50;

    --body-font: 'Poppins', sans-serif;
    --big-font-size: clamp(1.5rem, 5vw, 3.5rem);
    --h2-font-size: clamp(1.25rem, 3vw, 2rem);
    --normal-font-size: clamp(0.938rem, 2vw, 1rem);

    --mb1: 0.5rem;
    --mb2: 1rem;
    --mb3: 1.5rem;
    --mb4: 2rem;
    --mb5: 2.5rem;
    --mb6: 3rem;

    --z-back: -10;
    --z-normal: 1;
    --z-tooltip: 10;
    --z-fixed: 100;

    --primary1: #0E2431;
    --primary3: #4070F4;
    --primary5: #ffffff;
}

[data-theme="light"] {
    --background-color: #ffffff;
    --surface-color: #f0f0f0;
    --text-color: #0E2431;
    --text-color-light: #666666;
    --border-color: #cccccc;

    --primary5: #0E2431;
    --primary3: #4070F4;
    --primary1: #ffffff;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: var(--header-height) 0 0 0;
    font-family: var(--body-font), serif;
    font-size: var(--normal-font-size);
    color: var(--text-color);
    background-color: var(--background-color);
    min-width: 320px;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, p {
    margin: 0;
    line-height: 1.2;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

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

/* Layout */
.section {
    padding: 3rem 0;
}

.section-title {
    position: relative;
    font-size: var(--h2-font-size);
    color: var(--first-color);
    margin: var(--mb2) 0 var(--mb4);
    text-align: center;
    margin-bottom: 5rem;
}

.section-title::after {
    position: absolute;
    content: '';
    width: 64px;
    height: 0.18rem;
    left: 0;
    right: 0;
    margin: auto;
    top: 3rem;
    background-color: var(--first-color);
}

.bd-grid {
    max-width: 1024px;
    display: grid;
    grid-template-columns: 100%;
    grid-column-gap: 2rem;
    width: 90%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.l-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    background-color: var(--surface-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: var(--font-semi);
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: var(--mb4);
}

.nav-link {
    position: relative;
    color: var(--text-color);
}

.nav-link:hover::after {
    position: absolute;
    content: '';
    width: 100%;
    height: 0.18rem;
    left: 0;
    top: 2rem;
    background-color: var(--first-color);
}

.nav-toggle {
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

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

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

.active::after {
    position: absolute;
    content: '';
    width: 100%;
    height: 0.18rem;
    left: 0;
    top: 2rem;
    background-color: var(--first-color);
}

/* Home Section */
.home {
    height: auto;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    text-align: left;
}

.home-data {
    order: 1;
    width: 100%;
    padding: 0 1rem;
}

.home-title {
    font-size: var(--big-font-size);
    margin-bottom: var(--mb3);
    line-height: 1.2;
}

.home-title-color {
    color: var(--first-color);
}

.home-img {
    order: 2;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 2rem auto;
    position: relative;
}

.home-img img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.home-social {
    order: 3;
    display: flex;
    justify-content: left;
    margin-left: -10px;
    margin-top: 2rem;
    width: 100%;
}

.home-social-icon {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 1rem;
    transition: color 0.3s;
}

.home-social-icon:hover {
    color: var(--first-color);
}

.button {
    display: inline-block;
    background-color: var(--first-color);
    color: white;
    padding: 0.75rem 2rem;
    font-weight: var(--font-semi);
    border-radius: 0.5rem;
    transition: box-shadow 0.3s;
    margin-top: var(--mb2);
}

.button:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* About Section */
.about-container {
    row-gap: 2rem;
    text-align: center;
}

.about-img {
    justify-self: center;
}

.about-img img {
    width: 250px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.about-subtitle {
    margin-bottom: var(--mb2);
    color: var(--first-color);
}

.about-text {
    text-align: justify;
    padding: 0 1rem;
}

/* Skills Section */

.skills-container {
    row-gap: 2rem;
    text-align: justify;
}

.skills-subtitle {
    color: var(--first-color);
    margin-bottom: var(--mb2);
}

.skills-text {
    margin-bottom: var(--mb4);
    text-align: justify;
}

.skills-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    font-weight: var(--font-semi);
    padding: 0.5rem 1rem;
    margin-bottom: var(--mb4);
    border-radius: 0.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    background-color: var(--surface-color);
}

.skills-icon {
    font-size: 2rem;
    margin-right: var(--mb1);
    color: var(--first-color);
}

.skills-names {
    display: flex;
    align-items: center;
}

.skills-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    background-color: var(--first-color);
    height: 0.25rem;
    border-radius: 0.5rem;
    z-index: var(--z-back);
}

.skills-java { width: 45%; }
.skills-python { width: 30%; }
.skills-databases { width: 45%; }
.skills-git { width: 35%; }
.skills-html { width: 30%; }
.skills-css { width: 30%; }
.skills-js { width: 20%; }
.skills-linux { width: 45%; }
.skills-img { border-radius: 0.5rem; }

.skills-description-title {
    color: var(--first-color);
    margin-bottom: var(--mb2);
}

.skills-description-subtitle {
    margin-bottom: var(--mb2);
    text-align: justify;
}


/* Projects Section */
.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: var(--mb4);
}

.project-img {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 16/9;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.project-img:hover .overlay {
    opacity: 0.8;
}

.project-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    z-index: 2;
    width: 90%;
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    color: var(--text-color);
    text-align: center;
    font-weight: var(--font-semi);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-title {
    font-size: 1.5rem;
    margin-bottom: var(--mb2);
}

.footer-social {
    display: flex;
    justify-content: center;
    margin-bottom: var(--mb2);
}

.footer-icon {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 var(--mb1);
    transition: color 0.3s;
}

.footer-icon:hover {
    color: var(--first-color);
}

/* Media Queries */
@media screen and (min-width: 576px) {
    .home-img {
        max-width: 350px;
    }

    .about-container,
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        text-align: initial;
    }

    .about-text,
    .skills-text {
        padding: 0;
    }
}

@media screen and (min-width: 768px) {
    body {
        margin: 0;
    }

    .section {
        padding: 4rem 0 3rem;
    }

    .nav {
        height: calc(var(--header-height) + 1rem);
        padding: 0 2rem;
    }

    .nav-list {
        display: flex;
        padding-top: 0;
    }

    .nav-item {
        margin-left: var(--mb4);
        margin-bottom: 0;
    }

    .nav-toggle {
        display: none;
    }

    .home {
        flex-direction: row;
        text-align: left;
        align-items: center;
        padding: 0;
        height: 100vh;
        min-height: 600px;
    }

    .home-data {
        flex: 1;
        text-align: left;
        padding-right: 2rem;
        order: 1;
    }

    .home-img {
        flex: 0 0 auto;
        width: 350px;
        margin: 0;
        order: 2;
    }

    .home-social {
        position: static;
        justify-content: flex-start;
        margin-top: 1.5rem;
        margin-left: 2.5px;
        padding-left: 0;
    }

    .home-social-icon {
        margin: 0 1rem 0 0;
    }

    .home-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-top: 2rem;
    }

    .project-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 992px) {
    .bd-grid {
        margin-left: auto;
        margin-right: auto;
    }

    .home-img {
        width: 400px;
        margin-right: 5%;
    }

    .project-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 80%;
        height: 100%;
        padding: 2rem;
        background-color: var(--surface-color);
        transition: 0.5s;
        z-index: var(--z-fixed);
    }

    .nav-menu.show {
        right: 0;
    }

    .home-img {
        max-width: 250px;
    }

    .home-title {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.home,
.about,
.skills,
.projects {
    animation: fadeIn 0.5s ease-out;
}