/* =====================================================================
   LEXION HOMEPAGE
   HEADER + CINEMATIC COVER-FLOW + PLATFORM LAUNCHER
   =====================================================================

   FILE
   ----
   CSS/carousel.css


   RESPONSIBILITY
   --------------
   This file owns ONLY:

   1. Homepage header presentation
   2. Homepage showcase background
   3. Cinematic carousel layout
   4. Carousel visual states
   5. Carousel drag / settling presentation
   6. Carousel arrows and dots
   7. Platform intro
   8. Application launcher
   9. Responsive rules for the above


   IMPORTANT ARCHITECTURE
   ----------------------
   carousel.css
       Owns layout, appearance and transition timing.

   js/carousel.js
       Owns carousel state, autoplay, dragging, pointer events,
       keyboard controls and navigation.

   PNG carousel artwork
       Owns the illuminated artwork border / glow.

   index.html
       Owns structure and content only.


   DO NOT
   ------
   - Add another .lx-carousel-slide implementation later in this file.
   - Add JavaScript-driven values here as duplicate CSS states.
   - Add another carousel "fix" at the bottom of this file.
   - Add purple halo effects around carousel artwork.
   - Add CSS illuminated borders to carousel PNGs.
   - Duplicate responsive rules outside the RESPONSIVE section.

   If a carousel design changes, MODIFY the existing rule.
   Do not append an overriding copy.

   ===================================================================== */



/* =====================================================================
   01. HEADER
   ===================================================================== */

.lx-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    min-height: 82px;

    background:
        rgba(3, 6, 18, 0.92);

    border-bottom:
        1px solid
        rgba(122, 107, 255, 0.26);

    backdrop-filter:
        blur(22px);

    -webkit-backdrop-filter:
        blur(22px);

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.22);
}


.lx-header .lx-nav {
    min-height: 82px;

    display: flex;
    align-items: center;

    gap: 30px;
}



/* ---------------------------------------------------------------------
   Brand
   --------------------------------------------------------------------- */

.lx-brand {
    display: flex;
    align-items: center;

    flex: 0 0 auto;

    gap: 14px;

    color: #ffffff;

    text-decoration: none;
}


.lx-brand-mark {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;
}


.lx-brand-mark img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    filter:
        drop-shadow(
            0 0 10px
            rgba(144, 76, 255, 0.75)
        );
}


.lx-brand-name {
    color: #ffffff;

    font-size: 1.75rem;
    font-weight: 800;

    line-height: 1;

    letter-spacing: 0.055em;
}



/* ---------------------------------------------------------------------
   Desktop navigation
   --------------------------------------------------------------------- */

.lx-desktop-nav {
    display: flex;
    align-items: center;

    gap:
        clamp(
            22px,
            2.8vw,
            46px
        );

    margin-inline: auto;
}


.lx-nav-link {
    color:
        rgba(
            255,
            255,
            255,
            0.88
        );

    font-size: 0.98rem;
    font-weight: 500;

    text-decoration: none;

    transition:
        color 180ms ease;
}


.lx-nav-link:hover {
    color: #ffffff;
}



/* ---------------------------------------------------------------------
   Header actions
   --------------------------------------------------------------------- */

.lx-nav-actions {
    display: flex;
    align-items: center;

    flex: 0 0 auto;

    gap: 16px;
}


.lx-language-button,
.lx-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;

    color:
        rgba(
            255,
            255,
            255,
            0.90
        );

    background:
        transparent;

    cursor: pointer;
}


.lx-language-button {
    gap: 8px;

    font-size: 0.95rem;
}


.lx-search-button {
    width: 42px;
    height: 42px;

    padding: 0;

    border-radius: 50%;

    transition:
        background 180ms ease;
}


.lx-search-button:hover {
    background:
        rgba(
            255,
            255,
            255,
            0.07
        );
}


.lx-header .lx-button-primary {
    min-width: 142px;
    min-height: 48px;

    border-radius: 14px;

    box-shadow:
        0 0 8px
        rgba(255, 255, 255, 0.45),

        0 0 20px
        rgba(108, 67, 255, 0.65),

        inset 0 1px 0
        rgba(255, 255, 255, 0.28);
}



/* =====================================================================
   02. SHOWCASE
   ===================================================================== */

