.features {
  width: 100%;
  padding: 0.25em 0 0em 0;
  background: var(--color-bg);
  display: flex;
}

.features-col:nth-child(1) {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.features-col:nth-child(2) {
  flex: 4;
  display: flex;
  flex-direction: column;
  gap: 4em;
}

.features-row {
  width: 100%;
  display: flex;
  gap: 0.25em;
}

.features-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  flex-direction: column;
  background: var(--color-bg-secondary);
  border-radius: 8px;
}

.features-icon {
  position: relative;
  top: -10%;
  font-size: 36px;
  color: #fff;
}

.features-title {
  position: absolute;
  bottom: 0%;
  padding: 2em;
}

.features-title h2 {
  width: 70%;
  font-family: var(--font-secondary);
  font-size: 28px;
  line-height: 120%;
  letter-spacing: 0.25px;
  margin-bottom: 0.25em;
}

.features-title p {
  font-size: 18px;
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 900px) {

  .features {
    width: 100%;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .features-col:nth-child(1),
  .features-col:nth-child(2) {
    width: 100%;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .features-row {
    width: 100%;
    flex-direction: column;
    gap: 1rem;
  }

  /*
   * On mobile the cards should no longer be forced
   * into a square aspect ratio.
   */
  .features-item {
    position: relative;
    width: 100%;
    aspect-ratio: auto;
    min-height: 420px;

    display: flex;
    flex-direction: column;

    justify-content: flex-start;
    align-items: center;

    gap: 1.5rem;

    padding: 2rem 1.5rem;

    background: var(--color-bg-secondary);
    border-radius: 8px;

    box-sizing: border-box;
  }

  /*
   * Reset the desktop icon positioning.
   * The previous -25% positioning was causing
   * the icon to collide with the heading.
   */
  .features-icon {
    position: relative;
    top: 0;
    flex-shrink: 0;

    font-size: 36px;
    color: #fff;

    transform: scale(0.75);
    margin: 0;
  }

  /*
   * The title must NOT be absolutely positioned
   * on mobile.
   *
   * This allows the icon, heading and paragraph
   * to naturally stack.
   */
  .features-title {
    position: relative;
    bottom: auto;

    width: 100%;

    padding: 0;

    text-align: center;

    box-sizing: border-box;
  }

  /*
   * Allow the heading to naturally wrap according
   * to the phone's screen width.
   */
  .features-title h2 {
    width: 100%;

    max-width: 100%;

    font-family: var(--font-secondary);

    font-size: clamp(1.7rem, 7vw, 2.4rem);

    line-height: 1;

    letter-spacing: 0.25px;

    margin: 0 0 1rem 0;

    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .features-title p {
    width: 100%;

    max-width: 100%;

    margin: 0;

    font-size: 16px;

    line-height: 1.5;

    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

  .features {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .features-col:nth-child(1),
  .features-col:nth-child(2) {
    gap: 0.75rem;
  }

  .features-row {
    gap: 0.75rem;
  }

  .features-item {
    min-height: 380px;

    padding: 1.75rem 1.25rem;

    gap: 1.25rem;

    border-radius: 8px;
  }

  .features-icon {
    top: 0;

    transform: scale(0.7);

    margin-bottom: 0;
  }

  .features-title {
    position: relative;

    width: 100%;

    padding: 0;

    text-align: center;
  }

  .features-title h2 {
    width: 100%;

    font-size: clamp(1.5rem, 8vw, 2rem);

    line-height: 1;

    letter-spacing: 0.2px;

    margin-bottom: 0.9rem;
  }

  .features-title p {
    width: 100%;

    font-size: 15px;

    line-height: 1.45;
  }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

  .features {
    padding: 0.5rem;
  }

  .features-item {
    min-height: 350px;

    padding: 1.5rem 1rem;

    gap: 1rem;
  }

  .features-icon {
    transform: scale(0.65);
  }

  .features-title h2 {
    font-size: 1.45rem;

    line-height: 1;
  }

  .features-title p {
    font-size: 14px;

    line-height: 1.4;
  }
}