/* ==========================================================================
   Motion.css — Modern animation layer for everything below the hero
   (Solutions, Process, Partners, Team, CTA, Footer)
   Loaded last so it can refine the section stylesheets.
   ========================================================================== */

:root {
    --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-accent: linear-gradient(90deg, #0284c7, #38bdf8, #6366f1, #0284c7);
}

/* ── Scroll progress bar ── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--motion-accent);
    background-size: 200% 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 3000;
    pointer-events: none;
    animation: accentSlide 4s linear infinite;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

@keyframes accentSlide {
    from { background-position: 0% 0; }
    to { background-position: 200% 0; }
}

/* ── Live pulse dots in section labels ── */
.pulse-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0ea5e9;
    display: inline-block;
    flex-shrink: 0;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #0ea5e9;
    animation: pulseRing 2s var(--motion-ease) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3.2); opacity: 0; }
}

/* ── Split-word heading reveal ── */
.split-heading .split-word-mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.split-heading .split-word {
    display: inline-block;
    transform: translateY(105%) rotate(4deg);
    opacity: 0;
    transition:
        transform 0.9s var(--motion-ease),
        opacity 0.6s ease;
    transition-delay: calc(var(--i, 0) * 70ms + 120ms);
    will-change: transform;
}

.is-visible .split-heading .split-word,
.split-heading.is-visible .split-word {
    transform: translateY(0) rotate(0);
    opacity: 1;
}

.split-heading .word-accent {
    background: linear-gradient(90deg, #0284c7, #38bdf8, #6366f1, #0284c7);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: accentSlide 6s linear infinite;
}

/* ── Floating background orbs (parallax) ── */
.solution-page,
.process-section,
.partners-section,
.team-section {
    isolation: isolate;
}

.section-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    pointer-events: none;
    z-index: -1;
    will-change: transform;
}

.section-orb.orb-a {
    width: 380px;
    height: 380px;
    top: 8%;
    left: -140px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 70%);
}

.section-orb.orb-b {
    width: 320px;
    height: 320px;
    bottom: 6%;
    right: -120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.32), transparent 70%);
}

/* ── Animated section divider ── */
.section-divider {
    position: relative;
    max-width: 1100px;
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    overflow: hidden;
    z-index: 10;
}

.section-divider span {
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #38bdf8, #6366f1, transparent);
    animation: dividerTravel 5s ease-in-out infinite;
}

@keyframes dividerTravel {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* ── 3D tilt cards ── */
.tilt-card {
    --rx: 0deg;
    --ry: 0deg;
    --lift: 0px;
    transform-style: preserve-3d;
}

.tilt-card:not(.reveal-on-scroll),
.tilt-card.is-visible,
.tilt-card.is-visible:hover {
    transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
}

.tilt-card:hover {
    --lift: -4px;
}

.tilt-card.is-tilting {
    transition:
        transform 0.12s linear,
        box-shadow 0.3s var(--motion-ease),
        border-color 0.3s ease !important;
}

/* Shine sweep across cards on hover */
.shine-sweep {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
}

.shine-sweep::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-18deg);
    transition: left 0s;
}

.tilt-card:hover .shine-sweep::before {
    left: 130%;
    transition: left 0.9s var(--motion-ease);
}

/* ── Services refinements ── */
.service-icon-box {
    animation: iconFloat 4.5s ease-in-out infinite;
}

