.case-study-page {
    background: var(--color-bg);
}

.case-study-article {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding-bottom: clamp(4rem, 7vw, 6.5rem);
}

.case-study-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.72fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
    padding: clamp(2.2rem, 5vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
}

.case-study-hero h1 {
    max-width: 18ch;
    margin: 0;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4.8vw, 4rem);
    line-height: 1.08;
}

.case-study-lead {
    max-width: 720px;
    margin: 1.1rem 0 0;
    color: var(--muted);
    font-size: clamp(1.06rem, 1.8vw, 1.24rem);
    line-height: 1.62;
}

.case-study-summary {
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(23, 35, 54, 0.08);
}

.case-study-summary h2 {
    margin: 0 0 1rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.12rem;
}

.case-study-summary dl {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.case-study-summary div {
    padding-top: 0.85rem;
    border-top: 1px solid rgba(27, 53, 96, 0.12);
}

.case-study-summary div:first-child {
    padding-top: 0;
    border-top: 0;
}

.case-study-summary dt {
    color: var(--primary-2);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-study-summary dd {
    margin: 0.2rem 0 0;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.42;
}

.case-study-image {
    margin: 0 auto clamp(2rem, 5vw, 3.5rem);
}

.case-study-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(23, 35, 54, 0.14);
}

.case-study-image figcaption {
    max-width: 760px;
    margin: 0.7rem auto 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.case-study-body,
.case-study-panel,
.case-study-cta {
    max-width: 760px;
    margin-right: auto;
    margin-left: auto;
}

.case-study-body .decision-testimonial {
    max-width: none;
    margin: 1.75rem 0 0;
}

.case-study-body h2 {
    margin-top: clamp(2.2rem, 5vw, 3.2rem);
    margin-bottom: 0.85rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1.18;
}

.case-study-body h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.12rem;
}

.case-study-body p,
.case-study-body li {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.66;
}

.case-study-body ul,
.case-study-body ol {
    padding-left: 1.35rem;
}

.case-study-body li + li {
    margin-top: 0.45rem;
}

.case-study-body a {
    color: var(--primary);
    font-weight: 800;
    text-decoration-color: rgba(27, 53, 96, 0.28);
    text-underline-offset: 0.18em;
}

.case-study-focus {
    display: grid;
    gap: 0.85rem;
    margin: 1.25rem 0;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(23, 35, 54, 0.05);
}

.case-study-focus p {
    margin: 0;
}

.case-study-focus strong {
    color: var(--primary);
}

.priority-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.priority-grid article {
    min-height: 100%;
    padding: 1rem;
    border: 1px solid rgba(27, 53, 96, 0.14);
    border-radius: 8px;
    background: #fff;
}

.priority-grid article:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.priority-grid h3 {
    margin-top: 0;
}

.case-study-note {
    margin: 1.25rem 0;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--primary-2);
    background: color-mix(in srgb, var(--accent-soft), #fff 58%);
    color: var(--primary);
    font-weight: 800;
}

.case-study-panel {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding: clamp(1.2rem, 3vw, 1.6rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.case-study-panel h2 {
    margin: 0 0 1rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}

.setup-diagram {
    display: grid;
    gap: 1rem;
}

.setup-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.setup-label {
    color: var(--primary-2);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.setup-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    align-items: stretch;
}

.setup-flow--after {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-node {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    border: 1px solid rgba(27, 53, 96, 0.16);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font-weight: 850;
    line-height: 1.35;
    text-align: center;
}

.setup-node--emphasis {
    border-color: color-mix(in srgb, var(--primary-2), transparent 56%);
    background: color-mix(in srgb, var(--accent-soft), #fff 55%);
}

.setup-arrow {
    display: none;
}

.protected-path {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(27, 53, 96, 0.14);
}

.protected-path p {
    margin: 0;
    color: var(--primary);
    font-weight: 800;
}

.outcome-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.outcome-list li {
    min-height: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(47, 111, 86, 0.24);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font-weight: 850;
    line-height: 1.4;
}

.case-study-cta {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding: clamp(1.5rem, 4vw, 2.2rem);
    border: 1px solid color-mix(in srgb, var(--primary-2), transparent 64%);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(23, 35, 54, 0.08);
}

.case-study-cta h2 {
    margin: 0 0 0.8rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.case-study-cta p {
    margin-bottom: 1rem;
    color: var(--muted);
}

.case-study-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none;
}

.case-study-button:hover,
.case-study-button:focus-visible {
    background: var(--primary-2);
    color: #fff;
}

@media (min-width: 768px) {
    .setup-flow .setup-node:not(:last-child) {
        position: relative;
    }

    .setup-flow .setup-node:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 50%;
        right: -0.58rem;
        z-index: 1;
        width: 0.58rem;
        height: 2px;
        background: color-mix(in srgb, var(--primary-2), transparent 45%);
    }
}

@media (max-width: 767.98px) {
    .case-study-article {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .case-study-hero,
    .setup-row,
    .protected-path {
        grid-template-columns: 1fr;
    }

    .setup-flow,
    .setup-flow--after,
    .priority-grid,
    .outcome-list {
        grid-template-columns: 1fr;
    }

    .priority-grid article:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .setup-node {
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
    }

    .setup-arrow {
        display: block;
        color: var(--primary-2);
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
}
