/* Google Fonts */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap');

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

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

    /* Colors */
    --hue: 274;
    
    --dark-color: #15141B;
    --white-color: #FFFFFF;
    --primary-color: hsl(var(--hue), 70%, 49%);
    --paragraph: hsl(0, 0%, 100%);

    --brand-color: hsla(250, 11%, 11%, 1);
    --brand-light: hsla(calc(var(--hue) - 22), 23%, 89%, 1);
    --brand-light-2: hsl(calc(var(--hue) + 10), 14%, 97%);
    --brand-hover: hsl(255, 27%, 52%);
    --background: hsl(249, 16%, 9%);

    --nav-height: 7.2rem;
    
}

html {
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'DM Sans';
    font-size: 1.6rem;

    text-align: center;

    overflow: overlay;

    background-color: var(--background);
}

.wrapper {
    width: min(50rem, 100%);
    margin-inline: auto;
    padding-inline: 2.4rem;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

section {
    padding-block: 10rem;
}

section header h4 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 150%;
    letter-spacing: 0.08rem;
    color: var(--primary-color);
    text-transform: uppercase;

    margin-bottom: 1.6rem;
}

section header h2 {
        font-size: 3rem;
        line-height: 3.9rem;
    
        color: var(--brand-light-2);
}

section header h1 {
    font-size: 3.4rem;
    color: var(--brand-light-2);
    line-height: 130%;

    margin-bottom: 2.4rem;
}

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

    color: var(--paragraph);
}

.button {
    border: none;
    border-radius: 4rem;

    text-transform: uppercase;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white-color);
    background: var(--primary-color);

    padding: 1.6rem 3.2rem;
    width: fit-content;
    margin-bottom: 6rem;
    

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

.button:hover {
    background: var(--brand-hover);
    transition: background 200ms;
}

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

/* ----------- Custom Colors ----------- */

#services .card circle {
    fill: var(--primary-color);
}

#services .card path {
    stroke: var(--brand-light-2);
}

#navigation .logo path[fill*="#00856F"],
#backToTopButton circle {
    fill: var(--primary-color);
}

#navigation .open-menu path[stroke*="#00856F"],
#contact li path {
    stroke: var(--primary-color);
}

body.menu-expanded #navigation .logo img,
#navigation.scroll .logo path {
    filter: brightness(100);
}

#navigation.scroll .open-menu img, 
#navigation.scroll .open-menu path {
    filter: brightness(100);
    stroke: var(--brand-light-2);
}

/* -=-=-=-=-=-=- Navigate -=-=-=-=-=-=-*/
nav {
    display: flex;

    height: var(--nav-height);

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

    z-index: 100;
}

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

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

nav.scroll .logo img {
    filter: brightness(100);
}

nav .logo {
    width: 14.3rem; 
    height: 2.8rem;
}

nav.scroll button path {
    stroke: var(--white-color);
}

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

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

/* -=-=-=-=-=-=- Menu-Expanded -=-=-=-=-=-=-*/

body.menu-expanded {
    overflow: hidden;
}

body.menu-expanded > :not(nav) {
    visibility: hidden;
}

.menu {
    transform: translateY(100%);
}

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

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

body.menu-expanded .menu {
    top: 0;
    left: 0;
    background: var(--primary-color);

    width: 100vw;
    height: 100vh;

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

    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: var(--white-color);
    text-decoration: none;
}

.menu .button {
    background: var(--white-color);
    border-radius: 4rem;
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 2.3rem;
    text-transform: uppercase;
    text-decoration: none;

    color: var(--primary-color);

    display: inline-block;
    padding: 1.6rem 3.2rem;
    margin-top: 4.8rem;
    margin-bottom: 8rem;
}

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

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

body.menu-expanded .logo path {
    fill: var(--white-color);
}

body.menu-expanded button path {
    stroke: var(--white-color);
}

/* -=-=-=-=-=-=- Home -=-=-=-=-=-=-*/

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

#home::before {
    content: '';
    width: 100%;
    height: calc(76% + var(--nav-height));
    display: block;

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

#home span {
    color: var(--primary-color);
}

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

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

    margin-bottom: 3.2rem;
}

