
/* =========================================================
   THEWEALTHIFY - PREMIUM SERVICES SECTION
   Scope: .tw-services-section only
   Palette: Navy / Emerald / Warm Gold
========================================================= */

.tw-services-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 88px 0 76px !important;
    background:
        radial-gradient(
            circle at 8% 15%,
            rgba(22, 132, 91, .08),
            transparent 28%
        ),
        radial-gradient(
            circle at 92% 80%,
            rgba(201, 164, 92, .11),
            transparent 28%
        ),
        linear-gradient(135deg, #f8fbf9 0%, #ffffff 52%, #f1f6f3 100%);
}

/* Decorative background detail */
.tw-services-section::before,
.tw-services-section::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border: 1px solid rgba(22, 132, 91, .09);
    border-radius: 50%;
}

.tw-services-section::before {
    width: 390px;
    height: 390px;
    top: -220px;
    right: -100px;
}

.tw-services-section::after {
    width: 300px;
    height: 300px;
    bottom: -190px;
    left: -100px;
}

/* -------------------------
   SECTION HEADER
------------------------- */

.tw-services-section .tw-services-header {
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
}

.tw-services-section .tw-services-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 17px;
    color: #16845b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2.5px;
}

.tw-services-section .tw-eyebrow-line {
    width: 28px;
    height: 2px;
    border-radius: 5px;
    background: #c9a45c;
}

.tw-services-section .tw-services-title {
    margin: 0 0 16px !important;
    color: #092d49 !important;
    font-size: clamp(30px, 3.4vw, 43px) !important;
    font-weight: 800 !important;
    line-height: 1.18 !important;
    letter-spacing: -1.2px;
}

.tw-services-section .tw-services-title span {
    color: #16845b;
}

.tw-services-section .tw-services-intro {
    max-width: 640px;
    margin: 0 auto !important;
    color: #647785 !important;
    font-size: 15px;
    line-height: 1.8;
}

/* -------------------------
   SERVICES GRID
   Desktop: 3 + 2 centered
------------------------- */

.tw-services-section .tw-services-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.tw-services-section .tw-service-card {
    position: relative;
    grid-column: span 2;
    min-width: 0;
    min-height: 275px;
    padding: 27px 25px 23px !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(9, 45, 73, .09) !important;
    border-radius: 17px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 8px 26px rgba(9, 45, 73, .055);
    overflow: hidden;
    transition:
        transform .35s ease,
        box-shadow .35s ease,
        border-color .35s ease,
        background .35s ease;
    animation: twServiceReveal .7s ease both;
}

/* Center the last two cards */
.tw-services-section .tw-service-card:nth-child(4) {
    grid-column: 2 / span 2;
}

.tw-services-section .tw-service-card:nth-child(5) {
    grid-column: 4 / span 2;
}

/* Gold and emerald top detail */
.tw-services-section .tw-service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 25px;
    width: 55px;
    height: 3px;
    border-radius: 0 0 5px 5px;
    background: linear-gradient(90deg, #16845b, #c9a45c);
    transition: width .35s ease;
}

.tw-services-section .tw-service-card::after {
    content: "";
    position: absolute;
    right: -65px;
    bottom: -75px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(22, 132, 91, .045);
    transition: transform .4s ease;
    pointer-events: none;
}

/* -------------------------
   CARD TOP / ICON
------------------------- */

