/* ==========================================================
   Safi AI page
   Builds on home.css (tokens, nav, footer, chat, rails).
   ========================================================== */

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

.ai-hero {
    padding: 96px 0 56px;
    text-align: center;
}

.ai-title {
    margin-top: 22px;
    font-size: clamp(44px, 7vw, 84px);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.05em;
    color: var(--ink);
    text-wrap: balance;
}

.ai-sub {
    max-width: 580px;
    margin: 24px auto 0;
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.55;
    color: var(--muted);
    text-wrap: balance;
}

/* ---------- Demo ---------- */

.demo {
    padding: 24px 0 0;
}

.demo-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 560px);
    justify-content: center;
    align-items: start;
    gap: 40px;
    padding: 48px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background-color: #f7f8fa;
    background-image: radial-gradient(circle, #d3d6dd 1px, transparent 1.3px);
    background-size: 18px 18px;
}

.demo-prompts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.demo-label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.demo-prompt {
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.demo-prompt:hover {
    color: var(--ink);
}

.demo-prompt.is-active {
    background: #fff;
    border-color: var(--line-2);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(16, 18, 24, .05);
}

/* screenshots of the real CRM */
.shot {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-ui);
}

.shot-dark {
    border-color: #2a2b30;
    background: #141417;
}

.demo-shot {
    width: 100%;
    max-width: 440px;
    margin: 0;
}

.shot.is-in {
    animation: shot-in .45s var(--ease) both;
}

@keyframes shot-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* ---------- What it can answer ---------- */

.asks {
    padding-top: 140px;
}

.asks .rail {
    border-top: 1px solid var(--line);
}

.asks-head {
    padding: 72px 48px 56px;
}

.asks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
}

.ask {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    min-height: 170px;
    padding: 24px 24px 28px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ask:nth-child(4n) {
    border-right: 0;
}

.ask:nth-last-child(-n+4) {
    border-bottom: 0;
}

.ask-area {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.ask-area small {
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid var(--line-2);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--faint);
}

.ask-q {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-indent: -0.35em;
}

/* ---------- Split sections (write-ups, Auto Plan) ---------- */

.writeup .rail,
.plan-sec .rail {
    border-top: 1px solid var(--line);
}

.writeup-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.writeup-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 48px;
}

.writeup-copy .split-title {
    margin-top: 18px;
}

.writeup-text {
    max-width: 420px;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.writeup-art {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 64px 56px;
    border-left: 1px solid var(--line);
    background-color: #f7f8fa;
    background-image: radial-gradient(circle, #d3d6dd 1px, transparent 1.3px);
    background-size: 18px 18px;
}

.writeup-art .shot {
    max-width: 480px;
    margin: 0 auto;
}

/* ---------- Read-only (dark) ---------- */

.trust {
    margin-top: 140px;
    background: #0e0e10;
    color: #fff;
}

.trust-head {
    padding: 128px 24px 48px;
    text-align: center;
}

.trust-title {
    margin-top: 12px;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.05em;
    color: #fff;
    text-wrap: balance;
}

.trust-shot {
    width: min(440px, calc(100% - 40px));
    margin: 0 auto 112px;
}

.intel-grid.trust-grid {
    grid-template-columns: repeat(4, 1fr);
}

.trust-grid .intel-item h3 {
    margin-top: 56px;
}

/* ---------- Auto Plan ---------- */

.plan-sec {
    padding-top: 0;
}

.plan-sec .writeup-art .shot {
    max-width: 560px;
}

.plan-sec .rail {
    border-top: 0;
}

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

.faq .rail {
    border-top: 1px solid var(--line);
}

.faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.faq-title {
    padding: 80px 48px;
}

.faq-list {
    padding: 56px 48px 72px;
    border-left: 1px solid var(--line);
}

.faq-list details {
    border-bottom: 1px solid var(--line);
}

.faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";
    flex: none;
    font-size: 20px;
    font-weight: 400;
    color: var(--faint);
    transition: transform .2s var(--ease);
}

.faq-list details[open] summary::after {
    transform: rotate(45deg);
}

.faq-list details p {
    max-width: 560px;
    padding-bottom: 22px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--muted);
}

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

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

    .ask:nth-child(4n) {
        border-right: 1px solid var(--line);
    }

    .ask:nth-child(2n) {
        border-right: 0;
    }

    .ask:nth-last-child(-n+4) {
        border-bottom: 1px solid var(--line);
    }

    .ask:nth-last-child(-n+2) {
        border-bottom: 0;
    }

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

    .trust-grid .intel-item:nth-child(3) {
        border-left: 0;
    }

    .trust-grid .intel-item:nth-child(n+3) {
        border-top: 1px solid rgba(255, 255, 255, .09);
    }
}

@media (max-width: 960px) {
    .demo-shell {
        grid-template-columns: minmax(0, 1fr);
        padding: 32px;
    }

    .demo-prompts {
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        padding-top: 0;
    }

    .demo-prompts::-webkit-scrollbar {
        display: none;
    }

    .demo-label {
        display: none;
    }

    .demo-prompt {
        flex: none;
        border-color: var(--line-2);
        background: rgba(255, 255, 255, .6);
    }

    .writeup-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .writeup-art,
    .faq-list {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .faq-title {
        padding-bottom: 32px;
    }

    .faq-list {
        border-top: 0;
        padding-top: 0;
    }
}

@media (max-width: 720px) {
    .ai-hero {
        padding: 56px 0 40px;
    }

    .demo-shell {
        margin: 0 -16px;
        padding: 20px 16px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .demo-shot {
        margin: 0 auto;
    }

    .asks {
        padding-top: 96px;
    }

    .asks-head,
    .writeup-copy,
    .faq-title {
        padding: 56px 20px 40px;
    }

    .asks-grid {
        grid-template-columns: 1fr;
    }

    .ask,
    .ask:nth-child(n) {
        min-height: 0;
        gap: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .ask:last-child {
        border-bottom: 0;
    }

    .writeup-art {
        padding: 40px 20px;
    }

    .trust {
        margin-top: 96px;
    }

    .trust-head {
        padding: 88px 20px 40px;
    }

    .trust-shot {
        margin-bottom: 72px;
    }

    .intel-grid.trust-grid {
        grid-template-columns: 1fr;
    }

    .trust-grid .intel-item,
    .trust-grid .intel-item:nth-child(n) {
        border-left: 0;
    }

    .trust-grid .intel-item+.intel-item {
        border-top: 1px solid rgba(255, 255, 255, .09);
    }

    .trust-grid .intel-item h3 {
        margin-top: 20px;
    }

    .faq-list {
        padding: 0 20px 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shot.is-in {
        animation: none;
    }
}
