/*
 * Swiss Connect Core — Plugin Stylesheet
 * Developed by Ghaleb @ Serenemedia (https://serenemedia.io)
 * Client: Swiss Connect Solutions (https://swissconnect.ae)
 *
 * All values use CSS custom properties defined in the child theme variables.
 * Never hardcode colours, fonts or spacing here.
 */


/* ============================================================
   GLOBAL BUTTON SYSTEM
   ============================================================ */

.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: var(--sc-font-primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--sc-radius-sm);
    text-decoration: none;
    transition: var(--sc-transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.sc-btn--primary {
    background-color: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

.sc-btn--primary:hover {
    background-color: var(--sc-color-primary-hover);
    border-color: var(--sc-color-primary-hover);
    color: var(--sc-color-white);
}

.sc-btn--secondary {
    background-color: transparent;
    color: var(--sc-color-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.sc-btn--secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--sc-color-white);
    color: var(--sc-color-white);
}

/* Outline variant — white fill + red text at rest on the candidate (red) card.
   Inverts to transparent + white text/border on hover — the button "opens up".
   This inversion is deliberate: white→transparent feels lighter than dark→dark. */
.sc-btn--outline {
    background-color: var(--sc-color-white);
    color: var(--sc-color-primary);
    border-color: var(--sc-color-white);
}

.sc-btn--outline:hover {
    background-color: transparent;
    border-color: var(--sc-color-white);
    color: var(--sc-color-white);
    text-decoration: none;
}

.sc-btn--outline:focus-visible {
    outline: 2px solid var(--sc-color-white);
    outline-offset: 4px;
}


/* ============================================================
   HERO SECTION — SPLIT LAYOUT
   ============================================================ */

.sc-hero {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

/* Left panel — white, 55% */
.sc-hero__left {
    flex: 0 0 55%;
    width: 55%;
    background-color: var(--sc-color-white);
    display: flex;
    align-items: center;
    position: relative;
}

/* Right panel — brand red, 45% — stacking context for scene crossfades */
.sc-hero__right {
    flex: 0 0 45%;
    width: 45%;
    background-color: var(--sc-color-primary);
    position: relative;
    overflow: hidden;
}


/* Content wrapper — sits inside the left panel */
.sc-hero__content {
    padding: 80px 56px 80px 10%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}

/* Eyebrow tag */
.sc-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sc-color-primary);
    padding: 6px 14px;
    border: 1px solid rgba(204, 0, 0, 0.28);
    border-radius: 100px;
    background-color: rgba(204, 0, 0, 0.05);
}

/* Headline — chained specificity beats Superio's theme h1 colour override */
.sc-hero__left .sc-hero__content .sc-hero__headline {
    font-family: var(--sc-font-primary);
    font-size: clamp(36px, 4vw, 58px);
    font-weight: 900;
    line-height: 1.08;
    color: var(--sc-color-black) !important;
    margin: 0;
    letter-spacing: -0.03em;
    max-width: 12ch;
}

/* Red accent word inside headline */
.sc-hero__headline .sc-accent,
.sc-hero__headline em {
    color: var(--sc-color-primary) !important;
    font-style: normal;
}

/* Subheadline */
.sc-hero__sub {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--sc-color-grey-dark);
    margin: 0;
    max-width: 400px;
}

