/* ==========================================================================
   AI Development Services page (/ai-development-services)
   All rules are scoped to .ai-page so other pages are not affected.
   Breakpoints follow the Figma frames: 1440 / 1024 / 768 / 360.
   ========================================================================== */

.ai-page {
    --ai-bg: #090232;
    --ai-card-bg: rgba(24, 29, 34, 0.5);
    --ai-border: #6cb0ff;
    --ai-border-muted: #2a2c37;
    --ai-accent: #00d0ff;
    --ai-blue: #3fa9f5;
    --ai-muted: #9ca8c1;
    --ai-gradient: linear-gradient(70deg, #6cb0ff 0%, #d39bff 100%);
    --ai-btn-gradient: linear-gradient(167deg, #1d80f7 0%, #00d0ff 100%);
    --ai-gutter: 80px;

    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 240px 300px at 50% 0, rgba(29, 128, 247, 0.18), rgba(29, 128, 247, 0) 70%),
        var(--ai-bg);
    color: #fff;
    font-family: 'Raleway', raleway, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-align: left;
}

.ai-page *,
.ai-page *::before,
.ai-page *::after {
    box-sizing: border-box;
}

.ai-page h1,
.ai-page h2,
.ai-page h3,
.ai-page p,
.ai-page ul {
    margin: 0;
    padding: 0;
    text-align: inherit;
}

.ai-page img {
    display: block;
    max-width: none;
}

.ai-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--ai-gutter);
}

.ai-section {
    position: relative;
    padding: 80px 0;
}

/* ---------- Typography ---------- */

