/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  /*========== Colors ==========*/
  --title-color: #fff;
  --text-color: hsl(235, 20%, 57%);
  --shape-gradient: linear-gradient(
    90deg,
    hsl(300, 76%, 60%),
    hsl(57, 81%, 60%)
  );
  --body-gradient: linear-gradient(
    180deg,
    hsl(22, 100%, 84%),
    hsl(265, 100%, 80%)
  );
  --container-color: hsl(235, 32%, 10%);

  /*========== Font and typography ==========*/
  --body-font: "Poppins", sans-serif;
  --biggest-font-size: 2.25rem;
  --normal-font-size: 1.25rem;
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  color: var(--text-color);
}

img {
  max-width: 100%;
  height: auto;
}

/*=============== CARD ===============*/
.card {
  display: grid;
  place-items: center;
  background: var(--body-gradient);
  padding-block: 4.5rem;
}
.card__container {
  margin-inline: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 2rem;
}
.card__article {
  position: relative;
  background-color: var(--container-color);
  padding: 2.5rem;
  border-radius: 2rem;
  text-align: center;
  box-shadow: 0 20px 24px hsla(235, 32%, 15%, 0.2);
  overflow: hidden;
}

.card__img {
  width: 250px;
  margin-bottom: 1rem;
  animation: float-img 2.5s ease-in-out infinite;
}
.card__title {
  color: var(--title-color);
  font-size: var(--biggest-font-size);
  line-height: 100%;
  margin-bottom: 1rem;
}

.card__description {
  font-size: var(--normal-font-size);
}
.card__data {
  position: relative;
  z-index: 10;
}
.card__shapes {
  display: grid;
  justify-items: center;
  row-gap: 2.5rem;
  position: absolute;
  inset: 0;
  top: -3.5rem;
  z-index: 1;
}
.card__shape {
  display: block;
  width: 260px;
  height: 40px;
  background: var(--shape-gradient);
  border-radius: 4rem;
  transform: rotate(-24deg);
  opacity: 0;
}

.card__shape:nth-child(1) {
  animation-delay: 0.1s;
}
.card__shape:nth-child(2) {
  animation-delay: 0.2s;
}
.card__shape:nth-child(3) {
  animation-delay: 0.3s;
}
.card__shape:nth-child(4) {
  animation-delay: 0.4s;
}
.card__shape:nth-child(5) {
  animation-delay: 0.5s;
}
.card__shape:nth-child(6) {
  animation-delay: 0.6s;
}
.card__shape:nth-child(7) {
  animation-delay: 0.7s;
}
.card__shape:nth-child(8) {
  animation-delay: 0.8s;
}
/* Animation img */
@keyframes float-img {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.75rem);
  }
  100% {
    transform: translateY(0);
  }
}
/* Animation shape */
.card__article:hover .card__shape {
  animation-name: shape-animate;
  animation-duration: 0.8s;
  animation-iteration-count: 2; /* infinite */
}

@keyframes shape-animate {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.1;
  }
  40% {
    opacity: 0.3;
  }
  60% {
    opacity: 0.7;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 340px) {
  .card__container {
    margin-inline: 1rem;
  }
  .card__article {
    padding: 1.5rem;
  }
  .card__img {
    width: 160px;
  }
  .card__title {
    font-size: 2rem;
  }
}
/* For medium devices */
@media screen and (min-width: 440px) {
  .card__container {
    grid-template-columns: 328px;
  }
}
@media screen and (min-width: 768px) {
  .card__container {
    grid-template-columns: repeat(2, 328px);
    column-gap: 2rem;
  }
}
/* For large devices */
@media screen and (min-width: 1100px) {
  .card {
    height: 100vh;
  }
  .card__container {
    grid-template-columns: repeat(3, 328px);
  }
}
