/* =======================================================
   SPLIT-HERO — Industry Split-Screen Scroll Section
   Uses brand tokens from style.css — no hardcoded colours
   ======================================================= */

/* ── Outer scroll container ──────────────────────────── */
.industries-section {
    position: relative;
    /* Removed GSAP reliance — section has normal document flow padding */
    padding: var(--spacing-4xl) 1.5rem;
    background: var(--dark-secondary);
    background-image: var(--surface-texture); /* none in dark, noise in light */
}

.split-hero-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Sticky stage ─────────────────────────────────────── */
.split-stage {
    height: calc(80vh - 8rem);   /* Reduced viewport height by 20% to fit the header on-screen */
    min-height: 550px;           /* Safeguard for very short screens */
    width: 100%;
    max-width: 1200px;           /* Match site container width */
    margin: 0 auto;              /* Centre horizontally */
    display: flex;
    position: relative;          /* Anchor absolute children and shapes */
    overflow: hidden;            /* Keep children cornered */
    border-radius: var(--radius-xl, 20px);
    border: 1px solid rgba(102, 187, 106, 0.4);
    animation: neon-pulse 3s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 5px rgba(102, 187, 106, 0.2) inset, 0 0 5px rgba(102, 187, 106, 0.2);
        border-color: rgba(102, 187, 106, 0.2);
    }
    100% {
        box-shadow: 0 0 15px rgba(102, 187, 106, 0.6) inset, 0 0 20px rgba(102, 187, 106, 0.6);
        border-color: rgba(102, 187, 106, 0.8);
    }
}

