/* Services and Case Studies pages (Views/servicesHub, servicePage, caseStudiesHub, caseStudy).
   Built on the site's tokens in custom.css: dark background, Sora, the blue → cyan → green brand gradient
   and the glass material. Loaded only on these pages. */

.sx-page {
    --sx-c1: var(--brand-mint);
    --sx-c2: var(--brand-mint);
    --sx-text: rgba(255, 255, 255, 0.72);
    --sx-muted: rgba(255, 255, 255, 0.5);
    --sx-line: rgba(255, 255, 255, 0.08);
    --sx-card: rgba(255, 255, 255, 0.03);
    overflow-x: clip;
}

/* ---- Hero ---- */
.sx-hero {
    position: relative;
    padding: var(--page-top) 0 70px;
}

.sx-hero-glow {
    position: absolute;
    top: -240px;
    left: 30%;
    width: 900px;
    max-width: 120vw;
    height: 560px;
    transform: translateX(-50%);
    background: radial-gradient(50% 50% at 50% 50%, rgba(46, 230, 182, 0.16) 0%, rgba(46, 230, 182, 0.06) 45%, transparent 72%);
    pointer-events: none;
}

.sx-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 34px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--sx-muted);
}

.sx-breadcrumb li + li::before {
    content: "/";
    margin-right: 6px;
    opacity: 0.5;
}

.sx-breadcrumb a {
    color: var(--sx-muted);
    transition: color 0.2s ease;
}

.sx-breadcrumb a:hover,
.sx-breadcrumb a:focus-visible {
    color: #fff;
}

.sx-breadcrumb [aria-current] {
    color: rgba(255, 255, 255, 0.8);
}

.sx-eyebrow {
    margin-bottom: 22px;
    font-size: 13px;
}

/* Service pages: the eyebrow is a link back to the Services hub */
.sx-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 22px;
    transition: box-shadow 0.25s ease;
}

.sx-back svg {
    width: 14px;
    height: 14px;
    color: #2EE6B6;
    transition: transform 0.25s ease;
}

.sx-back:hover,
.sx-back:focus-visible {
    box-shadow: 0 6px 20px rgba(46, 230, 182, 0.18);
}

.sx-back:hover svg,
.sx-back:focus-visible svg {
    transform: translateX(-3px);
}

.sx-back:focus-visible {
    outline: 2px solid var(--sx-c1);
    outline-offset: 3px;
}

.sx-hero-title {
    margin: 0 0 24px;
    color: #fff;
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.sx-hero-lead,
.sx-hero-lead p {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--sx-text);
}

.sx-hero-lead p:last-child {
    margin-bottom: 0;
}

/* ---- Buttons (.sx-button itself is in custom.css) ---- */
.sx-card-link:focus-visible,
.sx-faq-item summary:focus-visible,
.sx-toc a:focus-visible {
    outline: 2px solid var(--sx-c1);
    outline-offset: 3px;
}

/* ---- Case study facts ---- */
.sx-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 40px;
    margin: 30px 0 0;
}

.sx-fact dt {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--sx-muted);
}

.sx-fact dd {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

/* ---- Long-form body ---- */
.sx-body {
    padding: 30px 0 40px;
}

.sx-h2 {
    margin: 0 0 22px;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
}

.sx-block {
    padding: 44px 0;
    border-top: 1px solid var(--sx-line);
}

.sx-block:first-child {
    border-top: 0;
    padding-top: 10px;
}

.sx-prose {
    font-size: 17px;
    line-height: 1.85;
    color: var(--sx-text);
}

.sx-prose > :last-child {
    margin-bottom: 0;
}

.sx-prose p,
.sx-prose ul,
.sx-prose ol {
    margin-bottom: 18px;
}

.sx-prose h2,
.sx-prose h3,
.sx-prose h4 {
    margin: 30px 0 12px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.sx-prose strong {
    color: #fff;
}

.sx-prose a {
    color: var(--sx-c1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sx-prose ul,
.sx-prose ol {
    padding-left: 0;
    list-style: none;
}

.sx-prose ol {
    counter-reset: sx-ol;
}

.sx-prose ul > li,
.sx-prose ol > li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 28px;
}

.sx-prose ul > li::before {
    content: "";
    position: absolute;
    top: 0.75em;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sx-c1), var(--sx-c2));
}

.sx-prose ol > li::before {
    counter-increment: sx-ol;
    content: counter(sx-ol) ".";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: var(--sx-c1);
}

.sx-prose table {
    width: 100%;
    margin-bottom: 18px;
    border-collapse: collapse;
    font-size: 15px;
}

.sx-prose th,
.sx-prose td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--sx-line);
    text-align: left;
    vertical-align: top;
}

