/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========GERAL================================== */

:root {
    font-size: 62.5%; /* 1rem = 10px*/

    /* Hue altera todas as cores do site */
    --hue: 170;
    --prymary-color: hsl(var(--hue), 100%, 26%);
    --headline: hsl(210, 11%, 15%);
    --paragraph: hsl(210, 9%, 31%);

    --brand-beige: hsl(39, 100%, 97%);
    --brand-light: hsl(calc(var(--hue) - 22), 23%, 89%);
    --brand-light-2: hsl(calc(var(--hue) + 10), 14%, 97%);
    --brand-dark: hsla(var(--hue), 100%, 14%);

    --bg-light: hsl(180, 14%, 97%);

    --nav-height: 7.2rem;
}
html {
    /* Para rolamento suave */
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    height: 100%;
}
body {
    font-family: "DM Sans";
    font-size: 1.6rem; /* agora vale 16px */

    text-align: center;

    background-color: var(--bg-light);

    /* para retirar o tamanho do scroll que soma e desloca os elementos quando ele é adivado/desativado */
    overflow: overlay;
}

.wrapper {
    /* pegar em 50rem ou, se menor que isso, deixar tudo em 100% da tela */
    width: min(50rem, 100%);
    margin-inline: auto;

    /* para todos seguirem o mesmo padding da lateral */
    padding-inline: 2.4rem;
}

ul {
    list-style: none;
}

/* Padrao para imagens */
/* nesse caso segue o wrapper, que foi definido qual 100% */
img {
    max-width: 100%;
}

section {
    padding-block: 10rem;
}

section header h4 {
    font-size: 1.4rem; /*agora vale 14px*/
    font-weight: 700;
    line-height: 150%;
    letter-spacing: 0.08rem;

    color: var(--prymary-color);

    text-transform: uppercase;

    margin-bottom: 1.6rem;
}
section header h2 {
    font-size: 3rem;
    line-height: 3.9rem;

    color: var(--headline);
}
section header h1 {
    font-size: 3.4rem;
    color: var(--headline);
    line-height: 130%;

    margin-bottom: 2.4rem;
}

section .content p {
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 150%;

    color: var(--paragraph);
}

.button {
    background: var(--prymary-color);

    border: none;
    border-radius: 4rem;

    margin-bottom: 6rem;

    /* Dessa maneira o botão tem um tamanho fixo
    height: 6.2rem;
    width: 26.3rem; */

    /* Assim ele respeita apenas o padding, deixando mais dinâmico, seguido do fit content para se adequar ao conteúdo interno */
    padding: 1.6rem /*em cima e embaixo*/ 3.2rem; /*laterais*/
    width: fit-content;

    color: #fff;
    text-transform: uppercase;
    font-size: 1.4rem;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;

    text-decoration: none;

    transition: background 200ms;
}

.button:hover {
    background-color: var(--brand-dark);
}

.social-links {
    display: flex;
    gap: 3.2rem;
    align-items: center;
    justify-content: center;
}

/* ====Custom colors=================================== */

/* Cor do cartão */
#services .card circle {
    fill: var(--brand-light);
}

/* cor do botão */

#backToTopButton circle {
    fill: var(--prymary-color);
}

#contact li path {
    stroke: var(--prymary-color);
}

/* pegando um elemento (fill) específico */
/* logo */
#navigation .logo path[fill="#00856F"] {
    fill: var(--prymary-color);
}

/* quando entra no scroll */
#navigation.scroll .logo path {
    fill: white;
}

/* cor hamburguer */
button.open-menu path[stroke="#00856F"] {
    stroke: var(--prymary-color);
}

/* quando entra no scroll */
#navigation.scroll button.open-menu path[stroke="#00856F"] {
    stroke: white;
}

/* logo menu navigation */
body.menu-expended #navigation .logo path {
    fill: white;
}

/* =============NAVIGATION=============================== */

nav {
    display: flex;

    height: var(--nav-height);

    position: fixed;
    top: 0;
    width: 100vw;

    z-index: 100;
}
nav .wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav.scroll {
    background-color: var(--prymary-color);
}

/* nth-child é o numero do filho que vc quer */
/* nav.scroll svg:nth-child(1) path {
    fill: white;
} */

nav.scroll .logo path {
    fill: white;
}

nav.scroll button path {
    stroke: white;
}

nav button {
    background: none;
    border: none;
    cursor: pointer;
}

nav .menu,
nav .close-menu {
    position: fixed;
}

/* =============MENU-EXPENDED================================= */

/* Overflow retira os elementos que sobram em todos os lados */
body.menu-expanded {
    overflow: hidden;
}

/* (> *)Pegando todos os filho do primeiro nível */
/* sudo class ou pseudo class (> : not) que indica quem não vai ser aplicado */
body.menu-expended > :not(nav) {
    /* display: none; */
    visibility: hidden;
}

.menu,
.close-menu,
body.menu-expended .open-menu {
    opacity: 0;
    visibility: hidden;
}

body.menu-expended .menu,
body.menu-expended .close-menu {
    opacity: 1;
    visibility: visible;
}

