html{
    scroll-behavior: smooth;
}

body {
    background-color: #dedede;
    padding: 5px;
    margin: 15px;
    font-size: 25px;
    font-family: Arial, sans-serif;
    color: black;
}

h1 {
    text-align: center;
    font-size: 1.95em;
}

p {
    margin-bottom: 15px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

figure {
    position: relative;
    overflow: hidden;
    border: 5px solid black;
    background-color: white;
    margin: 0;
}

figure img {
    width: 100%;
    display: block;
}

figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: black;
    color: yellow;
    text-align: center;
    padding: 8px 0;
    font-size: 18px;
}

@media screen and (min-width: 772px) {

    .grid {
        grid-template-columns: 1fr 1fr;
    }

    figure {
        border-radius: 50%;
    }

    figcaption {
        border-radius: 0 0 50% 50%;
    }

    .grid figure:last-child {
        grid-column: span 2;
    }
}

@media screen and (min-width: 992px) {

    .grid figure:nth-child(3n) {
        grid-column: span 2;
    }

    figure {
        border-radius: 0;
    }

    figcaption {
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
        transition: none;
        animation: none;
    }
}

@media (prefers-color-scheme: dark) {

    body {
        background-color: #333;
        color: #fafafa;
    }

    figure {
        background-color: #111;
        border-color: black;
    }

    figcaption {
        background-color: black;
        color: #f0e68c;
    }
  
    footer a {
        color: white;
    }
}