.lx-showcase {
    position: relative;

    overflow: hidden;

    padding:
        14px 0
        clamp(
            70px,
            7vw,
            110px
        );

    background:
        radial-gradient(
            ellipse at 50% -5%,
            rgba(104, 65, 255, 0.18),
            transparent 40%
        ),

        radial-gradient(
            ellipse at 90% 28%,
            rgba(63, 96, 255, 0.08),
            transparent 28%
        ),

        linear-gradient(
            180deg,
            #050817 0%,
            #02040d 100%
        );
}


.lx-showcase-container {
    position: relative;

    z-index: 1;

    width: 100%;
    max-width: none;

    padding-inline: 0;
}



/* =====================================================================
   03. CAROUSEL CONTAINER
   ===================================================================== */

.lx-carousel {
    position: relative;

    width: 100%;

    margin:
        0 auto
        22px;

    outline: none;
}



/* =====================================================================
   04. CAROUSEL STAGE
   =====================================================================

   This is intentionally a CINEMATIC viewport.

   The source artwork may be 16:9, but the visible carousel is wider
   and shallower. object-fit: cover performs the intentional crop.

   Desktop target:
   approximately 2.4:1 to 2.7:1 depending on viewport width.

   ===================================================================== */

.lx-carousel-stage {
    position: relative;

    width: 100%;

    height:
        clamp(
            430px,
            34vw,
            610px
        );

    overflow: hidden;

    background:
        transparent;

    cursor: grab;


    /*
     * Browser may continue normal vertical scrolling.
     * Horizontal movement is handled by carousel.js.
     */

    touch-action: pan-y;
}


.lx-carousel-stage.is-dragging {
    cursor: grabbing;
}



/* =====================================================================
   05. BASE SLIDE
   =====================================================================

   IMPORTANT:
   JavaScript assumes these desktop positions:

       Previous = -113%
       Active   =  -50%
       Next     =   13%

   Difference between carousel slots = 63%.

   If these values are changed, update SLIDE_SPACING and the base
   positions in js/carousel.js as well.

   ===================================================================== */

.lx-carousel-slide {
    position: absolute;

    top: 50%;
    left: 50%;

    width:
        min(
            88vw,
            1500px
        );

    height:
        calc(
            100% - 20px
        );

    opacity: 0;
    visibility: hidden;

    transform:
        translate(
            -50%,
            -50%
        )
        scale(0.84);

    transform-origin:
        center center;

    filter:
        brightness(0.34)
        saturate(0.70);

    pointer-events: none;

    transition:
        transform
        750ms
        cubic-bezier(
            .2,
            .8,
            .2,
            1
        ),

        opacity
        600ms
        ease,

        filter
        600ms
        ease;
}



/* ---------------------------------------------------------------------
   Active / centre slide
   --------------------------------------------------------------------- */

.lx-carousel-slide.is-active {
    z-index: 5;

    opacity: 1;
    visibility: visible;

    transform:
        translate(
            -50%,
            -50%
        )
        scale(1);

    filter:
        brightness(1)
        saturate(1.06)
        contrast(1.02);

    pointer-events: auto;
}



/* ---------------------------------------------------------------------
   Previous slide
   --------------------------------------------------------------------- */

.lx-carousel-slide.is-prev {
    z-index: 2;

    opacity: 0.48;
    visibility: visible;

    transform:
        translate(
            -113%,
            -50%
        )
        scale(0.86);

    filter:
        brightness(0.30)
        saturate(0.68);
}



/* ---------------------------------------------------------------------
   Next slide
   --------------------------------------------------------------------- */

.lx-carousel-slide.is-next {
    z-index: 2;

    opacity: 0.48;
    visibility: visible;

    transform:
        translate(
            13%,
            -50%
        )
        scale(0.86);

    filter:
        brightness(0.30)
        saturate(0.68);
}



/* =====================================================================
   06. CAROUSEL IMAGE
   =====================================================================

   IMPORTANT:
   The PNG artwork owns its illuminated border / glow.

   CSS deliberately does NOT add:
   - purple outer halo
   - illuminated purple border
   - glass overlay
   - violet bloom

   CSS adds only neutral depth beneath the artwork.

   ===================================================================== */

