/* Case study pages — built on the tokens, type and motion in styles.css */

:root { --cs-body: #3d3731; --cs-on-accent: #f5f2ed; --cs-on-accent-muted: rgba(245, 242, 237, 0.78); --cs-accent: #14315e; }
:root[data-theme="dark"] { --cs-body: #c3ccd8; }
.cs--ba { --cs-accent: #14315e; }
.cs--tesco { --cs-accent: #00539f; }
.cs--expana { --cs-accent: #0e3b2c; }
.cs--gap { --cs-accent: #1b3a3c; }
:root[data-theme="dark"] .cs--ba { --cs-accent: #1d4482; }
:root[data-theme="dark"] .cs--expana { --cs-accent: #14513d; }
:root[data-theme="dark"] .cs--gap { --cs-accent: #24525a; }

.cs ul, .cs ol { list-style: none; }
.cs strong { font-weight: 600; }

/* Hero */
.cs-hero { padding: clamp(128px, 12vw, 168px) 0 clamp(48px, 5vw, 64px); display: flex; flex-direction: column; gap: 28px; }
.cs-title { font-family: "Orpheus Pro", "Instrument Serif", "Times New Roman", serif; font-synthesis: style; font-variation-settings: normal; font-weight: 400; font-size: clamp(35px, 5.12vw, 74px); line-height: 1.04; letter-spacing: 0.005em; max-width: 1060px; text-wrap: balance; }
.cs-hero .chips li { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.cs-showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cs-showcase img { display: block; width: 100%; height: auto; aspect-ratio: 753 / 992; object-fit: cover; border-radius: 20px; }
.cs-banner img, .cs-banner video { display: block; width: 100%; height: auto; border-radius: 20px; }

/* Sections */
.cs-section { padding: clamp(72px, 9vw, 112px) 0; display: flex; flex-direction: column; gap: 48px; border-bottom: 1px solid var(--border); }
.cs-section--last { border-bottom: 0; }
.cs-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 40px 64px; }
.cs-split--end { align-items: end; }
.cs-stack { display: flex; flex-direction: column; gap: 24px; }
.cs-stack--sm { gap: 16px; }
.cs-h2 { font-family: "Orpheus Pro", "Instrument Serif", "Times New Roman", serif; font-synthesis: style; font-variation-settings: normal; font-weight: 400; font-size: clamp(32px, 2.6vw + 8px, 46px); line-height: 1.1; letter-spacing: 0.005em; text-wrap: balance; }
.cs-h2--xl { font-size: clamp(40px, 4.4vw + 4px, 66px); line-height: 1.05; max-width: 960px; }
.cs-h3 { font-size: clamp(24px, 1.2vw + 12px, 30px); line-height: 1.2; font-weight: 300; letter-spacing: -0.02em; }
.cs-text, .cs-stack > p { font-size: 18px; line-height: 1.65; color: var(--cs-body); }
.cs-text--sm { font-size: 16px; }
.cs-kicker { font-size: 13px; line-height: 18px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--muted-foreground); }

/* Big-number lists */
.cs-kpis { display: flex; flex-direction: column; align-self: end; }
.cs-kpis li { display: flex; flex-direction: column; gap: 6px; padding: 28px 0; border-top: 1px solid var(--border); }
.cs-kpis li:last-child { border-bottom: 1px solid var(--border); }
.cs-kpis strong { font-size: clamp(40px, 3vw + 12px, 54px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; }
.cs-kpis span { font-size: 16px; color: var(--muted-foreground); }

/* Numbered lists */
.cs-numlist li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); font-size: 17px; line-height: 1.5; transition: padding-left 500ms var(--ease-out-quint); }
.cs-numlist li:last-child { border-bottom: 1px solid var(--border); }
.cs-numlist li > span:first-child { font-size: 13px; color: var(--muted-foreground); font-weight: 500; padding-top: 3px; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .cs-numlist li:hover { padding-left: 8px; } }

/* Cards */
.cs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 320px)), 1fr)); gap: 16px; }
.cs-card { background: var(--secondary); border: 1px solid var(--border); border-radius: 16px; padding: clamp(24px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 16px; transition: transform 500ms var(--ease-out-quint), box-shadow 500ms var(--ease-out-quint); }
.cs-card p, .cs-card li { font-size: 16px; line-height: 1.6; color: var(--cs-body); }
.cs-card__lead { font-size: 18px !important; line-height: 1.5 !important; color: var(--foreground) !important; }
.cs-card__title { font-size: clamp(24px, 1vw + 16px, 30px); line-height: 1.2; font-weight: 300; letter-spacing: -0.02em; }
.cs-card__value { font-size: clamp(40px, 2vw + 24px, 52px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; }
.cs-card ul.cs-bullets { display: flex; flex-direction: column; gap: 8px; padding-left: 18px; list-style: disc; }
@media (hover: hover) { .cs-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(var(--shadow-rgb), 0.08); } }

/* Panels */
.cs-panel { border-radius: 20px; padding: clamp(28px, 3vw, 36px); display: flex; flex-direction: column; gap: 24px; background: var(--secondary); border: 1px solid var(--border); }
.cs-panel--accent { background: var(--cs-accent); color: var(--cs-on-accent); border-color: transparent; }
.cs-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cs-panel--accent .cs-kicker { color: var(--cs-on-accent-muted); }
.cs-icon { width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; background: var(--background); color: var(--foreground); flex-shrink: 0; }
.cs-panel--accent .cs-icon { background: rgba(245, 242, 237, 0.14); color: var(--cs-on-accent); }
.cs-panel__list li { padding: 16px 0; border-top: 1px solid var(--border); font-size: 19px; line-height: 1.45; }
.cs-panel__list li:last-child { border-bottom: 1px solid var(--border); }
.cs-panel--accent .cs-panel__list li { border-color: rgba(245, 242, 237, 0.2); }

/* Check lists */
.cs-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px 32px; }
.cs-checks li { display: flex; align-items: flex-start; gap: 12px; font-size: 17px; line-height: 1.5; }
.cs-checks svg { flex-shrink: 0; margin-top: 3px; color: var(--cs-accent); }
:root[data-theme="dark"] .cs-checks svg { color: var(--hero-accent); }

/* Figures */
.cs-figure { display: flex; flex-direction: column; gap: 12px; }
.cs-media { display: block; overflow: hidden; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.cs-media img { display: block; width: 100%; height: auto; transition: transform 900ms var(--ease-out-quint); }
a.cs-media { cursor: zoom-in; }
@media (hover: hover) { a.cs-media:hover img { transform: scale(1.02); } }
.cs-figure figcaption { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.cs-media--pad { background: var(--secondary); padding: 24px; display: flex; justify-content: center; }
.cs-media--pad img { max-width: 240px; border-radius: 8px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 440px)), 1fr)); gap: 24px; align-items: start; }
.cs-grid--wide { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); }
.cs-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cs-thumbs .cs-media { border-radius: 10px; }
.cs-thumbs img { aspect-ratio: 1035 / 617; object-fit: cover; }

