/* ==========================================================================
   Engineering & Design Consultants – body section
   Relies on the :root variables from style.css
   (--purple, --dark-purple, --baby-blue, --text-dark, --white …)
   ========================================================================== */

.eng-body {
    --eng-header-h: 0px;          /* set to your sticky header height if it overlaps, e.g. 90px */
    --eng-scroll-length: 130vh;   /* extra scroll distance for the animation */
    background: var(--white, #fff);
    overflow-x: clip;
    position: relative;
}

/* ---------- Title + intro ---------- */
.eng-intro {
    padding: 15px;
}

.eng-title {
    margin: 0 0 25px;
    font-family: "Questrial", "Montserrat", sans-serif;
    font-size: clamp(2rem, 4.2vw, 3.6rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--purple, #3535A7);
}

.eng-list li strong {
    display: block;
    font-weight: 700;
}

/* Sub-items under each <li> */
.eng-list__sub {
    display: block;          /* each sub-item on its own line */
    padding-left: 0.2em;
    font-weight: 400;
}

.eng-content__outro {
    margin: 14px 0 0;
}

.eng-lead {
    margin: 0;
    font-family: "Questrial", "Montserrat", sans-serif;
    font-size: clamp(1.15rem, 2.1vw, 2rem);
    line-height: 1.55;
    color: var(--purple, #3535A7);
}

/* ---------- Scroll wrapper (provides scroll distance) ---------- */
.eng-scroll {
    --p: 0;                                   /* progress 0 → 1, written by JS */
    position: relative;
    height: calc(100vh + var(--eng-scroll-length));
}

/* ---------- Sticky 3-column stage ---------- */
.eng-stage {
    position: sticky;
    top: var(--eng-header-h);
    height: calc(100vh - var(--eng-header-h));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    background: var(--white, #fff);
}

.eng-col {
    position: relative;
    margin: 0;
    min-height: 0;
    overflow: hidden;
}

/* Side images */
.eng-col--left img,
.eng-col--right img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* slight settle-in while the middle image reveals */
    transform: scale(calc(1.06 - (var(--p) * 0.06)));
    transform-origin: center;
    will-change: transform;
}

.eng-col--left img  { object-position: 40% center; }
.eng-col--right img { object-position: 30% center; }

/* ---------- Middle column ---------- */
.eng-col--middle {
    background: var(--white, #fff);
}

/* Text panel: fades & lifts away as progress goes 0 → 0.45 */
.eng-content {
    position: absolute;
    inset: 0;
    padding: clamp(16px, 2vw, 32px) clamp(20px, 3.5vw, 34px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    color: var(--text-dark, #111);
    font-family: "Questrial", "Montserrat", sans-serif;
    font-size: clamp(0.8rem, 0.95vw, 1rem);
    line-height: 1.35;
    text-align: left;

    opacity: calc(1 - (var(--p) * 3.5));
    transform: translateY(calc(var(--p) * -40px)) scale(calc(1 - (var(--p) * 0.04)));
    filter: blur(calc(var(--p) * 6px));
    pointer-events: none;
    will-change: opacity, transform;
}

.eng-content__intro {
    margin: 0 0 6px;
}

.eng-list {
    margin: 0;
    padding: 0 0 0 1.4em;
    list-style: disc;
}

.eng-list li {
    margin: 0 0 4px;
    padding-left: 0.4em;
}

.eng-list li::marker {
    color: var(--purple, #3535A7);
}

/* Middle image: slides up from the bottom as progress goes 0.1 → 1 */
.eng-reveal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    --r: clamp(0, calc((var(--p) - 0.05) * 1.9), 1);  /* reveal progress 0 → 1 */
    opacity: clamp(0, calc(var(--r) * 4), 1);
    /* the visible area grows upward from the bottom edge */
    clip-path: inset(calc((1 - var(--r)) * 100%) 0 0 0);
    /* image rises with the reveal, so it enters from the bottom */
    transform: translateY(calc((1 - var(--r)) * 18%));
    will-change: clip-path, opacity, transform;
}

/* ---------- Closing statement (under the showcase) ---------- */
.eng-closing {
    padding: clamp(48px, 8vw, 120px) clamp(20px, 13.8vw, 265px) clamp(64px, 9vw, 140px);
    background: var(--white, #fff);
}

.eng-closing__text {
    margin: 0;
    font-family: "Questrial", "Montserrat", sans-serif;
    font-size: clamp(2rem, 4.7vw, 5rem);
    font-weight: 400;
    line-height: 1.12;
    color: var(--purple, #3535A7);
}

/* ---------- Tablet / mobile: no sticky animation, stack naturally ---------- */
@media (max-width: 900px) {
    .eng-scroll {
        height: auto;
    }

    .eng-stage {
        position: static;
        height: auto;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .eng-col--left,
    .eng-col--right {
        height: 320px;
    }

    .eng-col--left img,
    .eng-col--right img {
        transform: none;
    }

    .eng-col--middle {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .eng-content {
        position: static;
        opacity: 1;
        transform: none;
        filter: none;
        pointer-events: auto;
        padding: 24px 20px;
        font-size: 1rem;
    }

    .eng-reveal {
        position: static;
        height: 340px;
        opacity: 1;
        clip-path: none;
        transform: none;
    }
}

/* ---------- Reduced motion: show the final state (3 images) ---------- */
@media (prefers-reduced-motion: reduce) and (min-width: 901px) {
    .eng-scroll { height: auto; }
    .eng-stage  { position: relative; }
    .eng-content { opacity: 0; }
    .eng-reveal {
        opacity: 1;
        clip-path: none;
        transform: none;
    }
    .eng-col--left img,
    .eng-col--right img { transform: none; }
}