/* =========================================================
   HOW IT WORKS — Journey Section
   ========================================================= */

.how-it-works-section {
    background-color: #f8faf5; /* Warm off-white with a hint of agricultural green */
    padding-top: 90px;
    padding-bottom: 110px;
    font-family: 'Inter', 'Poppins', 'Segoe UI', sans-serif;
    overflow: hidden;
}

@media (min-width: 768px) {
    .how-it-works-section {
        padding-top: 120px;
        padding-bottom: 140px;
    }
}

.hiw-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Section Header ─────────────────────────────────────── */
.hiw-header {
    text-align: center;
    margin-bottom: 80px;
}

.hiw-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4a6331;
    border: 1px solid #c8dab5;
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 20px;
    background: rgba(74, 99, 49, 0.06);
}

.hiw-heading {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    color: #0d1a12;
    margin: 0 0 18px 0;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .hiw-heading {
        font-size: 46px;
    }
}

.hiw-subheading {
    font-size: 16px;
    color: #6b7a6b;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Journey Track ──────────────────────────────────────── */
.hiw-journey {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Vertical connector for mobile */
.hiw-journey::before {
    content: '';
    position: absolute;
    top: 60px;
    bottom: 60px;
    left: 28px;
    width: 2px;
    background-image: repeating-linear-gradient(
        to bottom,
        #a8c48a 0px,
        #a8c48a 6px,
        transparent 6px,
        transparent 14px
    );
    opacity: 0.6;
    z-index: 0;
}

@media (min-width: 768px) {
    .hiw-journey::before {
        display: none; /* hidden on desktop — we use a custom SVG connector */
    }
}

/* ── Desktop: Staggered horizontal connector ────────────── */
.hiw-connector {
    display: none;
}

@media (min-width: 768px) {
    .hiw-connector {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 60px;
        margin: 0;
        position: relative;
    }

    /* Connector going right (after step 1 and 3) */
    .hiw-connector.to-right {
        justify-content: flex-start;
        padding-left: calc(45% + 20px);
    }

    /* Connector going left (after step 2) */
    .hiw-connector.to-left {
        justify-content: flex-end;
        padding-right: calc(45% + 20px);
    }

    .hiw-connector svg {
        display: block;
    }
}

/* ── Journey Step ───────────────────────────────────────── */
.hiw-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 20px 28px 60px; /* left padding for mobile vertical line */
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .hiw-step {
        padding: 0;
        gap: 0;
        margin-bottom: 0;
        max-width: 100%;
    }
}

/* Desktop: steps alternate left / right */
@media (min-width: 768px) {
    .hiw-step.left {
        justify-content: flex-start;
    }
    .hiw-step.right {
        justify-content: flex-end;
    }
}

/* ── Step Card ──────────────────────────────────────────── */
.hiw-card {
    background: #ffffff;
    border: 1px solid #e4edd9;
    border-radius: 18px;
    padding: 30px 28px;
    width: 100%;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 768px) {
    .hiw-card {
        width: 44%;
        min-width: 380px;
    }
}

.hiw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(13, 26, 18, 0.06);
}

/* Final step slight green tint */
.hiw-card.step-final {
    background: #f2f8ec;
    border-color: #c8dab5;
}

/* ── Card Top Row: Number + Category + Icon ─────────────── */
.hiw-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.hiw-step-left-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hiw-step-number {
    font-size: 36px;
    font-weight: 800;
    color: #c8dab5;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.hiw-step-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hiw-step-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4a6331;
}

/* ── Icon ───────────────────────────────────────────────── */
.hiw-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eef5e6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: #4a6331;
    transition: background 0.2s;
}

.hiw-card:hover .hiw-icon-wrap {
    background: #d4e9bc;
}

.hiw-card.step-final .hiw-icon-wrap {
    background: #d4e9bc;
    color: #2b5016;
}

/* ── Card Body ──────────────────────────────────────────── */
.hiw-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0d1a12;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.hiw-card-desc {
    font-size: 15px;
    color: #5a6b5a;
    line-height: 1.7;
    margin: 0;
}

/* ── Section Footer CTA ─────────────────────────────────── */
.hiw-footer {
    text-align: center;
    margin-top: 70px;
}

/* ── Entrance Animations ────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .hiw-from-left {
        opacity: 0;
        transform: translateX(-40px);
    }
    .hiw-from-right {
        opacity: 0;
        transform: translateX(40px);
    }
    .hiw-from-left.hiw-visible,
    .hiw-from-right.hiw-visible {
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    /* Connector fade-in */
    .hiw-connector {
        opacity: 0;
        transition: opacity 0.5s ease 0.3s;
    }
    .hiw-connector.hiw-visible {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hiw-from-left,
    .hiw-from-right {
        opacity: 1;
        transform: none;
    }
}

/* ── Mobile specifics ───────────────────────────────────── */
@media (max-width: 767px) {
    .hiw-step-number {
        font-size: 28px;
    }
    .hiw-card-title {
        font-size: 18px;
    }
    .hiw-card {
        padding: 22px 20px;
    }
}