/* Insight rows: big stat + bar + quotes */
.cs-insights { border-top: 1px solid var(--border); }
.cs-insight { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; padding: 40px 0; border-bottom: 1px solid var(--border); }
.cs-insight__stat { display: flex; flex-direction: column; gap: 16px; }
.cs-insight__stat strong { font-size: clamp(56px, 4vw + 24px, 80px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; }
.cs-insight__stat p { font-size: 20px; line-height: 1.4; }
.cs-bar { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.cs-bar span { display: block; height: 100%; width: var(--w); background: var(--cs-accent); transform: scaleX(0); transform-origin: left center; transition: transform 1400ms var(--ease-out-quint) 300ms; }
:root[data-theme="dark"] .cs-bar span { background: var(--hero-accent); }
.is-in .cs-bar span, html:not(.js) .cs-bar span { transform: none; }

/* Quotes */
.cs-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; align-content: start; }
.cs-quote { background: var(--secondary); border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.cs-quote::before { content: "\201C"; font-family: "Orpheus Pro", "Instrument Serif", serif; font-size: 48px; line-height: 0.6; height: 22px; color: var(--muted-foreground); opacity: 0.6; }
.cs-quote blockquote { font-size: 17px; line-height: 1.55; }
.cs-quote figcaption { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 500; margin-top: auto; }
.cs-person { display: flex; align-items: center; gap: 12px; text-transform: none !important; letter-spacing: 0 !important; }
.cs-person > span:first-child { width: 40px; height: 40px; border-radius: 999px; background: var(--foreground); color: var(--background); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.cs-person > span:last-child { display: flex; flex-direction: column; }
.cs-person strong { font-size: 15px; font-weight: 500; color: var(--foreground); }
.cs-person em { font-style: normal; font-size: 14px; color: var(--muted-foreground); }

/* Pills */
.cs-pill { align-self: flex-start; padding: 6px 14px; border-radius: 999px; background: var(--secondary); border: 1px solid var(--border); font-size: 12px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 500; }
.cs-pill--accent { background: var(--cs-accent); border-color: transparent; color: var(--cs-on-accent); }
.cs-option__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cs-option__head span:last-child { font-size: 20px; }

/* Video placeholder */
.cs-video { border: 1.5px dashed var(--border); border-radius: 16px; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted-foreground); text-align: center; padding: 24px; }
.cs-video span:last-child { font-size: 16px; max-width: 360px; }

/* Outcome stats */
.cs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 16px; }
.cs-stat { background: var(--secondary); border: 1px solid var(--border); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 220px; transition: transform 500ms var(--ease-out-quint); }
.cs-stat strong { font-size: clamp(44px, 2.4vw + 24px, 64px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; }
.cs-stat span { font-size: 17px; line-height: 1.5; color: var(--cs-body); }
.cs-stat--accent { background: var(--cs-accent); border-color: transparent; color: var(--cs-on-accent); }
.cs-stat--accent span { color: var(--cs-on-accent-muted); }
@media (hover: hover) { .cs-stat:hover { transform: translateY(-4px); } }
.cs-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 40px; }
.cs-lines li { padding: 22px 0; border-top: 1px solid var(--border); font-size: 18px; line-height: 1.5; }
.cs-defs li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--border); font-size: 18px; line-height: 1.5; }
.cs-defs li:last-child { border-bottom: 1px solid var(--border); }
.cs-defs li span:last-child { color: var(--cs-body); }

