* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: white;
    text-decoration: none;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
    font-size: inherit;
}


html {
    font-size: clamp(14px, 2.5vw, 18px);
    scroll-behavior: smooth;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin: 0;
}

p {
    font-size: clamp(1rem, 2vw, 1rem);
}

a {
    text-decoration: none;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #191E29;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 4em;
    padding: 1em 15%;
    box-shadow: 0 8px 4px rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 1px 3px 1.3vh rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

nav a {
    position: relative;
    margin-left: 1em;
    transition: color 0.3s;
    display: inline-block;
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: white;

}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: #FFFFFF;
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: center;
}

header img {
    display: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

nav a:hover::after {
    transform: scaleX(1);
}

@keyframes slideDown {
    0% {
        transform: translateY(-40px);
        opacity: 0;
    }

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

header h3 {
    animation: slideDown 0.7s ease 0.1s forwards;
}

nav a:nth-child(1) {
    animation: slideDown 0.7s ease 0.2s forwards;
}

nav a:nth-child(2) {
    animation: slideDown 0.7s ease 0.3s forwards;
}

nav a:nth-child(3) {
    animation: slideDown 0.7s ease 0.4s forwards;
}

nav a:nth-child(4) {
    animation: slideDown 0.7s ease 0.5s forwards;
}

nav a:nth-child(5) {
    animation: slideDown 0.7s ease 0.6s forwards;
}


main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto 15%;
}

section {
    margin: auto;
    width: 100%;
}

#home {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 2em;
    width: 100%;
    align-items: center;
    height: calc(100vh - 4em);
}


#home div {
    animation: sildelado 0.7s ease 0.1s forwards;
}

@keyframes sildelado {
    0% {
        transform: translateX(-40px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.group1 {
    grid-row: 1/3;
    grid-column: 1/3;
}

.group2 {
    grid-row: 1/4;
    grid-column: 3;
}

.group3 {
    grid-row: 3;
    grid-column: 1;
}

.group4 {
    grid-row: 3;
    grid-column: 2;
    display: flex;
    gap: 1em;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
}

.group1 p {
    color: #AAAAAA;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.group1 h1 {
    margin: 0.2em 0;
    font-weight: 700;
    line-height: 1.2em;
}

.group2 img {
    width: 100%;
}

#btn-about {
    display: flex;
    align-items: center;
    width: fit-content;
    color: #191E29;
    background-color: #FFFFFF;
    font-size: 1.5em;
    padding: 0.5em 2em;
    border-radius: 5px;
    font-weight: 700;
    transition: all 0.3s;
    white-space: nowrap;
}

#btn-about img {
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    filter: invert(1);
    vertical-align: middle;
}

#btn-about:hover {
    background-color: #191E29;
    color: #FFFFFF;
    box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 1);
    filter: invert(0);
}

.group4 a img {
    width: 50px;
    height: 50px;
    transition: all 0.3s;
    border-radius: 50%;
    padding: 1px
}

.group4 a img:hover {
    box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 1);
}

#about {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    white-space: normal;
    margin: 4em auto;
}

section h3 {
    padding-bottom: 1em;
    width: 100%;
    border-bottom: 1px solid #FFFFFF;
}

#about div {
    display: flex;
    align-items: center;
    gap: 1em;
    justify-content: space-between;
}

#about img {
    transform: rotate(-90deg);
    width: 25px;
    height: 25px;
}

.text-section {
    line-height: 1.6em;
    margin: 1em 0 0 1em;
    text-align: justify;
    width: 90%;
}

#hard_skils {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 4em auto;
}

.cards_skils div {
    background-color: #222831;
    border-radius: 10px;
    padding: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.cards_skils div:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.3);
}

.cards_skils div img {
    width: 70px;
    height: auto;
    margin-bottom: 0.5em;
}

.cards_skils {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 1.5em;
    width: 90%;
    margin: 2em auto 0 auto;
    text-align: center;
}

#projects {
    margin: 4em auto;
}

