/* Case study pages.
   Deliberately self-contained: these pages do not load css-style.css, so they
   carry no Bootstrap, no carousel, no tilt and no purge-css coupling. The
   palette repeats the site's values so the two read as one place. */

:root {
    --cs-bg: #ffffff;
    --cs-ink: #16181d;
    --cs-body: #55585f;
    --cs-muted: #6f717a;
    --cs-line: #e4e4e6;
    --cs-hair: #ececee;
    --cs-card: rgba(255, 255, 255, 0.72);
    --cs-code-bg: #f6f6f7;
    --cs-accent: #2ea043;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    /* The site is light-first and stamps data-theme itself; this only matters
       for the split second before the head script runs on a dark device. */
    :root:not([data-theme="light"]) {
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --cs-bg: #0d0f14;
    --cs-ink: #eceef2;
    --cs-body: #a8aab1;
    --cs-muted: #9a9ba1;
    --cs-line: #262930;
    --cs-hair: #1e2128;
    --cs-card: rgba(255, 255, 255, 0.035);
    --cs-code-bg: #15171d;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 20px 80px;
    font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--cs-body);
    background-color: var(--cs-bg);
    -webkit-font-smoothing: antialiased;
}

.cs-wrap {
    max-width: 760px;
    margin: 0 auto;
}

/* ---- top bar ---- */
.cs-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
    padding: 22px 0 0;
}

.cs-back {
    font-family: 'Panchang', sans-serif;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cs-muted);
    text-decoration: none;
    transition: color .25s ease;
}

.cs-back:hover {
    color: var(--cs-ink);
}

.cs-theme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--cs-line);
    border-radius: 50%;
    color: var(--cs-ink);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .25s ease;
}

.cs-theme:hover {
    border-color: var(--cs-ink);
}

/* ---- title block ---- */
.cs-header {
    margin: 44px 0 0;
}

.cs-kicker {
    margin: 0 0 10px;
    font-family: 'Panchang', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

h1.cs-title {
    margin: 0;
    font-family: 'Panchang', sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em;
    color: var(--cs-ink);
}

.cs-standfirst {
    margin: 16px 0 0;
    font-size: 18px;
    line-height: 1.6;
    color: var(--cs-body);
}

.cs-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 30px 0 0;
    padding: 18px 20px;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: 12px;
}

.cs-meta dt {
    margin: 0 0 3px;
    font-family: 'Panchang', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

.cs-meta dd {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--cs-ink);
}

.cs-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 0;
}

.cs-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--cs-line);
    border-radius: 9px;
    font-size: 13px;
    color: var(--cs-ink);
    text-decoration: none;
    transition: border-color .25s ease, background-color .25s ease;
}

.cs-btn:hover {
    border-color: var(--cs-ink);
}

.cs-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* ---- body copy ---- */
h2.cs-h2 {
    margin: 56px 0 0;
    font-family: 'Panchang', sans-serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cs-ink);
}

h3.cs-h3 {
    margin: 34px 0 0;
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cs-ink);
}

.cs-wrap p {
    margin: 14px 0 0;
}

.cs-wrap ul {
    margin: 14px 0 0;
    padding-left: 20px;
}

.cs-wrap li {
    margin: 7px 0 0;
}

.cs-wrap strong {
    color: var(--cs-ink);
    font-weight: 700;
}

.cs-wrap a {
    color: var(--cs-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

code {
    padding: 2px 6px;
    background: var(--cs-code-bg);
    border: 1px solid var(--cs-hair);
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--cs-ink);
}

/* A pulled-out point: the decision, not the description. */
.cs-note {
    margin: 22px 0 0;
    padding: 16px 18px;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-left-width: 3px;
    border-radius: 10px;
    font-size: 14.5px;
}

.cs-note p {
    margin: 0;
}

.cs-note p + p {
    margin-top: 10px;
}

/* ---- diagram ---- */
.cs-figure {
    margin: 28px 0 0;
    padding: 22px 18px 16px;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: 12px;
    overflow-x: auto;
}

.cs-figure svg {
    display: block;
    width: 100%;
    min-width: 520px;
    height: auto;
}

.cs-figure figcaption {
    margin: 16px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--cs-muted);
    text-align: center;
}

/* SVG parts follow the theme through currentColor and these two classes. */
.d-box {
    fill: var(--cs-card);
    stroke: var(--cs-line);
    stroke-width: 1;
}

.d-box-solid {
    fill: var(--cs-ink);
    stroke: var(--cs-ink);
}

.d-label {
    font-family: "Roboto", sans-serif;
    font-size: 11.5px;
    fill: var(--cs-ink);
}

.d-label-invert {
    fill: var(--cs-bg);
}

.d-sub {
    font-family: "Roboto", sans-serif;
    font-size: 9.5px;
    fill: var(--cs-muted);
}

.d-line {
    stroke: var(--cs-muted);
    stroke-width: 1;
    fill: none;
}

.d-line-dash {
    stroke-dasharray: 3 3;
}

/* ---- step list for the handover flow ---- */
.cs-steps {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.cs-steps li {
    position: relative;
    margin: 0;
    padding: 14px 0 14px 44px;
    border-top: 1px solid var(--cs-hair);
    font-size: 14.5px;
}

.cs-steps li:last-child {
    border-bottom: 1px solid var(--cs-hair);
}

.cs-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background: var(--cs-ink);
    color: var(--cs-bg);
    border-radius: 50%;
    font-size: 11.5px;
    font-weight: 700;
}

/* ---- honest list of things to fix ---- */
.cs-fix {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.cs-fix li {
    margin: 0;
    padding: 16px 0;
    border-top: 1px solid var(--cs-hair);
}

.cs-fix li:last-child {
    border-bottom: 1px solid var(--cs-hair);
}

.cs-fix b {
    display: block;
    margin-bottom: 5px;
    font-size: 14.5px;
    color: var(--cs-ink);
}

.cs-fix span {
    display: block;
    font-size: 13.5px;
    line-height: 1.6;
}

/* ---- closing ---- */
.cs-end {
    margin: 60px 0 0;
    padding-top: 26px;
    border-top: 1px solid var(--cs-line);
    text-align: center;
}

.cs-end p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--cs-muted);
}

@media (max-width: 640px) {
    body {
        padding: 0 16px 60px;
        font-size: 15px;
    }

    h1.cs-title {
        font-size: 30px;
    }

    .cs-standfirst {
        font-size: 16px;
    }

    h2.cs-h2 {
        margin-top: 44px;
        font-size: 20px;
    }

    .cs-meta {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .cs-figure {
        padding: 16px 12px 12px;
    }
}