/* CTA row */
.sc-hero__ctas {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Secondary button on white background — red outline, red text */
.sc-hero__left .sc-btn--secondary {
    color: var(--sc-color-primary);
    border-color: var(--sc-color-primary);
}

.sc-hero__left .sc-btn--secondary:hover {
    background-color: rgba(204, 0, 0, 0.05);
    border-color: var(--sc-color-primary-hover);
    color: var(--sc-color-primary-hover);
}

/* Trust line */
.sc-hero__trust {
    font-size: 12px;
    font-weight: 500;
    color: var(--sc-color-grey-mid);
    margin: 0;
    letter-spacing: 0.01em;
    margin-top: 8px;
}


/* ============================================================
   HERO — LEFT PANEL ENTRANCE ANIMATION (Phase 6)
   Gated on .is-loaded added by JS — never fires in Elementor editor.
   animation-fill-mode: backwards keeps elements invisible during delay.
   ============================================================ */

@keyframes sc-entrance {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sc-hero__left.is-loaded .sc-hero__eyebrow {
    animation: sc-entrance 0.55s ease backwards 0.08s;
}

.sc-hero__left.is-loaded .sc-hero__content .sc-hero__headline {
    animation: sc-entrance 0.55s ease backwards 0.2s;
}

.sc-hero__left.is-loaded .sc-hero__sub {
    animation: sc-entrance 0.55s ease backwards 0.32s;
}

.sc-hero__left.is-loaded .sc-hero__ctas {
    animation: sc-entrance 0.55s ease backwards 0.44s;
}

.sc-hero__left.is-loaded .sc-hero__trust {
    animation: sc-entrance 0.55s ease backwards 0.54s;
}


/* ============================================================
   HERO — RIGHT PANEL SCENES (Phase 3: static layout)
   ============================================================ */

/* Scenes stack absolutely — only the active one is visible */
.sc-hero__scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 32px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease;
}

.sc-hero__scene.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Graphic container — fixed size so scenes are consistent */
.sc-scene__graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 160px;
}

.sc-scene__graphic svg {
    width: 100%;
    height: 100%;
}

