/* Lexend+Deca font family  */

@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap');


/* Inter font family  */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap");

:root {
  /* Primary colors  */
  --Navy-950-body-bg: hsl(233, 47%, 7%);
  --Blu-95-main-bg: hsl(244, 37%, 16%);
  --Purple-500-highlight: hsl(277, 64%, 61%);
  --Purple-700-accent: hsl(278, 96%, 29%);

  /* Neutral colors  */
  --White-main-heading-stats: hsl(0, 0%, 100%);
  --White-main-paragraph: hsla(0, 0%, 100%, 0.75);
  --White-stat-headings: hsla(0, 0%, 100%, 0.6);

  /* font family  */
  --ff-lexend: 'Lexend Deca', sans-serif;
  --ff-inter: 'Inter', sans-serif;

  /* font weight  */
  --fw-400: 400;
  --fw-700: 700;

  /* font sizes  */
  --fs-large: 1.7rem;
  --fs-mid: 1.5rem;
  --fs-base: 0.9345rem;
  --fs-small: 0.78rem;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--ff-inter);
  background-color: var(--Navy-950-body-bg);
  display: grid;
 place-items: center; 
}

.main-container {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
}

.stats-card {
  background-color: var(--Blu-95-main-bg);
  width: min(90%, 24.375rem);
  border-radius: 10px;
  margin-block: 2rem;
}

.stats-card__image {
  position: relative;
}

.stats-card__image img {
  border-radius: 10px 10px 0 0;
  width: 100%;
  display: block;
}

.stats-card__image::before {
  content: "";
  inset: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: var(--Purple-700-accent);
  opacity: 0.5;
  z-index: 1;
  border-radius: 10px 10px 0 0;
}

.stats-card__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  justify-content: center;
  align-items: center;
}

.stats-card__title {
  font-size: clamp(var(--fs-large), 5vw, 1.9rem);
  color: var(--White-main-heading-stats);
  max-width: 18ch;
  text-align: center;
  font-family: var(--ff-lexend);
}

.stats-card__highlight {
     color: var(--Purple-500-highlight);
}

.stats-card__description {
  color: var(--White-main-paragraph);
  font-size: clamp(var(--fs-base), 5vw, 1rem);
  max-width: 30ch;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.stats-card__statistics {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stats-card__stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.stats-card__stat-number {
  font-size: var(--fs-mid);
  color: var(--White-main-heading-stats);
}

.stats-card__stat-label {
  font-size: var(--fs-small);
  color: var(--White-main-paragraph);
  text-transform: uppercase;
  font-family: var(--ff-lexend);
  letter-spacing: 1px;
}

.attribution {
  font-size: var(--fs-small);
  color: var(--White-main-paragraph);
}

.attribution a {
  color: var(--Purple-500-highlight);
  text-decoration: none;
}

@media (min-width: 48em) {
  .stats-card {
    display: grid;
    width: min(65em, 90%);
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "one two";
    margin-block: 0;
  }

  .stats-card__image {
    grid-area: two;
  }

  .stats-card__image img {
    width: 100%;
    height: 100%;
    border-radius: 0 10px 10px 0;
  }

  .stats-card__image::before {
    border-radius: 0 10px 10px 0;
  } 
  
  .stats-card__content {
    grid-area: one;
    padding: 3rem;
    gap: 2rem;
    align-items: flex-start;
  }

  .stats-card__title {
    text-align: left;
  }

    .stats-card__highlight span {
     position: relative;
     display: inline-block;
     top: 5px;
     animation: bounce 0.4s ease-in-out infinite alternate;
}
.stats-card__highlight span:nth-child(1) {
     animation-delay: 0.1s;
}

.stats-card__highlight span:nth-child(2) {
     animation-delay: 0.2s;
}
.stats-card__highlight span:nth-child(3) {
     animation-delay: 0.3s;
}
.stats-card__highlight span:nth-child(4) {
     animation-delay: 0.4s;
}
.stats-card__highlight span:nth-child(5) {
     animation-delay: 0.5s;
}
.stats-card__highlight span:nth-child(6) {
     animation-delay: 0.6s;
}
.stats-card__highlight span:nth-child(7) {
     animation-delay: 0.7s;
}

@keyframes bounce {
     20% {
          color: purple;
     }
     40% {
          color: rgb(242, 0, 255);
     }
     100% {
          top: -5px;
     }
  }

  .stats-card__description {
    text-align: left;
    max-width: 38ch;
  }

  .stats-card__statistics {
    flex-direction: row;
    justify-content: space-between;
  }

  .stats-card__stat {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .stats-card__stat-number:hover {
     color: var(--Purple-500-highlight);
  }
}

