* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background-color: lightgray;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

figure {
  width: 400px;
  aspect-ratio: 3/4;
  border-radius: 15px;
  overflow: clip;
  position: relative;

  img,
  figcaption {
    width: 100%;
    height: 100%;
  }

  img {
    transition: scale 0.2s;
  }

  figcaption {
    background-color: rgba(0, 0, 139, 0.8);
    color: white;
    font-family: sans-serif;
    font-size: 4rem;
    font-weight: bolder;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: underline;
    letter-spacing: 3px;
    text-underline-offset: 10px;
    text-shadow: 3px 3px 3px darkred;
    position: absolute;
    top: 0;
    translate: 100%;
    transition: translate 0.2s;
  }

  &:hover img {
    scale: 1.2;
    transition-duration: 0.5s;
  }

  &:hover figcaption {
    translate: 0;
    transition-duration: 0.5s;
  }
}