/* ============================================================
   styles-ai.css — AMSI-AI.html only.
   Loaded after styles.css and reuses its tokens (--accent, --muted,
   --line, --panel, --radius-*, --shadow, fonts). Only new component
   classes live here so the two files can sit in the same root
   folder without colliding with the main site's stylesheet.
   ============================================================ */

:root {
    --ai-violet: #9d7bff;
    --ai-violet-line: rgba(157, 123, 255, 0.32);
    --ai-violet-bg: rgba(157, 123, 255, 0.08);
    --ai-blue: #5aa0ff;
    --ai-orange: #ff9a4d;
}

.ai-section {
    padding-top: 76px;
}

.site-nav a.is-active {
    color: var(--brand-red);
}

/* ---------- Problem: scattered sources -> single hub ---------- */

.ai-sources {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 36px 0;
    text-align: center;
}

.ai-sources-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ai-source-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    animation: ai-source-chip-pulse 3.2s ease-in-out infinite;
}

.ai-source-chip:nth-child(2) { animation-delay: 0.4s; }
.ai-source-chip:nth-child(3) { animation-delay: 0.8s; }
.ai-source-chip:nth-child(4) { animation-delay: 1.2s; }
.ai-source-chip:nth-child(5) { animation-delay: 1.6s; }

@keyframes ai-source-chip-pulse {
    0%, 100% { border-color: var(--line); }
    50% { border-color: rgba(238, 20, 59, 0.55); }
}

.ai-sources-arrow {
    color: var(--accent);
    font-size: 1.3rem;
    opacity: 0.6;
    line-height: 1;
}

.ai-sources-flow {
    width: 20px;
    height: 46px;
}

.ai-sources-flow svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.ai-sources-hub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 16px 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(238, 20, 59, 0.22), rgba(188, 23, 55, 0.24));
    border: 1px solid rgba(238, 20, 59, 0.4);
    box-shadow: 0 14px 34px rgba(238, 20, 59, 0.18);
    font-family: "Unbounded", sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--text);
    animation: ai-hub-pulse 2.4s ease-in-out infinite;
}

@keyframes ai-hub-pulse {
    0%, 100% { box-shadow: 0 14px 34px rgba(238, 20, 59, 0.18); }
    50% { box-shadow: 0 14px 44px rgba(238, 20, 59, 0.4); }
}

.ai-sources-result {
    max-width: 46ch;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.ai-sources-link {
    margin-top: 22px;
    text-align: center;
}

.ai-sources-link a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(238, 20, 59, 0.4);
}

.ai-sources-link a:hover {
    color: var(--accent-cold);
    border-bottom-color: rgba(255, 131, 151, 0.6);
}

.ai-quote {
    max-width: 62ch;
    margin: 8px auto 0;
    padding: 22px 28px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: "Unbounded", sans-serif;
    font-size: 1.05rem;
    line-height: 1.5;
    font-style: normal;
}

/* ---------- How it works: 6-step loop ---------- */

.ai-loop {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
}

.ai-loop-step {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 168px;
    padding: 20px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(11, 31, 52, 0.8), rgba(7, 19, 33, 0.92));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.ai-loop-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(238, 20, 59, 0.16);
    border: 1px solid rgba(238, 20, 59, 0.34);
    color: var(--accent);
    font-family: "Unbounded", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
}

.ai-loop-title {
    font-family: "Unbounded", sans-serif;
    font-size: 0.98rem;
    color: var(--text);
}

.ai-loop-desc {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.ai-loop-arrow {
    display: flex;
    align-items: center;
    color: var(--accent);
    font-size: 1.3rem;
    opacity: 0.55;
}

.ai-loop-repeat {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Product ladder ---------- */

.ai-ladder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

/* Shared bits (used by both the simple and the diagram variant) */

.ai-ladder-caption {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0;
}

.ai-ladder-intel {
    display: block;
    margin-top: 22px;
    padding: 18px 28px;
    max-width: 720px;
    width: 100%;
    text-align: center;
    border-radius: 16px;
    border: 1.5px dashed var(--ai-violet-line);
    background: var(--ai-violet-bg);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    animation: ai-intel-breathe 3.6s ease-in-out infinite;
    transition: border-color 220ms ease, background 220ms ease;
}

.ai-ladder-intel strong {
    color: var(--ai-violet);
    font-family: "Unbounded", sans-serif;
    font-weight: 700;
}

.amsi-ai-scheme-link {
    margin-top: 20px;
}

.amsi-ai-guides {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
}

.ai-ladder-intel:hover {
    border-color: rgba(157, 123, 255, 0.6);
    background: rgba(157, 123, 255, 0.14);
    animation-play-state: paused;
}

@keyframes ai-intel-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(157, 123, 255, 0.16); }
    50% { box-shadow: 0 0 0 10px rgba(157, 123, 255, 0); }
}

/* ---- Narrow screens: simple stacked steps (shown < 860px) ---- */

.ai-ladder-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.ai-ladder-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ai-ladder-branch {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 640px;
}