.tw-services-section .tw-service-top {
    width: 100%;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tw-services-section .tw-service-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(22, 132, 91, .15);
    border-radius: 15px;
    color: #16845b;
    background: linear-gradient(145deg, #eff7f2, #ffffff);
    font-size: 23px;
    transition:
        transform .35s ease,
        color .35s ease,
        background .35s ease;
}

.tw-services-section .tw-service-number {
    color: #c9a45c;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

/* -------------------------
   CARD CONTENT
------------------------- */

.tw-services-section .tw-service-content {
    position: relative;
    z-index: 1;
}

.tw-services-section .tw-service-category {
    display: block;
    margin-bottom: 8px;
    color: #16845b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.tw-services-section .tw-service-card h3 {
    margin: 0 0 11px !important;
    color: #092d49 !important;
    font-size: 19px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}

.tw-services-section .tw-service-card p {
    margin: 0 0 20px !important;
    color: #687b88 !important;
    font-size: 13px !important;
    line-height: 1.75 !important;
}

/* -------------------------
   EXPLORE LINK
------------------------- */

.tw-services-section .tw-service-link {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(9, 45, 73, .09);
    color: #16845b !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    transition: color .25s ease;
}

.tw-services-section .tw-service-link span {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #16845b;
    background: #edf6f0;
    font-size: 17px;
    transition:
        transform .3s ease,
        background .3s ease,
        color .3s ease;
}

/* -------------------------
   HOVER INTERACTION
------------------------- */

.tw-services-section .tw-service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(22, 132, 91, .35) !important;
    background: #ffffff !important;
    box-shadow: 0 19px 42px rgba(9, 45, 73, .12);
}

.tw-services-section .tw-service-card:hover::before {
    width: 95px;
}

.tw-services-section .tw-service-card:hover::after {
    transform: scale(1.5);
}

.tw-services-section .tw-service-card:hover .tw-service-icon {
    transform: translateY(-3px) rotate(-4deg);
    color: #ffffff;
    background: linear-gradient(135deg, #16845b, #0d6848);
}

.tw-services-section .tw-service-card:hover .tw-service-link {
    color: #092d49 !important;
}

.tw-services-section .tw-service-card:hover .tw-service-link span {
    transform: translateX(4px);
    color: #ffffff;
    background: #16845b;
}

/* -------------------------
   SECTION FOOTER
------------------------- */

.tw-services-section .tw-services-footer {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.tw-services-section .tw-footer-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #16845b;
    box-shadow: 0 0 0 4px rgba(22, 132, 91, .10);
}

.tw-services-section .tw-services-footer p {
    margin: 0 !important;
    color: #71818c;
    font-size: 12px;
    letter-spacing: .2px;
}

/* -------------------------
   ENTRANCE ANIMATION
------------------------- */

@keyframes twServiceReveal {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tw-services-section .tw-service-card:nth-child(1) {
    animation-delay: .05s;
}

.tw-services-section .tw-service-card:nth-child(2) {
    animation-delay: .12s;
}

.tw-services-section .tw-service-card:nth-child(3) {
    animation-delay: .19s;
}

.tw-services-section .tw-service-card:nth-child(4) {
    animation-delay: .26s;
}

.tw-services-section .tw-service-card:nth-child(5) {
    animation-delay: .33s;
}

/* -------------------------
   TABLET
------------------------- */

@media (max-width: 991px) {

    .tw-services-section {
        padding: 70px 0 60px !important;
    }

    .tw-services-section .tw-services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .tw-services-section .tw-service-card,
    .tw-services-section .tw-service-card:nth-child(4),
    .tw-services-section .tw-service-card:nth-child(5) {
        grid-column: auto;
    }

    .tw-services-section .tw-service-card {
        min-height: 265px;
    }

    .tw-services-section .tw-service-card:last-child {
        grid-column: 1 / -1;
    }
}

/* -------------------------
   MOBILE
------------------------- */

@media (max-width: 600px) {

    .tw-services-section {
        padding: 55px 0 48px !important;
    }

    .tw-services-section .tw-services-header {
        margin-bottom: 30px;
        padding: 0 8px;
    }

    .tw-services-section .tw-services-eyebrow {
        font-size: 10px;
        letter-spacing: 1.7px;
        gap: 8px;
    }

    .tw-services-section .tw-eyebrow-line {
        width: 18px;
    }

    .tw-services-section .tw-services-title {
        font-size: 30px !important;
        letter-spacing: -.7px;
    }

    .tw-services-section .tw-services-intro {
        font-size: 13px;
        line-height: 1.7;
    }

    .tw-services-section .tw-services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tw-services-section .tw-service-card,
    .tw-services-section .tw-service-card:last-child {
        grid-column: auto;
        min-height: 0;
        padding: 22px 20px !important;
    }

    .tw-services-section .tw-service-top {
        margin-bottom: 17px;
    }

    .tw-services-section .tw-service-icon {
        width: 49px;
        height: 49px;
        font-size: 20px;
    }

    .tw-services-section .tw-service-card h3 {
        font-size: 18px !important;
    }

    .tw-services-section .tw-services-footer {
        margin-top: 25px;
        text-align: center;
    }
}

/* -------------------------
   ACCESSIBILITY
------------------------- */

@media (prefers-reduced-motion: reduce) {

    .tw-services-section .tw-service-card,
    .tw-services-section .tw-service-card *,
    .tw-services-section .tw-service-card::before,
    .tw-services-section .tw-service-card::after {
        animation: none !important;
        transition: none !important;
    }
}



/* Keep service cards above decorative animation */
.tw-services-section .container {
    position: relative;
    z-index: 1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .tw-services-section::before,
    .tw-services-section::after {
        animation: none;
    }
}

/* =====================================================
   THEWEALTHIFY – FLOWING EMERALD WAVE BACKGROUND
===================================================== */

.tw-services-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f7f4, #ffffff, #edf5f0);
}

/* Wave layer */
.tw-services-section::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    width: 160%;
    height: 260px;
    left: -30%;
    top: 35%;
    border-radius: 45%;
    background: linear-gradient(
        90deg,
        rgba(22, 132, 91, 0.17),
        rgba(22, 132, 91, 0.06),
        rgba(201, 164, 92, 0.13),
        rgba(22, 132, 91, 0.16)
    );
    filter: blur(35px);
    transform: rotate(-8deg);
    animation: twWaveFlow 12s ease-in-out infinite alternate;
}

/* Second flowing wave */
.tw-services-section::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    width: 150%;
    height: 200px;
    left: -25%;
    top: 52%;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        rgba(22, 132, 91, 0.10),
        rgba(201, 164, 92, 0.12),
        rgba(22, 132, 91, 0.14)
    );
    filter: blur(42px);
    transform: rotate(7deg);
    animation: twWaveFlowReverse 16s ease-in-out infinite alternate;
}

@keyframes twWaveFlow {
    0% {
        transform: translateX(-5%) translateY(-15px) rotate(-8deg);
    }
    100% {
        transform: translateX(8%) translateY(25px) rotate(-3deg);
    }
}

@keyframes twWaveFlowReverse {
    0% {
        transform: translateX(7%) translateY(20px) rotate(7deg);
    }
    100% {
        transform: translateX(-7%) translateY(-20px) rotate(2deg);
    }
}

/* Keep content above the waves */
.tw-services-section .container {
    position: relative;
    z-index: 1;
}

/* Mobile adjustment */
@media (max-width: 767px) {
    .tw-services-section::before {
        height: 180px;
        top: 30%;
    }

    .tw-services-section::after {
        height: 150px;
        top: 60%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .tw-services-section::before,
    .tw-services-section::after {
        animation: none;
    }
}
