﻿/* =====================================================================
   SOLUTIONS MORPH
   Contained section version.
   No 230vh / 300vh sticky runway.
   The animation happens inside this section only.
   ===================================================================== */

.solutions-morph-section {
    position: relative;
    height: 96svh;
    min-height: 760px;
    max-height: 980px;
    overflow: hidden;
    isolation: isolate;
    background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.06), transparent 52%), hsl(var(--secondary));
}

.morph-pin {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.morph-stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    --intro-op: 1;
    --arc-op: 0;
}

/* -----------------------------
   Center intro
   ----------------------------- */

.morph-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: min(34rem, calc(100% - 2rem));
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    opacity: var(--intro-op);
    transition: opacity 0.32s ease;
}

.morph-intro__eyebrow {
    display: inline-block;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: hsl(var(--muted-foreground));
}

.morph-intro__title {
    margin-top: 1.5rem;
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: clamp(1.9rem, 5vw, 3.1rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: hsl(var(--foreground));
}

.morph-intro__hint {
    margin-top: 1.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: hsl(var(--muted-foreground));
    animation: morphHintPulse 2.4s ease-in-out infinite;
}

@keyframes morphHintPulse {
    0%, 100% {
        opacity: 0.42;
    }

    50% {
        opacity: 1;
    }
}

/* -----------------------------
   Arc text
   ----------------------------- */

.morph-arc-copy {
    position: absolute;
    top: 10%;
    left: 50%;
    z-index: 2;
    width: min(42rem, calc(100% - 2rem));
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    opacity: var(--arc-op);
    transition: opacity 0.32s ease;
}

.morph-arc-copy__title {
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: hsl(var(--foreground));
}

.morph-arc-copy__text {
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: hsl(var(--muted-foreground));
}

/* -----------------------------
   Cards
   ----------------------------- */

.morph-cards {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.morph-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12.5rem;
    height: 16.5rem;
    margin-left: -6.25rem;
    margin-top: -8.25rem;
    --tx: 0px;
    --ty: 0px;
    --rot: 0deg;
    --scale: 1;
    --op: 1;
    transform: translate3d(var(--tx), var(--ty), 0) rotate(var(--rot)) scale(var(--scale));
    transform-style: preserve-3d;
    opacity: var(--op);
    will-change: transform, opacity;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
}

.morph-card__inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.09), transparent 38%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    padding: 0.95rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 44px -34px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.morph-card:hover .morph-card__inner,
.morph-card:focus-visible .morph-card__inner,
.morph-card.is-active .morph-card__inner {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 50px -28px rgba(255, 255, 255, 0.22);
}

.morph-card.is-active .morph-card__inner {
    transform: translateY(-2px);
}

.morph-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.morph-card__badge {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.28rem 0.55rem;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}

.morph-card__icon {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.03);
    color: hsl(var(--foreground));
}

.morph-card__title {
    margin-top: 0.85rem;
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
}

.morph-card__desc {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    line-height: 1.5;
    color: hsl(var(--muted-foreground));
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.morph-card__metric {
    margin-top: auto;
    padding-top: 0.7rem;
}

    .morph-card__metric span {
        display: inline-flex;
        border-left: 2px solid rgba(255, 255, 255, 0.3);
        padding-left: 0.5rem;
        font-family: Space Grotesk, system-ui, sans-serif;
        font-size: 0.74rem;
        font-weight: 600;
        color: hsl(var(--foreground));
    }

.morph-card__button {
    margin-top: 0.65rem;
    display: inline-flex;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--foreground));
    padding-inline: 0.65rem;
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: 0.68rem;
    color: hsl(var(--background));
    transition: transform 0.18s ease, background 0.18s ease;
}

    .morph-card__button:hover {
        transform: translateY(-1px);
        background: rgba(255, 255, 255, 0.88);
    }

/* -----------------------------
   Modal
   ----------------------------- */

.morph-modal[hidden] {
    display: none;
}

.morph-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.morph-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
}

