/* =========================================================
   Section 5 — Why Nexora / Differentiation
   Scoped under .nx-why. Reuses --nx-* tokens.
   Does not modify Sections 1–4.
   ========================================================= */

.nx-why {
    position: relative;
    background: var(--nx-bg);
    color: var(--nx-text);
    padding: clamp(5rem, 12vh, 9rem) 0;
    overflow: hidden;
    border-top: 1px solid var(--nx-border);
}

.nx-why__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 45% 35% at 8% 20%, rgba(79, 124, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 92% 70%, rgba(79, 124, 255, 0.04) 0%, transparent 55%);
}

.nx-why__inner {
    position: relative;
    z-index: 1;
}

/* Header */
.nx-why__header {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    grid-template-areas:
        "eyebrow eyebrow"
        "title description";
    column-gap: clamp(2rem, 5vw, 4.5rem);
    row-gap: 1.15rem;
    align-items: end;
    margin-bottom: clamp(3.5rem, 7vh, 5.5rem);
}

.nx-why__eyebrow {
    grid-area: eyebrow;
}

.nx-why__title {
    grid-area: title;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4.4vw, 3.75rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--nx-text);
    max-width: 14em;
}

.nx-why__description {
    grid-area: description;
    margin: 0;
    max-width: 32rem;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.65;
    color: var(--nx-text-muted);
    padding-bottom: 0.25rem;
}

/* Differentiator list */
.nx-why__list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--nx-border);
    position: relative;
    margin-bottom: clamp(3.5rem, 7vh, 5.5rem);
}

.nx-why__list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        rgba(79, 124, 255, 0.35) 0%,
        rgba(79, 124, 255, 0.08) 55%,
        transparent 100%
    );
    opacity: 0.7;
    pointer-events: none;
}

.nx-why__item {
    position: relative;
    border-bottom: 1px solid var(--nx-border);
    transition: background-color 0.3s ease;
}

.nx-why__item-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
    grid-template-areas: "content preview";
    column-gap: 2rem;
    align-items: start;
    padding: clamp(1.5rem, 3vh, 2.15rem) 0 clamp(1.5rem, 3vh, 2.15rem) 1.5rem;
}

.nx-why__item-content {
    grid-area: content;
    min-width: 0;
}

.nx-why__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--nx-accent);
    opacity: 0;
    transform: scaleY(0.35);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nx-why__item:hover {
    background: linear-gradient(90deg, rgba(18, 21, 26, 0.7) 0%, rgba(13, 15, 18, 0.15) 100%);
}

.nx-why__item:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.nx-why__item:focus-within {
    background: linear-gradient(90deg, rgba(18, 21, 26, 0.7) 0%, rgba(13, 15, 18, 0.15) 100%);
}

.nx-why__item:focus-within::before {
    opacity: 1;
    transform: scaleY(1);
}

.nx-why__item-top {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 0.75rem 1rem;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.nx-why__number {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--nx-text-muted);
    font-variant-numeric: tabular-nums;
}

.nx-why__item-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 2.6vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--nx-text);
    transition: transform 0.3s ease;
}

.nx-why__item:hover .nx-why__item-title {
    transform: translateX(6px);
}

.nx-why__item-copy {
    margin: 0 0 0.85rem;
    max-width: 40rem;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--nx-text-muted);
}

.nx-why__keywords {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(146, 153, 165, 0.75);
    transition: color 0.3s ease;
}

.nx-why__keywords span {
    white-space: nowrap;
}

.nx-why__keywords span:not(:last-child)::after {
    content: '·';
    margin: 0 0.55rem;
    color: rgba(146, 153, 165, 0.4);
}

.nx-why__item:hover .nx-why__keywords {
    color: var(--nx-text-muted);
}

.nx-why__preview {
    grid-area: preview;
    align-self: center;
    justify-self: end;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        border-color 0.3s ease;
    pointer-events: none;
}

.nx-why__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.9) brightness(0.92);
}

.nx-why__item:hover .nx-why__preview,
.nx-why__item:focus-within .nx-why__preview {
    opacity: 1;
    transform: translateY(0) scale(1);
    border-color: rgba(79, 124, 255, 0.28);
}

/* Closing brand statement */
.nx-why__closing {
    margin: 0;
    padding: clamp(2rem, 4vh, 2.75rem) 0 0;
    border-top: 1px solid var(--nx-border);
    max-width: 42rem;
}

.nx-why__closing-lines {
    margin: 0 0 1.35rem;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: var(--nx-text-muted);
}

.nx-why__closing-lead {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--nx-text);
}

/* Reveals */
.nx-why .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.65s ease,
        transform 0.65s ease;
}

.nx-why .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .nx-why .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .nx-why__item,
    .nx-why__item::before,
    .nx-why__item-title,
    .nx-why__keywords,
    .nx-why__preview {
        transition: none !important;
    }

    .nx-why__item:hover .nx-why__item-title {
        transform: none;
    }

    .nx-why__preview {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .nx-why__item-inner {
        grid-template-columns: 1fr;
        grid-template-areas: "content";
    }

    .nx-why__preview {
        display: none;
    }
}

@media (max-width: 900px) {
    .nx-why__header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "eyebrow"
            "title"
            "description";
        row-gap: 1rem;
        margin-bottom: 3rem;
    }

    .nx-why__title {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .nx-why {
        padding: clamp(4.5rem, 10vh, 6rem) 0;
    }

    .nx-why__list::before {
        display: none;
    }

    .nx-why__item {
        padding-left: 0;
    }

    .nx-why__item-inner {
        padding-left: 1.25rem;
    }

    .nx-why__item-top {
        grid-template-columns: 2.25rem minmax(0, 1fr);
        gap: 0.5rem 0.75rem;
    }

    .nx-why__item-title {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
    }

    .nx-why__item:hover .nx-why__item-title {
        transform: none;
    }

    .nx-why__item-copy {
        margin-bottom: 0.7rem;
    }

    .nx-why__keywords {
        font-size: 0.78rem;
    }

    .nx-why__keywords span:not(:last-child)::after {
        margin: 0 0.4rem;
    }

    .nx-why__list {
        margin-bottom: 2.75rem;
    }
}

@media (max-width: 430px) {
    .nx-why__title {
        font-size: clamp(2rem, 8.5vw, 2.35rem);
    }

    .nx-why__closing-lead {
        font-size: 1.45rem;
    }
}
