.page-main--home {
  background: transparent;
}

.home-hero {
  /*
    No hard breakpoint: min-height is the lesser of (1) fold band and (2) a width-tied cap that falls as the
    window narrows, so dead space doesn’t balloon while vw-based type shrinks. max(..., max-content) keeps
    the section at least as tall as the stacked hero content.
  */
  min-height: max(
    max-content,
    min(
      calc(100vh - var(--layout-shell-y)),
      calc(50vw + 11rem)
    )
  );
  min-height: max(
    max-content,
    min(
      calc(100dvh - var(--layout-shell-y)),
      calc(50vw + 11rem)
    )
  );
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 3vw 0 2vw;
  overflow-x: clip;
}

/* Desktop: [ primary + lower text col ] [ phone spans both rows ] */
.home-hero__inner {
  width: 100%;
  max-width: var(--layout-inner-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad-x);
  display: grid;
  /* Second column grows so tracks fill the inner width; otherwise dead space sits right of the image */
  grid-template-columns: minmax(0, min(54vw, 42rem)) minmax(0, 1fr);
  column-gap: clamp(1.25rem, 3.4vw, 2.75rem);
  row-gap: 0;
  align-items: center;
}

.home-hero__primary {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.home-hero__lower-text {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.home-hero__visual {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  /* Match text column: hug inner right edge of .home-hero__inner (not centered in track) */
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.home-hero__title {
  margin: 0 0 1.5rem;
  max-width: calc(var(--inner-width) * 0.5);
  font-family: "Inter", sans-serif;
  font-size: calc(3.75 * var(--iw));
  font-weight: 375;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}


.home-hero__lead {
  margin: 0;
  max-width: calc(var(--inner-width) * 0.47);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 300;
  font-size: calc(1.7 * var(--iw));
  line-height: 1.55;
  color: var(--muted);
}

.home-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2.5rem;
  padding: clamp(0.5rem, 0.95vw, 0.72rem) clamp(1rem, 1.6vw, 1.4rem);
  font-size: calc(1.6 * var(--iw));
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #000000;
  background: #3da05e;
  /* border: 1px solid #fff; */
  border-radius: 6px;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.home-hero__cta:hover {
  background: #fff;
  color: #000;
}

.home-hero__subhead {
  margin: clamp(2rem, 5vw, 3.75rem) 0 0.65rem;
  font-family: "Inter", sans-serif;
  font-size: calc(1.7 * var(--iw));
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-hero__secondary {
  margin: 0;
  max-width: calc(var(--inner-width) * 0.4);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 300;
  font-size: calc(1.3 * var(--iw));
  line-height: 1.55;
  color: var(--muted);
}

.home-hero__visual img {
  width: calc(var(--inner-width) * 0.25);
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

@media (max-width: 700px) {
  .home-hero {
    align-items: flex-start;
    min-height: auto;
    /* Breathing room below the fixed header */
    padding-top: 15vw;
    overflow-x: visible;
  }

  .home-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 36vw);
    column-gap: 0.5rem;
    /* Space between hero headline block (incl. Subscribe) and lower copy + phone */
    row-gap: 18vw;
    align-items: start;
  }

  .home-hero__primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .home-hero__lower-text {
    grid-column: 1;
    grid-row: 2;
    margin-top: calc(min(38vw, 168px) / 3);
  }

  /* Let headline copy use natural width and align left on mobile */
  .home-hero__title,
  .home-hero__lead {
    width: auto;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .home-hero__title {
    font-size: calc(8.5 * var(--iw));
    max-width: calc(var(--inner-width) * 1);
    font-weight: 400;
  }

  .home-hero__lead {
    font-size: calc(3.7 * var(--iw));
    max-width: calc(var(--inner-width) * 1);
  }

  .home-hero__subhead {
    margin-top: 0;
    font-size: calc(5 * var(--iw));
  }

  .home-hero__secondary {
    max-width: none;
    font-size: calc(3.22 * var(--iw));
  }

  .home-hero__visual {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: end;
    width: 100%;
    /* Pull image toward the right edge (mock bleeds slightly past padding) */
    margin-right: calc(-0.35 * var(--layout-pad-x));
  }

  .home-hero__visual img {
    width: min(38vw, 168px);
    max-width: none;
  }

  .home-hero__cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    margin-left: 0;
    margin-right: 0;
    padding: calc(3 * var(--iw)) calc(3.5 * var(--iw));
    box-sizing: border-box;
    border-radius: 6px;
    font-size: calc(5.5 * var(--iw));
  }
}

/* --- Feature cards (separate section below hero; styles scoped to .home-features) --- */

section.home-features {
  padding: 2vw 0 6vw;
}

.home-features__cta-wrap {
  width: 100%;
  max-width: var(--layout-inner-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad-x) clamp(2rem, 5vw, 4rem);
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.home-features__inner {
  width: 100%;
  max-width: var(--layout-inner-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad-x);
  box-sizing: border-box;
}

.home-features__rule {
  width: min(12rem, 42%);
  height: 2px;
  margin: 0 0 2vw;
  background: #fff;
}

.home-features__grid {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(1rem, 3vw, 1.75rem);
  width: 100%;
}

.home-features__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.home-features__icon {
  width: clamp(2.5rem, 6vw, 3rem);
  height: auto;
  display: block;
  margin: 0 0 1rem;
  object-fit: contain;
}

.home-features__title {
  margin: 0 0 0.65rem;
  font-family: "Inter", sans-serif;
  font-size: clamp(0.95rem, 0.5vw + 0.82rem, 1.125rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-features__text {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 300;
  font-size: clamp(0.72rem, 0.25vw + 0.65rem, 0.875rem);
  line-height: 1.55;
  color: #fff;
}

@media (max-width: 700px) {
  section.home-features {
    padding: 4vw 0 6vw;
  }

  .home-features__rule {
    margin: 0 0 6vw;
    background: #fff;
    visibility: hidden;
  }

  .home-features__cta-wrap {
    padding-bottom: clamp(2.25rem, 8vw, 3.5rem);
  }
  /* Stack cards vertically on mobile to avoid horizontal clipping/scroll confusion */
  .home-features__grid {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 1rem;
  }

  .home-features__card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: start;
    flex: 0 0 auto;
    align-self: flex-start;
    width: calc(var(--inner-width) * 1);
    max-width: 100%;
    padding: 4vw;
    border-radius: 14px;
  }

  .home-features__icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: clamp(2rem, 5vw, 2.5rem);
    margin: 0;
  }

  .home-features__title {
    grid-column: 2;
    font-size: clamp(0.88rem, 0.4vw + 0.76rem, 1rem);
    margin-bottom: 0.5rem;
  }

  .home-features__text {
    grid-column: 2;
    font-size: clamp(0.66rem, 0.2vw + 0.6rem, 0.8rem);
    line-height: 1.5;
  }
}
