
/* ==========================================
   TERRAIFA - SOLUTIONS WORKFLOW
   ========================================== */

/* Same background as end of About section */

.section-solutions {
    position: relative;
    overflow: hidden;
    padding: clamp(38px, 4vw, 55px) 0
             clamp(125px, 11vw, 170px);
    background: #0b1b2c;
}

/* ==========================================
   CONTINUOUS FLOW FROM ABOUT
   ========================================== */

.solutions-flow-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 56px;
    pointer-events: none;
}

.solutions-flow-entry__line {
    position: relative;
    display: block;
    width: 2px;
    height: 34px;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(91, 210, 177, .23);
}

.solutions-flow-entry__line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        #28a5a3,
        #65d7b4
    );
    transform: scaleY(0);
    transform-origin: top;
}

.solutions-flow-entry__arrow {
    display: block;
    color: #76dfbf;
    font-size: 20px;
    line-height: 22px;
}

.solutions-flow-entry.is-flow-active
.solutions-flow-entry__line::after {
    animation: solutions-path-grow .65s ease forwards;
}

@keyframes solutions-path-grow {
    to {
        transform: scaleY(1);
    }
}

/* ==========================================
   COMPACT CONTINUATION HEADING
   ========================================== */

.section-solutions .solutions-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    margin-bottom: 32px;
    text-align: center;
}

.section-solutions .solutions-heading .section-eyebrow {
    justify-content: center;
    margin: 0 0 3px;
}

.section-solutions .section-title {
    max-width: 860px;
    margin: 0;
    font-size: clamp(30px, 3vw, 43px);
    line-height: 1.18;
}

.section-solutions .solutions-heading__hint {
    max-width: 600px;
    margin: 0;
    color: #a9d1ce;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
}


/* ==========================================
   CONNECTED WORKFLOW GRID
   ========================================== */

.section-solutions .solutions-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 46px;
    align-items: stretch;
}

/* Connecting line behind the cards */

.section-solutions .solutions-grid::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(74, 184, 135, .25),
        rgba(67, 207, 186, .8),
        rgba(44, 165, 201, .3)
    );
    pointer-events: none;
}

/* Override previous large solution cards */

.section-solutions .solution-card,
.section-solutions .solution-card:last-child {
    position: relative;
    z-index: 1;
    display: block;
    grid-column: auto;
    width: 100%;
    height: 285px;
    min-height: 0;
    min-width: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.section-solutions .solution-card:hover,
.section-solutions .solution-card:last-child:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

/* Workflow arrows */

.section-solutions .solution-card:not(:last-child)::after {
    content: "→";
    position: absolute;
    z-index: 3;
    top: 50%;
    right: -37px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(120, 220, 192, .4);
    border-radius: 50%;
    background: #153746;
    color: #83e1c4;
    font-size: 20px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ==========================================
   FLIP CARD
   ========================================== */

.solution-flip {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: #ffffff;
    font: inherit;
    text-align: center;
    cursor: pointer;
    perspective: 1200px;
}

.solution-flip:focus-visible {
    outline: 3px solid #71dabb;
    outline-offset: 5px;
}

.solution-flip__inner {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.2, .75, .2, 1);
}

.solution-card.is-flipped .solution-flip__inner {
    transform: rotateY(180deg);
}

/* Both sides */

.solution-flip__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 23px;
    overflow: hidden;
    border: 1px solid rgba(139, 219, 199, .19);
    border-radius: 20px;
    box-shadow: 0 13px 32px rgba(0, 10, 22, .12);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}

/* ==========================================
   FRONT FACE
   ========================================== */

.solution-flip__face--front {
    gap: 22px;
    background: linear-gradient(
        145deg,
        #1b3447,
        #152b3c
    );
}

.solution-flip:hover .solution-flip__face--front {
    border-color: rgba(117, 225, 189, .48);
    box-shadow: 0 18px 38px rgba(0, 10, 22, .22);
}

.solution-flip__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 94px;
    height: 94px;
    border: 1px solid rgba(110, 222, 191, .3);
    border-radius: 25px;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(87, 206, 174, .18),
            transparent 75%
        ),
        rgba(51, 150, 139, .11);
    color: #7bd9bd;
    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.solution-flip__icon svg {
    width: 54px;
    height: 54px;
}

.solution-flip:hover .solution-flip__icon {
    transform: translateY(-4px);
    box-shadow: 0 0 28px rgba(65, 195, 160, .12);
}

.solution-flip__title {
    display: block;
    max-width: 295px;
    color: #ffffff;
    font-size: clamp(20px, 1.75vw, 25px);
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -.025em;
}

/* ==========================================
   BACK FACE
   ========================================== */

.solution-flip__face--back {
    gap: 11px;
    background: linear-gradient(
        150deg,
        #194354,
        #153244
    );
    transform: rotateY(180deg);
}

.solution-flip__status {
    color: #91dfc8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.solution-flip__back-title {
    color: #ffffff;
    font-size: 19px;
    font-weight: 750;
    line-height: 1.3;
}

.solution-flip__description {
    display: block;
    max-width: 310px;
    color: #d0e0e5;
    font-size: 13px;
    line-height: 1.55;
}

.solution-flip__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 3px;
}

.solution-flip__tags > span {
    padding: 6px 8px;
    border: 1px solid rgba(145, 227, 204, .2);
    border-radius: 6px;
    background: rgba(116, 211, 184, .12);
    color: #b7e8d7;
    font-size: 10px;
    line-height: 1.3;
}

.solution-flip__return {
    margin-top: 4px;
    color: #86dabe;
    font-size: 11px;
    font-weight: 600;
}

/* Technical Foundation is deferred */

.section-solutions .solutions-foundation[hidden] {
    display: none;
}

/* ==========================================
   TABLET / NARROW DESKTOP
   ========================================== */

@media (max-width: 930px) {

    .section-solutions .solutions-heading {
        gap: 11px;
    }

    .section-solutions .solutions-grid {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 45px;
    }

    .section-solutions .solutions-grid::before {
        top: 8%;
        bottom: 8%;
        left: 50%;
        right: auto;
        width: 2px;
        height: auto;
    }

    .section-solutions .solution-card,
    .section-solutions .solution-card:last-child {
        width: min(100%, 510px);
        height: 270px;
    }

    .section-solutions .solution-card:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: -37px;
        left: calc(50% - 14px);
        transform: rotate(90deg);
    }
}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 620px) {

    .section-solutions {
        padding: 36px 0 105px;
    }

    .section-solutions .section-title {
        font-size: clamp(31px, 8vw, 39px);
    }

    .section-solutions .solutions-heading {
        margin-bottom: 28px;
    }

    .section-solutions .solution-card,
    .section-solutions .solution-card:last-child {
        height: 300px;
        padding: 0;
    }

    .solution-flip__face {
        padding: 20px;
    }

    .solution-flip__icon {
        width: 82px;
        height: 82px;
    }

    .solution-flip__icon svg {
        width: 48px;
        height: 48px;
    }

    .solution-flip__title {
        font-size: 21px;
    }

    .solution-flip__description {
        font-size: 13px;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .solution-flip__inner {
        transition: none;
    }

    .solution-flip__icon,
    .solution-flip__face {
        transition: none;
    }

    .solution-flip:hover .solution-flip__icon {
        transform: none;
    }
}


/* ==========================================
   TRANSITION TO RESEARCH SECTION
   ========================================== */

.solutions-bottom-wave {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: -1px;
    left: 0;
    height: clamp(90px, 9vw, 140px);
    pointer-events: none;
}

.solutions-bottom-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}