.lx-carousel-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    /*
     * Individual slides can override this later with:
     *
     * style="--focus-y: 42%;"
     *
     * This lets us control cinematic cropping per image.
     */

    object-position:
        center
        var(--focus-y, 50%);

    border: 0;

    border-radius: 26px;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;

    /*
     * Prevent the browser's native image dragging.
     * Pointer interaction belongs to the carousel stage.
     */

    pointer-events: none;

    /*
     * Neutral depth only.
     * NO purple halo here.
     */

    box-shadow:
        0 24px 55px
        rgba(0, 0, 0, 0.55);
}


.lx-carousel-slide.is-active
.lx-carousel-image {
    box-shadow:
        0 28px 65px
        rgba(0, 0, 0, 0.62);
}


.lx-carousel-slide.is-prev
.lx-carousel-image,

.lx-carousel-slide.is-next
.lx-carousel-image {
    box-shadow:
        0 18px 40px
        rgba(0, 0, 0, 0.50);
}



/* ---------------------------------------------------------------------
   Explicitly disable old generated effects
   ---------------------------------------------------------------------

   These selectors remain intentionally so old HTML does not need to
   change yet.

   The element:
       .lx-carousel-edge-glow

   may remain in index.html, but it renders nothing.

   --------------------------------------------------------------------- */

.lx-carousel-edge-glow {
    display: none;
}


.lx-carousel-slide.is-active::after {
    display: none;
}



/* =====================================================================
   07. LIVE DRAG STATES
   =====================================================================

   During pointer movement:
       JavaScript writes inline transform / opacity / filter values.

   Therefore transitions MUST be disabled while dragging or the cards
   will lag behind the pointer.

   ===================================================================== */

.lx-carousel-stage.is-dragging
.lx-carousel-slide {
    transition: none;
}



/* ---------------------------------------------------------------------
   Successful slide release
   ---------------------------------------------------------------------

   Used when the user crosses the distance threshold or performs
   a sufficiently fast flick.

   --------------------------------------------------------------------- */

.lx-carousel-stage.is-settling
.lx-carousel-slide {
    transition:
        transform
        560ms
        cubic-bezier(
            .22,
            .72,
            .18,
            1
        ),

        opacity
        460ms
        ease,

        filter
        460ms
        ease;
}



/* ---------------------------------------------------------------------
   Rejected gesture / snap-back
   ---------------------------------------------------------------------

   Used when the pointer is released before the slide threshold.

   This deliberately returns more softly than a successful transition.

   --------------------------------------------------------------------- */

.lx-carousel-stage.is-snapback
.lx-carousel-slide {
    transition:
        transform
        720ms
        cubic-bezier(
            .16,
            .82,
            .22,
            1
        ),

        opacity
        560ms
        ease,

        filter
        560ms
        ease;
}



/* =====================================================================
   08. CAROUSEL ARROWS
   ===================================================================== */

.lx-carousel-arrow {
    position: absolute;

    z-index: 20;

    top: 50%;

    width: 62px;
    height: 62px;

    display: grid;
    place-items: center;

    padding: 0;

    transform:
        translateY(-50%);

    border:
        1px solid
        rgba(155, 121, 255, 0.82);

    border-radius: 50%;

    color: #ffffff;

    background:
        rgba(
            5,
            7,
            22,
            0.90
        );

    font-size: 42px;
    font-weight: 200;

    line-height: 1;

    cursor: pointer;

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    box-shadow:
        0 12px 38px
        rgba(0, 0, 0, 0.60);

    transition:
        transform 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}


.lx-carousel-prev {
    left: 2.8vw;
}


.lx-carousel-next {
    right: 2.8vw;
}


.lx-carousel-arrow:hover {
    transform:
        translateY(-50%)
        scale(1.08);

    border-color:
        rgba(
            215,
            196,
            255,
            0.95
        );

    background:
        rgba(
            82,
            47,
            205,
            0.96
        );

    box-shadow:
        0 14px 42px
        rgba(0, 0, 0, 0.65);
}


.lx-carousel-arrow:focus-visible {
    outline:
        2px solid
        rgba(
            199,
            180,
            255,
            0.95
        );

    outline-offset: 4px;
}



/* =====================================================================
   09. CAROUSEL DOTS
   ===================================================================== */

.lx-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 11px;

    margin-top: 8px;
}


.lx-carousel-dot {
    width: 10px;
    height: 10px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background:
        rgba(
            185,
            193,
            220,
            0.42
        );

    cursor: pointer;

    transition:
        transform 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}