.service-accordion-card:nth-child(2n) .service-icon-box {
    animation-delay: -2.2s;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.service-accordion-card::after,
.partner-card::after,
.team-card::after {
    background: var(--motion-accent) !important;
    background-size: 200% 100% !important;
    animation: accentSlide 3s linear infinite;
}

.feature-pill {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--motion-ease), border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.feature-pill:hover {
    transform: translateY(-2px);
    border-color: #bae6fd !important;
    color: #0369a1 !important;
}

.service-accordion-card.is-visible .feature-pill {
    animation: pillPop 0.6s var(--motion-ease) both;
}

.service-accordion-card.is-visible .feature-pill:nth-child(1) { animation-delay: 0.35s; }
.service-accordion-card.is-visible .feature-pill:nth-child(2) { animation-delay: 0.45s; }
.service-accordion-card.is-visible .feature-pill:nth-child(3) { animation-delay: 0.55s; }

@keyframes pillPop {
    from { opacity: 0; transform: translateY(8px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.preview-btn-sparkle {
    stroke-dasharray: 60;
    stroke-dashoffset: 0;
}

.preview-toggle-btn:hover .preview-btn-sparkle {
    animation: pulseLine 1.2s linear infinite;
}

@keyframes pulseLine {
    from { stroke-dashoffset: 60; }
    to { stroke-dashoffset: 0; }
}

.service-accordion-card.expanded .interactive-diagram-canvas {
    animation: canvasIn 0.7s var(--motion-ease) both;
}

@keyframes canvasIn {
    from { opacity: 0; transform: scale(0.97); filter: blur(4px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ── Process section ── */
.process-section {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 2rem 6rem;
}

.process-header {
    text-align: center;
    margin-bottom: 4.5rem;
}

.process-header .section-label,
.cta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 1.1rem;
}

.process-title {
    font-family: var(--font-serif) !important;
    font-weight: 700;
    font-size: clamp(2.3rem, 4vw, 3.2rem) !important;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin: 0 0 1rem;
    line-height: 1.15;
}

.process-subtitle {
    font-family: var(--font-sans);
    font-size: 1.08rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 620px;
    margin: 0 auto;
}

.process-track {
    position: relative;
}

.process-line {
    position: absolute;
    top: 27px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.process-line-fill {
    width: 100%;
    height: 100%;
    background: var(--motion-accent);
    background-size: 200% 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: accentSlide 3s linear infinite;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.process-step-node {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    z-index: 2;
    transition: all 0.5s var(--motion-ease);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.process-step-node::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px dashed #bae6fd;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

.process-step.is-active .process-step-node {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    transform: scale(1.06);
    box-shadow: 0 10px 26px rgba(14, 165, 233, 0.3);
}

.process-step.is-active .process-step-node::before {
    opacity: 1;
}

.process-step-card {
    position: relative;
    width: 100%;
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.85rem 1.6rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 6px 20px rgba(15, 23, 42, 0.03);
    transition: border-color 0.3s ease, box-shadow 0.3s var(--motion-ease);
    overflow: hidden;
}

.process-step-card:hover {
    border-color: #bae6fd;
    box-shadow: 0 18px 40px -10px rgba(2, 132, 199, 0.16);
}

.process-step-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0284c7;
    margin-bottom: 1.1rem;
    transition: transform 0.4s var(--motion-ease);
}

.process-step-card:hover .process-step-icon {
    transform: rotate(-8deg) scale(1.1);
}

.process-step-card h3 {
    font-family: var(--font-serif) !important;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.55rem;
    letter-spacing: -0.01em;
}

.process-step-card p {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.process-step-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
}

/* Stats band */
.stats-band {
    margin-top: 4.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    box-shadow: 0 10px 34px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: relative;
}

.stats-band::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--motion-accent);
    background-size: 200% 100%;
    animation: accentSlide 3s linear infinite;
}

.stat-item {
    padding: 2rem 1.5rem;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    transition: background 0.3s ease;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item:hover {
    background: #f8fafc;
}

.stat-value {
    display: block;
    font-family: var(--font-serif) !important;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0f172a 30%, #0284c7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
}

/* ── Partners & Team refinements ── */
.partner-logo-wrap {
    position: relative;
    overflow: hidden;
}

.team-card-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.35));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.team-card:hover .team-card-photo::after {
    opacity: 1;
}

.team-social-btn,
.partner-btn {
    position: relative;
    overflow: hidden;
}

/* ── CTA section (light Apple / Stripe style) ── */
.cta-section {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 7rem;
}

.cta-card {
    position: relative;
    border-radius: 24px;
    padding: 4.5rem 2.5rem;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 20px 50px -18px rgba(15, 23, 42, 0.12);
}

/* Soft pastel glows that drift slowly */
.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(420px circle at 15% 20%, rgba(56, 189, 248, 0.14), transparent 65%),
        radial-gradient(380px circle at 85% 80%, rgba(99, 102, 241, 0.10), transparent 65%);
    animation: ctaGlowDrift 14s ease-in-out infinite alternate;
    z-index: -2;
}

@keyframes ctaGlowDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(3%, -4%, 0); }
}

/* Cursor-following spotlight */
.cta-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(14, 165, 233, 0.07), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* Animated accent line on top, consistent with the other cards */
.cta-card .cta-accent-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--motion-accent);
    background-size: 200% 100%;
    animation: accentSlide 3s linear infinite;
}

