@charset "utf-8";

/**
  * set all elements box-sizing property to border-box
  */
*,
*:before,
*:after {
    box-sizing: border-box;
}

/**
    * set colors to custom properties
    */
:root {
    --color-text: hsl(270, 100%, 92%);
    --color-highlight: hsl(46, 100%, 85%);
    --color-wrapper: hsl(14, 100%, 95%);
    --color-body: hsl(180, 89%, 90%);
    --color-border: hsl(var(--color-hue), 0%, 0%);
    --color-image-cta: hsl(var(--color-hue), 0%, 75%);
    --card-title-out: hsla(var(--color-hue), 0%, 0%, 0.175);
    --card-title-in: hsla(var(--color-hue), 0%, 100%, 0.175);
    --color-hue: 0;
    --image-header: url(images/main-hero.webp);
    --white: #fff;
    --black: #000;
    --fractal-link: #a7a7fb;
    --star-active: #ffae00;
    --star-inactive: #6c6962;
}

@keyframes riseUp {
    0% {
        margin-top: 100%;
    }
    100% {
        margin-top: 0%;
    }
}

@keyframes grow {
    0% {
        transform: scale(0);
    }
    75% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes colors {
    0% {
        background-color: red;
    }
    20% {
        background-color: orange;
    }
    40% {
        background-color: yellow;
    }
    60% {
        background-color: green;
    }
    80% {
        background-color: blue;
    }
    100% {
        background-color: purple;
    }
}

@keyframes fade {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/**
    * set the min-height to 100dvh
    */
html {
    font-family: Lato, sans-serif;
    min-height: 100dvh;
    scroll-behavior: smooth;
}

/**
    * body
    */
/* prettier-ignore */
body {
    margin: 0;
    min-height: 100dvh;
    background-color: var(--color-body);
}

.envy {
    --color-hue: 156;
    --color-text: hsl(var(--color-hue), 53%, 91%);
    --color-body: hsl(var(--color-hue), 88%, 35%);
    --color-wrapper: hsl(var(--color-hue), 48%, 65%);
    --color-highlight: hsl(189, 100%, 81%);
    --color-border: hsl(var(--color-hue), 48%, 11%);
    --color-image-cta: hsl(var(--color-hue), 21%, 70%);
    --image-header: url(images/envy-hero.webp);
}

.veerle {
    --color-hue: 340;
    --color-text: hsl(var(--color-hue), 100%, 91%);
    --color-body: hsl(var(--color-hue), 100%, 59%);
    --color-wrapper: hsl(var(--color-hue), 67%, 76%);
    --color-highlight: hsl(32, 100%, 69%);
    --color-border: hsl(var(--color-hue), 48%, 11%);
    --color-image-cta: hsl(var(--color-hue), 29%, 77%);
    --image-header: url(images/veerle-hero.webp);
}

.fractal {
    --color-hue: 0;
    --color-text: hsl(var(--color-hue), 0%, 100%);
    --color-body: hsl(var(--color-hue), 0%, 0%);
    --color-wrapper: hsl(var(--color-hue), 0%, 50%);
    --color-highlight: hsl(var(--color-hue), 0%, 25%);
    --color-border: hsl(var(--color-hue), 0%, 0%);
    --color-image-cta: hsl(var(--color-hue), 0%, 75%);
    --image-header: url(images/fractal-hero.webp);
}

.c-icon {
    fill: var(--star-inactive);
}

.c-icon.active {
    fill: var(--star-active);
    animation: rotate 1s ease-in-out 3;
}

/**
    * content wrapper
    */
.wrapper {
    margin: 0 auto;
    max-width: 1000px;
    background-color: var(--color-wrapper);
    padding: 30px;
    border-radius: 30px;
}

header {
    background-color: var(--color-text);
    padding: 15px;
    border-radius: 10px;
    background: var(--image-header) center / cover;
    height: 250px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: start;
}

.main header {
    justify-content: center;
    align-items: center;
}

header h1 {
    margin: 0;
    animation: colors, colors;
    animation-duration: 1.5s, 1.5s;
    animation-delay: 0s, 1.5s;
    animation-timing-function: linear, linear;
    animation-direction: normal, reverse;
    background-color: var(--color-text);
    padding: 15px;
    border-radius: 5px;
}

.main header h1 {
    background-color: var(--black);
    color: var(--white);
    padding: 15px;
    border-radius: 5px;
    font-size: 3em;
}

header h1:target {
    animation: riseUp 2s 0.1s ease;
}

header a {
    border-radius: 5px;
    padding: 10px;
    background-color: var(--color-highlight);
    width: 100%;
    align-self: flex-end;
}

header a:hover {
    animation: fade 0.7s linear infinite;
}

.fractal header a:link,
.fractal header a:visited {
    color: var(--fractal-link);
}

/**
    * navigation
    */
nav {
    position: static;
    top: auto;
    left: auto;
    background-color: var(--color-highlight);
    border-radius: 5px;
    padding: 3px 0 3px 0;
    margin: 15px 0 15px 0;
}

nav ul {
    position: relative;
    display: flex;
    flex-direction: row;
    width: auto;
    list-style: none;
    justify-content: center;
    padding: 0;
    gap: 5px;
    margin: 0;
}

nav ul li a {
    display: flex;
    line-height: 2;
    padding: 0 0.5em;
    background-color: var(--color-image-cta);
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

nav ul li a:hover,
nav ul li a:focus {
    background-color: transparent;
    border: 1px solid var(--color-border);
}

.fractal nav ul li a:hover,
.fractal nav ul li a:focus {
    background-color: transparent;
    color: var(--fractal-link);
    border: 1px solid var(--color-border);
}

nav ul li a:active,
.fractal nav ul li a:active {
    transition: none;
    border: 1px solid transparent;
}

main {
    animation: grow 0.7s cubic-bezier(0, 0.56, 0.81, 1.16);
}

p {
    line-height: 1.5;
    max-width: 60ch;
}

/**
    * cards
    */
.cards {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    justify-content: center;
}

.cards .card {
    flex: 0 0 calc(100% - 20px);
    display: flex;
    min-width: 0;
    background: var(--color-image-cta);
    border-radius: 10px;
    border: 1px dotted var(--color-border);
    overflow: hidden;
    margin-bottom: 20px;
}

.cards .card:last-child {
    margin: 0;
}

.cards .card:has(.card-link:hover) {
    border: 1px dashed var(--color-border);
}

.cards .card:has(.card-link:active) {
    border: 1px solid var(--color-border);
}

.cards .card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 0 0 100%;
}

.cards .card-figure {
    position: relative;
    margin: 0;
    line-height: 0;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.cards .card-figure-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 1s ease;
}

.cards .card-link:hover .card-figure-image {
    transform: matrix3d(0.6, 0.1, 0.7, 0,
            -0.5, 0.8, 0.1, 0,
            -0.6, -0.5, 0.5, 0,
            0, 0, 0, 1);
}

.cards .card-figure-caption {
    padding: 0 10px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0px;
    background: var(--color-highlight);
    line-height: 2;
    font-weight: bold
}

.cards .card-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--color-text);
    border-radius: 0 0 10px 10px;
}