.lx-carousel-dot:hover {
    transform:
        scale(1.2);

    background:
        rgba(
            220,
            210,
            255,
            0.90
        );
}


.lx-carousel-dot.is-active {
    background:
        #9251ff;

    box-shadow:
        0 0 14px
        rgba(
            143,
            76,
            255,
            0.90
        );
}


.lx-carousel-dot:focus-visible {
    outline:
        2px solid
        rgba(
            199,
            180,
            255,
            0.95
        );

    outline-offset: 4px;
}



/* =====================================================================
   10. PLATFORM INTRO
   ===================================================================== */

.lx-showcase-intro {
    width:
        min(
            900px,
            calc(100% - 40px)
        );

    margin:
        14px auto
        42px;

    text-align: center;
}


.lx-showcase-label {
    margin:
        0 0 8px;

    color:
        #a99cff;

    font-size: 0.78rem;
    font-weight: 600;

    line-height: 1.3;

    letter-spacing: 0.18em;

    text-transform: uppercase;
}


.lx-showcase-title {
    margin: 0;

    color:
        #ffffff;

    font-size:
        clamp(
            2.25rem,
            4.4vw,
            4.5rem
        );

    font-weight: 800;

    line-height: 1;

    letter-spacing: -0.045em;

    text-align: center;

    text-transform: uppercase;
}


.lx-showcase-title span {
    display: inline;

    color: transparent;

    background:
        linear-gradient(
            90deg,
            #ffffff 0%,
            #d7c9ff 25%,
            #b172ff 58%,
            #8268ff 100%
        );

    background-clip: text;
    -webkit-background-clip: text;

    -webkit-text-fill-color:
        transparent;
}


.lx-showcase-description {
    max-width: 720px;

    margin:
        22px auto 0;

    color:
        rgba(
            222,
            226,
            245,
            0.72
        );

    font-size:
        clamp(
            1rem,
            1.25vw,
            1.15rem
        );

    line-height: 1.65;

    text-align: center;
}



/* =====================================================================
   11. APPLICATION LAUNCHER
   ===================================================================== */

.lx-app-launcher {
    width:
        min(
            1460px,
            calc(100% - 80px)
        );

    margin:
        0 auto;

    display: grid;

    grid-template-columns:
        repeat(
            12,
            minmax(0, 1fr)
        );

    align-items: start;

    gap:
        clamp(
            10px,
            1.5vw,
            26px
        );

    padding:
        12px 0
        4px;

    background:
        transparent;

    border: 0;
}



/* ---------------------------------------------------------------------
   Launcher item
   --------------------------------------------------------------------- */

.lx-launcher-app {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: flex-start;

    gap: 10px;

    padding:
        10px 4px;

    border-radius: 16px;

    color:
        rgba(
            245,
            247,
            255,
            0.88
        );

    text-decoration: none;

    transition:
        transform 200ms ease,
        color 200ms ease,
        background 200ms ease;
}


.lx-launcher-app:hover {
    transform:
        translateY(-6px);

    color:
        #ffffff;

    background:
        rgba(
            255,
            255,
            255,
            0.035
        );
}



/* ---------------------------------------------------------------------
   Launcher icon
   --------------------------------------------------------------------- */

.lx-launcher-icon {
    width:
        clamp(
            54px,
            4.6vw,
            72px
        );

    height:
        clamp(
            54px,
            4.6vw,
            72px
        );

    display: grid;
    place-items: center;

    flex: 0 0 auto;
}


.lx-launcher-icon img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    filter:
        drop-shadow(
            0 8px 12px
            rgba(0, 0, 0, 0.42)
        )
        drop-shadow(
            0 0 8px
            rgba(105, 83, 255, 0.18)
        );

    transition:
        transform 220ms ease,
        filter 220ms ease;
}


.lx-launcher-app:hover
.lx-launcher-icon img {
    transform:
        translateY(-2px)
        scale(1.06);

    filter:
        drop-shadow(
            0 10px 14px
            rgba(0, 0, 0, 0.48)
        )
        drop-shadow(
            0 0 14px
            rgba(130, 94, 255, 0.34)
        );
}



/* ---------------------------------------------------------------------
   Notes icon
   --------------------------------------------------------------------- */

