/* =========================================================
   RAVEN THOUGHT / LUNA
========================================================= */

.raven-thought {
    position: relative;
    isolation: isolate;

    padding:
        clamp(6rem, 10vw, 10rem)
        var(--page-gutter)
        clamp(6rem, 9vw, 9rem);

    overflow: hidden;

    background: #000;
    color: #fff;
}

.raven-thought__inner {
    width: min(100%, 82rem);
    margin-inline: auto;
}

/* =========================================================
   HEADER
========================================================= */

.raven-thought__header {
    position: relative;
    z-index: 4;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.raven-thought__title {
    margin: 0;

    font-family: var(--font-display);
    font-size: clamp(3rem, 6.7vw, 6rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.025em;
    text-transform: uppercase;

    will-change:
        transform,
        opacity,
        filter;
}

.raven-thought__subtitle {
    margin:
        clamp(0.7rem, 1.4vw, 1.25rem)
        0
        0;

    color: var(--color-raven-red);

    font-family: var(--font-body);
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.16em;

    will-change:
        transform,
        opacity,
        filter;
}

/* =========================================================
   PRINCIPLES
========================================================= */

.raven-thought__principles {
    position: relative;
    z-index: 5;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;

    gap: clamp(1rem, 2vw, 2rem);

    margin-top: clamp(2.8rem, 5vw, 4.7rem);
    margin-bottom: clamp(2rem, 3.2vw, 3rem);
}

.raven-thought__principle {
    display: block;

    font-family: var(--font-body);
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.05em;
    text-align: center;
    white-space: nowrap;

    will-change:
        transform,
        opacity,
        filter;
}

/* =========================================================
   CAROUSEL
========================================================= */

.luna-carousel {
    position: relative;
}

.luna-carousel__viewport {
    position: relative;

    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    border: 1px solid rgba(255, 255, 255, 0.72);

    background:
        linear-gradient(
            rgba(5, 12, 13, 0.44),
            rgba(5, 12, 13, 0.44)
        ),
        url("../assets/images/luna-moon-background.webp")
        center / cover no-repeat;

    cursor: grab;

    scrollbar-width: none;
    -ms-overflow-style: none;

    overscroll-behavior-x: contain;

    /*
     * Δεν χρησιμοποιούμε native snapping.
     * Το scrollLeft μπορεί να παραμένει σε οποιαδήποτε θέση.
     */
    scroll-snap-type: none;
    scroll-behavior: auto;

    /*
     * Επιτρέπει το κανονικό vertical page scroll στο touch.
     * Το horizontal drag ελέγχεται από το JavaScript.
     */
    touch-action: pan-y;

    box-shadow:
        0 1.5rem 5rem rgba(0, 0, 0, 0.42),
        inset 0 0 5rem rgba(0, 0, 0, 0.2);
}

.luna-carousel__viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.luna-carousel__viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

.luna-carousel__viewport:focus-visible {
    outline: 2px solid var(--color-raven-red);
    outline-offset: 0.35rem;
}

.luna-carousel__track {
    display: flex;

    width: 300%;

    /*
     * Αποτρέπει επιλογή κειμένου κατά το drag.
     */
    user-select: none;
    -webkit-user-select: none;
}

.luna-slide {
    flex: 0 0 calc(100% / 3);

    display: grid;
    grid-template-columns:
        minmax(0, 0.78fr)
        minmax(0, 1.25fr);

    align-items: center;

    gap: clamp(2.5rem, 6vw, 7rem);

    min-height: clamp(21rem, 31vw, 28rem);

    padding:
        clamp(2.5rem, 5vw, 5rem)
        clamp(2rem, 4vw, 3.75rem);

    scroll-snap-align: none;
    scroll-snap-stop: normal;
}

.luna-slide__column {
    min-width: 0;

    color: rgba(255, 255, 255, 0.86);

    font-family: var(--font-body);
    font-size: clamp(1rem, 1.55vw, 1.35rem);
    font-weight: 300;
    line-height: 1.22;
    letter-spacing: -0.025em;
}

.luna-slide__column p {
    margin: 0 0 clamp(0.8rem, 1.5vw, 1.25rem);
}

.luna-slide__column p:last-child {
    margin-bottom: 0;
}

.luna-slide__column strong {
    color: var(--color-raven-red);

    font-size: 1.22em;
    font-weight: 700;
}

.luna-slide__column--result {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 100%;

    text-align: center;
}

.luna-slide__result {
    margin-top: clamp(1rem, 2vw, 1.75rem) !important;

    color: var(--color-raven-red);

    font-size: clamp(1.75rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1.16;
}

/* =========================================================
   MOON PHASE CONTROLS — CORRECTED
========================================================= */

.luna-carousel__controls {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: min(100%, 18rem);

    margin:
        clamp(2.5rem, 4vw, 3.75rem)
        auto
        0;
}

.luna-carousel__dot {
    position: relative;

    z-index: 2;

    flex: 0 0 auto;

    width: clamp(1rem, 1.4vw, 1.35rem);
    aspect-ratio: 1;

    padding: 0;

    overflow: visible;

    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 50%;

    background:
        url("../assets/images/moon.png")
        center / cover no-repeat;

    transform: translateZ(0);

    transition:
        transform 300ms var(--ease-premium),
        border-color 250ms ease,
        box-shadow 300ms ease;
}

/*
 * Dark overlay used to create the moon phase.
 */
.luna-carousel__dot::after {
    content: "";

    position: absolute;
    z-index: 2;

    inset: -1px;

    border-radius: inherit;

    pointer-events: none;
}

/*
 * Active vertical marker, matching the Figma design.
 */
.luna-carousel__dot::before {
    content: "";

    position: absolute;
    z-index: 3;

    top: 50%;
    left: 50%;

    width: 1px;
    height: calc(100% + clamp(0.65rem, 1vw, 0.9rem));

    background: rgba(255, 255, 255, 0.9);

    opacity: 0;

    transform:
        translate(-50%, -50%)
        scaleY(0.7);

    transition:
        opacity 250ms ease,
        transform 350ms var(--ease-premium);
}

/* =========================================================
   PHASE 1 — LEFT SIDE ILLUMINATED
========================================================= */

.luna-carousel__dot--waxing::after {
    background:
        linear-gradient(
            90deg,
            transparent 0%,
            transparent 42%,
            rgba(0, 0, 0, 0.22) 49%,
            rgba(0, 0, 0, 0.82) 61%,
            #000 100%
        );
}

/* =========================================================
   PHASE 2 — FULL MOON
========================================================= */

.luna-carousel__dot--full::after {
    background:
        radial-gradient(
            circle,
            transparent 0%,
            transparent 72%,
            rgba(0, 0, 0, 0.08) 100%
        );
}

/* =========================================================
   PHASE 3 — RIGHT SIDE ILLUMINATED
========================================================= */

.luna-carousel__dot--waning::after {
    background:
        linear-gradient(
            270deg,
            transparent 0%,
            transparent 42%,
            rgba(0, 0, 0, 0.22) 49%,
            rgba(0, 0, 0, 0.82) 61%,
            #000 100%
        );
}

/* =========================================================
   MOON INTERACTIONS
========================================================= */

.luna-carousel__dot:hover {
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.luna-carousel__dot.is-active {
    border-color: rgba(255, 255, 255, 0.92);

    box-shadow:
        0 0 0.45rem rgba(255, 255, 255, 0.15);
}

.luna-carousel__dot.is-active::before {
    opacity: 1;

    transform:
        translate(-50%, -50%)
        scaleY(1);
}

.luna-carousel__dot:focus-visible {
    outline: 2px solid var(--color-raven-red);
    outline-offset: 0.25rem;
}

.luna-carousel__connector {
    position: relative;
    z-index: 1;

    flex: 1 1 auto;

    min-width: 2.5rem;
    height: 1px;

    background: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   CTA
========================================================= */

.raven-thought__cta {
    display: flex;
    align-items: center;
    justify-content: center;

    width: max-content;
    max-width: 100%;

    min-height: clamp(2.15rem, 3vw, 2.65rem);

    margin:
        clamp(1.8rem, 3vw, 2.6rem)
        auto
        0;

    padding:
        0.35rem
        clamp(1rem, 2.3vw, 1.75rem);

    border-radius: 999px;

    background: var(--color-raven-red);
    color: var(--color-white);

    font-family: var(--font-body);
    font-size: clamp(0.78rem, 1.25vw, 1rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;

    transition:
        transform 350ms var(--ease-premium),
        background-color 250ms ease,
        box-shadow 350ms ease;
}

.raven-thought__cta:hover {
    transform: translateY(-0.2rem);

    background: #ff2929;

    box-shadow:
        0 0.8rem 2.3rem rgba(245, 25, 25, 0.2);
}

.raven-thought__cta:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 0.3rem;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
    .luna-slide {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1.25fr);

        gap: clamp(2rem, 4vw, 4rem);
    }

    .luna-carousel__controls {
        width: min(100%, 15rem);
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
    .raven-thought {
        padding:
            clamp(5rem, 18vw, 7rem)
            var(--page-gutter)
            clamp(5rem, 18vw, 7rem);
    }

    .raven-thought__title {
        font-size: clamp(2.7rem, 13vw, 4.2rem);
    }

    .raven-thought__subtitle {
        font-size: clamp(1.8rem, 9vw, 2.75rem);
    }

    .raven-thought__principles {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap:
            clamp(1.4rem, 6vw, 2rem)
            1rem;
    }

    .raven-thought__principle {
        font-size: clamp(1rem, 5vw, 1.35rem);
    }

    .luna-slide {
        grid-template-columns: 1fr;

        align-content: center;

        gap: clamp(1.8rem, 7vw, 2.8rem);

        min-height: clamp(33rem, 140vw, 43rem);

        padding:
            clamp(2.25rem, 9vw, 3.5rem)
            clamp(1.3rem, 6vw, 2rem);
    }

    .luna-slide__column {
        font-size: clamp(0.95rem, 4.5vw, 1.15rem);
    }

    .luna-slide__column--result {
        min-height: auto;
    }

    .luna-slide__result {
        font-size: clamp(1.65rem, 8vw, 2.4rem);
    }

    .luna-carousel__controls {
        width: min(100%, 12rem);
    }

    .luna-carousel__dot {
        width: clamp(1rem, 5vw, 1.25rem);
    }

    .luna-carousel__connector {
        min-width: 2rem;
    }

    .raven-thought__cta {
        font-size: clamp(0.72rem, 3.5vw, 0.95rem);
        white-space: normal;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 430px) {
    .raven-thought__principles {
        column-gap: 0.6rem;
    }

    .raven-thought__principle {
        white-space: normal;
    }

    .luna-slide {
        min-height: 36rem;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .luna-carousel__viewport {
        scroll-behavior: auto;
    }

    .luna-carousel__dot,
    .luna-carousel__dot::before,
    .raven-thought__cta {
        transition: none;
    }
}