/* =================================================================== CASE STUDY — LAW FIRM (client, 2026-12-02)
   The project facts shown the way the firm's search answers: a query types into the search box
   (visuals.js data-ui="type"), then an AI summary ("What we did") appears with its source markers,
   and the other facts sit under it as the numbered sources. Uses the .vx-screen product panel. */

.lf-search {
    margin-top: var(--sp45);
    padding: var(--sp40) var(--sp40) var(--sp40);
    border: 1px solid var(--s-line);
    & .ui-search { font-size: var(--f20); padding: 18px 20px; }
    & .ui-answer { margin-top: var(--sp30); gap: 0; }
}
.lf-answer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp18);
    margin: 0;
}

/* the AI summary */
.lf-sum {
    grid-column: 1 / -1;
    padding-bottom: var(--sp30);
    margin-bottom: var(--sp12);
    border-bottom: 1px solid var(--s-line);
    & dt {
        display: inline-flex; align-items: center; gap: 8px;
        margin-bottom: var(--sp15);
        font-family: var(--font-mono); font-size: var(--f12); letter-spacing: 0; text-transform: none;
        color: var(--s-o);
    }
    & dt svg { width: 14px; height: 14px; }
    & dd {
        max-width: 34ch;
        margin: 0;
        font-size: var(--f40); font-weight: 600; line-height: 1.18; letter-spacing: -.02em;
        color: var(--s-fg);
    }
}
.lf-cites { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: .35em; }
.lf-cites > span, .lf-n {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px;
    font-family: var(--font-mono); font-size: var(--f12); font-weight: 600; letter-spacing: 0;
    color: #111; background: var(--s-o);
}
.lf-cites > span { opacity: 0; transform: scale(.4); transition: opacity .3s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.vx-screen.is-answered .lf-cites > span { opacity: 1; transform: none; }
.vx-screen.is-answered .lf-cites > span:nth-child(1) { transition-delay: .5s; }
.vx-screen.is-answered .lf-cites > span:nth-child(2) { transition-delay: .62s; }
.vx-screen.is-answered .lf-cites > span:nth-child(3) { transition-delay: .74s; }
.vx-screen.is-answered .lf-cites > span:nth-child(4) { transition-delay: .86s; }

/* the sources the summary cites — open columns, no boxes: a hairline divider between columns and
   a short orange rule on top of each that draws in when the answer lands */
.lf-answer { column-gap: 0; }
.lf-src {
    position: relative;
    display: flex; flex-direction: column; gap: 14px;
    padding: calc(var(--cvw) * .6) var(--sp30) calc(var(--cvw) * .4);
    border-left: 1px solid var(--s-line);
    opacity: 0; transform: translateY(12px);
    transition: opacity .5s ease, transform .6s cubic-bezier(.16, 1, .3, 1);
    & dt { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: var(--f12); letter-spacing: 0; text-transform: none; color: var(--s-soft); }
    & dd { margin: 0; font-size: var(--f18); font-weight: 500; line-height: 1.45; color: var(--s-fg); text-wrap: pretty; }
    & dd a { color: var(--s-fg); text-decoration: underline; text-decoration-color: var(--s-o); text-underline-offset: .18em; &:hover { color: var(--s-o); } }
    &::after {
        content: ""; position: absolute; left: -1px; top: 0;
        width: 2px; height: 0; background: var(--s-o);
        transition: height .7s cubic-bezier(.65, 0, .35, 1);
    }
    &:hover::after { height: 100%; }
}
.lf-sum + .lf-src { padding-left: 0; border-left: 0; }
.lf-sum + .lf-src::after { display: none; }
.vx-screen.is-answered .lf-src--ai::after { height: 100%; transition-delay: 1.6s; }
.vx-screen.is-answered .lf-src { opacity: 1; transform: none; }
.vx-screen.is-answered .lf-src:nth-child(2) { transition-delay: .9s, .9s, 0s; }
.vx-screen.is-answered .lf-src:nth-child(3) { transition-delay: 1.02s, 1.02s, 0s; }
.vx-screen.is-answered .lf-src:nth-child(4) { transition-delay: 1.14s, 1.14s, 0s; }
.vx-screen.is-answered .lf-src:nth-child(5) { transition-delay: 1.26s, 1.26s, 0s; }
.lf-src::before {              /* "Sources" label over the first column */
    position: absolute; left: 0; bottom: calc(100% + 10px);
    font-family: var(--font-mono); font-size: var(--f12); letter-spacing: 0; text-transform: none; color: var(--s-soft);
    content: none;
}
.lf-sum + .lf-src::before { content: "Sources"; }

@media (max-width: 991.98px) {
    .lf-answer { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
    .lf-src:nth-child(4) { padding-left: 0; border-left: 0; &::after { display: none; } }
}
@media (max-width: 767.98px) {
    .lf-search { padding: 20px; }
    .lf-answer { grid-template-columns: minmax(0, 1fr); }
    .lf-src { padding-left: 16px; }
    .lf-src:nth-child(n) { padding-left: 16px; border-left: 1px solid var(--s-line); &::after { display: block; } }
    .lf-sum + .lf-src::before { left: 0; }
    .lf-cites { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .lf-src, .lf-cites > span { opacity: 1 !important; transform: none !important; }
}

/* =================================================================== ANSWERS — the three kinds of question as routes
   (client, 2026-12-02: no table, no boxes). Each row: the employee's question as a chat bubble, then a drawn
   arrow to the route it takes and what the employee sees. Rows deal in with the homepage stack-rows preset. */
.lf-routes__cap { margin: 0 0 var(--sp20); font-family: var(--font-mono); font-size: var(--f12); letter-spacing: 0; text-transform: none; color: var(--light-grey); }
.lf-routes { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--white-10); }
.lf-route {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--sp30);
    align-items: start;
    padding: var(--sp30) 0;
    border-bottom: 1px solid var(--white-10);
    background: var(--background);
}
.lf-route__ask {
    margin: 0;
    font-size: var(--f25); font-weight: 700; line-height: var(--lhSnug); letter-spacing: var(--ls-h3); color: var(--white);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}
.lf-route__who { display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: var(--f12); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--light-grey); }
.lf-route__path {
    display: flex; align-items: flex-end; gap: 10px; margin: 0 0 12px;
    & svg { width: 34px; height: 24px; flex: 0 0 auto; fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
}
.lf-route__tag {           /* plain mono label, the theme's orange square as the marker */
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: var(--f12); letter-spacing: 0; text-transform: none; color: var(--orange);
    &::before { width: 8px; height: 8px; background: var(--orange); content: ""; }
}
.lf-route__out { margin: 0; padding-left: 44px; font-size: var(--f18); line-height: 1.5; color: var(--white); text-wrap: pretty; }
.lf-route:hover .lf-route__ask { transform: translateX(4px); }
@media (max-width: 767.98px) {
    .lf-route { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 0; }
    .lf-route__out { padding-left: 0; }
}

/* ANSWERS — the footage stays in view while the three routes scroll past (client, 2026-12-02) */
@media (min-width: 992px) {
    #answers .vx-split { align-items: start; }
    #answers .vx-split > .vx { position: sticky; top: calc(var(--header-h, 96px) + 32px); }
}
