.hg-section {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hg-section-container {
    width: 100%;
    background-image: linear-gradient(to right, var(--clr-light-greem-100), var(--clr-dark-green-100));
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.3);
    border-radius: var(--section-bottom-border-radius);
    /* min-height (not height) so the band grows when a wrapped title/standfirst
       needs more room (e.g. ~990-1100px viewports) instead of clipping the text
       against the curve. Title-only heroes keep the exact old height because
       their text is absolutely positioned and the min-height still applies. */
    min-height: calc(var(--section-divider-oval-height) - var(--section-divider-oval-offset));
    margin-bottom: var(--section-divider-oval-offset);
    position: relative;
    top: 0;
    z-index: 1;
    overflow: hidden;
}

/* Keep the light oval band tracking the section's real rendered height: the
   section is the container plus its offset margin, which reproduces the old
   35vh geometry exactly when nothing grows, and follows the container when a
   long standfirst extends it. Scoped to .hg-section so the base
   .section-divider-oval rule used elsewhere is untouched. */
.hg-section .section-divider-oval {
    height: 100%;
}

.hg-glowing-dots {
    z-index: 0;
}

.hg-aiprofit-logo {
    z-index: 1;
}

.hg-arrow {
    z-index: 2;
}

.hg-svg-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hg-svg-container img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    opacity: 0.5;
}

.hg-section .hg-title {
    position: absolute;
    top: 10%;
    color: white;
    z-index: 10;
    margin: 0;
    padding: 0;
    opacity: 0.9;
    text-align: left;
}

/* Optional hero standfirst. Only rendered when a page passes `hero_subtitle`, so
   title-only heroes are untouched. The wrapper flows in the normal layout (not
   absolute) so its height counts toward the band: when the title + standfirst
   wrap at mid widths, the band extends instead of clipping the last line into
   the curve. The paddings reproduce the old top: 10% start and keep the text
   clear of the curved bottom edge. */
.hg-section .hg-text {
    position: relative;
    padding-top: clamp(1.5rem, 3.5vh, 3rem);
    padding-bottom: clamp(2.5rem, 8vh, 4.5rem);
    z-index: 10;
}

.hg-section .hg-text .hg-title {
    position: static;
}

.hg-section .hg-subtitle {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 1.25rem 0 0;
    max-width: 46ch;
    opacity: 0.92;
    text-align: left;
}

.hg-section .hg-subtitle a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

.highlight {
    color: var(--clr-accent-100);
}


@media (min-width: 400px) {
    .hg-svg-container img {
        left: 10%;
    }
}

/* Subtitle heroes only — `.hg-text` is rendered only when a page passes
   hero_subtitle. On small screens the title + standfirst would overflow the
   fixed-height (~35vh) band and clip, so shrink them to fit. Title-only heroes
   (no `.hg-text`) are untouched. */
@media (max-width: 767px) {
    .hg-section .hg-text {
        padding-top: 1.25rem;
    }

    .hg-section .hg-text .hg-title {
        font-size: 1.85rem;
        line-height: 1.15;
    }

    .hg-section .hg-subtitle {
        font-size: 0.92rem;
        line-height: 1.45;
        margin-top: 0.75rem;
    }
}