/* Tesco org chart */
.cs-org { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.cs-org__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cs-org__head span:first-child { font-size: 22px; font-weight: 300; letter-spacing: -0.01em; }
.cs-org__head span:last-child { font-size: 13px; color: var(--muted-foreground); }
.cs-org .chips li { display: inline-flex; align-items: center; gap: 6px; background: var(--background); }
.cs-org .chips li.is-mine { background: var(--cs-accent); color: var(--cs-on-accent); border-color: transparent; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; color: var(--muted-foreground); align-items: center; }
.cs-legend span:first-child { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--cs-accent); color: var(--cs-on-accent); }

/* Prev / next */
.cs-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; padding: 48px 0 64px; }
.cs-next a { display: flex; flex-direction: column; gap: 8px; padding: 28px; border-radius: 16px; background: var(--secondary); border: 1px solid var(--border); transition: transform 500ms var(--ease-out-quint), background-color 300ms var(--ease-std); }
.cs-next a span:first-child { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 500; }
.cs-next a span:last-child { font-family: "Orpheus Pro", "Instrument Serif", serif; font-variation-settings: normal; font-size: 32px; line-height: 1.1; }
.cs-next a.cs-next__fwd { background: #060e1a; color: #f5f2ed; text-align: right; border-color: transparent; }
.cs-next a.cs-next__fwd span:first-child { color: rgba(245, 242, 237, 0.7); }
:root[data-theme="dark"] .cs-next a.cs-next__fwd { background: var(--cs-accent); }
@media (hover: hover) { .cs-next a:hover { transform: translateY(-4px); } }

/* Responsive */
@media (max-width: 900px) {
  .cs-insight { grid-template-columns: 1fr; gap: 24px; }
  .cs-grid--wide { grid-template-columns: 1fr; }
  .cs-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-defs li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 560px) {
  .cs-showcase { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cs-showcase::-webkit-scrollbar { display: none; }
  .cs-showcase img { flex: 0 0 78%; width: 78%; height: auto; scroll-snap-align: start; border-radius: 16px; }
  .cs-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-text, .cs-stack > p { font-size: 17px; }
  .cs-panel__list li { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-bar span { transform: none; transition: none; }
}

/* Metrics: four columns; the first is highlighted, and the highlight follows the pointer. */
.cs-metrics { list-style: none; margin: clamp(32px, 4vw, 48px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-metric { display: flex; flex-direction: column; gap: 14px; padding: clamp(28px, 3vw, 44px) clamp(22px, 2.6vw, 42px); border-radius: 20px; color: var(--cs-body); transition: background-color 450ms var(--ease-out-quint), color 450ms var(--ease-out-quint); }
.cs-metric p { margin: 0; font-size: 18px; line-height: 1.75; }
.cs-metric__num { font-size: 17px; font-weight: 500; letter-spacing: 0.04em; color: var(--muted-foreground); font-variant-numeric: tabular-nums; transition: color 450ms var(--ease-out-quint); }
.cs-metric__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--foreground); transition: color 450ms var(--ease-out-quint); }
.cs-metric:first-child,
.cs-metrics:hover .cs-metric:hover { background: var(--foreground); color: var(--background); }
.cs-metric:first-child .cs-metric__num,
.cs-metrics:hover .cs-metric:hover .cs-metric__num { color: color-mix(in srgb, var(--background) 70%, transparent); }
.cs-metric:first-child .cs-metric__title,
.cs-metrics:hover .cs-metric:hover .cs-metric__title { color: var(--background); }
@media (hover: hover) {
  .cs-metrics:hover .cs-metric:first-child:not(:hover) { background: transparent; color: var(--cs-body); }
  .cs-metrics:hover .cs-metric:first-child:not(:hover) .cs-metric__num { color: var(--muted-foreground); }
  .cs-metrics:hover .cs-metric:first-child:not(:hover) .cs-metric__title { color: var(--foreground); }
}
@media (max-width: 900px) { .cs-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cs-metrics { grid-template-columns: minmax(0, 1fr); } .cs-metric p { font-size: 17px; } }

/* Gallery lightbox: click a deck thumbnail to open a carousel of the whole deck. */
.cs-lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #f5f2ed; overflow: hidden; }
.cs-lightbox::backdrop { background: rgba(8, 10, 14, 0.9); backdrop-filter: blur(6px); }
.cs-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: cs-lb-in 400ms var(--ease-out-quint); }
.cs-lightbox[open]::backdrop { animation: cs-lb-fade 400ms var(--ease-out-quint); }
@keyframes cs-lb-in { from { opacity: 0; transform: scale(0.97); } }
@keyframes cs-lb-fade { from { opacity: 0; } }
.cs-lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px clamp(16px, 3vw, 32px); }
.cs-lightbox__title { font-size: 14px; font-weight: 500; letter-spacing: 1.96px; text-transform: uppercase; color: rgba(245, 242, 237, 0.7); }
.cs-lightbox__count { font-variant-numeric: tabular-nums; color: #f5f2ed; margin-left: 12px; }
.cs-lightbox__stage { position: relative; overflow: hidden; touch-action: pan-y; }
.cs-lightbox__track { display: flex; height: 100%; transition: transform 600ms var(--ease-out-quint); }
.cs-lightbox__slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; padding: 0 clamp(16px, 9.5vw, 120px); }
.cs-lightbox__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; background: #fff; user-select: none; -webkit-user-drag: none; }
.cs-lightbox__caption { text-align: center; padding: 18px 16px 28px; font-size: 15px; color: rgba(245, 242, 237, 0.8); min-height: 1.5em; }
.cs-lightbox button { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgba(245, 242, 237, 0.24); background: rgba(245, 242, 237, 0.08); color: #f5f2ed; cursor: pointer; transition: background-color 300ms var(--ease-std), transform 450ms var(--ease-out-quint), opacity 300ms var(--ease-std); }
.cs-lightbox button:hover { background: rgba(245, 242, 237, 0.18); }
.cs-lightbox button:active { transform: scale(0.94); }
.cs-lightbox button:focus-visible { outline: 2px solid #f5f2ed; outline-offset: 3px; }
.cs-lightbox button:disabled { opacity: 0.3; cursor: default; }
.cs-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.cs-lightbox__nav:active { transform: translateY(-50%) scale(0.94); }
.cs-lightbox__nav--prev { left: clamp(12px, 2.5vw, 40px); }
.cs-lightbox__nav--next { right: clamp(12px, 2.5vw, 40px); }
@media (max-width: 560px) { .cs-lightbox__nav { top: auto; bottom: 8px; transform: none; } .cs-lightbox__slide { padding: 0 12px 64px; } }
@media (prefers-reduced-motion: reduce) { .cs-lightbox__track, .cs-lightbox[open], .cs-lightbox[open]::backdrop { transition: none; animation: none; } }
.cs-lightbox--single .cs-lightbox__nav, .cs-lightbox--single .cs-lightbox__count { display: none; }
@media (max-width: 560px) { .cs-lightbox--single .cs-lightbox__slide { padding-bottom: 0; } }

/* Discussion guide: a sticky intro on the left, the questions on the right. */
.cs-guide__part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: 32px 64px; align-items: start; padding-top: clamp(48px, 6vw, 72px); border-top: 1px solid var(--border); scroll-margin-top: 96px; }
.cs-guide__aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 112px; }
.cs-guide__aside .eyebrow { font-size: 12.5px; }
.cs-guide__aside > p:last-child { font-size: 16px; line-height: 1.6; color: var(--cs-body); max-width: 300px; }
.cs-guide__card { gap: 12px; }
@media (hover: hover) { .cs-guide__card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.35); } }
.cs-guide__follow { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14.5px !important; }
.cs-guide__note { font-size: 14.5px !important; color: var(--muted-foreground) !important; }
.cs-guide__list li { grid-template-columns: 56px minmax(0, 1fr); padding: 20px 0; }
.cs-guide__list li > span:last-child { display: flex; flex-direction: column; gap: 8px; color: var(--foreground); }
.cs-guide__list small { font-size: 15px; color: var(--cs-body); }
@media (max-width: 900px) { .cs-guide__part { grid-template-columns: minmax(0, 1fr); } .cs-guide__aside { position: static; } }

