/* Investor Step — cinematic presentation layer. Loaded only when the cinematic plugin is active for the request. */

/* ---------- Loader and page transitions (pure CSS; JS only moves two variables) ---------- */
html.cin-js body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: #404040;
    clip-path: inset(var(--cin-t, 0%) 0 var(--cin-b, 0%) 0);
    pointer-events: none;
    /* If the script never runs, the page is still revealed. */
    animation: cin-failsafe 0.6s cubic-bezier(0.76, 0, 0.24, 1) 4s forwards;
}

/* First page of a session: the logo rises and fades in, an orange line fills beneath it, then the curtain lifts.
   Only the logo fades (through a same-grey veil layer): fading the whole layer let the page show through for the
   first ~0.3s, so the page flashed before the splash appeared. */
html.cin-js.cin-first body::before {
    background:
        linear-gradient(rgba(64, 64, 64, var(--cin-veil, 0)), rgba(64, 64, 64, var(--cin-veil, 0))),
        #404040 var(--cin-logo) center / min(56vw, 320px) auto no-repeat;
    animation: cin-logo-in 1.1s cubic-bezier(0.2, 0.75, 0.2, 1) both, cin-failsafe 0.7s cubic-bezier(0.76, 0, 0.24, 1) 5s forwards;
}

/* Later pages: no full-screen curtain. The header stays put; only the page body and footer wait for the script
   (so blocks it is about to animate never flash), then fade in. Failsafe: shown after 3s if the script never runs. */
html.cin-js:not(.cin-first) body::before {
    content: none;
}

html.cin-js:not(.cin-first) body > :is(main, [data-elementor-type="wp-page"], .elementor-location-footer) {
    transition: opacity 0.4s ease;
}

html.cin-js:not(.cin-first):not(.cin-ready) body > :is(main, [data-elementor-type="wp-page"], .elementor-location-footer) {
    opacity: 0;
    animation: cin-show 0.4s ease 3s forwards;
}

@keyframes cin-show {
    to { opacity: 1; }
}

