html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

:root {
    --body-background-color: rgb(60, 154, 255);
    --wrapper-border-color: rgb(44,44,44);
    --wrapper-fill-color: white;
    --review-link-background: black;
    --navigation-link-background-color: black;
    --link-color: white;
    --link-hover-color: rgb(44, 44, 44);
    --card-section-background: rgba(194, 255, 194, 0.856);
}

.envy {
    --body-background-color: hsl(193, 19%, 24%);
    --wrapper-border-color: none;
    --review-link-background: 	hsl(154, 75%, 45%);
    --review-line-color: white;
    --navigation-link-background-color: hsl(154, 75%, 45%);
    --link-color: black;
    --link-hover-color: hsl(0, 0%, 12%);
    --paragraph-color: white;
    --heading2-color: hsl(158, 53%, 91%);
    --figcaption-color: hsl(158, 53%, 91%);
    --footer-background: white;
    --footer-link-color: black;
    --footer-link-hover: hsl(193, 19%, 24%);
    --nav-list-hover-color: white;
    --review-link-hover: hsl(100, 100%, 88%);
}

.veerle {
    --body-background-color: hsla(0, 0%, 100%, 1);
    --wrapper-border-color: none;
    --review-background: hsl(40, 100%, 70%);
    --review-link-background: 	hsla(205, 42%, 65%, 1);
    --review-line-color: hsl(315, 25%, 39%);
    --navigation-link-background-color: hsla(205, 42%, 65%, 1);
    --link-color: black;
    --link-hover-color: hsl(0, 0%, 12%);
    --paragraph-color: hsl(315, 25%, 39%);
    --heading2-color: hsl(263, 19%, 40%);
    --figcaption-color: hsl(263, 19%, 40%);
    --footer-background: black;
    --footer-link-color: white;
    --footer-link-hover: hsl(0, 0%, 51%);
    --nav-list-hover-color: black;
    --review-link-hover: hsl(100, 96%, 80%);
}

.github {
    --body-background-color: hsla(210, 24%, 7%, 1);
    --wrapper-border-color: none;
    --review-background: hsl(214, 13%, 22%);
    --review-link-background: 	hsla(260, 56%, 52%, 1);
    --review-line-color: hsl(315, 25%, 39%);
    --navigation-link-background-color: hsla(205, 42%, 65%, 1);
    --link-color: white;
    --link-hover-color: white;
    --paragraph-color: hsl(128, 49%, 49%);
    --heading2-color: hsl(177, 57%, 45%);
    --figcaption-color: hsl(328, 89%, 72%);
    --footer-background: white;
    --footer-link-color: black;
    --footer-link-hover: hsl(0, 0%, 18%);
    --nav-list-hover-color: white;
    --review-link-hover: hsl(328,89%,72%);
}

