/* ============================================================
   Case studies: listing cards, case study layout and HTML/CSS wireframes.
   Uses theme tokens only, so light and dark mode work automatically.
   ============================================================ */

:root {
    --cs-good: #047857;
    --cs-good-bg: #ecfdf5;
    --cs-bad: #b91c1c;
    --cs-bad-bg: #fef2f2;
    --cs-accent: #7c3aed;
    --cs-accent-bg: #f5f3ff;
}

html[data-theme="dark"] {
    --cs-good: #6ee7b7;
    --cs-good-bg: #0f2a22;
    --cs-bad: #fca5a5;
    --cs-bad-bg: #2f1517;
    --cs-accent: #c4b5fd;
    --cs-accent-bg: #1e1638;
}

/* ---------- Case study page ---------- */

/* Impact strip */

/* Context card */
.cs-context {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 2rem;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 2.5rem;
}

.cs-context dt {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-light);
}

.cs-context dd {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    font-size: 0.97rem;
    line-height: 1.5;
}

/* Body */

/* Equation */
.cs-equation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: var(--cs-accent-bg);
    border-radius: 14px;
    padding: 1.2rem 1.4rem;
    margin: 1.5rem 0 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cs-equation .term {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    font-size: 0.95rem;
}

.cs-equation .op {
    color: var(--cs-accent);
    font-size: 1.2rem;
}

/* Tables */

/* Funnel bars */
.cs-funnel {
    margin: 1.5rem 0 2rem;
    display: grid;
    gap: 0.55rem;
}

.cs-funnel .row {
    display: grid;
    grid-template-columns: minmax(120px, 210px) 1fr;
    gap: 0.9rem;
    align-items: center;
    font-size: 0.92rem;
}

.cs-funnel .name { color: var(--text-primary); font-weight: 600; }

.cs-funnel .track {
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 30px;
    overflow: hidden;
}

.cs-funnel .bar {
    height: 100%;
    background: var(--primary);
    border-radius: 7px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding-left: 10px;
    white-space: nowrap;
}

html[data-theme="dark"] .cs-funnel .bar { color: #0b1220; }

.cs-funnel .bar.after { background: var(--cs-good); }
html[data-theme="dark"] .cs-funnel .bar.after { background: #34d399; }

/* Lever cards */

/* ---------- Wireframes ---------- */
.wf-compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 1rem;
    justify-items: center;
}

.wf-figure {
    margin: 0;
    width: 100%;
    max-width: 280px;
}

.wf-figure figcaption {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.7rem;
    color: var(--text-secondary);
}

.wf-figure.before figcaption { color: var(--cs-bad); }
.wf-figure.after figcaption { color: var(--cs-good); }

.wf-phone {
    border: 2px solid var(--text-light);
    border-radius: 28px;
    padding: 12px 10px 16px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.wf-phone::before {
    content: "";
    display: block;
    width: 64px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    margin: 0 auto 10px;
}

.wf-screen {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 12px;
    min-height: 420px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.wf-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
}

.wf-h {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.wf-sub { font-size: 11.5px; color: var(--text-light); }

.wf-field {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 10px;
    background: var(--surface);
}

.wf-field .k { display: block; font-size: 10.5px; color: var(--text-light); }
.wf-field .v { color: var(--text-primary); font-weight: 600; }
.wf-field.filled { border-color: var(--cs-good); }
.wf-field.error { border-color: var(--cs-bad); }
.wf-field.error .k { color: var(--cs-bad); }

.wf-btn {
    margin-top: auto;
    text-align: center;
    border-radius: 10px;
    padding: 10px;
    font-weight: 700;
    background: var(--primary);
    color: #ffffff;
}

html[data-theme="dark"] .wf-btn { color: #0b1220; }
html[data-theme="dark"] .wf-btn.ghost { color: var(--primary); }

.wf-btn.ghost {
    margin-top: 0;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.wf-steps {
    display: flex;
    gap: 4px;
}

.wf-steps span {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
}

.wf-steps span.done { background: var(--cs-good); }
.wf-steps span.now { background: var(--primary); }

.wf-chip {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--cs-good-bg);
    color: var(--cs-good);
}

.wf-chip.warn { background: var(--cs-bad-bg); color: var(--cs-bad); }

.wf-box {
    border-radius: 10px;
    padding: 9px 10px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
}

.wf-box.trust { background: var(--cs-good-bg); border-color: transparent; color: var(--text-primary); }

.wf-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.wf-row b { color: var(--text-primary); }

.wf-lines span {
    display: block;
    height: 7px;
    border-radius: 4px;
    background: var(--border);
    margin: 5px 0;
}

.wf-lines span:nth-child(2) { width: 85%; }
.wf-lines span:nth-child(3) { width: 65%; }

.wf-camera {
    border-radius: 12px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-oval {
    width: 92px;
    height: 120px;
    border-radius: 50%;
    border: 3px dashed var(--text-light);
}

.wf-oval.ok { border: 3px solid var(--cs-good); }

.wf-annot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cs-accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
    margin-right: 4px;
}

html[data-theme="dark"] .wf-annot { color: #0b1220; }

.wf-legend {
    max-width: 46rem;
    font-size: 0.93rem;
    margin: 0.5rem 0 1.5rem;
}

.wf-legend li { margin-bottom: 0.35rem; }

@media (max-width: 760px) {
    .cs-funnel .row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* Key takeaways */