@property --cin-veil {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

html.cin-js.cin-first:not(.cin-ready) body::after {
    content: "";
    position: fixed;
    z-index: 99999;
    inset-inline-start: 50%;
    top: calc(50% + min(12vw, 72px));
    width: min(44vw, 240px);
    height: 2px;
    margin-inline-start: calc(min(44vw, 240px) / -2);
    background: linear-gradient(90deg, #ffad4d, #f7931d);
    transform-origin: right center;
    animation: cin-loader-line 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.4s both;
    pointer-events: none;
}

html.cin-js.cin-ready body::before {
    animation: none;
}

@keyframes cin-failsafe {
    to { clip-path: inset(0 0 100% 0); }
}

/* The logo is a background image, so it is "moved" by sliding its position while the veil above it clears. */
@keyframes cin-logo-in {
    from { background-position: center, center calc(50% + 28px); --cin-veil: 1; }
    30% { --cin-veil: 0; }
    to { background-position: center, center; --cin-veil: 0; }
}

@keyframes cin-loader-line {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ---------- Smooth scrolling (Lenis) ---------- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* ---------- Hand the existing reveal systems over to GSAP (no double animation) ---------- */
.is-cinematic .elementor-invisible {
    visibility: visible !important;
}

/* Elementor keeps a hidden clone of the sticky header as a spacer; nothing inside it may become visible. */
.is-cinematic .elementor-sticky__spacer,
.is-cinematic .elementor-sticky__spacer * {
    visibility: hidden !important;
}

.is-cinematic .elementor-element.animated {
    animation: none !important;
}

.is-cinematic .investor-company.is-motion-ready .is-reveal,
.is-cinematic .investor-home-services.is-motion-ready .is-reveal,
.is-cinematic.home .elementor-element-314cdd3.investor-legacy-services--motion-ready .investor-legacy-service-card,
.is-cinematic.page-id-50 .investor-services--motion-ready .elementor-element-1cdacca.investor-service-card:not(.is-visible) {
    opacity: 1;
    transform: none;
    transition: box-shadow 300ms ease, border-color 300ms ease, background-color 300ms ease;
}

/* Elements driven by GSAP must not also ease their transform/opacity in CSS. */
.is-cinematic .cin-anim {
    transition-property: background-color, border-color, box-shadow, color, filter !important;
}

/* ---------- Headings revealed word by word (never by letter: Arabic letters must stay joined) ---------- */
cin-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-block: 0.28em;
    margin-block: -0.28em;
}

cin-text {
    display: inline-block;
    will-change: transform;
}

/* ---------- Header on scroll + reading progress ---------- */
/* Scrolled header: the dark bar turns into frosted glass. Elementor sets the colour via a CSS variable, so override that. */
.is-cinematic .elementor-location-header .e-con.e-parent {
    transition: box-shadow 450ms ease, background-color 450ms ease;
}

.is-cinematic .elementor-location-header .e-con.e-parent.cin-scrolled {
    --background-color: rgba(64, 64, 64, 0.78);
    background-color: rgba(64, 64, 64, 0.78);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
}

/* Panels and card images start clipped; GSAP opens the mask. */
.cin-mask {
    will-change: clip-path;
}

.cin-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 99990;
    height: 3px;
    background: linear-gradient(90deg, #ffad4d, #f7931d);
    transform: scaleX(0);
    transform-origin: right center;
    pointer-events: none;
}

/* ---------- Hero 3D scene (the original slider stays underneath as content, controls and fallback) ---------- */
.is-cinematic .investor-hero {
    overflow: hidden;
    background: #404040;
}

/* Above every stacked slide (absolute, z 0/1, opaque over the navy track) so a swap never paints over the scene.
   Only the active slide's copy column (z 4) and the controls (z 5) sit above the canvas. */
.cin-hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 900ms ease;
}

.cin-webgl .cin-hero-canvas {
    opacity: 1;
}

/* Once the scene is up, the flat slide images step aside (they remain the links and the screen-reader content). */
.cin-webgl .investor-hero__image {
    opacity: 0;
    transition: opacity 600ms ease;
}

/* Desktop: the scene is taller than the flat banner, and the slide copy sits in a side column beside the screens. */
@media (min-width: 1025px) {
    .is-cinematic.cin-webgl-ready .investor-hero__track {
        aspect-ratio: auto;
        min-height: clamp(520px, 62vh, 720px);
    }

    .cin-webgl .investor-hero__mobile-copy {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        position: absolute;
        inset-inline-start: 5%;
        top: 0;
        bottom: 0;
        z-index: 4;
        width: 30%;
        max-width: 420px;
        padding: 0;
        text-align: start;
        pointer-events: none;
    }

    /* The slide box itself stays under the canvas; only its copy column is lifted (absolute children escape the
       slide's stacking order because the slide has no z-index of its own while inactive and z 1 while active). */
    .cin-webgl .investor-hero__slide.is-active {
        z-index: 1;
    }

    .cin-webgl .investor-hero__mobile-copy > * {
        pointer-events: auto;
    }

    .cin-webgl .investor-hero__mobile-copy h2 {
        margin: 0 0 14px;
        font-size: clamp(30px, 2.6vw, 42px);
        line-height: 1.25;
        color: #ffffff;
        text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
    }

    .cin-webgl .investor-hero__mobile-copy h2::before {
        content: "INVESTOR STEP";
        display: block;
        margin-bottom: 14px;
        font-family: "Cairo", Arial, sans-serif;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.28em;
        color: #ffad4d;
    }

    .cin-webgl .investor-hero__mobile-copy p {
        margin: 0 0 24px;
        font-size: 17px;
        line-height: 1.8;
        color: #e2dfd8;
    }

    .cin-webgl .investor-hero__mobile-copy .investor-hero__cta {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-height: 50px;
        padding: 0 28px;
        border-radius: 999px;
        background: #f7931d;
        color: #ffffff;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 12px 30px rgba(247, 147, 29, 0.35);
    }

    /* Only the active slide's copy is shown; it fades/slides in on each swap. */
    .cin-webgl .investor-hero__slide:not(.is-active) .investor-hero__mobile-copy {
        opacity: 0;
        transform: translateX(-24px);
        pointer-events: none;
        transition: opacity 500ms ease, transform 600ms ease;
    }

    /* Starts right as the screens begin to move, so the headline is never absent mid-swap. */
    .cin-webgl .investor-hero__slide.is-active .investor-hero__mobile-copy {
        opacity: 1;
        transform: none;
        transition: opacity 600ms ease 120ms, transform 800ms cubic-bezier(0.2, 0.75, 0.2, 1) 120ms;
    }

    /* The flat slides are stacked absolutely; with the scene up, keep each one filling the track for the copy column. */
    .cin-webgl .investor-hero__slide {
        inset: 0;
    }
}

.is-cinematic .investor-hero__control,
.is-cinematic .investor-hero__dots {
    z-index: 5;
}

/* ---------- Inner-page hero: replaces the gold strip above «خدماتنا» and «من نحن» ---------- */
.is-cinematic .elementor-element-e8e16a8.e-atomic-element,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element {
    position: relative;
    overflow: hidden;
    padding-block: 96px 88px !important;
    background-color: #404040 !important;
    background-image:
        radial-gradient(ellipse 60% 70% at 86% 0%, rgba(247, 147, 29, 0.42), rgba(247, 147, 29, 0) 70%),
        radial-gradient(ellipse 50% 60% at 10% 100%, rgba(120, 90, 50, 0.3), rgba(120, 90, 50, 0) 70%),
        linear-gradient(180deg, #474747 0%, #3a3a3a 100%) !important;
}

/* floor lines + dust, drawn with gradients so no image is needed */
.is-cinematic .elementor-element-e8e16a8.e-atomic-element::before,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    background:
        repeating-linear-gradient(90deg, rgba(247, 147, 29, 0.09) 0 1px, transparent 1px 72px),
        linear-gradient(180deg, rgba(247, 147, 29, 0) 0%, rgba(247, 147, 29, 0.06) 100%);
    transform: perspective(600px) rotateX(58deg);
    transform-origin: 50% 100%;
    pointer-events: none;
}

.is-cinematic .elementor-element-e8e16a8.e-atomic-element::after,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 30%, rgba(255, 173, 77, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 28% 70%, rgba(255, 173, 77, 0.7) 0 1px, transparent 2px),
        radial-gradient(circle at 41% 22%, rgba(255, 173, 77, 0.8) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 55% 80%, rgba(255, 173, 77, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 63% 40%, rgba(255, 173, 77, 0.85) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 15%, rgba(255, 173, 77, 0.7) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 84% 62%, rgba(255, 173, 77, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 93% 35%, rgba(255, 173, 77, 0.8) 0 1px, transparent 2px),
        var(--cin-mark) 4% 50% / auto 78% no-repeat;
    opacity: 0.9;
    pointer-events: none;
    /* the logo mark alone is dimmed by compositing: dust stays bright, mark stays faint */
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 30%, #000 42%);
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 30%, #000 42%);
}

.is-cinematic .elementor-element-e8e16a8.e-atomic-element .elementor-heading-title,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element .elementor-heading-title {
    position: relative;
    z-index: 1;
    color: #ffffff !important;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.is-cinematic .elementor-element-e8e16a8.e-atomic-element .elementor-heading-title::before,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element .elementor-heading-title::before {
    content: "INVESTOR STEP";
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.28em;
    color: #ffad4d;
}

.is-cinematic .elementor-element-e8e16a8.e-atomic-element .elementor-heading-title::after,
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element .elementor-heading-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 3px;
    margin: 18px auto 0;
    border-radius: 2px;
    background: #f7931d;
}

/* ---------- About hero: a clean consulting image with no duplicated title ---------- */
.is-cinematic .elementor-element-1e6b4d1.e-atomic-element {
    min-height: clamp(320px, 38vw, 520px);
    padding: 0 !important;
    background-color: #171717 !important;
    background-image:
        linear-gradient(180deg, rgba(7, 7, 7, 0.04) 0%, rgba(7, 7, 7, 0.3) 100%),
        url("https://investor-step.com/wp-content/uploads/2026/08/ChatGPT-Image-18-%D8%A3%D8%BA%D8%B3%D8%B7%D8%B3-2026%D8%8C-05_32_27-%D9%85.png") !important;
    background-position: center 22% !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

.is-cinematic .elementor-element-1e6b4d1.e-atomic-element::before {
    inset: 0;
    height: auto;
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.34), rgba(10, 10, 10, 0.04) 58%, rgba(247, 147, 29, 0.08)) !important;
    transform: none;
}

