@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');
@import url('normalize.css');

:root {
    --red: hsl(0, 78%, 62%);
    --cyan: hsl(180, 62%, 55%);
    --orange: hsl(34, 97%, 64%);
    --blue: hsl(212, 86%, 64%);

    --very-dark-blue: hsl(234, 12%, 34%);
    --grayish-blue: hsl(229, 6%, 66%);
    --very-light-gray: hsl(0, 0%, 98%);
    --white: hsl(0, 0%, 100%);
}

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

body {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    background-color: var(--very-light-gray);
    color: var(--very-dark-blue);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 375px;
}

h1, h2 {
    margin-top: 0;
}

h1 {
    font-size: 1.6875rem;
    line-height: 1.4;
    margin: 0 0 1rem;
}

p {
    margin: 0 0 1rem;
}

.header {
    text-align: center;
    max-width: 520px;
    margin: 0 auto 62px;
}

.header p {
    font-size: 0.9375rem;
    color: var(--grayish-blue);
}

.container {
    max-width: 1142px;
    margin-left: auto;
    margin-right: auto;
    padding: 5rem 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-left: -15px;
    margin-right: -15px;
}

.col {
    padding-left: 15px;
    padding-right: 15px;
}

.card {
    background-color: var(--white);
    margin-bottom: 1.875rem;
    padding: 2rem 2rem 1.5rem;
    max-width: 350px;
    height: 250px;
    border-radius: 0.5rem;
    box-shadow: 0 0.75rem 1.75rem -0.75rem hsl(212deg 86% 34% / 35%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--grayish-blue);
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover,
.card:focus {
    box-shadow: 0 0.75rem 1.75rem -0.75rem hsl(212deg 86% 34% / 55%);
    transform: translate3d(0, -0.25rem, 0);
}

.card::before {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    position: absolute;
    top: 0;
    left: 0;
    background: red;
}

.card--red::before { background-color: var(--red); }
.card--cyan::before { background-color: var(--cyan); }
.card--orange::before { background-color: var(--orange); }
.card--blue::before { background-color: var(--blue); }

.card-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.625rem;
    color: var(--very-dark-blue);
}

.card-text {
    font-size: 0.8125rem;
    color: var(--grayish-blue);
}

.card-image {
    margin-top: auto;
    text-align: right;
}

.font-extralight {
    font-weight: 200;
}

.d-block {
    display: block;
}

.attribution {
    font-size: 11px;
    text-align: center;
    display: none;
}

.attribution a {
    color: hsl(228, 45%, 44%);
}

@media (min-width: 760px) {
    h1 {
        font-size: 2.275rem;
    }

    .row {
        margin-bottom: 125px;
    }

    .col:nth-child(1),
    .col:nth-child(4) {
        transform: translateY(50%);
    }

    .col:nth-child(1) { order: 1; }
    .col:nth-child(2) { order: 2; }
    .col:nth-child(3) { order: 4; }
    .col:nth-child(4) { order: 3; }
}

@media (min-width: 1140px) {
    .row {
        margin-bottom: 0;
    }
}
