:root {
  --purple-100: hsl(254, 88%, 90%);
  --purple-500: hsl(256, 67%, 59%);
  --yellow-100: hsl(31, 66%, 93%);
  --yellow-500: hsl(39, 100%, 71%);
  --white: hsl(0, 0%, 100%);
  --black: hsl(0, 0%, 7%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  --bg-color: hsl(0, 0%, 98%);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--black);
  background-color: var(--bg-color);
  padding: 1.5rem;
  min-height: 100vh;
}

h1, h2 {
  font-weight: 500;
  line-height: 1.2;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1110px;
  margin: 0 auto 2rem;
}

.card {
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 160px;
}

.card p {
  position: relative;
  z-index: 2;
  font-size: 0.95rem;
  max-width: 65%;
  line-height: 1.4;
}

.card-main {
  background-color: var(--purple-500);
  color: var(--white);
  text-align: center;
  padding: 3rem 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-main h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
  max-width: 80%;
}

.card-main p {
  max-width: 100%;
  font-size: 1rem;
  position: relative;
  z-index: 2;
}

.card-main::after {
  content: '';
  background-image: url('./assets/images/illustration-five-stars.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 100px;
  height: 20px;
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.card-accounts {
  background-color: var(--yellow-100);
  position: relative;
}

.card-accounts::after {
  content: '';
  background-image: url('./assets/images/illustration-multiple-platforms.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 100px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-schedule {
  background-color: var(--white);
  position: relative;
}

.card-schedule::after {
  content: '';
  background-image: url('./assets/images/illustration-consistent-schedule.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 80px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-social {
  background-color: var(--purple-100);
  position: relative;
}

.card-social h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  position: relative;
  z-index: 2;
  max-width: 70%;
}

.card-social p {
  max-width: 70%;
}

.card-social::after {
  content: '';
  background-image: url('./assets/images/illustration-schedule-posts.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 120px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-growth {
  background-color: var(--white);
  position: relative;
}

.card-growth::after {
  content: '';
  background-image: url('./assets/images/illustration-grow-followers.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 100px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-stats {
  background-color: var(--yellow-500);
  position: relative;
}

.card-stats span {
  font-weight: 500;
}

.card-stats::after {
  content: '';
  background-image: url('./assets/images/illustration-audience-growth.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 100px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-content {
  background-color: var(--white);
  position: relative;
}

.card-content::after {
  content: '';
  background-image: url('./assets/images/illustration-create-post.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 80px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.card-ai {
  background-color: var(--white);
  position: relative;
}

.card-ai::after {
  content: '';
  background-image: url('./assets/images/illustration-ai-content.webp');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 100px;
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 0.9;
}

.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 2rem;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* Desktop layout */
@media (min-width: 768px) {
  body {
    padding: 5rem 2rem;
  }

  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, minmax(140px, auto));
    gap: 1.25rem;
    max-width: 1000px;
  }

  .card {
    min-height: 0;
    padding: 1.25rem;
  }

  .card p {
    font-size: 0.85rem;
    max-width: 60%;
    line-height: 1.4;
  }

  .card-main {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    padding: 2.5rem 1.5rem;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .card-main h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    max-width: 80%;
  }

  .card-main p {
    max-width: 100%;
    font-size: 0.85rem;
  }

  .card-main::after {
    width: 110px;
    height: 22px;
    bottom: 3rem;
  }

  .card-social {
    grid-column: 3 / 5;
    grid-row: 1 / 3;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem;
  }

  .card-social h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    max-width: 55%;
  }

  .card-social p {
    max-width: 55%;
    font-size: 0.85rem;
  }

  .card-social::after {
    background-size: 150px;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .card-accounts {
    grid-column: 1;
    grid-row: 3;
  }

  .card-accounts::after {
    background-size: 110px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .card-schedule {
    grid-column: 2;
    grid-row: 3;
  }

  .card-schedule::after {
    background-size: 90px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .card-growth {
    grid-column: 3;
    grid-row: 3;
  }

  .card-growth::after {
    background-size: 110px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .card-stats {
    grid-column: 4;
    grid-row: 3;
  }

  .card-stats::after {
    background-size: 110px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .card-content {
    grid-column: 1;
    grid-row: 4;
  }

  .card-content::after {
    background-size: 90px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .card-ai {
    grid-column: 2;
    grid-row: 4;
  }

  .card-ai::after {
    background-size: 110px;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  /* Empty grid cells for desktop layout */
  .grid-container::after {
    content: "";
    grid-column: 3;
    grid-row: 4;
    background-color: var(--white);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
  }

  .grid-container::before {
    content: "";
    grid-column: 4;
    grid-row: 4;
    background-color: var(--white);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
  }
}