/* Modern Typography Headings */
.modern-heading-wrapper {
    position: relative;
    text-align: center;
    /* Center main title */
    padding: 6rem 0;
    margin-bottom: 3rem;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    max-width: 700px;
    /* Further compress points */
    margin-left: auto;
    margin-right: auto;
}

/* ... existing styles ... */

.heading-bg-text {
    /* ... */
    padding-left: 100%;
    /* Reset to standard */
    /* ... */
}

@keyframes marquee {
    0% {
        transform: translate(0, -50%);
    }

    100% {
        transform: translate(-100%, -50%);
        /* Reset to standard */
    }
}

.heading-subtitle {
    display: block;
    /* Restored visibility for Desktop */
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-dark);
    margin-bottom: 0px;
    text-transform: uppercase;
    position: relative;
    z-index: 3;
    transform: translateY(-50px);
    /* Restored desktop position */
}

.heading-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    color: var(--text-dark);
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
    position: relative;
    z-index: 3;
    transform: translateY(-50px);
    /* Keep title up if it exists, but h2s were removed */
}

.heading-bg-text {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-40%);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px grey;
    text-stroke: 1px grey;
    white-space: nowrap;
    z-index: 1;
    text-transform: uppercase;
    user-select: none;
    pointer-events: none;

    /* Marquee Animation */
    display: inline-block;
    padding-left: 100%;
    /* Start off-screen */
    animation: marquee 15s linear infinite;
}

/* Highlight the middle word */
.highlight-text {
    color: black;
    -webkit-text-stroke: 0px;
    /* Optional: remove stroke if fill is solid black, or keep it */
    text-stroke: 0px;
}

@keyframes marquee {
    0% {
        transform: translate(0, -50%);
    }

    100% {
        transform: translate(-100%, -50%);
    }
}

/* Specific speed adjustment for About Us to match visual pace */
#about .heading-bg-text {
    animation-duration: 25s;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .heading-subtitle {
        display: block !important;
        transform: translateY(-15px);
        /* Moved slightly up as requested */
        margin-bottom: 10px;
        font-size: 1.5rem;
        /* Make it readable */
    }

    .heading-bg-text {
        top: 75%;
        font-size: 3rem;
        /* Reduce size to show properly */
    }

    .modern-heading-wrapper {
        padding: 7rem 0 4rem 0;
        max-width: 350px;
        /* Slightly wider to prevent extreme clipping */
    }
}

/* iPad/Tablet Specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .modern-heading-wrapper {
        max-width: 500px;
        padding: 8rem 0 5rem 0;
        /* Increased padding to avoid overlapping */
    }

    .heading-bg-text {
        top: 75%;
        font-size: 5rem;
        /* Reduce size for tablet */
    }
}