.cta-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
    animation: gridDrift 18s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 44px 44px, 44px 44px; }
}

.cta-floating-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    pointer-events: none;
    animation: chipFloat 6s ease-in-out infinite;
}

.cta-floating-chip.chip-1 { top: 16%; left: 7%; }
.cta-floating-chip.chip-2 { top: 22%; right: 7%; animation-delay: -2s; }
.cta-floating-chip.chip-3 { bottom: 16%; left: 11%; animation-delay: -4s; }

@keyframes chipFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cta-title {
    font-family: var(--font-serif) !important;
    font-weight: 700;
    font-size: clamp(2.2rem, 4.2vw, 3.2rem) !important;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin: 0 auto 1.1rem;
    line-height: 1.15;
    max-width: 720px;
}

.cta-subtitle {
    font-family: var(--font-sans);
    font-size: 1.08rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto 2.25rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.cta-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.25s var(--motion-ease);
    overflow: hidden;
}

.cta-btn-primary {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.cta-btn-primary:hover {
    background: #1e293b;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
}

.cta-btn-primary svg {
    transition: transform 0.3s var(--motion-ease);
}

.cta-btn-primary:hover svg {
    transform: translateX(4px);
}

.cta-btn-ghost {
    background: #f8fafc;
    color: #334155;
    border-color: #e2e8f0;
}

.cta-btn-ghost:hover {
    background: #ffffff;
    border-color: #bae6fd;
    color: #0284c7;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.1);
}

/* ── Footer refinements ── */
.site-footer {
    overflow: hidden;
    animation: none;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--motion-accent);
    background-size: 200% 100%;
    animation: accentSlide 4s linear infinite;
}

.footer-watermark {
    position: absolute;
    left: 50%;
    bottom: -0.18em;
    transform: translateX(-50%);
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: clamp(7rem, 22vw, 18rem);
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}

.footer-container,
.footer-bottom {
    position: relative;
    z-index: 1;
}

.footer-links a {
    position: relative;
    display: inline-block;
}

.footer-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: #38bdf8;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--motion-ease);
}

.footer-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .process-steps {
        grid-template-columns: 1fr 1fr;
    }

    .process-line {
        display: none;
    }

    .stats-band {
        grid-template-columns: 1fr 1fr;
    }

    .stat-item:nth-child(2) {
        border-right: none;
    }

    .stat-item:nth-child(-n + 2) {
        border-bottom: 1px solid #f1f5f9;
    }

    .cta-floating-chip {
        display: none;
    }
}

@media (max-width: 640px) {
    .process-section {
        padding: 4.5rem 1.25rem 3.5rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .cta-section {
        padding: 2rem 1.25rem 4.5rem;
    }

    .cta-card {
        padding: 3.5rem 1.5rem;
    }
}

/* ── Respect reduced-motion preferences ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .split-heading .split-word {
        transform: none;
        opacity: 1;
    }

    .section-orb {
        display: none;
    }
}

