/* 02 — AI & AUTOMATION */

.ai-section {
    position: relative;
    padding: 140px 0 120px;
    background: var(--bg);
    overflow: hidden;
}

.ai-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        60% 50% at 0% 50%,

        rgba(93, 46, 222, 0.07) 0%,

        transparent 60%
    );
    pointer-events: none;
}

.ai-section .container {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 56px;
}

.ai-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

/* ───── LEFT: agent canvas ───── */

.canvas {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
    border: 1px solid var(--line-2);
    border-radius: 22px;
    padding: 16px;
    box-shadow:
        0 40px 80px -50px rgba(93, 46, 222, 0.4),
        0 12px 24px -16px rgba(11, 11, 20, 0.1);
}

.canvas-chrome {
    padding: 4px 10px 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.chrome-left {
    gap: 14px;
}

.dots-row {
    display: inline-flex;
    gap: 6px;
}

.dots-row i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-3);
}

.dots-row i:nth-child(2) {
    background: var(--brand-2);
}

.dots-row i:nth-child(3) {
    background: var(--brand);
}

.breadcrumb {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: -0.005em;
}

.breadcrumb span {
    color: var(--muted-2);
    margin: 0 6px;
    font-weight: 400;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.live-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 0 rgba(93, 46, 222, 0.5);
    animation: pulseLive 1.6s ease-out infinite;
}

@keyframes pulseLive {
    0% {
        box-shadow: 0 0 0 0 rgba(93, 46, 222, 0.5);
    }

    100% {
        box-shadow: 0 0 0 8px rgba(93, 46, 222, 0);
    }
}

.task-row {
    padding: 8px 12px 14px;
    gap: 14px;
}

.task-left {
    gap: 12px;
    min-width: 0;
}

.task-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--brand-soft);
    display: grid;
    place-items: center;
    color: var(--brand);
}

.task-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.task-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.task-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.005em;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-text mark {
    background: transparent;
    color: var(--brand);
    font-weight: 600;
}

.step-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: -0.005em;
}

.step-dots {
    display: inline-flex;
    gap: 5px;
}

.step-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line-2);
    transition: background 220ms ease;
}

.step-dots i.on {
    background: var(--brand);
}

.step-pill b {
    color: var(--ink);
    font-weight: 600;
}

/* diagram */

.diagram {
    position: relative;
    height: 460px;
    background:
        radial-gradient(
            circle at center,

            rgba(93, 46, 222, 0.07) 0%,

            transparent 55%
        ),
        radial-gradient(
                circle at 1px 1px,

                rgba(11, 11, 20, 0.05) 1px,

                transparent 0
            )
            0 0 / 22px 22px;
    border-radius: 14px;
    overflow: hidden;
}

.diagram::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,

        rgba(255, 255, 255, 0.95),
        transparent 12%,

        transparent 88%,

        rgba(255, 255, 255, 0.95)
    );
    pointer-events: none;
}

.connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connectors .conn {
    fill: none;
    stroke: rgba(93, 46, 222, 0.22);
    stroke-width: 1.5;
    stroke-dasharray: 4 6;
    stroke-linecap: round;
    transition:
        stroke 320ms ease,
        stroke-width 320ms ease,
        filter 320ms ease;
    animation: dashFlow 1.8s linear infinite;
}

.connectors .conn.active {
    stroke: var(--brand);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(93, 46, 222, 0.45));
}

@keyframes dashFlow {
    to {
        stroke-dashoffset: -20;
    }
}

.connectors circle.flow-dot {
    fill: var(--brand);
    filter: drop-shadow(0 0 6px rgba(93, 46, 222, 0.7));
}

/* node */

.node {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 10px;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 13px;
    box-shadow: 0 6px 16px -10px rgba(11, 11, 20, 0.18);
    transition:
        transform 360ms cubic-bezier(0.4, 1.4, 0.5, 1),
        box-shadow 360ms ease,
        border-color 360ms ease;
}

.node.active {
    transform: scale(1.05);
    border-color: var(--brand);
    box-shadow:
        0 12px 28px -10px rgba(93, 46, 222, 0.4),
        0 0 0 4px rgba(93, 46, 222, 0.12);
}

.node .nico {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--brand-soft);
    display: grid;
    place-items: center;
    color: var(--brand);
    transition:
        background 320ms ease,
        color 320ms ease;
}

.node.active .nico {
    background: var(--brand);
    color: #fff;
}

.node .ntext {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.node .nname {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.005em;
    line-height: 1.1;
}

.node .nsub {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--muted-2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.1;
}

.node .nbadge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(93, 46, 222, 0.1);
    color: var(--brand);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-left: 4px;
}

.node .nbadge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
}

/* node positions */

.n-postgres {
    top: 8px;
    left: 8px;
}

.n-stripe {
    top: 8px;
    right: 8px;
}

.n-vector {
    top: 214px;
    left: 8px;
}

.n-events {
    top: 214px;
    right: 6px;
}

.n-resend {
    bottom: 8px;
    left: 8px;
}

.n-slack {
    bottom: 8px;
    right: 8px;
}

/* AI core */

.ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    padding: 18px 18px 16px;
    background: #fff;
    border-radius: 18px;
    text-align: left;
    z-index: 3;
    box-shadow:
        0 24px 50px -20px rgba(93, 46, 222, 0.45),
        0 0 0 6px rgba(93, 46, 222, 0.05),
        0 0 0 14px rgba(93, 46, 222, 0.03);
}

.ai-core::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1.5px;
    background: linear-gradient(
        135deg,
        var(--brand) 0%,

        #b89bfb 50%,

        var(--brand) 100%
    );
    background-size: 200% 200%;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradMove 4s linear infinite;
    pointer-events: none;
}

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