/* Product videos: a framed, looping screen recording that plays while on screen. */
.cs-media--video { cursor: default; }
.cs-media--video video { display: block; width: 100%; height: auto; }
.cs-media--phone { background: var(--secondary); padding: clamp(24px, 4vw, 48px); display: flex; justify-content: center; }
.cs-media--phone video { width: auto; max-width: 100%; max-height: 640px; border-radius: 24px; }

/* Hero screens: the link frame does the rounding, so the image sits flush inside it */
.cs-banner .cs-media { background: transparent; }
.cs-banner .cs-media img { border-radius: 0; }

/* Smaller unit after a stat number, e.g. the % in 300% */
.cs-stat strong .cs-unit { font-size: 0.5em; }

/* The GAP Partnership: linked case-study cards (hub page + "other challenges") */
.cs-studies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.cs-study { display: flex; flex-direction: column; gap: 16px; color: inherit; text-decoration: none; }
.cs-study__media { display: block; overflow: hidden; border-radius: 16px; aspect-ratio: 4 / 3; }
.cs-study__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out-quint); }
.cs-study__title { font-size: clamp(24px, 1vw + 16px, 30px); line-height: 1.2; font-weight: 300; letter-spacing: -0.02em; }
.cs-study__more { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; background: linear-gradient(currentcolor, currentcolor) left bottom / 0 1px no-repeat; transition: background-size 450ms var(--ease-track); align-self: flex-start; padding-bottom: 2px; }
.cs-study__more span { transition: transform 450ms var(--ease-out-quint); }
@media (hover: hover) {
  .cs-study:hover .cs-study__media img { transform: scale(1.04); }
  .cs-study:hover .cs-study__more { background-size: 100% 1px; }
  .cs-study:hover .cs-study__more span { transform: translateX(4px); }
}
.cs-study:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 6px; border-radius: 16px; }

