<div class='box'>
  <img src='https://signal-interactive.com/wp-content/uploads/2016/07/shutterstock_396931693-600x400.jpg'>
  <div class='overlay'>
    <h1>Heading</h1>
    <p>Lorem ipsum dolor sit amet consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
  </div>	
</div>

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

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

body {
  padding: 2rem 6rem;
  font-family: 'Poppins', sans-serif;
  display: flex;
  justify-content: center;
}

p {
  font-weight: 300;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.box {
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 400px;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  color: hsl(0 0% 95%);
  background: black;
}

.box img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition:
    transform 1000ms ease-out,
    opacity 1000ms ease-out;
}

.overlay::after {
  content: '';
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle, transparent 80%, rgb(30 10 0 / .5) 200%
  );
}

.overlay {
  position: absolute;
  padding: 1rem;
  display: grid;
  height: 100%;
  grid-template-rows: 100% 100%;
  transition: all 750ms ease;
}

@container (min-width: 400px) {
  .overlay {
    padding: 1rem 2rem;
  }
}

.box h1 {
  width: 100%;
  align-self: center;
  text-align: center;
  color: hsl(0 0% 100%);
  text-shadow: -2px 2px 5px hsl(0 0% 0% / .5);
  border-bottom: 1px solid hsl(0 0% 100% / .25);
  letter-spacing: 0.01rem;
  white-space: nowrap;
  font-size: clamp(1.3rem, 8cqw, 2rem);
}

.box p {
  font-size: clamp(.5rem, 4cqw, .95rem);
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity 750ms,
    filter 750ms;
}

.box:hover .overlay {
  grid-template-rows: 15% 85%;
}

.box:hover img {
  transform: scale(1.6);
  opacity: 0.2;
}

.box:hover p {
  opacity: 1;
  filter: blur(0);
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.