.ai-ladder-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 168px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(16, 38, 64, 0.9), rgba(8, 20, 36, 0.95));
    border: 1.5px solid rgba(238, 20, 59, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.ai-ladder-step:hover {
    transform: translateY(-2px);
    border-color: rgba(238, 20, 59, 0.6);
    box-shadow: 0 10px 24px rgba(238, 20, 59, 0.22);
}

.ai-ladder-num {
    color: var(--accent);
    font-family: "Unbounded", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-ladder-name {
    color: var(--text);
    font-weight: 700;
    font-size: 0.94rem;
}

.ai-ladder-tag {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-ladder-arrow {
    color: var(--accent);
    font-size: 1.3rem;
    opacity: 0.55;
}

.ai-ladder-arrow-down {
    margin: 2px 0;
}

/* ---- Wide screens: branching diagram with animated flow (shown >= 860px) ---- */

.ald {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 760px;
}

.ald-row {
    display: grid;
    align-items: stretch;
    position: relative;
}

.ald-row-pair {
    grid-template-columns: repeat(2, 1fr);
}

.ald-row-triple {
    grid-template-columns: repeat(3, 1fr);
}

.ald-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 68px;
    margin: 0 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(16, 38, 64, 0.92), rgba(8, 20, 36, 0.96));
    border: 1.5px solid rgba(238, 20, 59, 0.4);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    text-align: center;
    position: relative;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.ald-box::before {
    content: "";
    position: absolute;
    top: -1.5px;
    left: 16px;
    right: 16px;
    height: 3px;
    border-radius: 3px;
    background: var(--brand-red);
    opacity: 0.85;
}

.ald-box:hover {
    transform: translateY(-4px);
    border-color: rgba(238, 20, 59, 0.75);
    box-shadow: 0 16px 34px rgba(238, 20, 59, 0.26);
}

.ald-box-violet { border-color: rgba(157, 123, 255, 0.42); }
.ald-box-violet::before { background: var(--ai-violet); }
.ald-box-violet:hover { border-color: rgba(157, 123, 255, 0.8); box-shadow: 0 16px 34px rgba(157, 123, 255, 0.26); }

.ald-box-blue { border-color: rgba(90, 160, 255, 0.42); }
.ald-box-blue::before { background: var(--ai-blue); }
.ald-box-blue:hover { border-color: rgba(90, 160, 255, 0.8); box-shadow: 0 16px 34px rgba(90, 160, 255, 0.26); }

.ald-box-orange { border-color: rgba(255, 154, 77, 0.42); }
.ald-box-orange::before { background: var(--ai-orange); }
.ald-box-orange:hover { border-color: rgba(255, 154, 77, 0.8); box-shadow: 0 16px 34px rgba(255, 154, 77, 0.26); }

.ald-num {
    color: var(--accent);
    font-family: "Unbounded", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
}

.ald-name {
    color: var(--text);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.25;
}

.ald-tag {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Horizontal wire between the two boxes of a pair row */

.ald-hwire {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    width: 64px;
    height: 22px;
    pointer-events: none;
}

.ald-hwire svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* Fan connector between a pair row and the triple row */

.ald-fan {
    width: 100%;
    height: 78px;
    margin: 4px 0;
    pointer-events: none;
}

.ald-fan svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.ald-fan-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.ald-joint {
    fill: rgba(255, 255, 255, 0.4);
}

.ald-dot-red { fill: var(--accent-strong); filter: drop-shadow(0 0 4px rgba(255, 79, 109, 0.9)); }
.ald-dot-violet { fill: var(--ai-violet); filter: drop-shadow(0 0 4px rgba(157, 123, 255, 0.9)); }
.ald-dot-blue { fill: var(--ai-blue); filter: drop-shadow(0 0 4px rgba(90, 160, 255, 0.9)); }
.ald-dot-orange { fill: var(--ai-orange); filter: drop-shadow(0 0 4px rgba(255, 154, 77, 0.9)); }

@media (min-width: 860px) {
    .ai-ladder-simple {
        display: none;
    }

    .ald {
        display: flex;
    }
}

/* ---------- Product cards: extra meta rows ---------- */

.ai-meta {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-meta p {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.ai-meta p:first-child {
    margin-top: 0;
}

.ai-meta-label {
    color: var(--text);
    font-weight: 700;
}

.ai-meta a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-color: rgba(255, 79, 109, 0.35);
    text-underline-offset: 3px;
}

.ai-meta a:hover {
    color: var(--accent-cold);
}

.ai-card-cross {
    border-color: var(--ai-violet-line);
    background: linear-gradient(180deg, rgba(40, 28, 66, 0.55), rgba(7, 19, 33, 0.92));
}

.ai-card-cross .offer-type {
    color: var(--ai-violet);
}

.ai-card-cross:hover {
    border-color: rgba(157, 123, 255, 0.5);
}

/* ---------- Platform capability tiles ---------- */

.ai-platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 32px;
}

.ai-platform-tile {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(11, 31, 52, 0.8), rgba(7, 19, 33, 0.92));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.ai-platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: rgba(238, 20, 59, 0.14);
    border: 1px solid rgba(238, 20, 59, 0.3);
    color: var(--accent-strong);
}

.ai-platform-icon svg {
    width: 22px;
    height: 22px;
}

.ai-platform-tile h3 {
    font-size: 1.08rem;
    margin-bottom: 10px;
}

.ai-platform-tile p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.ai-platform-tile .expand-btn {
    font-size: 0.78rem;
    margin-top: 14px;
}

.ai-platform-tile .offer-details {
    margin: 14px -26px -26px;
    padding: 14px 26px 26px;
    font-size: 0.86rem;
}

.ai-platform-tile .offer-details.hidden {
    padding: 0 26px;
}

.ai-platform-core {
    margin-top: 26px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.ai-platform-core strong {
    color: var(--text);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .ai-platform-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-ladder-branch {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 700px) {
    .ai-section {
        padding-top: 56px;
    }

    .ai-loop-step {
        width: 100%;
        max-width: 320px;
    }

    .ai-loop-arrow {
        transform: rotate(90deg);
    }

    .ai-platform-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-ladder-branch {
        grid-template-columns: minmax(0, 1fr);
        max-width: 320px;
    }

    .ai-ladder-row {
        flex-direction: column;
    }

    .ai-ladder-row .ai-ladder-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 560px) {
    .ai-sources-row {
        flex-direction: column;
        align-items: center;
    }
}