@keyframes swirlIn{
    0% {
        transform:rotate(-540deg) scale(0);
        transform:rotate(-540deg) scale(0);
        opacity: 0;
    }

    100% {
        transform:rotate(0) scale(1);
        transform:rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes shakeHorizontal {
    0%, 
    100% {
        transform: translateX(0);
    }

    10%, 
    30%, 
    50%, 
    70% {
        transform: translateX(-10px);
    }

    20%, 
    40%, 
    60% {
        transform: translateX(10px);
    }

    80% {
        transform: translateX(8px);
    }

    90% {
        transform: translateX(-8px);
    }
}

@keyframes spaceOut {
    0% {
        opacity: 1;
    }

    60% {
        opacity: 0.8;
    }

    100% {
        letter-spacing: 2em;
        opacity: 0;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-1000px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(32px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes tiltInFromTop {
    0% {
        transform: rotateY(-10deg) translateY(-100px) skewY(10deg);
        opacity: 0;
    }

    100% {
        transform: rotateY(0deg) translateY(0) skewY(0deg);
        opacity: 1;
    }
}

header h1 {
    text-align: center;
    background: black;
    color: white;
    align-self: center;
    padding: 0.5rem;
    border-radius: 4px;
    animation-name: swirlIn;
    animation-fill-mode: forwards;
    animation-duration: 1.5s;
    animation-delay: 0s;
    font-family: sans-serif;
}

header h1:target {
    animation-name: shakeHorizontal;
    animation-fill-mode: forwards;
    animation-duration: 1.25s;
    animation-iteration-count: 3;
    animation-delay: 0.25s;
    transform-origin: 0 center;
}

.return-button {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.8rem;
    background: rgb(22, 22, 22);
    border-radius: 4px;
    transition-duration: 300ms;
    width: 226px;
    box-shadow: 2px 2px black;
    font-family: sans-serif;
}

.return-button:hover {
    background: rgb(45, 45, 45);;
    transition-duration: 300ms;
}

.return-button a {
    color: white !important;
    text-decoration: none;
}

.return-button p {
    margin: 0;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.return-button a:hover {
    color: white;
}

main {
    animation-name: tiltInFromTop;
    animation-duration: 1.2s;
}

body {
    background:var(--body-background-color);
    margin: 0;
}

.wrapper {
    width: min(100%, 1240px);
    padding: 0 1rem;
    margin: 0 auto;
    border: solid 4px var(--wrapper-border-color);
    border-radius: 3px;
    color: var(--wrapper-fill-color);
}

.envy header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: url(../images/envy-header-image.webp) center / cover;
    height: 184px;
}

.veerle header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: url(../images/veerle-header-image.webp) center / cover;
    height: 184px;
}

.github header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: url(../images/github-header.webp) center / cover;
    height: 184px;
}

p {
    color: var(--paragraph-color);
    text-indent: 1.5rem;
    padding-left: 3px;
}

h2 {
    color: var(--heading2-color);
    text-indent: 0.5rem;
    position: relative;
    overflow: hidden;
    font-family: sans-serif;
}

[class*="stars"]:before {
    position: relative;
    z-index: 1;
    display: block;
    float: left;
    animation-name: slideInFromLeft;
    animation-duration: 2s;
    animation-delay: 0.1s;
}

[class*="stars"]:after {
    content: "✪✪✪✪✪";
    color: rgba(167, 167, 167, 0.4);
    position: absolute;
    left: 0;
    top: 0;
    animation-name: slideInFromRight;
    animation-duration: 1.4s;
    animation-delay: 0.2s;
}

.stars-5:before {
    content: "✪✪✪✪✪";
    padding-right: 10px;
}

.stars-4:before {
    content: "✪✪✪✪";
    padding-right: 32px;
}

.stars-3:before {
    content: "✪✪✪";
    padding-right: 54px;
}

.stars-2:before {
    content: "✪✪";
    padding-right: 76px;
}

.stars-1:before {
    content: "✪";
    padding-right: 98px;
}

figure {
    margin: auto;
    overflow: scroll;
}

figure img {
    padding: 20px;
    width: 100%;
    background: var(--review-link-background);
    border: 1px solid gray;
}

figcaption {
    color: var(--figcaption-color);
    padding-bottom: 0.5em;
    font-family: sans-serif;
}

.review {
    border-top: solid var(--review-line-color) 1px;
    background: var(--review-background);
}

.review-link-list {
    background: var(--review-link-background);
    display: flex;
    border-radius: 4px;
    font-size: 1.3rem;
    padding: 8px;
    align-content: center;
    flex: 1 1 auto;
    list-style: none;
    align-items: stretch;
    font-family: sans-serif;
}

.review-link {
    flex: 1 1 auto;
    align-self: center;
    text-align: center;
    font-family: sans-serif;
}

.review-link:hover {
    animation-name: spaceOut;
    animation-fill-mode: forwards;
    animation-duration: 1.2s;
    animation-delay: 0.2s;
    overflow: hidden;
    transition-duration: 500ms;
    background: var(--review-link-hover);
}

.review-link-list:hover {
    transition-duration: 500ms;
    background: var(--review-link-hover);
}

nav {
    display: flex;
    width: 100%;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: stretch;
    flex-direction: column;
    padding-left: 0;
    flex: 1 1 auto;
    margin-right: auto;
}

.nav-list li {
    border-bottom: solid var(--review-line-color) 1px;
    flex: 1 1 auto;
    display: flex;
    padding-left: 12px;
    padding-right: 12px;
    background: var(--review-link-background);
    border-top: solid 5px var(--review-link-background);
    transition-duration: 250ms;
    width: 100%;
    justify-content: center;
    font-family: sans-serif;
}

.nav-list li:hover {
    border-top: solid 5px var(--nav-list-hover-color);
    transition-duration: 250ms;
}

.nav-list li a {
    padding: 10px;
    text-align: center;
}

a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 1.1em;
    transition-duration: 200ms;
}

a:hover {
    transition-duration: 200ms;
    color: var(--link-hover-color);
}

footer {
    margin-top: 12px;
}

footer a {
    background: var(--footer-background);
    color: var(--footer-link-color);
    padding: 8px;
    border-radius: 6px;
    line-height: 1em;
}

footer a:hover {
    color: var(--footer-link-hover);
}

#top {
    scroll-margin-top: 100px;
}

span {
    flex-wrap: wrap;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2em;
}

.card-overhead {
    padding-left: 24px;
    margin-top: 2em;
    color: white;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
    margin-left: 8px;
    margin-right: 8px;
    gap: 24px;
}

.card {
    flex: 0 0 calc(40%);
    display: flex;
    flex-direction: column;
    border: solid 2px white;
    border-radius: 4px;

}

.card-figure {
    position: relative;
    width: auto;
    margin: 0;
    line-height: 0;
    overflow: hidden;
    object-fit: cover;
    transform-origin: 50% 50%;
    transform: rotate(0) scale(1);
    transition: all 1.5s;
}

.card-figure-img {
    width:100%;
    height: 200px;
    object-fit: cover;
}

.card-figure .card-figure-img
{
    transform: rotate(0) scale(1.0);
    transition: all 1.5s;
}

.card-figure:hover .card-figure-img {
    transform: rotate(0deg) scale(1.15);
    transition: all 1.5s;
    overflow: hidden;
}

.card-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-section-background);
    padding: 4px;
}

