/* The home hero fills the browser viewport, including the overlay header. */
@media (min-width: 993px) {
  body.main-page {
    --atrs-hero-viewport: 100vh;
    --atrs-hero-page-scale: 1;
  }

  body.main-page .page-wrapper {
    padding-top: 0;
  }

  body.main-page #sp-topcontent {
    margin-top: 0 !important;
  }

  body.main-page main.page-top.main {
    height: calc(var(--atrs-hero-viewport) / var(--atrs-hero-page-scale));
    min-height: 0;
    /* Leave room for the cookie notice as well as the catalog link. */
    padding: 104px 0 clamp(64px, 6vh, 80px);
  }

  body.main-page main.page-top.main > .container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  body.main-page main.page-top.main .page-top__flex {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    width: 100%;
  }

  body.main-page main.page-top.main .page-top__title,
  body.main-page main.page-top.main .page-top__wrapper {
    flex-shrink: 0;
  }
}

@media (max-width: 992px) {
  body.main-page {
    --atrs-mobile-hero-bottom: 160px;
  }

  body.main-page > .body-wrapper.page-wrapper {
    padding-top: 0;
  }

  body.main-page #sp-topcontent {
    margin-top: 0 !important;
  }

  body.main-page main.page-top.main {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 80px 0 max(var(--atrs-mobile-hero-bottom), calc(env(safe-area-inset-bottom) + 24px)) !important;
  }

  body.main-page main.page-top.main > .container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  body.main-page main.page-top.main .page-top__flex {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    width: 100%;
  }

  body.main-page main.page-top.main .page-top__title {
    margin-top: auto;
    flex-shrink: 0;
    font-size: 32px;
    line-height: 1.05;
  }

  body.main-page main.page-top.main .page-top__wrapper {
    flex-shrink: 0;
    width: 100%;
  }

  body.main-page main.page-top.main .page-top__subtitle,
  body.main-page main.page-top.main .contact-link {
    margin-top: 16px;
  }

  /* Static company statistics: keep icons clear of numbers on narrow screens. */
  body.main-page .homeAbout-statistics .about-item {
    padding: 16px 8px;
    align-items: flex-start;
  }

  body.main-page .homeAbout-statistics .about-item__icon {
    position: static;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-bottom: 8px;
  }

  body.main-page .homeAbout-statistics .about-item__title {
    padding-left: 0;
    font-size: clamp(24px, 7.5vw, 32px) !important;
    line-height: 1.15;
  }

  body.main-page .homeAbout-statistics .about-item__title span {
    font-size: 0.7em;
    line-height: inherit;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  body.main-page {
    --atrs-mobile-hero-bottom: 144px;
  }
}

@media (min-width: 768px) and (max-width: 992px) {
  body.main-page {
    --atrs-mobile-hero-bottom: 80px;
  }
}

@media (max-width: 992px) and (max-height: 650px) {
  body.main-page main.page-top.main .page-top__title {
    font-size: 28px;
  }

  body.main-page main.page-top.main .page-top__subtitle,
  body.main-page main.page-top.main .contact-link {
    margin-top: 12px;
  }
}

@media (min-width: 600px) and (max-width: 992px) and (max-height: 480px) {
  body.main-page {
    --atrs-mobile-hero-bottom: 80px;
  }

  body.main-page main.page-top.main > .container {
    width: calc(100% - 32px);
  }
}

@media (min-width: 600px) and (max-width: 767px) and (max-height: 480px) {
  body.main-page {
    --atrs-mobile-hero-bottom: 112px;
  }
}

@supports (height: 100dvh) {
  @media (min-width: 993px) {
    body.main-page {
      --atrs-hero-viewport: 100dvh;
    }
  }
}

/* Keep the existing wide-screen page scale without making the hero 20% taller. */
@media (min-width: 1920px) {
  body.main-page {
    --atrs-hero-page-scale: 1.2;
  }
}

/* Short desktop windows still need room for all text and the catalog link. */
@media (min-width: 993px) and (max-height: 600px) {
  body.main-page main.page-top.main .page-top__title {
    font-size: clamp(32px, 8vh, 64px);
    line-height: 1;
  }

  body.main-page main.page-top.main .page-top__subtitle {
    font-size: clamp(16px, 3vh, 20px);
    line-height: 1.2;
    margin-top: clamp(12px, 3vh, 24px);
  }

  body.main-page main.page-top.main .contact-link {
    margin-top: clamp(12px, 3vh, 24px);
  }
}