.is-cinematic .elementor-element-1e6b4d1.e-atomic-element::after {
    display: none;
}

.is-cinematic .elementor-element-1e6b4d1.e-atomic-element .elementor-element-9b6bdf6 {
    display: none !important;
}

@media (max-width: 767px) {
    .is-cinematic .elementor-element-1e6b4d1.e-atomic-element {
        min-height: 350px;
        background-position: 39% 18% !important;
        background-size: auto 180% !important;
    }
}

/* ---------- Cards: depth, light and parallax ---------- */
.cin-tilt {
    transform-style: preserve-3d;
    will-change: transform;
}

.cin-glare {
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 55%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms ease;
}

.cin-tilt:hover > .cin-glare {
    opacity: 1;
}

/* ---------- Buttons: light sweep ---------- */
.is-cinematic .elementor-button,
.is-cinematic .is-company-button {
    position: relative;
    overflow: hidden;
}

.is-cinematic .elementor-button::after,
.is-cinematic .is-company-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.32) 50%, rgba(255, 255, 255, 0) 65%);
    transform: translateX(-120%);
    transition: transform 700ms cubic-bezier(0.2, 0.75, 0.2, 1);
    pointer-events: none;
}

.is-cinematic .elementor-button:hover::after,
.is-cinematic .elementor-button:focus-visible::after,
.is-cinematic .is-company-button:hover::after,
.is-cinematic .is-company-button:focus-visible::after {
    transform: translateX(120%);
}

/* ---------- Accessibility: no motion layer at all when the visitor asks for less motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html.cin-js body::before,
    html.cin-js body::after,
    .cin-progress,
    .cin-hero-canvas {
        display: none !important;
    }

    /* nothing animates, so later pages need not wait for the script */
    html.cin-js:not(.cin-first) body > :is(main, [data-elementor-type="wp-page"], .elementor-location-footer) {
        opacity: 1 !important;
        animation: none !important;
        transition: none !important;
    }
}