.core-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.core-label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    animation: pulseMini 1.4s ease-in-out infinite;
}

.core-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.core-name svg {
    color: var(--brand);
}

.core-status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.005em;
    font-feature-settings: "tnum" 1;
}

.core-status::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
    animation: pulseMini 0.9s ease-in-out infinite;
}

@keyframes pulseMini {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.progress-track {
    margin-top: 12px;
    height: 4px;
    background: var(--brand-soft);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand), #8b5bfa);
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(93, 46, 222, 0.5);
}

/* ───── RIGHT: copy ───── */

.ai-copy {
    max-width: 560px;
}

.ai-eyebrow {
    display: inline-block;
    padding: 6px 12px;
    background: var(--ink);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ai-heading {
    margin: 22px 0 0;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    color: var(--ink);
    text-wrap: balance;
}

.ai-heading .alt {
    background: linear-gradient(
        105deg,
        var(--brand) 0%,

        #8b5bfa 60%,

        var(--brand) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-lede {
    margin: 22px 0 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 540px;
    font-weight: 400;
}

.feat-list {
    margin: 36px 0 0;
}

.feat {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 16px;
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
    cursor: default;
}

.feat:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 16px 28px -16px rgba(93, 46, 222, 0.3);
}

.feat:hover .fico {
    background: var(--brand);
    color: #fff;
}

.fico {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: var(--brand-soft);
    display: grid;
    place-items: center;
    color: var(--brand);
    transition:
        background 220ms ease,
        color 220ms ease;
}

.feat-body {
    min-width: 0;
}

.feat h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.feat-body p {
    margin: 3px 0 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--muted);
}

@media (max-width: 1280px) and (min-width: 1101px) {
    .diagram {
        height: 520px;
    }

    .n-vector,
    .n-events {
        top: 240px;
    }

    .ai-section .container {
        padding: 0 4px;
    }
}

@media (max-width: 1100px) {
    .ai-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .canvas {
        margin: 0 auto;
        max-width: 100%;
    }

    .ai-copy {
        max-width: 100%;
        width: 100%;
    }

    .ai-heading {
        font-size: 44px;
    }
}

@media (max-width: 900px) {
    .ai-section {
        padding: 80px 0;
    }

    .ai-section .container {
        padding: 0 24px;
    }

    .diagram {
        height: 380px;
    }

    .n-vector,
    .n-events {
        top: 171px;
    }

    .task-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .task-text {
        white-space: normal;
        font-size: 13px;
    }

    .ai-core {
        width: 200px;
        padding: 14px 14px 12px;
    }

    .core-name {
        font-size: 18px;
    }

    .node .nsub {
        display: none;
    }

    .node .nbadge {
        display: none;
    }

    .ai-heading {
        font-size: 38px;
    }

    .ai-lede {
        font-size: 15px;
    }

    .feat {
        grid-template-columns: 48px 1fr;
        padding: 16px 18px;
    }

    .fico {
        width: 46px;
        height: 46px;
    }

    .feat h4 {
        font-size: 16px;
    }
}

@media (max-width: 720px) {
    .ai-section {
        padding: 64px 0;
    }

    .ai-section .container {
        padding: 0 16px;
    }

    .canvas {
        border-radius: 16px;
        padding: 12px;
    }

    .diagram {
        height: 340px;
    }

    .n-vector,
    .n-events {
        top: 151px;
    }

    .ai-core {
        width: 180px;
        padding: 12px;
    }

    .core-name {
        font-size: 16px;
        gap: 6px;
    }

    .core-name svg {
        width: 16px;
        height: 16px;
    }

    .core-status {
        font-size: 11px;
        margin-top: 7px;
    }

    .node {
        padding: 7px 10px;
        gap: 7px;
    }

    .node .nico {
        width: 22px;
        height: 22px;
    }

    .node .nname {
        font-size: 11px;
    }

    .ai-heading {
        font-size: 32px;
    }

    .feat {
        grid-template-columns: 44px 1fr;
        gap: 12px;
        padding: 14px;
    }

    .fico {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .feat h4 {
        font-size: 15px;
    }

    .feat-body p {
        font-size: 13.5px;
    }
}

@media (max-width: 480px) {
    .diagram {
        height: 300px;
    }

    .n-vector,
    .n-events {
        top: 131px;
    }

    .ai-core {
        width: 160px;
        padding: 10px;
    }

    .core-name {
        font-size: 14px;
    }

    .breadcrumb {
        display: none;
    }

    .ai-heading {
        font-size: 28px;
    }
}

/* SHARED SECTION CHROME */

.sec {
    position: relative;
    padding: 120px 0;
}

.sec .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 56px;
    position: relative;
}

.sec-eyebrow {
    display: inline-block;
    padding: 6px 12px;
    background: var(--ink);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sec-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: end;
    margin-bottom: 56px;
}

.sec-title {
    margin: 18px 0 0;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    color: var(--ink);
    text-wrap: balance;
}

.sec-title .alt {
    background: linear-gradient(
        105deg,
        var(--brand) 0%,

        #8b5bfa 60%,

        var(--brand) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sec-lede {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
    font-weight: 400;
    max-width: 500px;
    justify-self: end;
}

@media (max-width: 1100px) {
    .sec-head {
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
    }

    .sec-lede {
        justify-self: start;
    }

    .sec-title {
        font-size: 40px;
    }

    .sec {
        padding: 80px 0;
    }
}

@media (max-width: 720px) {
    .sec .container {
        padding: 0 20px;
    }

    .sec-title {
        font-size: 32px;
    }
}
