:root {
    --Morado600: hsl(246, 80%, 60%);
    --Naranja300: hsl(15, 100%, 70%);
    --Azul300: hsl(195, 74%, 62%);
    --Rosa400: hsl(348, 100%, 68%);
    --Verde400: hsl(145, 58%, 55%);
    --Morado700: hsl(264, 64%, 52%);
    --Amarillo300: hsl(43, 84%, 65%);
    --AzulOscuro500: hsl(226, 43%, 10%);
    --AzulOscuro400: hsl(226, 43%, 16%);
    --AzulOscuro300: hsl(226, 43%, 24%);
    --AzulOscuro200: hsl(226, 43%, 35%);
    --BlancoGrisaceo: hsl(235, 45%, 61%);
    --BlancoGrisaceoSuave: hsl(236, 100%, 87%);
}


.rubik {
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
}

* {
    box-sizing: border-box;
}


/*mobile first*/
body {
    display: flex;
    flex-direction: column;
    background-color: var(--AzulOscuro500);
    color: white;
    font-family: "Rubik", sans-serif;
    align-items: center;
}

header,
main,
footer {
    max-width: 375px;
    margin: 10px;
}

header {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    border-radius: 20px;
    background-color: var(--AzulOscuro400);
}

#perfil {
    grid-area: 1 / 1 / 2 / 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    background-color: var(--Morado600);
    border-radius: 20px;

}

#perfil img {
    grid-area: 1 / 1 / 3 / 2;
    border: 5px solid white;
    border-radius: 50%;
    width: 50%;
    height: 60%;
    justify-self: center;
    align-self: center;
    position: relative;
    right: 10px;
}

#perfil p {
    grid-area: 1 / 2 / 2 / 3;
    font-weight: 300;
    margin-bottom: 0px;
    align-self: self-end;
    position: relative;
    right: 30px;

}

#perfil h1 {
    grid-area: 2 / 2 / 3 / 3;
    font-weight: 400;
    font-size: 1.2rem;
    margin-top: 0px;
    position: relative;
    right: 30px;

}


header nav {
    grid-area: 2 / 1 / 3 / 2;
}

header nav ul {
    padding: 10px;
    height: auto;
    display: flex;
    list-style: none;
    justify-content: space-evenly;
}

header nav ul li h2 {
    margin: 0px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--BlancoGrisaceoSuave);
}

header nav ul li h2:hover {
    color: white;
    cursor: pointer;
}

/*main*/

.active {
    color: white;
    font-weight: 500;
    cursor: pointer;
    font-size: 1.2rem;
}

.card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    background-color: var(--AzulOscuro300);
    border-radius: 20px;
    height: auto;
    width: 100%;
    padding: 20px;
}

.card:hover {
    background-color: var(--AzulOscuro200);
    cursor: pointer;
}

.card h3 {
    grid-area: 1 / 1 / 2 / 2;
    font-weight: 400;
    font-size: 1.2rem;
    justify-self: start;
    margin: 0;
}

.card img {
    grid-area: 1 / 2 / 2 / 3;
    padding: 20px 20px 0px 0px;
    justify-self: end;
}

.card .hours {
    grid-area: 2 / 1 / 3 / 2;
    font-size: 2rem;
    font-weight: 300;
    margin: 0;
}

.card .previous {
    grid-area: 2 / 2 / 3 / 3;
    justify-self: end;
}

#work,
#play,
#study,
#exercise,
#social,
#self-care {
    padding-top: 45px;
    border-radius: 20px;
    height: auto;
    margin-bottom: 20px;
}

#work {
    background-image: url(images/icon-work.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Naranja300);
}

#play {
    background-image: url(images/icon-play.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Azul300);
}

#study {
    background-image: url(images/icon-study.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Rosa400);
}

#exercise {
    background-image: url(images/icon-exercise.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Verde400);
}

#social {
    background-image: url(images/icon-social.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Morado700);
}

#self-care {
    background-image: url(images/icon-self-care.svg);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 80px;
    background-color: var(--Amarillo300);
}


/*footer*/
.attribution {
    font-size: 11px;
    text-align: center;
}

.attribution a {
    color: hsl(228, 45%, 44%);
}

/*tablet*/
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding: 40px 20px;
    }
    header {
        max-width: 100%;
        margin: 0 0 30px 0;
    }
    #perfil {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 30px;
        gap: 20px;
    }
    #perfil img {
        width: 80px;
        height: 80px;
        right: auto;
        margin: 0;
    }
    #perfil p, #perfil h1 {
        right: auto;
        align-self: auto;
        margin: 0;
    }
    #perfil h1 {
        font-size: 2rem;
    }
    main {
        max-width: 100%;
        margin: 0;
    }
    main section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    #work, #play, #study, #exercise, #social, #self-care {
        margin: 0;
    }
}

/*desktop*/
@media (min-width: 1024px) {
    body {
        display: grid;
        grid-template-columns: 250px 830px;
        gap: 30px;
        align-content: center;
        justify-content: center;
        min-height: 100vh;
        padding: 0;
        justify-items: center;
    }
    header {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    main {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        width: 100%;
        max-width: 830px;
    }
    footer {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    #perfil {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 35px 30px;
    }

    #perfil img {
        width: 80px;
        height: 80px;
        right: auto;
        margin-bottom: 35px;
        border: 3px solid white;
    }

    #perfil p {
        right: auto;
        align-self: flex-start;
        font-size: 0.9rem;
        margin: 0;
    }

    #perfil h1 {
        right: auto;
        font-size: 2.5rem;
        line-height: 1.2;
        margin: 5px 0 35px 0;
        font-weight: 300;
    }

    header nav {
        height: auto;
    }
    header nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 30px;
        gap: 15px;
    }
    header nav ul li h2 {
        font-size: 1.1rem;
    }

    main section {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        height: 100%;
    }

    #work, #play, #study, #exercise, #social, #self-care {
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .card {
        flex-grow: 1;
        padding: 30px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        align-items: start;
        grid-column-gap: 0;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .card:hover {
        background-color: var(--AzulOscuro200);
    }

    .card h3 {
        grid-area: 1 / 1 / 2 / 2;
        font-size: 1.1rem;
        font-weight: 500;
        margin: 0;
    }

    .card img {
        grid-area: 1 / 2 / 2 / 3;
        padding: 0;
        align-self: center;
        justify-self: end;
    }

    .card .hours {
        grid-area: 2 / 1 / 3 / 3;
        font-size: 3.5rem;
        font-weight: 300;
        margin: 25px 0 10px 0;
    }

    .card .previous {
        grid-area: 3 / 1 / 4 / 3;
        justify-self: start;
        font-size: 0.9rem;
        margin: 0;
    }
}