/* Hianma commercial page — Features complete viewport composition.
   Presentation-only refinement: no copy, asset, route, translation or product logic changes.
   Goal: on desktop/laptop, the complete #features section (intro + approved artwork + 8 cards)
   fits inside the useful viewport without exposing the previous or next section. */

body .hm-marketing #features {
  position: relative;
  z-index: 1;
  border-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: calc(100svh - var(--commercial-fixed-header-height, 110px));
  background: #fff;
  scroll-margin-top: -18px !important;
  box-shadow: 0 -34px 0 #fff;
}

/* Extend the white Features surface upward so no grey seam from the previous section
   is visible when navigation lands on #features. */
body .hm-marketing #features::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -52px;
  height: 54px;
  background: #fff;
  pointer-events: none;
  z-index: 0;
}

body .hm-marketing #features > .hm-container {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - var(--commercial-fixed-header-height, 110px));
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: clamp(14px, 2vh, 22px);
  padding-top: clamp(10px, 1.8vh, 20px);
  padding-bottom: clamp(10px, 1.8vh, 20px);
}

/* Compact the existing title/text/artwork band instead of giving it a whole viewport. */
body .hm-marketing #features .hm-final-heading {
  width: min(1180px, 100%);
  min-height: 0 !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, .97fr) minmax(360px, 1.03fr) !important;
  grid-template-rows: auto auto auto !important;
  column-gap: clamp(40px, 5vw, 68px) !important;
  row-gap: 0 !important;
  align-items: center !important;
  align-content: center !important;
  text-align: left !important;
}

body .hm-marketing #features .hm-final-heading > .hm-final-eyebrow,
body .hm-marketing #features .hm-final-heading > h2,
body .hm-marketing #features .hm-final-heading > p {
  grid-column: 1 !important;
  max-width: 620px;
}

body .hm-marketing #features .hm-final-heading > h2 {
  margin-top: 8px !important;
  margin-bottom: 10px !important;
}

body .hm-marketing #features .hm-final-heading > p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.46 !important;
}

body .hm-marketing #features .hm-final-heading::after {
  grid-column: 2 !important;
  grid-row: 1 / 4 !important;
  align-self: center !important;
  justify-self: center !important;
  width: min(100%, 430px) !important;
  margin: 0 !important;
}

/* The 8 existing cards stay in the same section and are intentionally visible at once. */
body .hm-marketing #features .hm-final-feature-grid {
  width: min(1180px, 100%);
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 11px 14px !important;
  align-items: stretch !important;
}

body .hm-marketing #features .hm-final-feature-card {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 11px 13px 10px !important;
}

body .hm-marketing #features .hm-final-feature-card h3 {
  margin-top: 6px !important;
  margin-bottom: 4px !important;
  line-height: 1.24 !important;
}

body .hm-marketing #features .hm-final-feature-card p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.36 !important;
}

/* Short desktop/laptop screens (including the user's current viewport):
   reduce only presentation scale/spacing so all copy + all 8 cards remain visible. */
@media (min-width: 1121px) and (max-height: 850px) {
  body .hm-marketing #features {
    scroll-margin-top: -20px !important;
    box-shadow: 0 -40px 0 #fff;
  }

  body .hm-marketing #features::before {
    top: -60px;
    height: 62px;
  }

  body .hm-marketing #features > .hm-container {
    row-gap: 9px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body .hm-marketing #features .hm-final-heading {
    width: min(1120px, 100%);
    grid-template-columns: minmax(0, .99fr) minmax(330px, 1.01fr) !important;
    column-gap: 38px !important;
  }

  body .hm-marketing #features .hm-final-heading > .hm-final-eyebrow {
    margin-bottom: 0 !important;
  }

  body .hm-marketing #features .hm-final-heading > h2 {
    margin-top: 5px !important;
    margin-bottom: 6px !important;
    font-size: clamp(32px, 2.5vw, 40px) !important;
    line-height: 1.08 !important;
  }

  body .hm-marketing #features .hm-final-heading > p {
    font-size: 14px !important;
    line-height: 1.38 !important;
  }

  body .hm-marketing #features .hm-final-heading::after {
    width: min(100%, 330px) !important;
  }

  body .hm-marketing #features .hm-final-feature-grid {
    width: min(1120px, 100%);
    gap: 8px 11px !important;
  }

  body .hm-marketing #features .hm-final-feature-card {
    padding: 8px 11px 8px !important;
  }

  body .hm-marketing #features .hm-final-feature-card h3 {
    margin-top: 4px !important;
    margin-bottom: 2px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
  }

  body .hm-marketing #features .hm-final-feature-card p {
    font-size: 12.5px !important;
    line-height: 1.28 !important;
  }
}

