* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Lato', sans-serif;
}

:root {
    font-size: 62.5%;
}

body {
    font-size: 1.6rem;
}

main {
    background:  url(assets/bg.jpeg) no-repeat center/cover;
    min-height: 100vh;
    display: grid;
    place-content: center;
    gap: 2.4rem;
    padding: 6.4rem;
}

section {
    background: #6D67D0;
    backdrop-filter: blur(1rem);
    border-radius: 1rem;
}

.temperature-now {
    background: url(assets/bg-temp-now.jpeg);
    position: relative;
    display: grid;
    grid-template-rows: max-content 1fr max-content;
}

.temperature-now::before {
    content: "";
    width: 17.6rem;
    height: 17.6rem;
    background: url(assets/clouds.svg) no-repeat;
    position: absolute;
    top: -5.6rem;
    left: -5.6rem;
}

.location {
    justify-self: end;
    padding: 3.2rem 3.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.location strong {
    font-size: 1.4rem;
    color: #c2bff4;
}

.temp {
    margin: 6rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.temp .number {
    text-align: center;
    font-size: 8.8rem;
    color: #fff;

    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.temp .number .maxmin {
    font-size: 2rem;
}

.temp .number .maxmin span {
    color: #c2bff4;
}

.celsius {
    font-size: 2.4rem;
    color: #dad8f7;
    margin-top: 2rem;
}

.statistics {
    padding: 1.2rem;
    display: flex;
    gap: 0.8rem;
}

.stats {
    flex: 1;
    padding: 1.2rem 1.6rem;
    background: rgba(102, 96, 200, 0.6);
    border-radius: 6px;
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.stats .info {
    color: #e7e6fb
}

.stats .info h5 span,
.stats .info p {
    font-size: 1.2rem;
}

.stats .info h5 {
    font-size: 1.8rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.air-quality {
    font-weight: 700;
    text-align: center;
    display: grid;
}

h2.title {
    font-size: 1.6rem;
    color: #dad8f7;

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

    margin-top: 3.2rem;
}

.air-quality .good {
    margin-top: 3.2rem;
    font-size: 1.8rem;
    color: #87ebcd;
}

.air-quality > .number {
    margin-top: 0.4rem;
    font-size: 4rem;
    color: #e7e6fb;
}

.air-quality .info {
    display: flex;
    align-items: center;
    margin-top: 3.2rem;
    padding: 0 1.6rem 1.6rem;
}

.air-quality .info .number {
    flex: 1;
}

.air-quality .info p {
    color: #87ebcd;
    font-size: 1.4rem;
}

.air-quality .info small {
    font-size: 1.2rem;
    color: #e7e6fb;
}



.sun-chart-wrapper {
    margin-top: 4rem;
    height: 11rem;
}

.sun-chart {
    --pos-x: 20;
    margin: auto;
    width: 21.6rem;
    height: 21.6rem;
    position: relative;
}

.sun-chart::before {
    content: "";
    width: 1.2rem;
    height: 1.2rem;
    position: absolute;
    background: #f6c833;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -0.6rem;

    transform: rotate(calc(1deg * ( ( (100 - var(--pos-x)) /-100) *180))) translate(10.6rem);
}

.chart {
    width: 21.6rem;
    height: 10.8rem;
    overflow: hidden;
}

.chart::before {
    content: "";
    width: 21.6rem;
    height: 21.6rem;
    display: block;
    border-radius: 50%;
    
    --mask: linear-gradient(0deg, white 50%, transparent 0%);
    background: linear-gradient(180deg, rgba(251, 219, 96, 0.2) 0%, rgba(251, 219, 96, 0) 101.89%);
    -webkit-mask: var(--mask);
    mask:  var(--mask);
    rotate: calc(1.8deg * var(--pos-x));
}

.chart img {
    position: absolute;
    top: 0;
    left: -1%;
}

time.now {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

.time {
    font-size: 1.2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem auto 0;
    padding: 0 1.6rem 1.6rem;
    max-width: 27.6rem;
}

/* Week Weather */

.week-weather {
    padding: 4rem;
    display: flex;
    gap: 1.2rem;
}

.day {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 1.6rem;
}

h4.title {
    font-size: 1.4rem;
    color: #dad8f7;
}

.day .maxmin {
    font-weight: 700;
    color: white;
    font-size: 1.6rem;
}

.day .maxmin span {
    color: #c2bff4;
}

.day .day-status {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.1rem;
}

.day .day-status small {
    font-weight: 700;
    font-size: 1.4rem;
    color: white;
    margin-top: -0.5rem;
}

@media (min-width: 1200px) {
    main {
        grid-template-columns: 48rem 27.7rem 27.7rem;
        grid-template-rows: 24.4rem 21.2rem;
    }
    .temperature-now {
        grid-row: 1/3;
    }
    .week-weather {
        grid-column: 2/4;
    }
}

@media (max-width: 768px) {
    main {
        width: 100vw;
    }
    section {
        width: 80vw;
    }
    main {
        display: flex;
        align-items: center;
        flex-direction: column;
    }
    .week-weather {
        display: grid;
        grid-template-columns: 33% 33% 33%;
        grid-template-rows: 50% 50%;
    }
    .statistics {
        display: grid;
        place-items: center;
        padding: 0.8rem;
    }
    .stats {
        padding: 0.5rem;
        justify-content: center;
        width: 50%;
    }
    .temperature-now::before {
        left: -3rem;
        top: -7rem;
    }
}