/* ── Left panel ───────────────────────────────────────── */
.split-left {
    width: 33.333%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 2.5rem;
    background-color: var(--dark-secondary, #1c2127);
    border-right: 1px solid rgba(102, 187, 106, 0.15);
    overflow: hidden;
}

.split-left-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.split-left-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 116px;
    height: 116px;
    background: rgba(102, 187, 106, 0.1);
    color: var(--text-accent-green, #66bb6a);
    border-radius: var(--radius-md, 12px);
    margin: 0 auto 1.5rem auto;
    border: 1px solid rgba(102, 187, 106, 0.2);
}

.split-left-icon-container svg {
    width: 58px;
    height: 58px;
}

.split-left-name {
    display: none; /* shown only on mobile via breakpoint below */
}

.split-agency-tag {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.5rem;
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: var(--tracking-widest, 0.1em);
    text-transform: uppercase;
    color: var(--text-accent-green, #66bb6a);
    margin: 0;
}

.split-left-headline {
    font-family: var(--heading-font-family, 'Poppins', sans-serif);
    font-size: clamp(1.875rem, 5vw, 3rem);
    font-weight: var(--font-weight-semibold, 600);
    line-height: var(--leading-tight, 1.1);
    letter-spacing: var(--tracking-tight, -0.025em);
    color: var(--color-heading, #ffffff);
    margin: 0.75rem 0 0;
    /* Override global h1 gradient */
    background: none;
    -webkit-text-fill-color: var(--color-heading-fill, #ffffff);
}

.split-left-headline em {
    font-family: 'Caveat', cursive;
    font-style: normal;
    font-weight: 500;
    font-size: 1.3em; /* Exact match to polaroid-hero */
    color: var(--text-accent-green, #66bb6a);
    -webkit-text-fill-color: var(--text-accent-green, #66bb6a);
}

/* ── Industry progress nav ────────────────────────────── */
.split-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    justify-content: center;
}

.split-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-sm, 4px);
    transition: background 0.2s ease;
}

.split-nav-item:hover {
    background: rgba(102, 187, 106, 0.06);
}

.split-nav-label {
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-weight-normal, 400);
    color: var(--text-secondary, #8a94a0);
    transition: color 0.25s ease;
    line-height: 1;
}

.split-nav-item.active .split-nav-label {
    color: var(--text-accent-green, #66bb6a);
    font-weight: var(--font-weight-medium, 500);
}

.split-nav-bar-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.split-nav-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--text-accent-green, #66bb6a);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* ── Left panel CTA ───────────────────────────────────── */
.split-left-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-green, #2e7d32);
    color: var(--white, #ffffff);
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    border: none;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.2s ease;
    align-self: center;
}

.split-left-cta:hover {
    background: var(--primary-green-hover, #1b5e20);
    transform: translateY(-1px);
    color: var(--white, #ffffff);
    -webkit-text-fill-color: var(--white, #ffffff);
}

/* ── Right panel ──────────────────────────────────────── */
.split-right {
    flex: 1;
    position: relative;
    /* Horizontal swipe between slides — vertical scroll on the page is left
       free for the rest of the page sections. */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    display: flex;
    flex-direction: row;
    background-color: var(--dark-primary);
    /* Hide scrollbar for a cleaner look while maintaining scrollability */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.split-right::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
}

/* ── Individual slide ─────────────────────────────────── */
.split-slide {
    position: relative;
    width: 100%;
    min-width: 100%; /* Each slide takes the full visible width of split-right */
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 3.5rem;
    transition: opacity 0.3s ease;
}

/* Faint out adjacent inactive slides */
.split-slide:not(.active) {
    opacity: 0.3;
}

/* ── Industry tag pill ────────────────────────────────── */
.slide-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(102, 187, 106, 0.12);
    border: 1px solid rgba(102, 187, 106, 0.3);
    color: var(--text-accent-green, #66bb6a);
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: var(--tracking-wider, 0.05em);
    text-transform: uppercase;
    border-radius: 999px;
    width: fit-content;
}

/* ── Slide headline ───────────────────────────────────── */
.slide-headline {
    font-family: var(--heading-font-family, 'Poppins', sans-serif);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: var(--font-weight-semibold, 600);
    line-height: var(--leading-snug, 1.25);
    letter-spacing: var(--tracking-tight, -0.025em);
    color: var(--color-heading, #ffffff);
    margin: 0;
    background: none;
    -webkit-text-fill-color: var(--color-heading-fill, #ffffff);
}

/* ── Problem / Solution cards ─────────────────────────── */
.slide-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.slide-card {
    border-radius: var(--radius-md, 8px);
    padding: 1rem 1.25rem;
}

.slide-card-label {
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: var(--tracking-wider, 0.05em);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.slide-card-body {
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-sm, 0.875rem);
    line-height: var(--leading-relaxed, 1.7);
    margin: 0;
}

.slide-card.problem {
    background: rgba(255, 75, 75, 0.08);
    border: 1px solid rgba(255, 75, 75, 0.2);
}

.slide-card.problem .slide-card-label {
    color: #ff8787;
}

.slide-card.problem .slide-card-body {
    color: var(--text-secondary, #8a94a0);
}

.slide-card.solution {
    background: rgba(102, 187, 106, 0.08);
    border: 1px solid rgba(102, 187, 106, 0.2);
}

.slide-card.solution .slide-card-label {
    color: var(--text-accent-green, #66bb6a);
}

.slide-card.solution .slide-card-body {
    color: var(--text-secondary, #8a94a0);
}

/* ── Deliverable pills ────────────────────────────────── */
.slide-deliverables {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.slide-deliverables-label {
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-xs, 0.75rem);
    color: var(--text-muted, #6e7a8a);
    font-weight: var(--font-weight-medium, 500);
    margin-right: 0.25rem;
}

.slide-pill {
    padding: 0.25rem 0.7rem;
    background: var(--dark-tertiary, #252d36);
    border: 1px solid var(--neutral-700, #3d4756);
    color: var(--text-primary, #e2e6ea);
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-weight-normal, 400);
    border-radius: 999px;
}

/* ── Stat cards ───────────────────────────────────────── */
.slide-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.slide-stat {
    background: var(--dark-secondary, #1c2127);
    border: 1px solid var(--neutral-700, #3d4756);
    border-radius: var(--radius-md, 8px);
    padding: 0.9rem 1rem;
    text-align: center;
}

.slide-stat-value {
    display: block;
    font-family: var(--heading-font-family, 'Poppins', sans-serif);
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-accent-green, #66bb6a);
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.slide-stat-label {
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: var(--text-2xs, 0.625rem);
    color: var(--text-muted, #6e7a8a);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider, 0.05em);
    line-height: 1.3;
}

/* ── Slide prev/next navigation ───────────────────────── */
.slide-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.slide-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--neutral-700, #3d4756);
    background: transparent;
    color: var(--text-primary, #e2e6ea);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.slide-nav-btn:hover {
    background: rgba(102, 187, 106, 0.12);
    border-color: var(--text-accent-green, #66bb6a);
    color: var(--text-accent-green, #66bb6a);
}

.slide-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ── Dot indicators ───────────────────────────────────── */
.split-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.split-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.split-dot.active {
    background: var(--text-accent-green, #66bb6a);
    transform: scale(1.4);
}

/* ── Mobile: stack vertically at 768px ───────────────── */
@media (max-width: 768px) {
    .industries-section {
        /* Vertical matches other sections; horizontal stays tighter for narrow viewports. */
        padding: var(--spacing-2xl) 0.75rem;
    }

    .split-hero-header {
        margin-bottom: 1.5rem;
    }

    .split-stage {
        /* Restored a constrained height — the right column needs one so each
           .split-slide (height: 100%) can size correctly and scroll-snap works.
           Just shrink it to roughly the height of the slide content so we
           don't get a big gap below slide-stats. */
        height: auto;
        min-height: 0;
        border-radius: var(--radius-lg, 12px);
        flex-direction: column;
    }

    .split-left {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1.25rem;
        gap: 0.75rem;
        flex-wrap: nowrap;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid rgba(102, 187, 106, 0.15);
    }

    .split-left-icon-container {
        width: 44px;
        height: 44px;
        min-width: 44px;
        margin: 0;
        border-radius: var(--radius-sm, 6px);
    }

    .split-left-icon-container svg {
        width: 22px;
        height: 22px;
    }

    .split-left-header {
        flex: 1;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .split-left-name {
        display: block;
        font-family: var(--font-family, 'Inter', sans-serif);
        font-size: var(--text-sm, 0.875rem);
        font-weight: var(--font-weight-semibold, 600);
        color: var(--text-primary, #e2e6ea);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex: 1;
    }

    .split-left .split-left-headline {
        font-size: 1rem;
        margin-top: 0.25rem;
    }

    .split-nav-list {
        display: none; /* Too cramped on mobile */
    }

    .split-left-cta {
        font-size: var(--text-xs, 0.75rem);
        padding: 0.5rem 1rem;
        flex-shrink: 0;
    }

    .split-right {
        /* Fixed height required for internal scroll-snap. Sized so the tallest
           slide content (heading + 2 cards + 3-col stats + nav row with dots)
           fits without overflow-y: hidden clipping the bottom of the slide. */
        flex: none;
        height: 64vh;
        min-height: 540px;
        max-height: 620px;
    }

    .split-slide {
        /* Anchor content to the top so the heading isn't hidden behind the
           left bar; spare room (if any) ends up below the nav row. */
        justify-content: flex-start;
        padding: 1.25rem 1.25rem 1rem;
        gap: 0.5rem;
    }

    /* Tighter card body on mobile — desktop's `leading-relaxed` (1.7) was
       costing ~30px across both problem/solution cards, pushing the nav out
       of the visible area. */
    .slide-card {
        padding: 0.85rem 1rem;
    }
    .slide-card-body {
        line-height: 1.5;
    }

    /* Sit the prev/next row directly under the stats — drop the auto
       margin-top that was anchoring nav to the slide bottom (which on tall
       slides produced a big empty band between stats and the buttons). */
    .slide-nav {
        margin-top: 0.5rem;
        padding-top: 0;
    }

    /* Hide the industry tag and deliverables list on mobile to free up vertical room. */
    .slide-tag,
    .slide-deliverables {
        display: none;
    }

    .slide-cards {
        grid-template-columns: 1fr;
    }

    .slide-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        /* Match the problem→solution gap (1rem from .slide-cards grid gap)
           so vertical rhythm stays consistent once deliverables are hidden. */
        margin-top: 0.5rem;
    }

    .slide-stat {
        padding: 0.65rem 0.5rem;
    }

    /* Bump dot prominence on mobile — the desktop sizes read fine against the
       industry-list backdrop but get lost on the dark slide-nav row. */
    .split-dots {
        gap: 8px;
    }
    .split-dot {
        width: 9px;
        height: 9px;
        background: rgba(255, 255, 255, 0.28);
    }
    .light-theme .split-dot {
        background: rgba(0, 0, 0, 0.22);
    }
    .split-dot.active {
        transform: scale(1.5);
    }
}