/* Phone-sized image (e.g. an animated GIF) shown like the phone videos */
.cs-media--phone img { width: auto; max-width: 100%; max-height: 640px; border-radius: 24px; }

/* Embedded phone animation (e.g. the GAP AI agent) inside the phone frame */
.cs-media--phone iframe { display: block; width: 100%; max-width: 319px; aspect-ratio: 399 / 801; height: auto; border: 0; background: transparent; color-scheme: light; }

/* Frameless media: for images with their own transparent background and shadows */
.cs-media--bare { background: none; border: 0; border-radius: 0; overflow: visible; }

/* Card images with a separate version for each colour theme */
.cs-study__media img.theme-dark-only { display: none; }
:root[data-theme="dark"] .cs-study__media img.theme-dark-only { display: block; }
:root[data-theme="dark"] .cs-study__media img.theme-light-only { display: none; }

/* SVG card art: the viewBox includes the full glow, so show it whole rather than cropping */
.cs-study__media img[src$=".svg"] { object-fit: contain; }
/* Let the soft glow spill past the card (it fades to nothing), so the art can sit larger */
.cs-study__media:has(img[src$=".svg"]) { overflow: visible; min-height: 0; }
.cs-study__media img[src$=".svg"] { transform: scale(1.35); }
@media (hover: hover) { .cs-study:hover .cs-study__media img[src$=".svg"] { transform: scale(1.4); } }