/* Tablet landscape / wide tablet: keep the same 4 x 2 card composition. */
@media (min-width: 900px) and (max-width: 1120px) {
  body .hm-marketing #features {
    min-height: calc(100svh - var(--commercial-fixed-header-height, 92px));
    box-shadow: 0 -26px 0 #fff;
  }

  body .hm-marketing #features::before {
    top: -38px;
    height: 40px;
  }

  body .hm-marketing #features > .hm-container {
    min-height: calc(100svh - var(--commercial-fixed-header-height, 92px));
    row-gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  body .hm-marketing #features .hm-final-heading {
    width: min(940px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(290px, .9fr) !important;
    column-gap: 28px !important;
  }

  body .hm-marketing #features .hm-final-heading::after {
    width: min(100%, 320px) !important;
  }

  body .hm-marketing #features .hm-final-feature-grid {
    width: min(940px, 100%);
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body .hm-marketing #features .hm-final-feature-card {
    padding: 10px 11px !important;
  }
}

/* Tablet portrait: two columns preserve readability while the taller viewport accommodates
   all eight cards. */
@media (min-width: 761px) and (max-width: 899px) {
  body .hm-marketing #features {
    min-height: calc(100svh - var(--commercial-fixed-header-height, 86px));
    box-shadow: 0 -22px 0 #fff;
  }

  body .hm-marketing #features::before {
    top: -32px;
    height: 34px;
  }

  body .hm-marketing #features > .hm-container {
    min-height: calc(100svh - var(--commercial-fixed-header-height, 86px));
    row-gap: 14px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  body .hm-marketing #features .hm-final-heading {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr) !important;
    column-gap: 24px !important;
  }

  body .hm-marketing #features .hm-final-heading::after {
    width: min(100%, 290px) !important;
  }

  body .hm-marketing #features .hm-final-feature-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 12px !important;
  }

  body .hm-marketing #features .hm-final-feature-card {
    padding: 10px 12px !important;
  }
}

/* On phones, keep every item readable rather than shrinking eight full text cards into an
   unusable single viewport. The section still lands cleanly without the previous seam. */
@media (max-width: 760px) {
  body .hm-marketing #features {
    min-height: calc(100svh - var(--commercial-fixed-header-height, 70px));
    padding-top: 28px !important;
    padding-bottom: 70px !important;
    box-shadow: 0 -16px 0 #fff;
    scroll-margin-top: -8px !important;
  }

  body .hm-marketing #features::before {
    top: -22px;
    height: 24px;
  }

  body .hm-marketing #features > .hm-container {
    min-height: 0;
    display: block;
    padding-top: 0;
    padding-bottom: 0;
  }

  body .hm-marketing #features .hm-final-heading {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    row-gap: 14px !important;
    margin-bottom: 24px !important;
  }

  body .hm-marketing #features .hm-final-heading > .hm-final-eyebrow,
  body .hm-marketing #features .hm-final-heading > h2,
  body .hm-marketing #features .hm-final-heading > p {
    grid-column: 1 !important;
    max-width: 100%;
  }

  body .hm-marketing #features .hm-final-heading::after {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: min(100%, 360px) !important;
    margin: 4px auto 0 !important;
  }

  body .hm-marketing #features .hm-final-feature-grid {
    width: 100%;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body .hm-marketing #features .hm-final-feature-card {
    padding: 14px 16px !important;
  }
}

body .hm-marketing:has(#features:target) .hm-header {
  border-bottom-color: transparent !important;
}
