:root {
    --cv-img-width: calc(20px + 3vw);
    --body-background: rgb(3, 12, 24);
}

*,
*:before,
*:after {
    box-sizing: border-box;

    margin: 0;
    padding: 0;
    border: none;
    list-style-type: none;
    text-decoration: none;
}

body {
    background: var(--body-background);
    background: linear-gradient(90deg, rgba(0, 17, 36, 1) 40%, rgba(40, 69, 102, 1) 100%);
    color: azure;
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
}

body.with-popup {
    margin: 0;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

main,
footer {
    padding: 0 5vw;
}

h1 {
    font-size: clamp(18px, 3vw, 32px);
    text-transform: uppercase;
    text-align: center;
    padding-top: 3vw;
    margin-bottom: 5vw;
}

a {
    color: white;
    text-decoration: none;
}

.btn {
    display: block;
    width: max-content;
    padding: 1.2vw 2vw;
    margin: 0 auto;
    color: white;
    text-transform: uppercase;
    font-weight: 600;
    background: rgba(0, 17, 36, 0.8);
    border-radius: 5px;
    cursor: pointer;
    /*transition: all ease-out .3s;*/
}

.btn:hover {
    /*background: rgba(6, 41, 80, 0.8);*/
}

.btn_close {
    background: transparent;
    border: 1px solid #fff;
    transition: all ease-out .3s;
}

.btn_close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 2vw 0;
    background: rgba(49, 62, 79, 0.5);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 10px 0 rgba(27, 30, 33, 0.75);
    z-index: 100;
}

header .header_wrapper,
.nav ul {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    text-transform: uppercase;
}

header .header_wrapper {
    padding: 0 5vw;
}

.nav ul {
    min-width: 20vw;
}

.nav ul li:first-child {
    margin-right: 15px;
}

header .cv-hh a {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-weight: 600;
    position: relative;
}

header .cv-hh a:hover,
header .cv_img {
    transition: all ease-in-out .4s;
}

header .cv-hh a:hover {
    color: #ff0021;
}

header .cv-hh a:hover .cv_img {
    scale: .95;
    box-shadow: 0 0 4px 0 #ff0021;
}

header .cv-hh a span {
    text-transform: lowercase;
    letter-spacing: 0.1em;
    padding-left: calc(var(--cv-img-width) + 10px + .5vw);
}

header .cv_img {
    width: var(--cv-img-width);
    height: var(--cv-img-width);
    max-width: 75px;
    max-height: 75px;
    border-radius: 50%;
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(0, -50%);
}

header .cv_img img {
    width: 100%;
}

.portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4vw;
    margin-bottom: 10vw;
}

.portfolio_item {
    width: 100%;
    display: flex;
    align-items: center;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.img_bg,
.portfolio_img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.img_bg {
    background: rgba(139, 203, 255, 0.25);
    transition: all ease-in-out .3s;
}

.portfolio_img {
    z-index: -1;
}

.portfolio_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio_item a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: blur(0px);
}

.portfolio_item a span {
    padding: 15px 20px;
    background: rgba(26, 32, 44, 0.8);
    border-radius: 5px;
    text-align: center;
}

.portfolio_item._active a {
    backdrop-filter: blur(3px);
}

.portfolio_item._active .img_bg {
    background: rgba(12, 31, 40, 0.4);
}

.result {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3vw;
    gap: calc(10px + 2vw);
    margin-top: 20px;
}

.result .item {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    gap: 2vw;
    gap: calc(10px + 2vw);
    padding: 35px 35px;
    padding: calc(10px + 1.5vw);
    /*color: white;*/
    background: rgba(61, 97, 154, 0.1);
    /*border: 1px solid rgba(255, 255, 255, 0.41);*/
    border-radius: 17px;
    /*box-shadow: 10px 15px 12px rgba(5, 23, 31, 0.45);*/
    box-shadow: 0 0 10px rgba(238, 250, 253, 0.3);
}

.result .item .item-img {
    height: max(15vw, 150px);
    width: 100%;
}

.result .item .item-img.item_video {
    display: flex;
    justify-content: center;
}

.result .item iframe,
.result .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.nasa_date {
    align-self: start;
}

.nasa h3 {
    text-align: center;
}

.btn_apod {
    font-weight: 600;
    text-transform: uppercase;
    margin-top: auto;
    border-bottom: 2px solid #fff;
    cursor: pointer;
    transition: all ease-in-out .3s;
}

.btn_apod:hover {
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}

*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-thumb {
    background-color: transparent;
    border: 2px solid transparent;
    border-radius: 50px;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.4);
}

*::-webkit-scrollbar-track {
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.4);
    border-radius: 50px;
}

@media (max-width: 1199px) {
    .result {
        grid-template-columns: 1fr 1fr;
        gap: 3vw;
    }

    .portfolio {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    header {
        padding: 4vw 0;
    }

    h1 {
        padding-top: 5vw;
    }

    .portfolio {
        grid-template-columns: repeat(1, 1fr);
    }

    .result {
        grid-template-columns: 1fr;
        gap: 3vw;
    }

    .result .item .item-img {
        max-width: 350px;
    }
}

/*POPUP*/
.popup {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: center;
    pointer-events: none;
    z-index: 1000;
}

.popup.active,
.popup .popup_wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup .popup_wrapper {
    height: 90vh;
    width: 75vw;
    max-width: 1200px;
    line-height: 1.75;
    padding: 2vw;
    background: var(--body-background);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    pointer-events: initial;
    overflow: hidden;
}

.popup .popup_wrapper:last-child {
    justify-content: flex-end;
}

.apod_date {
    align-self: flex-end;
    margin-bottom: 10px;
}

.apod_article_items {
    display: flex;
    flex-direction: row;
    gap: calc(10px + 1vw);
    height: 72%;
    margin-bottom: 20px;
    margin-bottom: calc(10px + 2vw);
    overflow: hidden;
}

.apod_article_media {
    width: 50%;
    height: auto;
}

.apod_article_media img,
.apod_article_media iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.apod_article_media.video {
    display: flex;
    justify-content: center;
}

.apod_article_text {
    width: 50%;
    padding-right: 10px;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .popup .popup_wrapper {
        height: 95%;
        width: 95vw;
    }

    .apod_article_items {
        height: auto;
        flex-direction: column;
        gap: calc(10px + .5vw);
        margin-bottom: 15px;
        overflow-y: auto;
    }

    .apod_article_media,
    .apod_article_text {
        width: 100%;
    }

    .apod_article_text {
        height: auto;
        padding: 0;
        overflow-y: initial;
    }
}

.overlay {
    /*display: none;*/
    position: fixed;
    height: 100vh;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 900;
}
