/* SS Profiling: spacing follows Lipped Channels → Let Natural Light In. */
body.ss-home > main#top {
  --ss-section-gap-half: clamp(29px, 5.3vw, 68px);
  --ss-section-divider: #39628653;
  --ss-section-divider-width: min(1280px, calc(100% - 8vw));
}
@media (max-width: 720px) {
  body.ss-home > main#top { --ss-section-divider-width: calc(100% - 32px); }
}

/* Chapter pairs each contribute one half. Preserve site-header→opening and footer→page-end. */
body.ss-home > main#top > :is(
  #highveld, #virtual-roof, #profiles, #sheet-explorer, #flashings, #lipped-sections,
  #polycarbonate, #steel-coils, #bullnosing, #ss-sheet-story, #big-roofs-start-here, #delivery
) {
  padding-block-end: var(--ss-section-gap-half);
  margin-block-end: 0;
}
body.ss-home > main#top > :is(
  #virtual-roof, #profiles, #sheet-explorer, #flashings, #lipped-sections, #polycarbonate,
  #steel-coils, #bullnosing, #ss-sheet-story, #big-roofs-start-here, #delivery, #quote
) {
  padding-block-start: var(--ss-section-gap-half);
  margin-block-start: 0;
  border-block-start: 1px solid var(--ss-section-divider);
}
body.ss-home > main#top > #delivery { border-block-end: 0; }
body.ss-home > main#top > #quote > .foot { padding-block-start: 0; }
body.ss-home > main#top > #big-roofs-start-here > .ss-profile-factory { margin-block: 0; }

/* Only one decorative line per boundary, with the same horizontal extent as .wrap.
   For delivery/footer the band stays full width while the rule stays content width. */
body.ss-home > main#top > :is(#delivery, #quote) {
  position: relative;
  padding-block-start: calc(var(--ss-section-gap-half) + 1px);
  border-block-start: 0;
}
body.ss-home > main#top > :is(#delivery, #quote)::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--ss-section-divider-width);
  height: 1px;
  background-color: var(--ss-section-divider);
  pointer-events: none;
}

@media (min-width: 721px) {
  body.ss-home > main#top {
    /* Restore the original one-pixel line instead of scaling it. Subtract
       0.125px from each half so the visible gap, line included, is 75%. */
    --ss-section-gap-half: calc(clamp(15.225px, 2.7825vw, 35.7px) - 0.125px);
    /* V49 leading margins: the sheet title's 10px and service h2's .15em.
       Once those margins are removed, return 75% across the two new halves. */
    --ss-sheet-gap-extra: 3.75px;
    --ss-service-gap-extra: clamp(0.106875rem, 0.241875vw, 0.219375rem);
  }

  body.ss-home > main#top > #sheet-explorer > .ss-sheet-heading > h2:first-child,
  body.ss-home > main#top > :is(#flashings, #lipped-sections, #polycarbonate, #steel-coils, #bullnosing) > .ss-service-heading > h2:first-child {
    margin-block-start: 0;
  }

  body.ss-home > main#top > #profiles {
    padding-block-end: calc(var(--ss-section-gap-half) + var(--ss-sheet-gap-extra));
  }
  body.ss-home > main#top > #sheet-explorer {
    padding-block-start: calc(var(--ss-section-gap-half) + var(--ss-sheet-gap-extra));
  }

  body.ss-home > main#top > :is(#sheet-explorer, #flashings, #lipped-sections, #polycarbonate, #steel-coils) {
    padding-block-end: calc(var(--ss-section-gap-half) + var(--ss-service-gap-extra));
  }
  body.ss-home > main#top > :is(#flashings, #lipped-sections, #polycarbonate, #steel-coils, #bullnosing) {
    padding-block-start: calc(var(--ss-section-gap-half) + var(--ss-service-gap-extra));
  }
}