.menu {
    /* transiçãp do menu */
    transform: translateY(100%);
}

body.menu-expended .menu {
    top: 0;
    left: 0;
    background: var(--prymary-color);

    width: 100vw;
    height: 100vh;

    padding-top: var(--nav-height);

    /* transição do menu */
    transition: transform 300ms;
    transform: translateY(0);
}

.menu ul:nth-child(1) {
    display: flex;
    flex-direction: column;
    gap: 4.8rem;

    margin-top: 6rem;

    font-weight: 700;
    font-size: 2.4rem;
    line-height: 3.1rem;
}

.menu ul li a {
    color: #fff;
    text-decoration: none;
}

.menu .button {
    background: #ffffff;
    border-radius: 4rem;

    font-weight: 700;
    font-size: 1.8rem;
    line-height: 2.3rem;
    text-transform: uppercase;
    /* retira o sublinhado que vem através do link */
    text-decoration: none;

    color: var(--prymary-color);

    display: inline-block;
    padding: 1.6rem 3.2rem;

    margin-top: 4.8rem;
    margin-bottom: 8rem;
}

.menu .button:hover {
    background-color: var(--prymary-color);
    color: #fff;

    filter: brightness(1.1);
}

body.menu-expended .logo,
body.menu-expended nav button {
    position: relative;
    z-index: 100;
}

body.menu-expended .logo path {
    fill: white;
}
body.menu-expended button path {
    stroke: white;
}
/* =============HOME=============================================== */

#home {
    /* propriedade de cálculo para somar marging top do Header com a altura do Nav
    /* margin-top: 4.1rem;  */

    padding-block: 0;
    padding-top: calc(4.1rem + var(--nav-height));
}

#home::before {
    content: "";
    /* nos 100vw ele conta a barrinha de rolamento, trocar por 100% */
    width: 100%;
    /* somar as alturas para se precisar alteral alguma delas, todas respeitam o posicionamento*/
    height: calc(76% + var(--nav-height));
    /* height: 115.2rem; */
    background-color: var(--brand-light);
    display: block;

    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

#home .button {
    margin-inline: auto;
}

#home p {
    font-size: 1.8rem;
    line-height: 150%;
    color: var(--paragraph);

    margin-bottom: 3.2rem;
}

#home img {
    width: 26.4rem;

    display: block;
    margin-inline: auto;

    object-position: 0 2rem;
}

#home .stats {
    width: 100%;
    /* padding-top: 4rem;
    padding-bottom: 4rem; */
    padding-block: 4rem;

    margin-inline: auto;

    background-color: var(--brand-beige);
    border: 1px solid var(--brand-light);
    border-radius: 0.6rem;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6rem;
}

#home .stat h3 {
    font-size: 4.8rem;
    color: var(--headline);
    line-height: 130%;

    margin-bottom: 0.4rem;
}

#home .stat p {
    margin: 0;
    color: var(--prymary-color);
    font-size: 1.6rem;
    line-height: 150%;
}

/* =============SERVICES============================================== */

#services header h2 {
    margin-bottom: 6rem;
}

#services .cards {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
    /* width: 32.7rem;
    height: 20.7rem; */
}

#services .card {
    padding: 2.4rem;
    text-align: left;

    background: #ffffff;

    border: 1px solid var(--brand-light);
    border-radius: 0.6rem;
}

#sevices .card h3 {
    margin-block: 1.6rem;
}

/* =============ABOUT================================================= */

#about {
    text-align: left;
    background-color: var(--brand-beige);
}

#about header h2 {
    margin-bottom: 2.4rem;
}

#about .content p {
    margin-top: 2.4rem;
    margin-bottom: 6rem;
}

/* =============CONTACT================================================ */

#contact {
    text-align: left;
}

#contact header {
    margin-bottom: 3.2rem;
}

#contact ul {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;

    margin-bottom: 3.2rem;
}

#contact ul li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* =============FOOTER================================================== */

footer {
    background-color: var(--prymary-color);
    /* espaço em cima e embaixo */
    padding-block: 6rem;

    text-align: left;

    color: #fff;
}

footer .logo {
    display: inline-block;
    margin-bottom: 2.4rem;
}

footer .logo svg {
    width: 23.6rem;
    height: 3.1rem;
}

footer .logo path {
    fill: white;
}

footer p {
    color: var(--brand-beige);
    /* altura da linha */
    line-height: 2;

    margin-bottom: 3.2rem;
}

footer .social-links {
    justify-content: flex-start;
}

/* =============BACK TO TOP============================================== */

#backToTopButton {
    position: fixed;
    /* posição do botão */
    bottom: 1rem;
    right: 2.5rem;

    /* iniciar desaparecido */
    opacity: 0;
    visibility: hidden;

    /* transição para aparecer o botão suavemente */
    /* transform: translateY(100%);
    transition: 200ms; */
}

/* Para quando ativar (JS) a classe show */
#backToTopButton.show {
    opacity: 1;
    visibility: visible;
}

/*! =============RESPONSIVO================================================ */