.sx-prose th {
    color: #fff;
}

.sx-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.sx-prose blockquote {
    margin: 0 0 18px;
    padding-left: 18px;
    border-left: 3px solid var(--sx-c2);
}

/* Service results: a bulleted list shows as highlighted cards */
.sx-block--results .sx-prose ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.sx-block--results .sx-prose ul > li {
    margin: 0;
    padding: 22px 22px 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(46, 230, 182, 0.22);
    background: linear-gradient(160deg, rgba(46, 230, 182, 0.08), rgba(46, 230, 182, 0.04));
    color: rgba(255, 255, 255, 0.85);
}

.sx-block--results .sx-prose ul > li::before {
    display: none;
}

.sx-block--results .sx-prose ul > li strong {
    display: block;
    margin-bottom: 4px;
    font-size: 24px;
    line-height: 1.2;
    color: var(--sx-c1);
}

/* "Is this for you?": a bulleted list shows as a checklist */
.sx-block--checklist .sx-prose ul > li {
    padding-left: 34px;
}

.sx-block--checklist .sx-prose ul > li::before {
    top: 0.35em;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(46, 230, 182, 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2335d39a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
    border: 1px solid rgba(46, 230, 182, 0.35);
}

/* ---- Service key facts (under the hero) ---- */
.sx-keyfacts {
    padding: 0 0 20px;
}

.sx-keyfacts .sx-metric-grid--3 {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (min-width: 992px) {
    .sx-keyfacts .sx-metric-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .sx-keyfacts .sx-metric-grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sx-metric-source {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--sx-muted);
}

.sx-metric-source a,
.sx-chart-source a {
    color: var(--sx-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sx-metric-source a:hover,
.sx-chart-source a:hover {
    color: #fff;
}

/* ---- Service diagram / image ---- */
.sx-figure {
    margin: 0 0 10px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--sx-line);
    background: var(--sx-card);
}

/* Block, not the theme's inline-block: a shrink-wrapped link gives a viewBox-only SVG its 300px default */
.sx-figure a {
    display: block;
}

.sx-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.sx-figure figcaption {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--sx-muted);
}

/* ---- Service bar chart (one series, values labelled on every bar) ---- */
.sx-chart {
    margin: 0;
    padding: 28px 28px 24px;
    border-radius: 20px;
    border: 1px solid var(--sx-line);
    background: var(--sx-card);
}

.sx-chart-title {
    margin-bottom: 22px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: #fff;
}

.sx-chart-bars {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sx-chart-row {
    display: grid;
    grid-template-columns: minmax(110px, 30%) 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 9px 0;
}

.sx-chart-label {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

.sx-chart-track {
    display: block;
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.sx-chart-bar {
    display: block;
    height: 100%;
    border-radius: 0 4px 4px 0;
    background: var(--sx-c1);
}

.sx-chart-value {
    min-width: 56px;
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.sx-chart-caption {
    margin: 18px 0 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--sx-text);
}

.sx-chart-source {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--sx-muted);
}

@media (max-width: 576px) {
    .sx-chart {
        padding: 22px 18px 20px;
    }

    .sx-chart-row {
        grid-template-columns: 1fr auto;
        row-gap: 6px;
    }

    .sx-chart-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .sx-figure {
        padding: 10px;
    }
}

/* ---- Sidebar ---- */
.sx-aside {
    position: sticky;
    top: 110px;
    padding: 10px 0 40px 30px;
}

.sx-toc-title {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--sx-muted);
}

.sx-toc ul {
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--sx-line);
}

.sx-toc a {
    display: block;
    padding: 6px 0 6px 16px;
    font-size: 14px;
    color: var(--sx-text);
    transition: color 0.2s ease;
}

.sx-toc a:hover {
    color: #fff;
    text-decoration: none;
}

.sx-aside-cta {
    padding: 24px;
}

.sx-aside-cta-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
}

/* ---- FAQ ---- */
.sx-faq-item {
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--sx-card);
    border: 1px solid var(--sx-line);
    transition: border-color 0.3s ease;
}