/* Stat number row */
.sc-scene__stat {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.sc-scene__number {
    font-family: var(--sc-font-primary);
    font-size: clamp(48px, 6vw, 72px);
    font-weight: 900;
    color: var(--sc-color-white);
    line-height: 1;
    letter-spacing: -0.04em;
}

/* Text-based stat (GCC, UAE) — slightly smaller */
.sc-scene__number--text {
    font-size: clamp(40px, 5vw, 60px);
    letter-spacing: -0.02em;
}

.sc-scene__plus {
    font-family: var(--sc-font-primary);
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 700;
    color: var(--sc-color-white);
    line-height: 1;
    opacity: 0.7;
    margin-bottom: 4px;
}

.sc-scene__label {
    font-family: var(--sc-font-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: white;
    opacity: 0.65;
    margin: 0;
}

/* People grid SVG */
.sc-scene__people-grid {
    width: 100%;
    height: auto;
}

/* Spoke diagram SVG */
.sc-scene__spoke-diagram {
    width: 180px;
    height: 180px;
}

/* GCC map SVG */
.sc-scene__gcc-map {
    width: 200px;
    height: auto;
}

/* Badge SVG */
.sc-scene__badge {
    width: 130px;
    height: 130px;
}


/* ============================================================
   HERO — SCENE ANIMATIONS (Phase 4)
   All animations gate on .is-active so Phase 5 can replay them.
   ============================================================ */

/* --- Shared keyframes --- */
@keyframes sc-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sc-person-pop {
    from {
        opacity: 0;
        transform: scale(0.2);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes sc-spoke-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sc-pin-drop {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sc-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes sc-count-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Scene 1: People grid --- */
.sc-person {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.sc-hero__scene[data-scene="1"].is-active .sc-person {
    animation: sc-person-pop 0.22s ease forwards;
    animation-delay: var(--delay, 0ms);
}

/* --- Scene 2: Spoke diagram --- */
.sc-spoke {
    opacity: 0;
}

.sc-hero__scene[data-scene="2"].is-active .sc-spoke {
    animation: sc-spoke-in 0.35s ease forwards;
    animation-delay: var(--delay, 0ms);
}

/* --- Scene 3: GCC map --- */
.sc-country {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.sc-hero__scene[data-scene="3"].is-active .sc-country {
    animation: sc-draw 0.9s ease forwards;
}

.sc-pin {
    opacity: 0;
}

.sc-hero__scene[data-scene="3"].is-active .sc-pin {
    animation: sc-pin-drop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay, 600ms);
}

/* --- Scene 4: Badge --- */
.sc-badge__ring-progress {
    /* stroke-dasharray and stroke-dashoffset set inline in HTML */
}

.sc-hero__scene[data-scene="4"].is-active .sc-badge__ring-progress {
    animation: sc-draw 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sc-badge__shield {
    opacity: 0;
}

.sc-hero__scene[data-scene="4"].is-active .sc-badge__shield {
    animation: sc-fade-in 0.5s ease forwards 0.85s;
}

.sc-badge__check {
    stroke-dasharray: 45;
    stroke-dashoffset: 45;
    opacity: 0;
}

.sc-hero__scene[data-scene="4"].is-active .sc-badge__check {
    animation: sc-fade-in 0.1s ease forwards 1.1s, sc-draw 0.45s ease forwards 1.1s;
}

/* Stat numbers and labels — shared entrance for all scenes */
.sc-scene__stat,
.sc-scene__label {
    opacity: 0;
}

.sc-hero__scene.is-active .sc-scene__stat {
    animation: sc-count-in 0.4s ease forwards 0.6s;
}

.sc-hero__scene.is-active .sc-scene__label {
    animation: sc-fade-in 0.4s ease forwards 0.8s;
}

/* Text-based stats (GCC, UAE) appear a touch later */
.sc-hero__scene[data-scene="3"].is-active .sc-scene__stat,
.sc-hero__scene[data-scene="4"].is-active .sc-scene__stat {
    animation-delay: 1s;
}

.sc-hero__scene[data-scene="3"].is-active .sc-scene__label,
.sc-hero__scene[data-scene="4"].is-active .sc-scene__label {
    animation-delay: 1.2s;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .sc-person,
    .sc-spoke,
    .sc-country,
    .sc-pin,
    .sc-badge__ring-progress,
    .sc-badge__shield,
    .sc-badge__check,
    .sc-scene__stat,
    .sc-scene__label {
        opacity: 1;
        animation: none;
        stroke-dashoffset: 0;
    }

    .sc-hero__left.is-loaded .sc-hero__eyebrow,
    .sc-hero__left.is-loaded .sc-hero__content .sc-hero__headline,
    .sc-hero__left.is-loaded .sc-hero__sub,
    .sc-hero__left.is-loaded .sc-hero__ctas,
    .sc-hero__left.is-loaded .sc-hero__trust {
        animation: none;
    }
}


/* ============================================================
   STATS BAR
   ============================================================ */

.sc-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background-color: var(--sc-color-dark);
    padding: 40px;
    flex-wrap: wrap;
}

.sc-stats-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 48px;
    position: relative;
}

/* Dividers between stats */
.sc-stats-bar__item+.sc-stats-bar__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.12);
}

.sc-stats-bar__number {
    font-size: 36px;
    font-weight: 800;
    color: var(--sc-color-white);
    line-height: 1;
    letter-spacing: -0.02em;
}

.sc-stats-bar__label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


/* ============================================================
   CLIENT LOGOS BAR — INFINITE MARQUEE
   ============================================================ */

/*
 * Section shell.
 * The 2px red top border anchors this section to the brand and
 * creates a clean visual break from the stats bar above it.
 */
.sc-logos-bar {
    border-top: 2px solid var(--sc-color-primary);
    background-color: var(--sc-color-white);
    padding: var(--sc-spacing-lg) 0;
    overflow: hidden;
}

/*
 * Label — present but subordinate.
 * This is deliberately not a heading: it labels context, it does
 * not compete with the hero or section titles above.
 */
.sc-logos-bar__label {
    font-family: var(--sc-font-primary);
    font-size: 11px;
    font-weight: 500;
    color: var(--sc-color-grey-mid);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-align: center;
    margin: 0 0 var(--sc-spacing-md) 0;
    padding: 0 var(--sc-spacing-md);
}

/*
 * Viewport — clips the track and dissolves logos in/out at both edges.
 * --mask-fade is overridden at smaller breakpoints below.
 * We use mask-image (not overflow alone) so the fade is silky rather
 * than a hard cut, and the loop seam becomes completely invisible.
 */
.sc-logos-bar__viewport {
    overflow: hidden;
    position: relative;
    width: 100%;
    --mask-fade: 120px;
    -webkit-mask-image: linear-gradient(to right,
            transparent,
            black var(--mask-fade),
            black calc(100% - var(--mask-fade)),
            transparent);
    mask-image: linear-gradient(to right,
            transparent,
            black var(--mask-fade),
            black calc(100% - var(--mask-fade)),
            transparent);
}

/*
 * Track — infinite scrolling container.
 * translateX(-50%) moves by exactly one logo set's width, landing
 * at the start of the duplicate clone — seamless loop, no JS.
 */
.sc-logos-bar__track {
    display: flex;
    align-items: center;
    gap: var(--sc-spacing-xl);
    width: max-content;
    animation: sc-marquee 45s linear infinite;
}

@keyframes sc-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-logos-bar__track {
        animation: none;
    }
}

/*
 * Logo wrapper — each logo (img or SVG placeholder) sits inside
 * a span so the selector works for both node types.
 */
.sc-logos-bar__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.sc-logos-bar__logo img,
.sc-logos-bar__logo svg {
    height: 100px;
    width: auto;
    display: block;
}


/* ============================================================
   RESPONSIVE — TABLET & MOBILE
   ============================================================ */

/*
 * Tablet — logos bar only.
 * Shrink logo height and gap slightly; tighten the fade so it
 * doesn't eat too much of a narrower viewport.
 */
@media (max-width: 1024px) {

    /* Hero — stack at tablet */
    .sc-hero {
        flex-direction: column;
        min-height: auto;
    }

    .sc-hero__left {
        width: 100%;
        flex: none;
    }

    .sc-hero__right {
        width: 100%;
        flex: none;
        min-height: 55vh;
    }

    /* Logos bar — tighten at tablet */
    .sc-logos-bar {
        padding: var(--sc-spacing-md) 0;
    }

    .sc-logos-bar__viewport {
        --mask-fade: 72px;
    }

    .sc-logos-bar__track {
        gap: var(--sc-spacing-lg);
    }

    .sc-logos-bar__logo img,
    .sc-logos-bar__logo svg {
        height: 30px;
    }
}

@media (max-width: 768px) {
    .sc-hero {
        flex-direction: column;
        min-height: auto;
    }

    .sc-hero__left {
        width: 100%;
        flex: none;
        min-height: 70vh;
    }

    .sc-hero__content {
        padding: 56px 24px;
    }

    .sc-hero__ctas {
        flex-direction: column;
        width: 100%;
    }

    .sc-hero__ctas .sc-btn {
        width: 100%;
        justify-content: center;
    }

    .sc-hero__right {
        width: 100%;
        flex: none;
        min-height: 55vh;
    }

    .sc-stats-bar {
        padding: 32px 16px;
    }

    .sc-stats-bar__item {
        padding: 16px 24px;
        flex: 0 0 50%;
    }

    .sc-stats-bar__item+.sc-stats-bar__item::before {
        display: none;
    }

    /* Logos bar — mobile */
    .sc-logos-bar {
        padding: var(--sc-spacing-sm) 0;
    }

    .sc-logos-bar__viewport {
        --mask-fade: 40px;
    }

    .sc-logos-bar__track {
        gap: var(--sc-spacing-md);
        /* Speed up slightly on mobile — 45s feels too slow on a small screen */
        animation-duration: 30s;
    }

    .sc-logos-bar__logo img,
    .sc-logos-bar__logo svg {
        height: 24px;
    }
}