/* Case studies share the portfolio's header, fonts, palette and contact footer. */
.case-study { --cs-gutter: clamp(24px, 4vw, 64px); --cs-header-height: 100px; }
html:has(.case-study) { scroll-padding-top: 0; }
.cs-container { width: min(1200px, calc(100% - var(--cs-gutter) * 2)); margin-inline: auto; }
.cs-skip { position: fixed; top: -80px; left: 20px; z-index: 120; padding: 12px 20px; background: white; color: var(--color-blue); }
.cs-skip:focus { top: 16px; }
.cs-hero { padding: 144px 0 64px; background: linear-gradient(180deg,#f4f6fb,#eef1f7); }
.cs-back { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-sm); color: var(--color-text-muted); }
.cs-back:hover { color: var(--color-blue); }
.cs-hero-grid { display: grid; grid-template-columns: .9fr 1.2fr; align-items: center; gap: 64px; margin-top: 32px; }
.cs-eyebrow { color: var(--color-blue); letter-spacing: .16em; font-size: var(--text-xs); font-weight: 700; margin-bottom: 24px; }
.cs-hero h1 { font-size: clamp(44px, 4.8vw, 68px); font-weight: 400; line-height: 1.04; letter-spacing: -.04em; text-wrap: initial; }
.cs-hero h1 em { color: var(--color-blue); }
.cs-platform { margin: 24px 0 28px; color: var(--color-text-muted); font-size: var(--text-base); }
.cs-hero .pill { gap: 24px; }
.cs-figure { margin: 0; min-width: 0; }
.cs-image-button { position: relative; display: block; width: 100%; background: white; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 12px; cursor: zoom-in; overflow: hidden; }
.cs-image-button img { width: 100%; height: auto; object-fit: contain; border-radius: var(--radius-sm); }
.cs-enlarge { position: absolute; bottom: 20px; right: 20px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--color-blue); box-shadow: 0 2px 16px #0d0b2620; font-size: 24px; font-weight: 400; transition: background .2s,color .2s; }
.cs-image-button:hover .cs-enlarge { background: var(--color-blue); color: #fff; }
.cs-figure figcaption { margin-top: 14px; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.cs-hero-image .cs-image-button { background: white; padding: 20px; border: 0; box-shadow: 0 12px 40px #1026500a; }
.cs-hero-image figcaption { text-align: right; }
.cs-section-nav { position: sticky; top: var(--cs-header-height); z-index: 20; background: #fff; border-bottom: 1px solid var(--color-border); }
.cs-section-nav .cs-container { display: flex; align-items: center; gap: 32px; overflow-x: auto; scrollbar-width: thin; }
.cs-section-nav a { flex-shrink: 0; display: block; padding: 20px 0; border-bottom: 2px solid transparent; color: var(--color-text-muted); font-size: var(--text-sm); }
.cs-section-nav a:hover,.cs-section-nav a[aria-current="location"] { color: var(--color-blue); border-bottom-color: var(--color-blue); }
.cs-section { padding: clamp(52px, 6vw, 88px) 0; scroll-margin-top: calc(var(--cs-header-height) + 68px); }
.case-study .cs-section { scroll-margin-top: calc(var(--cs-header-height) + 68px); }
.cs-section--tint { background: var(--color-surface); }
.cs-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 40px; border-bottom: 1px solid var(--color-border); padding-bottom: 24px; }
.cs-section h2,.cs-related h2 { font-size: var(--text-xl); font-weight: 500; }
.cs-top { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--color-border); border-radius: 50%; flex-shrink: 0; color: var(--color-blue); }
.cs-top:hover { background: white; }
.cs-prose { max-width: 75ch; font-size: var(--text-base); line-height: 1.8; color: #4a5063; }
.cs-prose h3 { color: var(--color-text); font-size: var(--text-lg); font-weight: 600; line-height: 1.3; margin: 0 0 18px; text-wrap: initial; }
.cs-prose p + p,.cs-prose p + h3 { margin-top: 20px; }
.cs-prose + .cs-prose { margin-top: 36px; }
.cs-prose a { color: var(--color-blue); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.cs-details { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px 64px; border-top: 1px solid var(--color-border); padding-top: 40px; margin: 40px 0; }
.cs-details .cs-prose { margin: 0; }
.cs-details .cs-prose p + p { margin-top: 7px; }
.cs-grid { display: grid; gap: 32px; align-items: start; margin-top: 36px; }
.cs-grid--screens { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px 24px; }
.cs-grid--boards { grid-template-columns: 1fr; gap: 40px; }
.cs-grid--boards .cs-image-button { padding: 24px; }
.cs-grid--comparison { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 850px; margin-inline: auto; gap: 48px; }
.cs-grid--comparison .cs-prose { min-height: 80px; margin-bottom: 20px; font-weight: 500; color: var(--color-text); }
.cs-grid--single { max-width: 760px; margin-inline: auto; }
.cs-grid--single .cs-image-button img { max-height: 1000px; }
.cs-callout { margin-top: 40px; padding: 28px 32px; background: #eef1fb; border-left: 3px solid var(--color-blue); max-width: none; }
.cs-callout h3 { max-width: 65ch; }
.cs-callout p { max-width: 75ch; }
.cs-grid + .cs-prose { margin-top: 40px; }
.cs-feature { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 80px; }
.cs-feature .cs-figure { width: 100%; max-width: 420px; justify-self: end; }
.cs-section--results { background: var(--color-surface-dark); color: #fff; }
.cs-section--results .cs-prose { color: #e7e7f6; font-size: var(--text-lg); max-width: 60ch; }
.cs-section--results .cs-section-heading { border-color: #ffffff25; }
.cs-section--results .cs-top { border-color: #ffffff35; color: white; }
.cs-section--results .cs-top:hover { background: #ffffff15; }
.cs-related { padding: 72px 0; border-bottom: 1px solid var(--color-border); }
.cs-related-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.cs-related-top a,.cs-bottom-links a { font-size: var(--text-sm); color: var(--color-blue); }
.cs-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cs-related-grid a { display: grid; grid-template-columns: 1fr auto; gap: 12px; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); padding: 32px 0; }
.cs-related-grid a > span:first-child { grid-column: 1/-1; font-size: var(--text-xs); color: var(--color-text-muted); }
.cs-related-grid strong { font-size: var(--text-lg); font-weight: 500; }
.cs-related-grid a:hover strong { color: var(--color-purple); }
.cs-bottom-links { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 32px; }
.cs-contact-note { max-width: 50ch; margin: 20px auto; font-size: var(--text-sm); color: var(--color-text-muted); }
.cs-lightbox { position: fixed; inset: 24px; width: calc(100% - 48px); max-width: 1400px; height: calc(100dvh - 48px); max-height: none; margin: auto; padding: 0 24px 16px; border: 0; border-radius: var(--radius-lg); background: #f5f6fb; color: var(--color-text); }
.cs-lightbox::backdrop { background: #07091bdb; }
.cs-lightbox[open] { display: flex; flex-direction: column; }
.cs-lightbox-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px 0; }
.cs-lightbox-toolbar p { font-size: var(--text-sm); font-weight: 500; }
.cs-lightbox-close { flex-shrink: 0; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: var(--color-surface-dark); color: white; font-size: var(--text-sm); }
.cs-lightbox-scroll { flex: 1; min-height: 0; overflow: auto; display: grid; align-items: start; justify-items: center; }
.cs-lightbox-scroll img { max-width: 100%; width: auto; height: auto; object-fit: contain; }
.cs-original { align-self: center; padding-top: 14px; color: var(--color-blue); font-size: var(--text-sm); }
body.image-open { overflow: hidden; }
@media (min-width: 901px) and (max-width: 1250px) {
  .case-study .header { padding-inline: 24px; }
  .case-study .header__inner { gap: 16px; }
  .case-study .brand-logo { height: 52px; }
  .case-study .brand-name { font-size: 21px; }
  .case-study .brand-tag { font-size: 15px; }
  .case-study .nav { gap: 18px; margin-right: 0; font-size: 16px; }
  .case-study .header__ctas .btn { padding: 12px 16px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 900px) {
  .cs-hero { padding-top: 112px; }
  .cs-hero-grid { gap: 32px; grid-template-columns: 1fr 1fr; }
  .cs-grid--screens { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cs-details { gap: 32px; }
  .cs-feature { gap: 32px; }
}
@media (max-width: 600px) {
  .case-study .header { padding-inline: 16px; }
  .cs-hero { padding-bottom: 40px; }
  .cs-hero-grid { grid-template-columns: 1fr; gap: 36px; margin-top: 24px; }
  .cs-hero h1 { font-size: 48px; }
  .cs-platform { margin-block: 18px 24px; }
  .cs-hero-image .cs-image-button { padding: 12px; }
  .cs-section-nav .cs-container { gap: 24px; }
  .cs-section-nav a { padding-block: 16px; }
  .cs-section-heading { margin-bottom: 28px; }
  .cs-details,.cs-feature,.cs-grid--comparison,.cs-related-grid { grid-template-columns: 1fr; gap: 32px; }
  .cs-grid--screens { grid-template-columns: 1fr; gap: 32px; }
  .cs-grid--screens .cs-figure { width: 100%; max-width: 360px; margin-inline: auto; }
  .cs-grid--comparison .cs-prose { min-height: 0; }
  .cs-grid--boards .cs-image-button { padding: 8px; }
  .cs-callout { padding: 24px; }
  .cs-related-top { align-items: flex-start; flex-direction: column; }
  .cs-lightbox { inset: 10px; width: calc(100% - 20px); height: calc(100dvh - 20px); padding-inline: 12px; }
  .cs-lightbox-toolbar { gap: 12px; }
  .case-study .cs-section { scroll-margin-top: calc(var(--cs-header-height) + 60px); }
}