.lx-launcher-notes
.lx-launcher-icon img {
    filter:
        drop-shadow(
            0 8px 12px
            rgba(0, 0, 0, 0.45)
        )
        drop-shadow(
            0 0 13px
            rgba(255, 170, 30, 0.30)
        );
}



/* ---------------------------------------------------------------------
   Launcher label
   --------------------------------------------------------------------- */

.lx-launcher-name {
    display: block;

    max-width: 100%;

    overflow: hidden;

    color: inherit;

    font-size: 0.78rem;
    font-weight: 500;

    line-height: 1.25;

    text-align: center;

    text-overflow: ellipsis;

    white-space: nowrap;
}



/* =====================================================================
   12. RESPONSIVE — LARGE TABLET / SMALL DESKTOP
   ===================================================================== */

@media (max-width: 1200px) {

    .lx-carousel-stage {
        height: 39vw;

        min-height: 380px;
    }


    .lx-carousel-slide {
        width: 90vw;
    }


    .lx-app-launcher {
        width:
            min(
                calc(100% - 40px),
                1000px
            );

        grid-template-columns:
            repeat(
                6,
                minmax(0, 1fr)
            );

        row-gap: 22px;
    }

}



/* =====================================================================
   13. RESPONSIVE — TABLET
   ===================================================================== */

@media (max-width: 900px) {

    .lx-header .lx-nav {
        min-height: 70px;
    }


    .lx-desktop-nav {
        display: none;
    }


    .lx-brand-name {
        font-size: 1.4rem;
    }


    .lx-brand-mark {
        width: 42px;
        height: 42px;
    }


    .lx-carousel-stage {
        height: 48vw;

        min-height: 340px;
    }


    .lx-carousel-slide {
        width: 94vw;
    }


    /*
     * IMPORTANT:
     *
     * These positions differ slightly from desktop.
     * carousel.js currently uses desktop interpolation during
     * the live drag, but final resting positions use these rules.
     */

    .lx-carousel-slide.is-prev {
        transform:
            translate(
                -111%,
                -50%
            )
            scale(0.84);
    }


    .lx-carousel-slide.is-next {
        transform:
            translate(
                11%,
                -50%
            )
            scale(0.84);
    }


    .lx-carousel-arrow {
        width: 48px;
        height: 48px;

        font-size: 32px;
    }


    .lx-carousel-prev {
        left: 2vw;
    }


    .lx-carousel-next {
        right: 2vw;
    }


    .lx-showcase-title {
        font-size:
            clamp(
                2.1rem,
                7vw,
                3.5rem
            );
    }

}



/* =====================================================================
   14. RESPONSIVE — MOBILE
   ===================================================================== */

@media (max-width: 650px) {

    .lx-showcase {
        padding-top: 8px;
    }


    .lx-carousel {
        margin-bottom: 18px;
    }


    /*
     * Mobile gets a taller frame because the desktop cinematic
     * ratio would become too shallow on a narrow screen.
     */

    .lx-carousel-stage {
        height: 58vw;

        min-height: 270px;
    }


    .lx-carousel-slide {
        width: 96vw;

        height:
            calc(
                100% - 12px
            );
    }


    .lx-carousel-image {
        border-radius: 16px;
    }


    .lx-carousel-arrow {
        width: 42px;
        height: 42px;

        font-size: 28px;
    }


    .lx-carousel-prev {
        left: 8px;
    }


    .lx-carousel-next {
        right: 8px;
    }


    .lx-showcase-intro {
        width:
            calc(
                100% - 28px
            );

        margin-bottom: 28px;
    }


    .lx-showcase-description {
        font-size: 0.95rem;
    }


    .lx-app-launcher {
        width:
            calc(
                100% - 24px
            );

        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );

        gap:
            16px 8px;
    }


    .lx-launcher-icon {
        width: 52px;
        height: 52px;
    }


    .lx-launcher-name {
        font-size: 0.72rem;
    }

}



/* =====================================================================
   15. RESPONSIVE — SMALL MOBILE
   ===================================================================== */

@media (max-width: 420px) {

    .lx-app-launcher {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }

}



/* =====================================================================
   16. ACCESSIBILITY
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {

    .lx-carousel-slide,
    .lx-carousel-arrow,
    .lx-carousel-dot,
    .lx-launcher-app,
    .lx-launcher-icon img {
        transition: none !important;
    }

}