#home img {
    width: 36.4rem;

    display: block;
    margin-inline: auto;

    object-position: 0 2rem;
}

#home .stats {
    width: 100%;
    padding-block: 4rem;
    margin-inline: auto;

    background-color: var(--primary-color);
    border-radius: 0.6rem;
    box-shadow: 0 5px 15px rgb(0 0 0 / 8%);

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

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

    margin-bottom: 0.4rem;
}

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

/* -=-=-=-=-=-=- Services -=-=-=-=-=-=-*/

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

#services .cards {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
}

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

    background: var(--dark-color);

    box-shadow: 0 5px 15px rgb(0 0 0 / 8%);
    box-sizing: 0.6rem;
}

#services .card h3 {
    margin-block: 1.6rem;
    color: var(--brand-light-2);
}

/* -=-=-=-=-=-=- About -=-=-=-=-=-=-*/

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

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

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

#about img {
    width: 48rem;
    height: 41.4rem;
}

/* -=-=-=-=-=-=- 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: .8rem;

    color: var(--brand-light);
}

/* -=-=-=-=-=-=- Footer -=-=-=-=-=-=-*/

footer {
    background-color: var(--primary-color);
    padding-block: 6rem;

    text-align: left;

    color: var(--white-color);
}

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

    width: 23.94rem; 
    height: 3.24rem;
}

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

footer .logo path {
    fill: var(--white-color);
}

footer p {
    color: var(--brand-light);
    line-height: 2;

    margin-bottom: 3.2rem;
}

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

/* -=-=-=-=-=-=- Credit -=-=-=-=-=-=-*/

.credit {
    padding: 1.7rem 1rem;

    text-align: center;
    background-color: var(--primary-color);
    font-size: 1.4rem;
    border-top: .13rem solid #fff3;
}

.credit p {
    color: var(--brand-light);
}

.credit p a {
    color: var(--paragraph);
    font-weight: 700;
    text-decoration: none;
}

/* -=-=-=-=-=-=- Back to Top -=-=-=-=-=-=-*/

#backToTopButton {
    position: fixed;
    bottom: 1rem;
    right: 2.5rem;

    opacity: 0;
    visibility: hidden;

    transform: translateY(100%);
    transition: 200ms;
}

#backToTopButton.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* -=-=-=-=-=-=- Responsive -=-=-=-=-=-=-*/

@media (min-width: 1024px) {

    /* -=-=-=-=-=-=- General -=-=-=-=-=-=-*/
    body {
        overflow: auto;
    }

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

    .col-a {
        grid-area: A;
    }

    .col-b {
        grid-area: B;
    }

    section {
        padding-block: 16rem;
    }

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

    /* -=-=-=-=-=-=- Navigate -=-=-=-=-=-=-*/

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

    nav#navigation .open-menu,
    nav#navigation .close-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(--primary-color);
        font-weight: 700;

        opacity: 0.5;
    }

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

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

        color: var(--primary-color);

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

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

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

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

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

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

    nav#navigation .menu li a::after {
        content: '';
        width: 0%;
        height: 2px;
        background-color: var(--primary-color);

        position: relative;
        bottom: -1.9rem;
        left: -0.5rem;

        display: block;

        transition: width .2s;
    }

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

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

    nav#navigation.scroll .wrapper a img {
        filter: brightness(100);
    }

    nav#navigation .menu ul li a.active,
    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(--primary-color);
        filter: brightness(1.2);
        border: none;
    }

    /* -=-=-=-=-=-=- Home -=-=-=-=-=-=-*/

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

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

    #home .wrapper {
        grid-template-columns: 60.5rem 1fr;
        grid-template-areas: 
        'A B'
        'C C';
    }

    #home .col-a {
        text-align: left;
        align-self: center;
    }

    #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(--brand-light);
    }

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

    #home .button {
        margin: 0;
    }

    #home img {
        width: 48rem;
    }

    /* -=-=-=-=-=-=- 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: 48rem 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';
    }

    #contact h2 {
        width: 40.4rem;
    }

    /* -=-=-=-=-=-=- Footer -=-=-=-=-=-=-*/

    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;
    }
}