.card-section-header {
    border-bottom: solid 1px black;
    margin-bottom: 16px;
}

.card-section-metatext {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: solid 1px black;
    margin-top: 16px;
    margin-bottom: 16px;
}


.card-section-link {
    text-align: right;
    text-decoration: none;
    color: black;
    padding-right: 6px;
    padding-bottom: 6px;
    font-size: 1.1em;
    transition-duration: 500ms;
}

.card-section-link:hover {
    transition-duration: 400ms;
    transform: translateX(-2%);
    padding-top: 8px;
    font-size: 1.125em;
}

@media (min-width: 768px) {
    .review-link {
        border-radius: 4px;
        font-size: 1.3rem;
        padding: 16px;
        display: inline-block;
    }
    
    .wrapper {
        padding: 1rem;
    }

    .nav-list {
        list-style: none;
        display:flex;
        flex-wrap: wrap;
        align-items: flex-start;
        align-content: flex-start;
        flex-direction: row;
    }
    
    .nav-list li {
        border-bottom: none;
        width: calc((80vw * 0.25) - 20px);
        flex: 1 1 auto;
    }
    
    .nav-list li a {
        text-align: center;
        flex: 1 1 auto;
    }
    
    a {
        font-size: 1.1em;
        transition-duration: 200ms;
    }

    .review {
        display: flex;
        border-top: solid var(--review-line-color) 1px;
        gap: 12px;
        padding-bottom: 12px;
    }
    
    .review-content {
        flex: 0 0 calc(60% - 6px);
    }

    .review-content p {
        max-width: 60ch;
        font-size: 1.2rem;
        line-height: 1.6;
        font-family: sans-serif;
    }

    .review-featured-image {
        flex: 0 0 calc(40% - 6px);
    }

}