main {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* helps push the newsletter to the bottom when viewport is too big */
}

.hero {
  display: flex;
  text-align: center;
  justify-content: space-between; /* ensures space is distributed between children, pushing the newsletter section to the bottom */
  align-items: center; /* Vertically center the content */
  flex-direction: column; /* Stack children vertically */
  background: var(--background-color);
  flex: 1; /* ensures this section takes up available space, pushing the newsletter div to the bottom if the viewport is too big */
  overflow-x: hidden; /* allow content (like images) to overflow without the area becoming scrollable */
}

.hero-content {
  padding-top: 80px;
  padding-bottom: 40px;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.hero-content img {
  height: auto;
  width: 250px;
}

.hero-content h1 {
  color: var(--primary-color);
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 10px;
  margin-top: 0px;
}

.hero-content p {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 30px;
}

.store-links img {
  display: inline-block;
  border-radius: 13px;
  width: 188px;
  height: 48px;
}

.alternate-background {
  background-color: var(--background-secondary-color);
  width: 100%;
}

.features {
  display: flex;
  align-items: center;
  margin: auto;
  padding-top: 0px;
  padding-bottom: 0px;
  max-width: 1200px;  /* bigger than --max-content-width since it contains text only partially with half the space taken by the image */
  overflow: visible; /* ensure the image can overflow even with hero having an overflow-x: hidden */
}

.features-text {
  flex: 0 0 50%; /* flex-grow, flex-shrink, flex-basis */
  width: 50%;
  padding-right: 20px;
  box-sizing: border-box;
  text-align: left;
}

.features-text h1 {
  margin-top: 1em;
  margin-bottom: 0.2em;
}

.features-text h1:first-of-type {
  margin-top: 0em; /* no spacing to help alignment of text with image */
}

.features-text p {
  color: var(--seconday-color-on-secondary-background-color);
}

.features img {
  flex: 0 0 auto; /* Do not allow the image to grow or shrink */
  width: auto;
  height: 700px;
  position: relative; /* Enable positioning relative to its normal position */
  top: 12px; /* Shift the image a few points down so it looks more centered (mac screenshot images have more bottom empty space due to shadow) */
}

#newsletter {
  width: 100%;
  padding-top: 20px;
  padding-bottom: 50px;
}

@media screen and (max-width: 768px) {

  .hero-content {
    padding-top: 0px;
    padding-bottom: 50px;
  }
}

@media screen and (max-width: 980px) {

  .features {
    flex-direction: column; /* Stack children vertically */
  }

  .features-text {
    width: 100%; /* Take the full width */
    padding-right: 0; /* Remove padding on the right */
    padding-top: 46px; /* extra padding now needed */
  }

  .features img {
    width: 105%; /* Take the full width with a bit extra since mac screenshots have some inner padding */
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure the image maintains its aspect ratio, for some reason not happening when width is in % */
    top: 0; /* Remove the relative positioning offset */
    padding-top: 10px; /* a bit extra separation with text */
    padding-bottom: 20px; /* a bit extra separation with next section */
  }
}