.ai-eyebrow {
    color: var(--ai-accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.ai-eyebrow--lg {
    font-size: 14px;
}

.ai-title {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 40px;
}

.ai-title--black {
    font-size: 40px;
    font-weight: 900;
    line-height: 1.1;
}

.ai-text {
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
}

.ai-text--narrow {
    max-width: 800px;
    line-height: 24px;
}

.ai-heading {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.ai-heading--narrow {
    max-width: 800px;
}

/* ---------- Common elements ---------- */

.ai-btn {
    display: inline-block;
    align-self: flex-start;
    padding: 16px 32px;
    border-radius: 8px;
    background-image: var(--ai-btn-gradient);
    color: #0a0535;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0.4px;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.ai-btn:hover,
.ai-btn:focus {
    color: #0a0535;
    text-decoration: none;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.ai-card {
    background: var(--ai-card-bg);
    border: 1px solid var(--ai-border);
    border-radius: 16px;
}

.ai-list {
    list-style: none;
}

.ai-list li {
    position: relative;
    padding-left: 14px;
    color: var(--ai-muted);
    font-size: 14px;
    line-height: 20px;
}

.ai-list li + li {
    margin-top: 8px;
}

.ai-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-blue);
}

.ai-tag {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 200px;
    background-image: var(--ai-gradient);
    color: var(--ai-bg);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}

/* ---------- Hero ---------- */

.ai-hero {
    position: relative;
    padding: 150px 0 80px;
}

/* top offset keeps the wave line ~35px under the CTA button, as in the design
   (the site header pushes the hero text down compared to Figma) */
.ai-hero__bg {
    position: absolute;
    top: 70px;
    left: 50%;
    /* full viewport width on wide screens, never narrower than the 1440 design
       (narrower screens see its centre, as in the tablet/phone designs) */
    width: max(100%, 1440px);
    height: 637px;
    /* centred with a margin, not transform: a transform would isolate the
       lighten blend of the wave from the page background */
    margin-left: calc(max(100%, 1440px) / -2);
    pointer-events: none;
}

.ai-hero__wave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill; /* stretch with the box, like the shader */
    mix-blend-mode: lighten;
}

/* animated version of the wave (js/ai-gradient-shader.js); fades in over the static image */
.ai-hero__shader {
    position: absolute;
    inset: 0;
    width: 100% !important;  /* main.css forces canvas {height:auto !important} */
    height: 100% !important;
    mix-blend-mode: lighten;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.ai-hero__shader.is-ready {
    opacity: 1;
}

.ai-hero__wave {
    transition: opacity 0.6s ease;
}

/* soften the bottom edge of the wave layer so it never shows as a hard line
   (the mask sits on the blended elements themselves, so the lighten blend still works) */
.ai-hero__wave,
.ai-hero__shader {
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.ai-hero__bg.is-animated .ai-hero__wave {
    opacity: 0;
}

.ai-hero__stars {
    position: absolute;
    top: -70px;
    left: 0;
    width: 100%;
    height: 284px;
    object-fit: cover;
    object-position: center top;
}

.ai-hero__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.ai-hero__text {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
}

.ai-hero__title {
    color: #fff;
    font-size: 56px;
    font-weight: 900;
    line-height: 1.1;
}

.ai-hero__lead {
    font-size: 16px;
    line-height: 1.6;
}

.ai-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ai-stats__item {
    padding: 20px;
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    background: var(--ai-card-bg);
}

.ai-stats__value {
    color: var(--ai-blue);
    font-size: 32px;
    font-weight: 700;
    line-height: 36px;
}

.ai-stats__label {
    padding-top: 4px;
    font-size: 12px;
    line-height: 16.5px;
}

/* ---------- Service categories ---------- */

.ai-services {
    padding-top: 80px;
}

.ai-services__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.ai-service {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.ai-service:nth-child(4),
.ai-service:nth-child(5) {
    grid-column: span 3;
}

.ai-service__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(63, 169, 245, 0.12);
}

.ai-service__title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}

/* ---------- Case studies ---------- */

.ai-cases__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 0 var(--ai-gutter);
    scroll-padding: 0 var(--ai-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

.ai-cases__track::-webkit-scrollbar {
    display: none;
}

.ai-cases__track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
}

/* keep the first card aligned with the container on wide screens */
@media (min-width: 1441px) {
    .ai-cases__track {
        padding-left: calc((100vw - 1440px) / 2 + var(--ai-gutter));
        scroll-padding-left: calc((100vw - 1440px) / 2 + var(--ai-gutter));
    }
}

.ai-case {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    scroll-snap-align: start;
}

.ai-case--featured {
    background: linear-gradient(84deg, rgba(108, 176, 255, 0.1) 0%, rgba(211, 155, 255, 0.1) 100%);
}

.ai-case__title {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 40px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}

.ai-case__title img {
    flex: 0 0 auto;
}

.ai-case__block + .ai-case__block {
    margin-top: -4px;
}

.ai-case__label {
    padding: 4px 0;
    color: var(--ai-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.ai-case__text {
    padding-top: 4px;
    font-size: 14px;
    line-height: 20px;
}

.ai-case__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.ai-case__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
    color: var(--ai-blue);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-decoration: none;
}

.ai-case__link:hover,
.ai-case__link:focus {
    color: #6cb0ff;
    text-decoration: none;
}

/* ---------- Tech strip (marquee) ---------- */

.ai-tech {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding: 40px 0;
    border-top: 0.625px solid var(--ai-border-muted);
    border-bottom: 0.625px solid var(--ai-border-muted);
    background-image: linear-gradient(51deg, #6cb0ff 0%, #d39bff 100%);
}

.ai-tech__title {
    padding: 0 16px;
    color: var(--ai-bg);
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 1.2px;
    text-align: center;
    text-transform: uppercase;
}

.ai-tech__viewport {
    width: 100%;
    overflow: hidden;
}

.ai-tech__track {
    display: flex;
    width: max-content;
    animation: ai-marquee 40s linear infinite;
}

.ai-tech__viewport:hover .ai-tech__track {
    animation-play-state: paused;
}

.ai-tech__group {
    display: flex;
    gap: 12px;
    padding-right: 12px;
}

.ai-tech__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 16px;
    color: var(--ai-bg);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
}

.ai-tech__item img {
    width: auto;
    height: 24px;
}

@keyframes ai-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-tech__track {
        animation: none;
    }
}

/* ---------- Business impact ---------- */

.ai-impact__inner {
    display: flex;
    gap: 40px;
    align-items: center;
}

.ai-impact__intro,
.ai-impact__rows {
    flex: 1 1 0;
    min-width: 0;
}

.ai-impact__intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-impact__intro .ai-text {
    line-height: 24px;
}

.ai-impact__rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-compare {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 12px;
}

.ai-compare__title {
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
}

.ai-compare__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-compare__track {
    position: relative;
    flex: 1 1 0;
    height: 10px;
    border-radius: 6px;
    background: #1c1b33;
}

.ai-compare__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 6px;
}

.ai-compare__bar--with {
    background-image: var(--ai-gradient);
}

.ai-compare__bar--without {
    background: rgba(63, 169, 245, 0.25);
}

.ai-compare__value {
    flex: 0 0 180px;
    color: #94a3b8;
    font-size: 12px;
    line-height: normal;
}

.ai-compare__value--with {
    background-image: linear-gradient(40deg, #6cb0ff 0%, #d39bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* ---------- FAQ ---------- */

.ai-faq__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-faq__item {
    border: 1px solid var(--ai-border-muted);
    border-radius: 12px;
    background: var(--ai-card-bg);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.ai-faq__item.is-open {
    border-color: var(--ai-border);
}

.ai-faq__question {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    padding: 20px 24px;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
}

.ai-faq__question span {
    flex: 1 1 0;
}

.ai-faq__question img {
    flex: 0 0 16px;
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.ai-faq__item.is-open .ai-faq__question img {
    transform: rotate(180deg);
}

.ai-faq__answer {
    display: none;
    padding: 0 60px 20px 24px;
    color: var(--ai-muted);
    font-size: 14px;
    line-height: 22px;
}

/* ---------- CTA ---------- */

.ai-cta {
    padding-bottom: 80px;
}

.ai-cta__box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding: 40px 80px;
    border: 2px solid #d39bff;
    border-radius: 20px;
    background: linear-gradient(71deg, rgba(211, 155, 255, 0.1) 0%, rgba(108, 176, 255, 0.1) 100%);
    text-align: center;
}

.ai-cta__box .ai-btn {
    align-self: center;
}

.ai-cta__title {
    color: #fff;
    font-size: 40px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ai-cta__text {
    font-size: 18px;
    line-height: 29.25px;
}

/* ==========================================================================
   Desktop small (Figma "Desktop - 2", 1024)
   ========================================================================== */

@media (max-width: 1279px) {
    .ai-services__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-service,
    .ai-service:nth-child(4),
    .ai-service:nth-child(5) {
        grid-column: span 1;
    }

    .ai-service:nth-child(5) {
        grid-column: span 2;
    }
}

@media (max-width: 1023px) {
    .ai-page {
        --ai-gutter: 40px;
    }

    .ai-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-hero__bg {
        top: 150px;
    }

    .ai-hero__stars {
        top: -150px;
    }

    .ai-impact__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-cta__box {
        padding: 40px;
    }
}

/* ==========================================================================
   Tablet (768)
   ========================================================================== */

@media (max-width: 767px) {
    .ai-page {
        --ai-gutter: 16px;
    }

    .ai-section {
        padding: 60px 0;
    }

    .ai-hero {
        padding: 110px 0 60px;
    }

    .ai-hero__bg {
        top: 130px;
    }

    .ai-hero__stars {
        top: -130px;
    }

    .ai-hero__inner {
        gap: 60px;
    }

    .ai-hero__title {
        font-size: 40px;
    }

    .ai-hero__lead {
        font-size: 14px;
    }

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

    .ai-title,
    .ai-title--black {
        font-size: 24px;
        line-height: 1.25;
    }

    .ai-text {
        font-size: 14px;
    }

    .ai-services__grid {
        grid-template-columns: 1fr;
    }

    .ai-service,
    .ai-service:nth-child(4),
    .ai-service:nth-child(5) {
        grid-column: span 1;
    }

    .ai-case {
        flex-basis: 304px;
    }

    .ai-tech__title {
        max-width: 300px;
    }

    .ai-compare__row {
        flex-wrap: wrap;
    }

    .ai-compare__track {
        flex-basis: 100%;
    }

    .ai-compare__value {
        flex-basis: 100%;
    }

    .ai-faq__question {
        padding: 20px;
        font-size: 14px;
    }

    .ai-faq__answer {
        padding: 0 20px 20px;
    }

    .ai-cta__box {
        align-items: flex-start;
        padding: 24px;
        text-align: left;
    }

    .ai-cta__box .ai-btn {
        align-self: flex-start;
    }

    .ai-cta__title {
        font-size: 24px;
    }

    .ai-cta__text {
        font-size: 14px;
        line-height: 22px;
    }
}

/* FAQ answers can contain several paragraphs, lists and links */
.ai-faq__answer p + p,
.ai-faq__answer p + ul,
.ai-faq__answer ul + p {
    margin-top: 10px;
}

.ai-faq__answer ul {
    margin-top: 10px;
    padding-left: 20px;
    list-style: disc;
}

.ai-faq__answer li + li {
    margin-top: 6px;
}

.ai-faq__answer a {
    color: var(--ai-accent);
    text-decoration: underline;
}

.ai-faq__answer a:hover,
.ai-faq__answer a:focus {
    color: #fff;
}
