/* Process Flow — Front-end Styles v1.2
   Five fixed editorial variants, each pixel-tuned to match the master design.
*/

.pf-process-flow {
    position: relative;
    background-color: var(--pf-bg, #fff);
    color: var(--pf-text, #1a1a1a);
    padding: 80px 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pf-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Vertical line ===== */
.pf-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--pf-line, #000);
    transform: translateX(-50%);
    z-index: 50;
}

.pf-line__active {
    position: absolute;
    left: 50%;
    top: 0;
    width: 3px;
    background: #000;
    transform: translateX(-50%);
    height: 0;
    transition: height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 2px;
    z-index: 51;
}

/* ===== Step wrapper ===== */
.pf-step {
    position: relative;
    margin-bottom: 0;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
    transform: translateY(20px);
    z-index: auto;
}

.pf-step.pf-visible {
    opacity: 1;
    transform: none;
}

/* ===== Marker (dot + STEP label) on the central line ===== */
.pf-step__marker {
    position: relative;
    height: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pf-step__bullet-dot {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--pf-bullet, #c8e636);
    transition: transform 0.4s ease;
    z-index: 60;
}

.pf-step__bullet-dot::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background-color: var(--pf-bullet, #c8e636);
    z-index: -1;
}

.pf-step__label {
    position: absolute;
    left: calc(50% + 22px);
    top: 0;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pf-text, #1a1a1a);
    background: var(--pf-bg, #fff);
    padding: 2px 6px;
}

@keyframes pf-dot-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200,230,54,0.5); }
    100% { box-shadow: 0 0 0 18px rgba(200,230,54,0); }
}

.pf-step.pf-visible .pf-step__bullet-dot {
    transform: translate(-50%, -50%) scale(1.15);
    animation: pf-dot-pulse 1.6s ease-out;
}

/* ===== Panel (coloured background block + content) ===== */
.pf-step__panel {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    padding-top: 40px;
    align-items: start;
}

.pf-panel--a .pf-step__text { background: var(--pf-panel-a, #7d94b0); color: #000; }
.pf-panel--b .pf-step__text { background: var(--pf-panel-b, #c8e636); color: #000; }

.pf-step__text {
    padding: 56px 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 2;
}

.pf-step__image {
    position: relative;
    z-index: 3;
    overflow: hidden;
    box-sizing: border-box;
}

.pf-step__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Typography ===== */
.pf-step__subtitle {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.85;
}

.pf-step__title {
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 22px;
    letter-spacing: -0.02em;
}

.pf-step__desc {
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0 0 16px;
    max-width: 520px;
}

.pf-step__button {
    display: inline-block;
    align-self: flex-start;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: inherit;
    border: 1px solid currentColor;
    padding: 12px 26px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}
.pf-panel--a .pf-step__button:hover { background: #000; color: #fff; }
.pf-panel--b .pf-step__button:hover { background: #000; color: #fff; }

/* ===========================================================
   FIVE FIXED VARIANTS — pixel-tuned to master design
   =========================================================== */

/* --- Variant 1 (Idea, blue): wide panel left, smaller image overlapping inside on the right --- */
.pf-step--v1 .pf-step__text {
    grid-column: 1 / span 8;
    grid-row: 1;
    min-height: 420px;
}
.pf-step--v1 .pf-step__image {
    grid-column: 7 / span 5;
    grid-row: 1;
    align-self: center;
    margin-top: 40px;
    aspect-ratio: 4/3;
}

/* --- Variant 2 (Sourcing, green): big image left, narrow panel right --- */
.pf-step--v2 .pf-step__image {
    grid-column: 1 / span 7;
    grid-row: 1;
    align-self: start;
    margin-top: 0;
    aspect-ratio: 4/3;
}
.pf-step--v2 .pf-step__text {
    grid-column: 7 / span 6;
    grid-row: 1;
    margin-top: 60px;
}

/* --- Variant 3 (Formulation, blue): wide tall panel left, image overlapping high on right --- */
.pf-step--v3 .pf-step__text {
    grid-column: 1 / span 8;
    grid-row: 1;
    min-height: 560px;
}
.pf-step--v3 .pf-step__image {
    grid-column: 7 / span 5;
    grid-row: 1;
    align-self: start;
    margin-top: 90px;
    aspect-ratio: 4/3;
}

/* --- Variant 4 (Production, green): portrait image left (overlapping panel slightly),
   green panel sits to the RIGHT of the centre line so the line stays visible between them --- */
.pf-step--v4 .pf-step__image {
    grid-column: 1 / span 5;
    grid-row: 1;
    align-self: start;
    margin-top: 20px;
    aspect-ratio: 3/4;
    z-index: 4;
}
.pf-step--v4 .pf-step__text {
    grid-column: 7 / span 6;
    grid-row: 1;
    margin-top: 80px;
    padding-left: 56px;
}

/* --- Variant 5 (Distribution, blue): panel left top, large image right overlapping bottom --- */
.pf-step--v5 .pf-step__text {
    grid-column: 1 / span 7;
    grid-row: 1;
    min-height: 380px;
}
.pf-step--v5 .pf-step__image {
    grid-column: 6 / span 7;
    grid-row: 1;
    align-self: end;
    margin-top: 180px;
    margin-bottom: -60px;
    aspect-ratio: 4/3;
}

/* ===== Spacing between steps ===== */
.pf-step + .pf-step { margin-top: 160px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .pf-process-flow { padding: 40px 0; }

    .pf-line       { left: 20px; transform: none; }
    .pf-line__active { left: 20px; transform: none; }

    .pf-step__marker { justify-content: flex-start; padding-left: 20px; }
    .pf-step__bullet-dot { left: 20px; transform: translate(-50%, -50%); }
    .pf-step.pf-visible .pf-step__bullet-dot { transform: translate(-50%, -50%) scale(1.15); }
    .pf-step__label { left: 44px; }

    .pf-step__panel {
        display: block;
        padding-top: 32px;
        padding-left: 44px;
    }

    .pf-step__text {
        padding: 32px 28px 36px;
        margin-top: 0 !important;
        min-height: 0 !important;
    }

    .pf-step__image {
        margin: 0 !important;
        aspect-ratio: 4/3 !important;
    }

    /* Image always BELOW text on mobile for consistency */
    .pf-step--v1 .pf-step__image,
    .pf-step--v2 .pf-step__image,
    .pf-step--v3 .pf-step__image,
    .pf-step--v4 .pf-step__image,
    .pf-step--v5 .pf-step__image { order: 2; }

    .pf-step--v1 .pf-step__text,
    .pf-step--v2 .pf-step__text,
    .pf-step--v3 .pf-step__text,
    .pf-step--v4 .pf-step__text,
    .pf-step--v5 .pf-step__text { order: 1; }

    .pf-step + .pf-step { margin-top: 80px; }
}

/* ===== Fade-in (2800ms) for text panel and image when step becomes visible ===== */
@keyframes pf-fade-in {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.pf-step__text,
.pf-step__image {
    opacity: 0;
}

.pf-step.pf-visible .pf-step__text,
.pf-step.pf-visible .pf-step__image {
    animation: pf-fade-in 2800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.pf-step.pf-visible .pf-step__image {
    animation-delay: 200ms;
}

@media (prefers-reduced-motion: reduce) {
    .pf-step__text,
    .pf-step__image { opacity: 1; animation: none !important; }
}