@media (min-width: 1024px) {
    /* =============GERAL================================================= */

    body {
        overflow: auto;
    }

    .wrapper {
        width: min(112rem, 100%);

        display: grid;
    }

    /* geral disposição das colunas no grid-area */
    .col-a {
        grid-area: A;
        margin: 4rem;
    }
    .col-b {
        grid-area: B;
    }

    section {
        padding-block: 16rem;
    }

    section header h2 {
        font-size: 4rem;
        line-height: 5.2rem;
    }

    /* =============NAVIGATION============================================ */

    /* Reset */
    nav#navigation .wrapper * {
        margin: 0;
        padding: 0;
        visibility: initial;
        display: initial;
        opacity: initial;
        flex-direction: initial;
        position: initial;
        font-size: initial;
        transform: initial;
        color: initial;
        background-color: initial;
        font-weight: initial;
        filter: initial;
    }

    /* não mostra mais na tela */
    nav#navigation .close-menu,
    nav#navigation .open-menu,
    nav#navigation .social-links {
        display: none;
    }

    nav#navigation .menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 60%;
    }

    nav#navigation .menu ul:nth-child(1) {
        display: flex;
        gap: 3.2rem;
    }

    nav#navigation .menu ul li a {
        color: var(--prymary-color);
        opacity: 0.7rem;
    }

    nav#navigation .menu a.button {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 1rem 2.4rem;

        border: 1px solid var(--prymary-color);
        border-radius: 4rem;

        color: var(--prymary-color);

        font-weight: 700;
        font-size: 1.4rem;
        line-height: 1.8rem;
        text-transform: uppercase;
    }

    nav#navigation .menu a.button:hover {
        background-color: var(--prymary-color);
        border: none;
        color: white;
    }

    nav#navigation.scroll .menu ul li a {
        color: var(--brand-light-2);
        opacity: 0.6rem;
    }

    nav#navigation.scroll .menu a.button {
        border-color: white;
        color: white;
    }

    /* Para ativar quando passar o mouse em cima */

    nav#navigation .menu li a {
        transition: opacity 0.4s;
    }

    nav#navigation .menu li a.active,
    nav#navigation .menu li a:hover {
        opacity: 1;
        font-weight: 700;
    }

    /* Para a linha em baixo ficar mais bonitinha */
    nav#navigation .menu li a::after {
        content: "";
        width: 0%;
        height: 2px;
        background-color: var(--prymary-color);

        position: relative;
        bottom: -2rem;
        left: -1rem;

        display: block;

        transition: width 0.2s;
    }

    nav#navigation.scroll li a::after {
        background-color: white;
    }

    nav#navigation .menu li a.active::after,
    nav#navigation .menu li a:hover::after {
        padding-inline: 0.8rem;
        width: 100%;
    }

    nav#navigation.scroll .menu li a.active,
    nav#navigation.scroll .menu li a:hover {
        opacity: 1;
    }

    nav#navigation.scroll .menu a.button.active,
    nav#navigation.scroll .menu a.button:hover {
        background-color: var(--prymary-color);
        filter: brightness(1.2);
        border: none;
    }

    /* =============HOME============================================ */

    #home::before {
        height: calc(96% - var(--nav-height));
    }

    #home {
        padding-top: var(--nav-height);
    }

    #home .wrapper {
        /* outra maneira de escrever é por fração (fr) 1fr 1fr */
        grid-template-columns: 60.5rem 1fr;

        /* Increvelmente se desenha as áreas que vc quer distribuir os elementos, graças ao grid */
        grid-template-areas:
            "A B"
            "C C";
    }
    /* Colocando cada elemento nas áreas desenhadas no template */
    #home .col-a {
        grid-area: A;

        text-align: left;
        align-self: center;
    }
    #home .col-b {
        grid-area: B;
    }

    #home h1 {
        font-size: 5.2rem;
    }

    #home .content p {
        font-size: 1.8rem;
    }

    #home .stats {
        grid-area: C;

        flex-direction: row;
        padding: 6rem;
        gap: 0;
    }

    #home .stats .stat + .stat {
        border-left: 1px solid var(--prymary-color);
    }

    #home .stats .stat {
        flex: 1;
    }

    #home .button {
        margin: 0;
    }
    #home img {
        width: 42rem;
    }

    /* =============SERVICES============================================ */

    #services h2 {
        width: 47rem;
        margin-inline: auto;
    }

    #services .cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4rem;
    }

    #services .card {
        width: 30%;
        flex-grow: 1;
    }

    /* =============ABOUT============================================ */

    #about .wrapper {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "B A";
        gap: 6.7rem;
    }

    #about .col-a {
        align-self: center;
    }

    #about .content p {
        margin-bottom: 0;
    }

    /* =============CONTACT============================================ */

    #contact .wrapper {
        grid-template-columns: 1fr 57.5rem;
        grid-template-areas: "A B";
    }

    #contat h2 {
        width: 40.4rem;
    }

    /* =============CONTACT============================================ */

    footer {
        padding-block: 8rem;
    }

    footer .wrapper {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "A B";
    }

    footer .col-a {
        align-self: center;
    }

    footer .col-b {
        align-self: center;
        justify-self: flex-end;
    }

    footer p {
        margin-bottom: 0;
    }
}