.cards .card-section-title {
    margin-bottom: 15px;
    border: 3px ridge;
    padding: 5px;
    text-align: center;
    border-radius: 5px;
    background: linear-gradient(to right, var(--card-title-out), var(--card-title-in), var(--card-title-out));
    transition: all 1s ease;
}

.cards .card-link:hover .card-section-title {
    transform: rotate(3deg);
}

.cards .card-section-excerpt {
    flex-grow: 1;
    padding: 5px;
    line-height: 1.3;
}

.cards .card-section-button {
    align-self: flex-end;
    margin: 10px;
    padding: 0 1em;
    border-radius: .5em;
    border: 1px solid;
    line-height: 2;
    transition: transform 1s ease, background-color 1s ease, text-shadow 1s ease;
}

.cards .card-link:hover .card-section-button {
    border: none;
    padding-top: 1px;
    padding-bottom: 1px;
    margin-right: 11px;
    transform: scale(1.3);
    background: var(--color-image-cta);
    text-shadow: 1px 1px 3px var(--color-border);
}

.cards .card-link:active .card-section-button {
    border: none;
    padding-top: 1px;
    padding-bottom: 1px;
    margin-right: 11px;
    transition: none;
    transform: scale(1);
    text-shadow: none;
}

/**
    * reviews
    */
.review {
    background-color: var(--color-text);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.review-featured-image img {
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-border);
    background-color: var(--color-image-cta);
}

.review-featured-image figcaption {
    background-color: var(--color-highlight);
    line-height: 2;
    font-weight: bold;
    padding-left: 10px;
}

.fractal .review-featured-image figcaption {
    color: var(--white);
}

figure {
    margin: 0;
}

/**
    * footer
    */
footer {
    position: static;
    bottom: auto;
    left: auto;
    background-color: var(--color-highlight);
    display: flex;
    gap: 10px;
    border-radius: 5px;
    padding: 3px;
}

/**
    * footer a
    */
footer a {
    display: flex;
    line-height: 2;
    padding: 0 0.5em;
    background-color: var(--color-image-cta);
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: auto 0;
    border: 1px solid transparent;
}

footer a:first-child {
    color: black;
    text-decoration: none;
}

footer a:nth-child(2) {
    margin-right: auto;
}

footer a:hover,
footer a:focus {
    background-color: transparent;
    border: 1px solid var(--color-border);
}

.fractal footer a:hover,
.fractal footer a:focus {
    background-color: transparent;
    color: var(--fractal-link);
    border: 1px solid var(--color-border);
}

footer a:active,
.fractal footer a:active {
    transition: none;
    border: 1px solid transparent;
}

/**
    * media query if screen is 48rem or larger
    */
@media (min-width: 48rem) {

    /**
      * content wrapper
      */
    .wrapper {
        position: relative;
    }

    /**
      * header
      */
    /* prettier-ignore */
    header {
        position: relative;
    }

    header h1:target {
        animation: riseUp 1.5s 0.1s ease;
    }

    nav ul {
        gap: 10px;
    }

    .review {
        flex-direction: row;
        gap: 15px;
    }

    .review-content:not(:last-child) {
        width: 50%;
    }

    .review-featured-image {
        width: 50%;
    }

    /**
      * cards
      */
    .cards {
        justify-content: space-between;
    }

    .card:last-child:first-child {
        flex: 0 0 calc(100%);
        margin: 0;
    }

    .card:nth-child(2):nth-last-child(1),
    .card:nth-child(1):nth-last-child(2) {
        flex: 0 0 calc(50% - 20px);
        margin: 0;
    }

    .card:nth-child(3):nth-last-child(1),
    .card:nth-child(2):nth-last-child(2),
    .card:nth-child(1):nth-last-child(3) {
        flex: 0 0 calc(33.333% - 20px);
        margin: 0;
    }

    /**
      * img
      */
    .card-figure-image {
        width: 250px;
        height: 250px;
        float: right;
        margin: 0 0 50px 5px;
    }
}