/* =========================================================
   RotoEdge — homepage "Our Services" infographic
   Desktop ≥1025px · Tablet 768–1024px · Mobile ≤767px
========================================================= */

.re-svc {
    --svc-red: #ff1f1f;
    --svc-line: rgba(255, 255, 255, .12);
    --svc-card: #171717;
    --svc-muted: rgba(255, 255, 255, .62);
    position: relative;
    padding: clamp(32px, 3.5vw, 56px) 0;
    background: var(--e-global-color-primary, #121212);
    color: #fff;
    overflow: hidden;
}

.re-svc__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- header ---------- */

.re-svc__head {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: clamp(28px, 4vw, 64px);
    align-items: end;
    margin-bottom: clamp(28px, 3vw, 44px);
}

.re-svc__title {
    margin: 18px 0 0;
    font-family: "Marcellus", serif;
    font-weight: 400;
    font-size: clamp(34px, 4.1vw, 64px);
    line-height: 1.05;
    color: var(--svc-red);
    text-wrap: balance;
}

.re-svc__intro {
    margin: 0 0 22px;
    font-size: clamp(15px, 1.15vw, 18px);
    line-height: 1.65;
    color: var(--svc-muted);
    text-wrap: pretty;
}

.re-svc__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--svc-line);
}

.re-svc__stat {
    padding: 16px 12px 0 0;
}

.re-svc__stat + .re-svc__stat {
    padding-left: 16px;
    border-left: 1px solid var(--svc-line);
}

.re-svc__stat strong {
    display: block;
    font-family: "Marcellus", serif;
    font-weight: 400;
    font-size: clamp(30px, 2.8vw, 44px);
    line-height: 1;
    color: #fff;
}

.re-svc__stat strong em {
    font-style: normal;
    color: var(--svc-red);
}

.re-svc__stat span {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--svc-muted);
}

/* ---------- pipeline ---------- */

.re-pipe__labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--svc-muted);
}

.re-pipe__labels span:last-child {
    color: var(--svc-red);
}

.re-pipe {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* the track that links every stage */
.re-pipe::before {
    content: "";
    position: absolute;
    top: 38px;
    left: 4%;
    right: 4%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .22) 20%, rgba(255, 31, 31, .55) 100%);
}

/* signal travelling along the track */
.re-pipe::after {
    content: "";
    position: absolute;
    top: 34px;
    left: 4%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--svc-red);
    box-shadow: 0 0 14px 4px rgba(255, 31, 31, .6);
    animation: re-pipe-signal 6s cubic-bezier(.45, 0, .55, 1) infinite;
}

@keyframes re-pipe-signal {
    0%   { left: 4%;  opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: calc(96% - 10px); opacity: 0; }
}

.re-pipe__step {
    position: relative;
    z-index: 1;
}

.re-pipe__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.re-pipe__node {
    position: relative;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #232323, #121212 70%);
    box-shadow: 0 0 0 6px var(--e-global-color-primary, #121212);
    transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease;
}

.re-pipe__node svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.re-pipe__node svg .accent {
    stroke: var(--svc-red);
}

.re-pipe__node svg .accent-fill {
    fill: var(--svc-red);
    stroke: none;
}

.re-pipe__num {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 26px;
    padding: 3px 6px;
    border-radius: 20px;
    background: var(--svc-red);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    color: #fff;
}

.re-pipe__title {
    margin: 0 0 8px;
    font-family: "Marcellus", serif;
    font-weight: 400;
    font-size: clamp(18px, 1.45vw, 22px);
    line-height: 1.2;
    color: #fff;
}

.re-pipe__desc {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--svc-muted);
}

.re-pipe__out {
    align-self: flex-start;
    margin-top: auto;
    padding: 5px 11px;
    border: 1px solid rgba(255, 31, 31, .45);
    border-radius: 30px;
    font-size: 12px;
    line-height: 1.2;
    color: #ffd3d3;
    white-space: nowrap;
}

.re-pipe__out::before {
    content: "→ ";
    color: var(--svc-red);
}

.re-pipe__link:hover .re-pipe__node,
.re-pipe__link:focus-visible .re-pipe__node {
    transform: translateY(-4px);
    border-color: var(--svc-red);
    box-shadow: 0 0 0 6px var(--e-global-color-primary, #121212), 0 0 26px rgba(255, 31, 31, .45);
}

.re-pipe__link:hover .re-pipe__title,
.re-pipe__link:focus-visible .re-pipe__title {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--svc-red);
    text-underline-offset: 6px;
}

.re-pipe__link:focus-visible {
    outline: 2px solid var(--svc-red);
    outline-offset: 6px;
    border-radius: 8px;
}

/* =========================================================
   TABLET — 768px to 1024px: 3 × 2 stage grid
========================================================= */
@media (max-width: 1024px) {
    .re-svc__head {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .re-pipe {
        grid-template-columns: repeat(3, 1fr);
        gap: 34px 22px;
    }

    .re-pipe::before,
    .re-pipe::after {
        display: none;
    }

    .re-pipe__step {
        padding: 22px;
        border: 1px solid var(--svc-line);
        border-radius: 16px;
        background: var(--svc-card);
    }

    .re-pipe__node {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
        box-shadow: none;
    }

    .re-pipe__node svg {
        width: 28px;
        height: 28px;
    }
}

/* =========================================================
   MOBILE — up to 767px: vertical timeline
========================================================= */
@media (max-width: 767px) {
    .re-svc__inner {
        padding: 0 18px;
    }

    .re-svc__stat + .re-svc__stat {
        padding-left: 10px;
    }

    .re-svc__stat span {
        font-size: 12px;
    }

    .re-pipe__labels {
        display: none;
    }

    .re-pipe {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .re-pipe::before {
        display: block;
        top: 28px;
        bottom: 28px;
        left: 27px;
        right: auto;
        width: 2px;
        height: auto;
        background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .22) 20%, rgba(255, 31, 31, .6));
    }

    .re-pipe__step {
        padding: 0 0 22px;
        border: 0;
        background: none;
    }

    .re-pipe__link {
        display: grid;
        grid-template-columns: 56px 1fr;
        column-gap: 16px;
        align-items: start;
    }

    .re-pipe__node {
        grid-row: 1 / span 3;
        width: 56px;
        height: 56px;
        margin: 0;
        box-shadow: 0 0 0 5px var(--e-global-color-primary, #121212);
    }

    .re-pipe__node svg {
        width: 24px;
        height: 24px;
    }

    .re-pipe__num {
        top: -6px;
        right: -8px;
        min-width: 22px;
        font-size: 10px;
    }

    .re-pipe__title {
        margin: 4px 0 4px;
        font-size: 19px;
    }

    .re-pipe__desc {
        margin-bottom: 8px;
    }

    .re-pipe__out {
        justify-self: start;
        margin-top: 0;
    }

    .re-svc__head {
        gap: 18px;
        margin-bottom: 28px;
    }

    .re-svc__stat {
        padding-right: 8px;
    }

    .re-svc__stat strong {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .re-pipe::after { animation: none; opacity: 0; }
    .re-pipe__node { transition: none; }
}
