/* ============================================================
   MULTI-AGENT SERVICES PAGE
   Design: hero + 6 alternating feature sections,
   each with orbit (1,3,5) or flow-pipeline (2,4,6) visual.

   Color palette (brand):
     Primary   #2f1f4f   deep purple
     Secondary #4949e7   electric blue
     Accent    #d35b74   rose
     Light     #dedede
   ============================================================ */

/* ── Body baseline ─────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--theme-bg-primary, #ffffff);
    color: var(--theme-text-secondary, #1d1d1f);
    overflow-x: hidden;
}

/* ============================================================
   HERO
   ============================================================ */
.mas-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 100px;
    background: linear-gradient(
        180deg,
        var(--theme-bg-primary, #ffffff) 0%,
        var(--theme-bg-secondary, #f5f5f7) 100%
    );
    position: relative;
    overflow: hidden;
}

.mas-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 28%, rgba(73, 73, 231, 0.07) 0%, transparent 58%),
        radial-gradient(circle at 78% 72%, rgba(211, 91, 116, 0.05) 0%, transparent 52%);
    pointer-events: none;
}

.mas-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.mas-kicker {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-accent-secondary, #4949e7);
    margin-bottom: 1.25rem;
}

.mas-hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--theme-text-primary, #2f1f4f);
    margin-bottom: 1.5rem;
    animation: masHeroFadeUp 0.9s ease 0.1s both;
}

.mas-hero-desc {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--theme-text-light, #6e6e73);
    line-height: 1.65;
    max-width: 640px;
    margin: 0 auto;
    animation: masHeroFadeUp 0.9s ease 0.28s both;
}

@keyframes masHeroFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FEATURE SECTIONS  (shared layout — mirrors home.css pattern)
   ============================================================ */
.mas-section {
    min-height: 100vh;
    background: var(--theme-bg-primary, #ffffff);
    display: flex;
    align-items: center;
    overflow-x: hidden;
}

.mas-section--alt {
    background: var(--theme-bg-secondary, #f5f5f7);
}

/* Two-column inner grid */
.mas-section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 6%;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    align-items: center;
    gap: 4rem;
}

/* Reversed: visual left, content right */
.mas-section-inner--reverse {
    grid-template-columns: 1.4fr 1fr;
}

/* ── Content side ──────────────────────────────────────────── */
.mas-content {
    max-width: 480px;
}

.section-kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--theme-accent-secondary, #4949e7);
    margin-bottom: 1rem;
}

.mas-title {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--theme-text-primary, #2f1f4f);
    margin-bottom: 1rem;
}

.mas-desc {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--theme-text-light, #6e6e73);
    line-height: 1.65;
    margin-bottom: 0;
}

/* Works-with block */
.works-with {
    margin-top: 2rem;
}

.works-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--theme-text-light, #6e6e73);
    margin-bottom: 0.75rem;
}