.sx-faq-item[open] {
    border-color: rgba(46, 230, 182, 0.3);
}

.sx-faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    list-style: none;
    cursor: pointer;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: #fff;
}

.sx-faq-item summary::-webkit-details-marker {
    display: none;
}

.sx-faq-icon {
    position: relative;
    flex: 0 0 22px;
    height: 22px;
}

.sx-faq-icon::before,
.sx-faq-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    margin: -1px 0 0 -7px;
    border-radius: 2px;
    background: var(--sx-c2);
    transition: transform 0.3s ease;
}

.sx-faq-icon::after {
    transform: rotate(90deg);
}

.sx-faq-item[open] .sx-faq-icon::after {
    transform: rotate(0deg);
}

.sx-faq-answer {
    padding: 0 24px 22px;
    font-size: 15px;
    line-height: 1.85;
    color: var(--sx-text);
}

.sx-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ---- Case study metrics ---- */
.sx-metrics {
    padding: 10px 0 30px;
}

.sx-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sx-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px 24px;
}

.sx-metric-value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--sx-c1);
}

.sx-metric-label {
    font-size: 15px;
    line-height: 1.5;
    color: var(--sx-text);
}

/* ---- Quote and tags ---- */
.sx-quote {
    margin: 10px 0 44px;
    padding: 30px 32px;
    border-radius: 20px;
    border: 1px solid var(--sx-line);
    background: var(--sx-card);
}

.sx-quote blockquote {
    margin: 0;
    font-size: 19px;
    line-height: 1.7;
    color: #fff;
}

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

.sx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sx-tags li {
    padding: 7px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

/* ---- Cards ---- */
.sx-cards {
    padding: 50px 0 30px;
}

.sx-cards .row {
    row-gap: 24px;
}

.sx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 30px 28px;
    border-radius: 20px;
    border: 1px solid var(--sx-line);
    background: var(--sx-card);
    transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.sx-card:hover,
.sx-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(46, 230, 182, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.sx-card-eyebrow {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sx-c2);
}

.sx-card-title {
    margin: 0 0 12px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
}

/* The whole card is clickable through the title link */
.sx-card-link {
    color: #fff;
}

.sx-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.sx-card-link:hover {
    color: #fff;
    text-decoration: none;
}

.sx-card-text {
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--sx-text);
}

.sx-card-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--sx-c1);
}

.sx-card-more svg {
    width: 15px;
    height: 15px;
    transition: transform 0.3s ease;
}

.sx-card:hover .sx-card-more svg {
    transform: translateX(3px);
}

/* Closing CTA (Sections/_Cta) and .sx-button are in custom.css: other pages use them too */

/* ---- Tablet / phone ---- */
@media (max-width: 991px) {
    .sx-hero {
        padding-bottom: 50px;
    }

    .sx-hero-title {
        font-size: 44px;
    }
}

@media (max-width: 576px) {
    .sx-hero {
        padding-bottom: 40px;
    }

    .sx-hero-title {
        font-size: 34px;
        letter-spacing: -0.5px;
    }

    .sx-hero-lead,
    .sx-hero-lead p,
    .sx-prose {
        font-size: 16px;
    }

    .sx-h2 {
        font-size: 26px;
    }

    .sx-block {
        padding: 34px 0;
    }

    .sx-button {
        width: 100%;
        justify-content: center;
    }

    .sx-faq-item summary {
        padding: 18px 18px;
        font-size: 16px;
    }

    .sx-faq-answer {
        padding: 0 18px 18px;
    }

    .sx-card {
        padding: 26px 22px;
    }

    .sx-metric-value {
        font-size: 34px;
    }

    .sx-quote {
        padding: 24px 20px;
    }
}