/* Bullet lists in running text (outside cards) match the card bullets and body copy */
.cs-stack > ul.cs-bullets { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; list-style: disc; }
.cs-stack > ul.cs-bullets li { font-size: inherit; line-height: 1.6; }

/* Lightbox pan mode ([data-pan] links): very wide images fill the height and scroll sideways */
.cs-lightbox__slide--pan { padding: 0 clamp(12px, 3vw, 40px); min-width: 0; }
.cs-lightbox__pan { width: 100%; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; cursor: grab; border-radius: 12px; scrollbar-color: rgba(245, 242, 237, 0.4) transparent; }
.cs-lightbox__pan.is-dragging { cursor: grabbing; }
.cs-lightbox__pan:focus-visible { outline: 2px solid #f5f2ed; outline-offset: 3px; }
.cs-lightbox__slide--pan .cs-lightbox__pan img { display: block; height: 100%; width: auto; max-width: none; max-height: none; border-radius: 0; }

/* Screen-reader-only text */
.cs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Animated usage bar chart (GAP: top 5 tools). Colours validated for colour-blind separation per theme. */
.cs-usage { --u-num: #0b8f7f; --u-beh: #b9781f; --u-neg: #8a63d2; --u-name: 148px; --u-val: 56px; display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 3vw, 36px); border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
:root[data-theme="dark"] .cs-usage { --u-num: #1fa595; --u-beh: #c4852b; --u-neg: #8f6fdc; }
.cs-usage--num { --u: var(--u-num); }
.cs-usage--beh { --u: var(--u-beh); }
.cs-usage--neg { --u: var(--u-neg); }
.cs-usage__legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted-foreground); }
.cs-usage__legend li { display: inline-flex; align-items: center; gap: 8px; }
.cs-usage__legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--u); }
.cs-usage__rows { display: flex; flex-direction: column; gap: 6px; }
.cs-usage__row { position: relative; display: grid; grid-template-columns: var(--u-name) minmax(0, 1fr) var(--u-val); align-items: center; gap: 16px; padding: 6px 0; border-radius: 8px; outline: none; transition: opacity 300ms var(--ease-std); }
.cs-usage__name { font-size: 15px; font-weight: 500; color: var(--foreground); text-align: right; }
.cs-usage__val { font-size: 15px; font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; }
/* Recessive gridlines at 0/25/50/75/100% behind each bar */
.cs-usage__track { position: relative; height: 16.5px; background: linear-gradient(to right, var(--border) 1px, transparent 1px) 0 0 / 25% 100% repeat-x; box-shadow: inset -1px 0 0 var(--border); }
/* Bars grow from the baseline when the chart scrolls into view, one after another */
.cs-usage__bar { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); background: var(--u); border-radius: 0 4px 4px 0; transform-origin: left center; }
.js .cs-usage__bar { transform: scaleX(0); }
.js .reveal.is-in .cs-usage__bar { transform: none; transition: transform 1400ms var(--ease-out-quint) calc(250ms + var(--i) * 120ms); }
@media (prefers-reduced-motion: reduce) { .js .cs-usage__bar { transform: none; transition: none; } }
.cs-usage__axis { position: relative; height: 16px; margin: 0 calc(var(--u-val) + 16px) 0 calc(var(--u-name) + 16px); font-size: 12px; color: var(--muted-foreground); }
.cs-usage__axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cs-usage__axis span:nth-child(1) { left: 0; transform: none; }
.cs-usage__axis span:nth-child(2) { left: 25%; }
.cs-usage__axis span:nth-child(3) { left: 50%; }
.cs-usage__axis span:nth-child(4) { left: 75%; }
.cs-usage__axis span:nth-child(5) { left: 100%; }
/* Hover / keyboard focus: highlight one bar, dim the rest, show its group */
@media (hover: hover) { .cs-usage__rows:hover .cs-usage__row:not(:hover) { opacity: 0.45; } }
.cs-usage__rows:has(.cs-usage__row:focus-visible) .cs-usage__row:not(:focus-visible) { opacity: 0.45; }
.cs-usage__row::after { content: attr(data-tip); position: absolute; left: calc(var(--u-name) + 16px + (100% - var(--u-name) - var(--u-val) - 32px) * var(--v) / 100); bottom: calc(100% - 2px); transform: translate(-100%, 4px); padding: 6px 10px; border-radius: 8px; background: var(--foreground); color: var(--background); font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease-std), transform 200ms var(--ease-std); z-index: 1; }
@media (hover: hover) { .cs-usage__row:hover::after { opacity: 1; transform: translate(-100%, 0); } }
.cs-usage__row:focus-visible::after { opacity: 1; transform: translate(-100%, 0); }
.cs-usage__row:focus-visible .cs-usage__name { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .cs-usage { --u-name: 92px; --u-val: 40px; }
  .cs-usage__row { gap: 10px; }
  .cs-usage__name { font-size: 13px; }
  .cs-usage__val { font-size: 13px; }
  .cs-usage__axis { margin: 0 calc(var(--u-val) + 10px) 0 calc(var(--u-name) + 10px); }
  .cs-usage__axis span:nth-child(2), .cs-usage__axis span:nth-child(4) { display: none; }
}

/* Animated banner (e.g. the GAP Trade Surveyor walkthrough) */
.cs-banner__anim { display: block; width: 100%; aspect-ratio: 1302 / 720; height: auto; border: 0; border-radius: 20px; background: #f3f4f6; color-scheme: light; }
.cs-banner__anim--flow { aspect-ratio: 1500 / 829; background: #F4F6F7; }
.cs-banner__hint { display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; margin: 0 0 14px; font-size: 16.1px; line-height: 23px; color: var(--muted-foreground); }
.cs-banner__hint svg { flex: none; width: 18px; height: 18px; }
.cs-media--plain { background: transparent; border: 0; border-radius: 0; padding: 0; overflow: visible; }

/* Embedded looping animation (iframe) sized by its artwork */
.cs-anim { display: block; width: 100%; aspect-ratio: 1977 / 1443; height: auto; border: 0; background: transparent; color-scheme: light; }
.cs-anim--flow { aspect-ratio: 1864 / 860; }
.cs-fan object { display: block; width: 100%; aspect-ratio: 5715 / 4867; height: auto; color-scheme: light; }
