/* New Website Theme (Yellow) — Case Study Page Template. Shared by every case study page.
   Markup is generated by ds/case-study.js from window.CASE_STUDY; never restyle per page. */
.csx{--csx-grey:var(--pal-light,#FAFAFA);--csx-text:760px}
[data-theme="dark"] .csx{--csx-grey:var(--bg-2)}
.csx a{color:var(--brand)}.csx a:hover{color:var(--brand-hover,var(--brand))}
[data-theme="dark"] .csx a{color:var(--pal-sky,#C9D6EA)}
.csx :focus-visible{outline:2px solid var(--focus-ring,#1F44FF);outline-offset:2px}
[data-theme="dark"] .csx :focus-visible{outline-color:var(--pal-sky,#C9D6EA)}

/* hero */
.csx-hero{padding:56px 0 40px;background:var(--surface,#fff)}
[data-theme="dark"] .csx-hero{background:var(--bg)}
.csx-hero__g{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:56px;align-items:center}
.csx-hero--solo .csx-hero__g{grid-template-columns:minmax(0,1fr);max-width:880px;margin:0 auto;text-align:center}
.csx-hero--solo .csx-hero__logo,.csx-hero--solo .csx-cta{justify-content:center;margin-left:auto;margin-right:auto}
.csx-hero__logo{display:flex;align-items:center;margin-bottom:24px}
.csx-hero__logo img{display:block;height:auto;max-height:64px;max-width:220px;width:auto;object-fit:contain}
[data-theme="dark"] .csx-logo-chip{background:#fff;padding:10px 14px;border-radius:12px}
.csx-brand{margin:0 0 12px;font-size:13px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--brand)}
[data-theme="dark"] .csx-brand{color:var(--pal-sky,#C9D6EA)}
.csx-hero h1{margin:0;font-family:var(--display);font-weight:700;font-size:clamp(32px,4.2vw,52px);line-height:1.1;letter-spacing:-.025em;color:var(--fg-1);text-wrap:balance;overflow-wrap:anywhere}
.csx-hero--long h1{font-size:clamp(28px,3.4vw,42px);line-height:1.15}
.csx-hero__sub{margin:16px 0 0;font-family:var(--display);font-weight:600;font-size:clamp(20px,2.2vw,26px);line-height:1.35;letter-spacing:-.01em;color:var(--fg-1);text-wrap:balance}
.csx-hero__intro p{margin:20px 0 0;font-size:18px;line-height:29px;color:var(--fg-3);text-wrap:pretty}
.csx-hero__art{margin:0;display:flex;justify-content:center}
.csx-hero__art img{display:block;width:100%;max-width:560px;height:auto;object-fit:contain;border-radius:20px}

/* layout: article + optional contents rail */
.csx-body{padding:0}
.csx-body__g{display:block}
.csx-has-toc .csx-body__g{display:grid;grid-template-columns:minmax(180px,240px) minmax(0,1fr);gap:clamp(40px,4.5vw,64px);align-items:start}
.csx-toc{position:sticky;top:96px;padding-top:0;max-height:calc(100vh - 112px);overflow-y:auto;overscroll-behavior:contain}
.csx-toc__t{margin:0 0 12px;font-size:12px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--fg-4)}
.csx-toc ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;border-left:1px solid var(--border)}
.csx-toc a{display:block;margin-left:-1px;padding:7px 0 7px 14px;border-left:2px solid transparent;font-size:15px;line-height:21px;font-weight:600;color:var(--fg-3);text-decoration:none;overflow-wrap:break-word;text-wrap:pretty}
.csx-toc a:focus-visible,.csx-tocm a:focus-visible,.csx-tocm summary:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:4px}
[data-theme="dark"] :is(.csx-toc a,.csx-tocm a,.csx-tocm summary):focus-visible{outline-color:var(--pal-sky,#C9D6EA)}
.csx-tocm a.is-on{color:var(--brand)}[data-theme="dark"] .csx-tocm a.is-on{color:var(--pal-sky)}
.csx-b h2[tabindex]:focus{outline:none}
.csx-body--tail .csx-b--cta{margin-top:0}
.csx-toc a:hover{color:var(--brand)}
.csx-toc a.is-on{color:var(--brand);border-left-color:var(--brand)}
[data-theme="dark"] .csx-toc a.is-on,[data-theme="dark"] .csx-toc a:hover{color:var(--pal-sky);border-left-color:var(--pal-sky)}
.csx-tocm{display:none}
.csx-art{min-width:0}

/* blocks */
/* rhythm: one section gap (--csx-gap) between blocks, never doubled */
.csx{--csx-gap:56px}
/* Blocks hug their content (no padding on white blocks); the section gap is a margin BETWEEN blocks,
   so a block's box ends at its last line. Text fills the article column — no inner text max-width. */
.csx-b{padding:0;margin:var(--csx-gap) 0 0;scroll-margin-top:96px}
.csx-art>.csx-b:last-child,.csx-body>.wrap>.csx-b:last-child{margin-bottom:var(--csx-gap)}
.csx-art>.csx-tocm+.csx-b{margin-top:var(--csx-gap)}
.csx-has-toc .csx-b>h2{scroll-margin-top:96px}
.csx-b>:first-child{margin-top:0!important}.csx-b>:last-child{margin-bottom:0!important}
.csx-b:empty{display:none}
.csx-grey{padding:var(--csx-gap) 0;background:var(--csx-grey);box-shadow:0 0 0 100vmax var(--csx-grey);clip-path:inset(0 -100vmax)}
@media(min-width:1024px){
  /* inset grey cards inside the article column: 40px gap above and below the card */
  .csx-has-toc .csx-grey{box-shadow:none;clip-path:none;border-radius:24px;padding:48px;margin-top:40px}
  .csx-has-toc .csx-grey+.csx-b{margin-top:40px}
  .csx-toc{z-index:2}
}
.csx-b h2{margin:0;font-family:var(--display);font-weight:700;font-size:clamp(26px,3vw,36px);line-height:1.18;letter-spacing:-.02em;color:var(--fg-1);text-wrap:balance}
.csx-b h3{margin:24px 0 0;font-family:var(--display);font-weight:700;font-size:21px;line-height:29px;color:var(--fg-1)}
.csx-p{max-width:none}
.csx-p>*{margin:16px 0 0}.csx-p>:first-child{margin-top:0}.csx-b>:is(h2,h3)+.csx-p>:first-child{margin-top:16px}
.csx-p p,.csx-p li{margin-bottom:0;font-size:17px;line-height:28px;color:var(--fg-2);text-wrap:pretty}
.csx-p ul,.csx-p ol{padding-left:22px;display:flex;flex-direction:column;gap:8px}
.csx-p li::marker{color:var(--brand)}
.csx-p strong,.csx-p b{color:var(--fg-1)}
.csx-items{list-style:none;margin:24px 0 0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.csx-items>li{padding:24px;border:1px solid var(--border);border-radius:18px;background:var(--surface-elevated)}
.csx-items--num{counter-reset:n;grid-template-columns:minmax(0,1fr)}
.csx-items--num>li{counter-increment:n;display:grid;grid-template-columns:auto minmax(0,1fr);gap:18px}
.csx-items--num>li::before{content:counter(n,decimal-leading-zero);display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--surface-brand);color:var(--brand);font:700 14px/1 var(--display)}
.csx-items h3{margin:0;font-size:18px;line-height:26px}
.csx-items .csx-p>*:first-child{margin-top:8px}
.csx-items .csx-p p,.csx-items .csx-p li{font-size:16px;line-height:26px}
[data-theme="dark"] .csx-items>li{border-color:var(--border-strong)}
[data-theme="dark"] .csx-items--num>li::before{color:var(--pal-sky)}

/* CASE STUDY METRICS (component) — columns follow the space the block actually has (container query on the
   metrics section, not the viewport): 1 col <520px · 2 cols 520–999px (3 cols ≥760px for 3-item groups) · up to 4 cols ≥1000px.
   Values never wrap or clip: one size per group, scaled to the longest value by ds/case-study.js (--met-fs). Labels wrap; cards grow. */
.csx-b:has(>.csx-mets){container-type:inline-size}
.csx-mets{list-style:none;margin:32px 0 0;padding:0;display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}
@container (min-width:520px){.csx-mets{grid-template-columns:repeat(min(var(--n,3),2),minmax(0,1fr))}}
@container (min-width:760px){.csx-mets[style*="--n:3"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container (min-width:1000px){.csx-mets{grid-template-columns:repeat(var(--n,3),minmax(0,1fr))}}
.csx-b>.csx-mets:first-child{margin-top:0}
.csx-met{min-width:0;display:flex;flex-direction:column;gap:8px;padding:28px 24px;border:1px solid var(--border);border-radius:18px;background:var(--surface-elevated);overflow:visible}
.csx-met b{display:block;white-space:nowrap;font-family:var(--display);font-weight:700;font-size:var(--met-fs,clamp(30px,4.4cqi,48px));line-height:1.1;letter-spacing:-.03em;color:var(--brand);font-variant-numeric:tabular-nums}
.csx-met span{font-size:15.5px;line-height:23px;color:var(--fg-2);text-wrap:pretty}
[data-theme="dark"] .csx-met{border-color:var(--border-strong)}
[data-theme="dark"] .csx-met b{color:var(--pal-yellow,#FFE14D)}

/* quote */
.csx-q{margin:0}
.csx-q__ic{font-size:44px;color:var(--brand);line-height:1}
[data-theme="dark"] .csx-q__ic{color:var(--pal-yellow,#FFE14D)}
.csx-q blockquote{margin:8px 0 0;font-family:var(--display);font-weight:600;font-size:clamp(20px,2.2vw,26px);line-height:1.45;letter-spacing:-.01em;color:var(--fg-1);text-wrap:pretty}
.csx-q blockquote p{margin:0 0 14px}.csx-q blockquote p:last-child{margin:0}
.csx-q figcaption{margin-top:24px;display:flex;align-items:center;gap:14px}
.csx-q figcaption img{width:56px;height:56px;border-radius:50%;object-fit:cover;flex:none}
.csx-q figcaption b{display:block;font-size:16px;color:var(--fg-1)}
.csx-q figcaption span{display:block;font-size:15px;color:var(--fg-3)}

/* media */
.csx-media{margin:32px 0 0;display:grid;gap:20px;grid-template-columns:repeat(var(--n,1),minmax(0,1fr))}
.csx-b>.csx-media:first-child{margin-top:0}
.csx-fig{margin:0}
.csx-fig img{display:block;width:100%;height:auto;max-height:620px;object-fit:contain;border-radius:16px;border:1px solid var(--border);background:#fff}
.csx-fig figcaption{margin-top:10px;font-size:14px;line-height:21px;color:var(--fg-3)}

/* cta */
.csx-ctab{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:28px;align-items:center;padding:44px 48px;border-radius:24px;background:#1F44FF;color:#fff}
.csx-ctab h2{color:#fff;max-width:none}
.csx-ctab p{margin:10px 0 0;font-size:17px;line-height:27px;color:#fff}
.csx-cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}
.csx-ctab .csx-cta{margin-top:0}
.csx-cta .btn{white-space:nowrap}
.csx-ctab .btn--white{background:#fff;color:#1F44FF;border:1px solid #fff}
.csx-ctab .btn:focus-visible{outline-color:#fff}
[data-theme="dark"] .csx-ctab{background:#1A2B8F}

/* responsive */
@media(max-width:1023px){
  .csx-has-toc .csx-body__g{display:block}
  .csx-toc{display:none}
  .csx-tocm{display:block;margin:24px 0 0;border:1px solid var(--border);border-radius:14px;background:var(--surface-elevated)}
  .csx-tocm summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 16px;font-weight:700;font-size:15px;color:var(--fg-1);cursor:pointer;list-style:none}
  .csx-tocm summary::-webkit-details-marker{display:none}
  .csx-tocm summary .ms{transition:rotate .2s}
  .csx-tocm[open] summary .ms{rotate:180deg}
  .csx-tocm ol{margin:0;padding:4px 16px 14px 34px;display:flex;flex-direction:column;gap:6px}
  .csx-tocm a{font-size:15px;line-height:22px;font-weight:600;text-decoration:none}
}
@media(max-width:1023px){.csx{--csx-gap:48px}}
@media(max-width:960px){
  .csx-hero__g{grid-template-columns:minmax(0,1fr);gap:36px}
  .csx-hero__art img{max-width:460px}
  .csx-items{grid-template-columns:minmax(0,1fr)}
  .csx-ctab{grid-template-columns:minmax(0,1fr);padding:36px 28px}
}
@media(max-width:600px){
  .csx-hero{padding:40px 0 32px}
  .csx{--csx-gap:40px}
  .csx-media{grid-template-columns:minmax(0,1fr)}
  .csx-items--num>li{grid-template-columns:minmax(0,1fr);gap:12px}
  .csx-met{padding:22px 20px}
}
@media(prefers-reduced-motion:reduce){.csx-tocm summary .ms{transition:none}}