.cards_projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em;
    margin: 2em auto 0 auto;
    width: calc(100%);
}

.cards_projects .card {
    background-color: #222831;
    border-radius: 10px;
    padding: 0.5em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    text-align: justify;
    height: 100%;
}

.cards_projects .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.3);
}

.cards_projects .card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1em;
}

.cards_projects .card h2 {
    border-bottom: 1px solid #FFFFFF;
    color: #FFFFFF;
}

.btn-project {
    display: inline-block;
    background-color: #FFFFFF;
    color: #191E29;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    margin-top: auto;
    transition: all 0.3s;
    width: 100%;
}

.btn-project:hover {
    background-color: #191E29;
    color: #FFFFFF;
    box-shadow: 0px 0px 0px 2px rgba(255, 255, 255, 1);
}

#contact {
    display: flex;
    flex-direction: column;
    margin: auto;
}

form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 2em 2em;
    width: 90%;
    margin: auto;
}

input,
textarea {
    border: none;
    resize: vertical;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
    background-color: transparent;
    border-bottom: 2px solid #FFFFFF;
    height: 100%;
}

::placeholder {
    color: #ffffff;
    opacity: 1;
}

input:focus,
textarea:focus {
    outline: none;
}

form button {
    grid-column: 1/3;
    padding: 1em 4em;
    border: none;
    background-color: #FFFFFF;
    color: #191E29;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin: auto;
}

form button:hover {
    background-color: #191E29;
    color: #FFFFFF;
    box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 1);
}

#contact h1 {
    text-align: center;
    margin: 1em 0;
}

footer {
    text-align: center;
    padding: 1em 0;
    background-color: #191E29;
    border-top: 1px solid #FFFFFF;
}

footer p {
    margin: 0;
}

#btnTopo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 1px solid #ffffff;
    padding: 5px;
    transition: all 0.3s;
    transform: rotate(-180deg);
    box-shadow: 1px 3px 1.3vh rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

#btnTopo:hover {
    background-color: #191E29;
    color: #FFFFFF;
    box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 1);
    cursor: pointer;
}

@media only screen and (max-width: 767px) {
    main {
        margin: auto 5%;
        padding-top: 4vh;
    }

    header {
        padding: 1em 5%;
    }

    header img {
        display: block;
    }

    #home {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, 1fr);
    }

    #home div:nth-child(1) {
        grid-column: 1/3;
        grid-row: 1;
        text-align: center;
    }

    #home div:nth-child(2) {
        grid-column: 1/3;
        grid-row: 2;
    }

    #home div:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    #home div:nth-child(4) {
        grid-column: 2;
        grid-row: 3;
    }

    #about div {
        flex-direction: column;
    }

    #about img {
        transform: rotate(0deg);
    }

    .text-section {
        width: 90%;
        margin: 1em auto;
    }

    .cards_skils {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(4, 1fr);
    }

    .cards_projects {
        display: none;
    }

    #projectsCarousel {
        display: block !important;
        height: 50vh;
        margin: auto 0;
    }

    .card {
        background-color: #222831;
    }

    .card-title {
        color: #FFFFFF;
    }

    #contact h1 {
        margin: 1em 0 1em 0;
    }

    #about,
    #hard_skills,
    #concact {
        margin: 2em auto;
    }
    #projects {
        margin: 2em 0 0 0 ;
    }
    form {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, 1fr);
        gap: 2em;
        width: 100%;
    }

    form button {
        margin: auto 1em;
    }

    form button {
        grid-row: 5;
        grid-column: 1;
        margin: auto;
    }

    nav {
        width: 60vw;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        position: fixed;
        top: 50vh;
        left: 50vw;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: #FFFFFF;
        border-radius: 8px;
        box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 1);
    }

    nav a {
        margin: 1em 0;
        color: #191E29;
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    nav a:hover::after {
        background: #191E29;
    }

    nav[style*="opacity: 1"] {
        pointer-events: auto;
    }
}