.morph-modal__panel {
    position: relative;
    width: min(42rem, 100%);
    max-height: min(42rem, calc(100vh - 2.5rem));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.5rem;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.11), transparent 36%), linear-gradient(180deg, hsl(var(--card)), hsl(var(--background)));
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -34px rgba(0, 0, 0, 0.95);
    animation: morphModalEnter 0.24s ease-out;
    outline: none;
}

.morph-modal__close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 1.35rem;
    line-height: 1;
}

.morph-modal__label {
    display: inline-flex;
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    background: hsl(var(--background));
    padding: 0.35rem 0.8rem;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}

.morph-modal__title {
    margin-top: 1.25rem;
    padding-right: 2rem;
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: hsl(var(--foreground));
}

.morph-modal__desc,
.morph-modal__detail {
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: hsl(var(--muted-foreground));
}

.morph-modal__metric {
    margin-top: 1.4rem;
    display: grid;
    gap: 0.35rem;
    border: 1px solid hsl(var(--border));
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.035);
    padding: 1rem;
}

    .morph-modal__metric span,
    .morph-modal__modules p {
        font-size: 0.68rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: hsl(var(--muted-foreground));
    }

    .morph-modal__metric strong {
        font-family: Space Grotesk, system-ui, sans-serif;
        font-size: 1.2rem;
        color: hsl(var(--foreground));
    }

.morph-modal__modules {
    margin-top: 1.4rem;
}

    .morph-modal__modules div {
        margin-top: 0.75rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .morph-modal__modules span {
        border: 1px solid hsl(var(--border));
        border-radius: 999px;
        background: hsl(var(--background));
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
        color: hsl(var(--foreground));
    }

.morph-modal__footer {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid hsl(var(--border));
    padding-top: 1.25rem;
}

    .morph-modal__footer span {
        font-size: 0.85rem;
        color: hsl(var(--muted-foreground));
    }

    .morph-modal__footer a {
        display: inline-flex;
        height: 2.6rem;
        align-items: center;
        justify-content: center;
        border-radius: 0.75rem;
        background: hsl(var(--foreground));
        padding-inline: 1rem;
        font-family: Space Grotesk, system-ui, sans-serif;
        font-size: 0.85rem;
        color: hsl(var(--background));
    }

body.morph-modal-open {
    overflow: hidden;
}

@keyframes morphModalEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

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

/* -----------------------------
   Mobile
   ----------------------------- */

@media (max-width: 767px) {
    .solutions-morph-section {
        height: 90svh;
        min-height: 640px;
        max-height: none;
    }

    .morph-arc-copy {
        top: 8%;
    }

    .morph-card {
        width: 10rem;
        height: 13.5rem;
        margin-left: -5rem;
        margin-top: -6.75rem;
    }

    .morph-card__title {
        font-size: 0.82rem;
    }

    .morph-card__desc {
        font-size: 0.66rem;
        -webkit-line-clamp: 2;
    }

    .morph-intro__title {
        font-size: 1.8rem;
    }

    .morph-arc-copy__title {
        font-size: 1.7rem;
    }

    .morph-arc-copy__text {
        font-size: 0.84rem;
    }

    .morph-modal__panel {
        padding: 1.2rem;
    }
}

/* -----------------------------
   Reduced motion fallback
   ----------------------------- */

@media (prefers-reduced-motion: reduce) {
    .solutions-morph-section {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .morph-pin {
        position: relative;
        height: auto;
        padding: 4rem 0;
        overflow: visible;
    }

    .morph-stage {
        height: auto;
    }

    .morph-intro,
    .morph-arc-copy {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        opacity: 1;
        width: min(42rem, calc(100% - 2rem));
        margin: 0 auto;
        padding: 2rem 0;
    }

    .morph-cards {
        position: relative;
        height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
        gap: 1rem;
        padding: 1.5rem;
    }

    .morph-card {
        position: relative;
        top: auto;
        left: auto;
        margin: 0;
        width: auto;
        height: auto;
        min-height: 15rem;
        transform: none;
        opacity: 1;
    }

    .morph-card__inner,
    .morph-modal__panel {
        transition: none;
        animation: none;
    }
}