.works-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.works-list li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9375rem;
    color: var(--theme-text-secondary, #1d1d1f);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    margin-left: -0.6rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.works-list li.is-active {
    background: linear-gradient(90deg, rgba(73, 73, 231, 0.12) 0%, rgba(211, 91, 116, 0.08) 100%);
    color: var(--theme-text-primary, #2f1f4f);
    font-weight: 600;
}

.works-list li.is-active i {
    color: #d35b74;
}

body.theme-dark .works-list li.is-active {
    background: linear-gradient(90deg, rgba(73, 73, 231, 0.25) 0%, rgba(211, 91, 116, 0.15) 100%);
    color: var(--theme-text-primary, #d35b74);
}

.works-list li i {
    color: var(--theme-accent-secondary, #4949e7);
    font-size: 0.78rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Visual side ───────────────────────────────────────────── */
.mas-visual {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.visual-container {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ============================================================
   VISUAL: ORBIT  (sections 01, 03, 05)
   Circular satellite nodes revolving around a central icon.
   ============================================================ */
.mas-orbit {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Central node */
.mas-orbit-center {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4949e7 0%, #2f1f4f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.75rem;
    position: relative;
    z-index: 3;
    box-shadow:
        0 0 0 0 rgba(73, 73, 231, 0.4),
        0 15px 50px rgba(73, 73, 231, 0.45),
        inset 0 -20px 40px rgba(47, 31, 79, 0.3);
    animation: masOrbCenterBlue 3s ease-in-out infinite;
}

@keyframes masOrbCenterBlue {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(73, 73, 231, 0.4),
            0 15px 50px rgba(73, 73, 231, 0.45),
            inset 0 -20px 40px rgba(47, 31, 79, 0.3);
    }
    50% {
        transform: scale(1.07);
        box-shadow:
            0 0 0 22px rgba(73, 73, 231, 0),
            0 20px 60px rgba(73, 73, 231, 0.65),
            inset 0 -20px 40px rgba(47, 31, 79, 0.5);
    }
}

/* Accent variant: sections 03 (financial) */
.mas-orbit--accent .mas-orbit-center {
    background: linear-gradient(135deg, #d35b74 0%, #2f1f4f 100%);
    animation: masOrbCenterAccent 3s ease-in-out infinite;
}

@keyframes masOrbCenterAccent {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(211, 91, 116, 0.4),
            0 15px 50px rgba(211, 91, 116, 0.45),
            inset 0 -20px 40px rgba(47, 31, 79, 0.3);
    }
    50% {
        transform: scale(1.07);
        box-shadow:
            0 0 0 22px rgba(211, 91, 116, 0),
            0 20px 60px rgba(211, 91, 116, 0.65),
            inset 0 -20px 40px rgba(47, 31, 79, 0.5);
    }
}

/* Support variant: section 05 */
.mas-orbit--support .mas-orbit-center {
    background: linear-gradient(135deg, #d35b74 0%, #4949e7 100%);
    animation: masOrbCenterAccent 3s ease-in-out infinite;
}

/* Rotating ring */
.mas-orbit-ring {
    position: absolute;
    width: 280px;
    height: 280px;
    border: 3px solid transparent;
    border-top-color: rgba(73, 73, 231, 0.4);
    border-right-color: rgba(211, 91, 116, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: masOrbRing 25s linear infinite;
}

.mas-orbit-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px dashed rgba(73, 73, 231, 0.18);
    animation: masOrbRingRev 35s linear infinite;
}

@keyframes masOrbRing {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes masOrbRingRev {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* Satellite nodes */
.mas-orbit-sat {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #dedede 100%);
    border: 3px solid #4949e7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2f1f4f;
    font-size: 1.75rem;
    top: 50%;
    left: 50%;
    /* position on ring radius */
    transform:
        translate(-50%, -50%)
        rotate(var(--angle))
        translateY(-140px)
        rotate(calc(-1 * var(--angle)));
    box-shadow:
        0 8px 25px rgba(73, 73, 231, 0.28),
        inset 0 -10px 20px rgba(0, 0, 0, 0.04);
    animation: masOrbSatFloat 2.5s ease-in-out infinite;
    animation-delay: var(--delay);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mas-orbit-sat {
    cursor: pointer;
}

.mas-orbit-sat:hover,
.mas-orbit-sat.is-active {
    background: linear-gradient(135deg, #4949e7 0%, #d35b74 100%);
    color: #ffffff;
    border-color: #d35b74;
    transform:
        translate(-50%, -50%)
        rotate(var(--angle))
        translateY(-140px)
        rotate(calc(-1 * var(--angle)))
        scale(1.15);
    box-shadow:
        0 12px 40px rgba(211, 91, 116, 0.5),
        0 0 30px rgba(73, 73, 231, 0.4);
}

@keyframes masOrbSatFloat {
    0%, 100% {
        box-shadow:
            0 8px 25px rgba(73, 73, 231, 0.28),
            inset 0 -10px 20px rgba(0, 0, 0, 0.04);
    }
    50% {
        box-shadow:
            0 14px 38px rgba(73, 73, 231, 0.48),
            inset 0 -10px 20px rgba(0, 0, 0, 0.07);
    }
}

/* Dark-theme satellites */
body.theme-dark .mas-orbit-sat {
    background: linear-gradient(135deg, #3d2e5f 0%, #2f1f4f 100%);
    border-color: #4949e7;
    color: #dedede;
}

body.theme-dark .mas-orbit-sat:hover,
body.theme-dark .mas-orbit-sat.is-active {
    background: linear-gradient(135deg, #4949e7 0%, #d35b74 100%);
    color: #ffffff;
}

/* ============================================================
   SECTION REVEAL ANIMATION  (toggled by IntersectionObserver)
   ============================================================ */
.mas-section .mas-content,
.mas-section .mas-visual {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.mas-section.is-visible .mas-content {
    opacity: 1;
    transform: translateY(0);
}

.mas-section.is-visible .mas-visual {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.mas-cta {
    background: linear-gradient(
        135deg,
        var(--theme-bg-secondary, #f5f5f7) 0%,
        var(--theme-bg-primary, #ffffff) 100%
    );
    padding: 120px 10%;
    text-align: center;
}

.mas-cta-inner {
    max-width: 600px;
    margin: 0 auto;
}

.mas-cta-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--theme-text-primary, #2f1f4f);
    margin-bottom: 1rem;
}

.mas-cta-desc {
    font-size: 1.2rem;
    color: var(--theme-text-light, #6e6e73);
    margin-bottom: 2.5rem;
    line-height: 1.65;
}

.mas-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-accent-secondary, #4949e7);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
    border: 2px solid var(--theme-accent-secondary, #4949e7);
    padding: 0.85rem 2rem;
    border-radius: 8px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.mas-cta-btn:hover {
    background: var(--theme-accent-secondary, #4949e7);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(73, 73, 231, 0.3);
}

/* ============================================================
   FOOTER  (mirrored from aboutus.css)
   ============================================================ */
.footer-minimal {
    background: var(--theme-bg-secondary, #f5f5f7);
    padding: 3rem 10%;
    text-align: center;
    border-top: 1px solid var(--theme-border, rgba(0, 0, 0, 0.05));
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--theme-text-light, #6e6e73);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--theme-accent-secondary, #4949e7);
}

.footer-copy {
    color: var(--theme-text-light, #86868b);
    font-size: 0.8125rem;
    margin: 0;
}

@media (max-width: 768px) {
    .footer-minimal {
        padding: 2rem 5%;
    }
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / small desktop: stack to single column */
@media (max-width: 1024px) {
    .mas-section-inner,
    .mas-section-inner--reverse {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 80px 5%;
    }

    /* All sections: content first, visual second on mobile */
    .mas-section-inner--reverse .mas-visual {
        order: 1;
    }

    .mas-section-inner--reverse .mas-content {
        order: -1;
    }

    .mas-content {
        max-width: 100%;
    }

    .visual-container {
        max-width: 380px;
        margin: 0 auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mas-hero {
        padding: 120px 20px 80px;
    }

    .mas-section-inner,
    .mas-section-inner--reverse {
        padding: 64px 6%;
        gap: 2.5rem;
    }

    /* Smaller orbit on mobile — radius 95px keeps satellites
       inside a ~280px container (95 + 29 half-sat = 124px < 140px half-container) */
    .mas-orbit-ring {
        width: 190px;
        height: 190px;
    }

    .mas-orbit-sat {
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
        transform:
            translate(-50%, -50%)
            rotate(var(--angle))
            translateY(-95px)
            rotate(calc(-1 * var(--angle)));
    }

    .mas-orbit-sat:hover,
    .mas-orbit-sat.is-active {
        transform:
            translate(-50%, -50%)
            rotate(var(--angle))
            translateY(-95px)
            rotate(calc(-1 * var(--angle)))
            scale(1.1);
    }

    .mas-orbit-center {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    /* Narrower flow on mobile */
    .mas-flow {
        max-width: 100%;
    }

    .mas-flow-step {
        padding: 0.85rem 1rem;
    }

    .mas-flow-step span {
        white-space: normal;
    }

    .mas-cta {
        padding: 80px 6%;
    }
}
