/* ═══════════════════════════════════════════════════════════
   Case-study pages, extends styles.css
   ═══════════════════════════════════════════════════════════ */

.case {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 32px 120px;
}

/* ── Back link ─────────────────────────────────────────── */

.case-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 128px 0 56px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

.case-back:hover { color: var(--text); gap: 14px; }
.case-back span { transition: transform 0.25s var(--ease); }
.case-back:hover span { transform: translateX(-3px); }

/* ── Header ────────────────────────────────────────────── */

.case-kicker {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 18px;
}

.case-title {
    font-size: clamp(38px, 6vw, 60px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.04;
    color: var(--text);
    margin-bottom: 20px;
}

.case-standfirst {
    font-size: 19px;
    line-height: 1.6;
    color: var(--text-2);
    margin-bottom: 40px;
    max-width: 62ch;
}

/* ── Fact strip ────────────────────────────────────────── */

.case-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--edge);
    border: 1px solid var(--edge);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 72px;
}

.case-facts > div {
    background: var(--void-2);
    padding: 18px 20px;
}

.case-facts dt {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 7px;
}

.case-facts dd {
    font-size: 14px;
    color: var(--text);
    line-height: 1.45;
}

.case-facts a {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s var(--ease);
}

.case-facts a:hover { border-bottom-color: var(--cyan); }

/* ── Body ──────────────────────────────────────────────── */

.case h2 {
    font-size: 15px;
    font-family: var(--mono);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    margin: 72px 0 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--edge);
    display: flex;
    align-items: center;
    gap: 12px;
}

.case h2::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    flex-shrink: 0;
}

.case h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--text);
    margin: 40px 0 12px;
}

.case p {
    font-size: 16px;
    line-height: 1.78;
    color: var(--text-2);
    margin-bottom: 20px;
}

.case p strong { color: var(--text); font-weight: 600; }

.case a.inline {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(34, 211, 238, 0.35);
    transition: border-color 0.2s var(--ease);
}

.case a.inline:hover { border-bottom-color: var(--cyan); }

.case ul.case-list {
    list-style: none;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.case ul.case-list li {
    position: relative;
    padding-left: 22px;
    font-size: 15.5px;
    line-height: 1.72;
    color: var(--text-2);
}

.case ul.case-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--indigo);
}

.case ul.case-list li strong { color: var(--text); font-weight: 600; }

/* ── Callouts ──────────────────────────────────────────── */

.callout {
    border: 1px solid var(--edge);
    border-left: 2px solid var(--indigo);
    background: var(--glass);
    border-radius: var(--r-sm);
    padding: 20px 24px;
    margin: 32px 0;
}

.callout p:last-child { margin-bottom: 0; }

.callout-label {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--indigo);
    margin-bottom: 10px;
}

/* Draft marker: delete these blocks once filled in */
.todo {
    border: 1px dashed var(--amber);
    border-left: 2px solid var(--amber);
    background: rgba(240, 180, 92, 0.05);
    border-radius: var(--r-sm);
    padding: 20px 24px;
    margin: 32px 0;
}

.todo .callout-label { color: var(--amber); }
.todo p { font-size: 15px; margin-bottom: 12px; }
.todo p:last-child { margin-bottom: 0; }
.todo ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.todo li {
    font-size: 14.5px;
    color: var(--text-2);
    padding-left: 18px;
    position: relative;
    line-height: 1.6;
}
.todo li::before {
    content: '?';
    position: absolute;
    left: 0;
    color: var(--amber);
    font-family: var(--mono);
    font-size: 13px;
}

/* ── Metric row ────────────────────────────────────────── */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin: 32px 0;
}

.metric {
    border: 1px solid var(--edge);
    background: var(--glass);
    border-radius: var(--r-sm);
    padding: 20px 18px;
}

.metric-val {
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 6px;
}

.metric-key {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    line-height: 1.4;
}

/* ── Code ──────────────────────────────────────────────── */

.case pre {
    background: var(--void-2);
    border: 1px solid var(--edge);
    border-radius: var(--r-sm);
    padding: 20px 22px;
    overflow-x: auto;
    margin: 26px 0;
}

.case pre code {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre;
}

.case :not(pre) > code {
    font-family: var(--mono);
    font-size: 0.88em;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.07);
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 5px;
    padding: 1px 6px;
}

/* ── Stack chips ───────────────────────────────────────── */

.case .chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.case .chips li {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-2);
    border: 1px solid var(--edge);
    background: var(--glass);
    border-radius: 999px;
    padding: 5px 13px;
}

/* ── Footer nav ────────────────────────────────────────── */

.case-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 96px;
    padding-top: 32px;
    border-top: 1px solid var(--edge);
}

.case-nav a {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-decoration: none;
    padding: 16px 22px;
    border: 1px solid var(--edge);
    border-radius: var(--r-md);
    background: var(--glass);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
    min-width: 210px;
}

.case-nav a:hover {
    border-color: var(--edge-hi);
    transform: translateY(-2px);
}

.case-nav .nav-dir {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

.case-nav .nav-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.case-nav a.next { text-align: right; margin-left: auto; }

@media (max-width: 620px) {
    .case { padding: 0 22px 80px; }
    .case-back { margin: 96px 0 40px; }
    .case-standfirst { font-size: 17px; }
    .case h2 { margin: 56px 0 20px; }
    .case-nav a { min-width: 100%; }
    .case-nav a.next { text-align: left; margin-left: 0; }
}
