* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.color-list {
    display: flex;
    /*
    On small displays we want each .color stacked.
    Flexbox let's us determine stacking direction via
    flex-direction: column;
    */
    flex-direction: column;
    height: 100vh;
}

.color {
    /*
    Each .color is also a flex item. We do this so that we have reasonable
    distribution of space between elements. We use flex-direction so that
    flexbox knows which way to position each element (in this case, vertical).
    */
    display: flex;
    flex-direction: column;

    /*
    .color can grow but not shrink (we want space for first three elements).
    10em is enough space to see name, hsl, and hex values.
    Try shrinking vertically on a small display.
    */
    flex: 1 0 20%;
    box-shadow: 0 0 30px #424242;

    /* Handles any clipping/overflow issues on transition */
    overflow: hidden;
    padding: 1em;
    color: white;
    background-size: cover;
    background-position: center;
    transition: flex-basis 0.8s cubic-bezier(.6,.08,.5,.98);
}

.color:hover {
    /*
    Change the flex-basis so that we know what
    size to transition to on hover. Arbitrary,
    based on our design/content.
    */
    flex-basis: 100%;
}

.color:hover .details {
    opacity: 1;
}

.name {
    font-size: 1.2em;
    font-weight: 600;
}

.details {
    margin: 0;
    padding: 0;
    list-style: none;
    opacity: 0;
    transition: opacity 500ms ease-in-out;
}

.details li {
    font-size: 1em;
    line-height: 2em;
}

@media (min-width: 600px) {
    .color-list {
        /*
        Change the direction so that each .color
        aligns horizontally
        */
        flex-direction: row;
    }

    .color {
        /*
        No scrollbars on mobile
        */
        flex-shrink: 1;
    }
}
