/* Case study detail (single-zs_case_study.php): patterned banner, browser-framed screenshots,
   "at a glance" tiles, the story in numbered chapters with feature cards, a tinted results panel,
   and "meet your next team" faces. Orange for actions and dots, blue for numbers and icons. */

.case-detail { --peach: #fbdcc6; --sky: #d9eaf7; --sand: #f6e3c8; }

/* ---------- Banner ---------- */
.case-banner { padding: 40px 0 56px; }
.case-banner.has-showcase { padding-bottom: 150px; }
.case-banner__grid { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 44px; align-items: center; margin-top: 22px; }
.case-banner__logo { margin: 0; aspect-ratio: 1; display: grid; place-items: center; padding: 22px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 14px 30px -20px rgba(42, 33, 28, 0.5); }
.case-banner__logo img { width: 100%; height: 100%; object-fit: contain; }
.case-banner__body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.case-banner__title { margin: 0; max-width: 22em; }
.case-banner__intro { max-width: 58ch; font-size: 19px; line-height: 1.55; }
.case-banner__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.case-banner__meta .chip--link { background: rgba(255, 255, 255, 0.7); }

/* ---------- Browser-framed screenshots ---------- */
.case-showcase { position: relative; z-index: 1; margin-top: -112px; }
.case-shot { margin: 0; overflow: hidden; border-radius: 16px; background: #fff; border: 1px solid var(--c-border-strong); box-shadow: 0 24px 50px -30px rgba(42, 33, 28, 0.45); }
.case-shot img { display: block; width: 100%; height: auto; }
.case-shot__bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: #f4f1ec; border-bottom: 1px solid var(--c-border); }
.case-shot__bar i { width: 10px; height: 10px; border-radius: 50%; background: #d0402b; }
.case-shot__bar i:nth-child(2) { background: #e3a008; }
.case-shot__bar i:nth-child(3) { background: var(--c-blue); }
.case-shot__url { margin-left: 12px; padding: 3px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--c-border); font-size: 12.5px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }

/* ---------- At a glance ---------- */
.case-glance__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.case-glance__tile { display: grid; align-content: start; gap: 12px; padding: 24px 26px; border-radius: var(--radius); background: var(--tile); border: 1px solid rgba(30, 30, 30, 0.06); }
.case-glance__tile--peach { --tile: var(--peach); }
.case-glance__tile--sky { --tile: var(--sky); }
.case-glance__tile--sand { --tile: var(--sand); }
.case-glance__label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.case-glance__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(30, 30, 30, 0.08); color: var(--c-blue); }
.case-glance__icon svg { width: 18px; height: 18px; }
.case-glance__text { font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1.2; }
.case-glance__text--result { color: var(--c-text); }
.case-glance__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.case-glance__list li { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); font-size: 14.5px; font-weight: 600; }

/* ---------- The story ---------- */
.case-story { padding-top: 24px; }
.case-story__body { max-width: 1060px; margin: 0 auto; display: grid; gap: 72px; }
.case-chapter { display: grid; gap: 20px; scroll-margin-top: calc(var(--header-h, 80px) + 24px); }
.case-chapter__copy { max-width: 720px; }
.case-chapter.has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px 56px; align-items: start; }
.case-chapter.has-media .case-chapter__copy { grid-column: 1; }
.case-chapter.has-media .case-chapter__media { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--header-h, 80px) + 24px); }
.case-chapter.has-media.is-flipped .case-chapter__copy { grid-column: 2; }
.case-chapter.has-media.is-flipped .case-chapter__media { grid-column: 1; }
.case-chapter.has-media .case-features { grid-column: 1 / -1; }
.case-chapter__step { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.case-chapter__step span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--c-surface) 90%, #1e1e1e); border: 1px solid var(--c-border); font-family: var(--f-display); font-size: 17px; letter-spacing: 0; color: var(--c-blue); }
.case-chapter__title { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.05; margin-bottom: 14px; }
.case-chapter__text { font-size: 18px; }

/* Feature cards (list items lifted out of the story) */
.case-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.case-feature { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--c-surface-2); border: 1px solid var(--c-border); font-weight: 600; line-height: 1.4; }
.case-feature__dot { flex: none; width: 8px; height: 8px; margin-top: 0.5em; border-radius: 50%; background: var(--c-accent); }
.case-features--highlights .case-feature { display: grid; gap: 6px; font-weight: 400; }
.case-features--highlights strong { font-family: var(--f-display); font-size: 19px; }

.case-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

/* Pull quote */
.case-quote { margin: 0; padding: 40px 44px; border-radius: var(--radius-lg); background: var(--c-surface-2); border: 1px solid var(--c-border); }
.case-quote blockquote { margin: 0; font-family: var(--f-display); font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; line-height: 1.25; }
.case-quote blockquote p::before { content: "“"; color: var(--c-accent); }
.case-quote blockquote p::after { content: "”"; color: var(--c-accent); }
.case-quote figcaption { margin-top: 16px; color: var(--c-muted); }

/* Results panel */
.case-results { display: grid; gap: 28px; padding: clamp(28px, 4vw, 52px); border-radius: var(--radius-lg); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M9 4l5 5-5 5-5-5z' fill='none' stroke='%23fff' stroke-opacity='.75' stroke-width='1.2'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3Ccircle cx='18' cy='18' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3C/svg%3E"), var(--sky); }
.case-chapter--result .eyebrow { justify-self: start; }
.case-results .case-chapter__text { max-width: 760px; }
.case-results__metrics { margin: 0; }
.case-results .case-feature { background: rgba(255, 255, 255, 0.75); }

/* ---------- Meet your next team ---------- */
.case-team__inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 40px; align-items: center; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M9 4l5 5-5 5-5-5z' fill='none' stroke='%23fff' stroke-opacity='.75' stroke-width='1.2'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3Ccircle cx='18' cy='18' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3C/svg%3E"), var(--sand); }
.case-team__copy { display: grid; gap: 12px; }
.case-team__copy .eyebrow { justify-self: start; }
.case-team__title { font-size: clamp(30px, 3vw, 44px); line-height: 1.02; }
.case-team__text { color: var(--c-muted); font-size: 17px; }
.case-team__faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.case-face { display: grid; justify-items: center; gap: 4px; padding: 16px 10px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.6); text-align: center; color: var(--c-text); text-decoration: none; transition: transform 160ms, background-color 160ms; }
.case-face__photo { width: 96px; height: 96px; margin-bottom: 8px; border-radius: 50%; overflow: hidden; background: var(--c-surface); box-shadow: 0 8px 18px -12px rgba(42, 33, 28, 0.5); }
.case-face__photo img { width: 100%; height: 100%; object-fit: cover; }
.case-face__name { font-weight: 700; line-height: 1.2; }
.case-face__role { font-size: 13.5px; line-height: 1.35; color: var(--c-muted); }
.case-face:hover, .case-face:focus-visible { transform: translateY(-3px); background: #fff; }
.case-face:hover .case-face__name { color: var(--c-blue); }

/* The quiz starter sits between the story and the team. */
.case-detail .quiz-teaser { padding-top: 24px; }

@media (max-width: 1023px) {
	.case-chapter.has-media, .case-chapter.has-media.is-flipped { grid-template-columns: 1fr; }
	.case-chapter.has-media .case-chapter__copy, .case-chapter.has-media .case-chapter__media, .case-chapter.has-media.is-flipped .case-chapter__copy, .case-chapter.has-media.is-flipped .case-chapter__media { grid-column: 1; grid-row: auto; position: static; }
	.case-glance__grid { grid-template-columns: 1fr; }
	.case-team__inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
	.case-banner__grid { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
	.case-banner__logo { padding: 12px; border-radius: 14px; }
	.case-banner__body { display: contents; }
	.case-banner__body .eyebrow, .case-banner__title { grid-column: 2; }
	.case-banner__intro, .case-banner__meta { grid-column: 1 / -1; font-size: 17px; }
	.case-banner.has-showcase { padding-bottom: 90px; }
	.case-showcase { margin-top: -70px; }
	.case-story__body { gap: 52px; }
	.case-quote { padding: 26px; }
}

/* Text-only chapters read editorially: step and title on the left (sticky), text on the right. */
@media (min-width: 1024px) {
	.case-chapter.is-editorial { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr); gap: 20px 56px; }
	.case-chapter.is-editorial .case-chapter__copy { display: contents; }
	.case-chapter.is-editorial .case-chapter__step, .case-chapter.is-editorial .case-chapter__title { grid-column: 1; }
	.case-chapter.is-editorial .case-chapter__step { grid-row: 1; align-self: end; margin: 0; }
	.case-chapter.is-editorial .case-chapter__title { grid-row: 2; align-self: start; position: sticky; top: calc(var(--header-h, 80px) + 24px); }
	.case-chapter.is-editorial .case-chapter__text { grid-column: 2; grid-row: 1 / span 2; }
	.case-chapter.is-editorial .case-features { grid-column: 1 / -1; }
}
.case-results__stat { font-family: var(--f-display); font-size: clamp(36px, 4.4vw, 60px); font-weight: 700; line-height: 1; color: var(--c-blue); }
.case-features__lead { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }

/* ---------- Phone frame for tall app screens ---------- */
.case-shot--phone { justify-self: center; max-width: 300px; padding: 12px; border-radius: 34px; background: #1e1e1e; border: 0; }
.case-shot--phone img { border-radius: 22px; }
.case-shot__notch { display: block; width: 72px; height: 6px; margin: 2px auto 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.25); }
.case-showcase .case-shot--phone { max-width: 340px; margin: 0 auto; }

/* ---------- Snapshot layout: screenshot mosaic + numbered step cards ---------- */
.case-mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.case-mosaic--1 { grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
.case-mosaic--3 > :first-child { grid-row: span 2; }
.case-mosaic .case-shot--phone { max-width: 240px; }
.case-steps { display: grid; gap: 6px; scroll-margin-top: calc(var(--header-h, 80px) + 24px); }
.case-steps__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.case-steps__grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.case-step { position: relative; overflow: hidden; display: grid; align-content: start; gap: 10px; padding: 24px 26px; border-radius: var(--radius); background: var(--c-surface-2); border: 1px solid var(--c-border); scroll-margin-top: calc(var(--header-h, 80px) + 24px); }
.case-step:nth-child(4n + 2) { background: color-mix(in srgb, var(--sky) 55%, var(--c-surface-2)); }
.case-step:nth-child(4n + 3) { background: color-mix(in srgb, var(--sand) 60%, var(--c-surface-2)); }
.case-step:nth-child(4n + 4) { background: color-mix(in srgb, var(--peach) 50%, var(--c-surface-2)); }
.case-step__sketch { position: absolute; right: -24px; bottom: -22px; width: 150px; color: var(--c-muted); opacity: 0.12; stroke-width: 1.4; pointer-events: none; }
.case-step__n { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: color-mix(in srgb, var(--c-surface) 90%, #1e1e1e); border: 1px solid var(--c-border); font-family: var(--f-display); font-size: 17px; color: var(--c-blue); }
.case-step__title { position: relative; font-size: 22px; line-height: 1.15; }
.case-step__text { position: relative; font-size: 16px; }
.case-step__text p { margin: 0 0 0.6em; }
.case-step__chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.case-step__chips li { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--c-border); font-size: 13.5px; font-weight: 600; }

/* ---------- Metrics dashboard: stat cards, growth bars, before/after table ---------- */
.case-metrics { display: grid; gap: 24px; }
.case-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
.case-stat { display: grid; align-content: start; gap: 6px; padding: 20px 22px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--c-border); }
.case-stat__label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.case-stat__value { margin: 0; font-family: var(--f-display); font-size: clamp(34px, 3.2vw, 46px); font-weight: 700; line-height: 1; color: var(--c-blue); }
.case-stat__prev { font-size: 0.55em; color: var(--c-muted); }
.case-stat__note { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--c-muted); }
.case-bars { margin: 0; padding: 24px 26px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--c-border); display: grid; gap: 12px; }
.case-bars__title { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.case-bars__row { display: grid; grid-template-columns: minmax(140px, 0.9fr) minmax(0, 2fr) 70px; gap: 14px; align-items: center; }
.case-bars__label { font-weight: 600; line-height: 1.25; }
.case-bars__label small { font-weight: 400; color: var(--c-muted); }
.case-bars__track { height: 14px; border-radius: 14px; background: var(--c-surface); overflow: hidden; }
.case-bars__fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--c-blue), color-mix(in srgb, var(--c-blue) 65%, #fff)); transform-origin: left; transition: transform 1.2s var(--ease-out); }
.motion .case-results:not(.is-in) .case-bars__fill { transform: scaleX(0); }
.case-bars__value { font-family: var(--f-display); font-weight: 700; color: var(--c-blue); text-align: right; }
.case-table { margin: 0; }
.case-table table { width: 100%; border-collapse: collapse; background: rgba(255, 255, 255, 0.85); border-radius: var(--radius); overflow: hidden; }
.case-table th, .case-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--c-border); }
.case-table thead th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.case-table__up { font-weight: 700; color: var(--c-blue); }
.case-table__up small { font-weight: 400; color: var(--c-muted); }
.case-table figcaption { margin-top: 8px; font-size: 13.5px; color: var(--c-muted); }

/* ---------- More case studies: one row of five hero-style cards ---------- */
.case-more__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.case-more .hero-card { position: relative; display: block; aspect-ratio: 227 / 270; border-radius: 16px; overflow: hidden; background: var(--c-surface); transition: box-shadow 200ms var(--ease-out); }
.case-more .hero-card:hover, .case-more .hero-card:focus-visible { box-shadow: 0 0 0 3px var(--c-accent); }
.case-more .hero-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; }
.case-more .hero-card__img.is-current { opacity: 1; }
.case-more .hero-card__story { display: flex; flex-direction: column; padding: 8px 8px 12px; text-align: center; background: #fffaf2; }
.case-more .hero-card__photo { position: static; flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 10px; background: var(--c-surface); opacity: 1; }
.case-more .hero-card__stat { margin-top: 10px; font-family: var(--f-display); font-weight: 700; font-size: 19px; line-height: 1.05; letter-spacing: -0.02em; color: var(--c-text); text-wrap: balance; }
.case-more .hero-card__more { margin-top: 4px; font-size: 12px; color: var(--c-muted); }
.case-more .hero-card__more::after { content: " \2192"; }

/* Smaller faces for the team row. */
.case-face__photo { width: 76px; height: 76px; }

@media (max-width: 1023px) {
	.case-more__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.case-more__row > :nth-child(n + 4) { display: none; }
	.case-steps__grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
	.case-more__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.case-more__row > :nth-child(n + 3) { display: none; }
	.case-mosaic { grid-template-columns: 1fr; }
	.case-mosaic--3 > :first-child { grid-row: auto; }
	.case-bars__row { grid-template-columns: 1fr 56px; }
	.case-bars__track { grid-column: 1 / -1; grid-row: 2; }
}

/* Brand print instead of faded tints (owner, 2026-11-06): the diamond pattern on full sky / sand / peach. */
.case-step:nth-child(4n + 2), .case-step:nth-child(4n + 3), .case-step:nth-child(4n + 4), .case-glance__tile { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M9 4l5 5-5 5-5-5z' fill='none' stroke='%23fff' stroke-opacity='.75' stroke-width='1.2'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3Ccircle cx='18' cy='18' r='1.4' fill='%23fff' fill-opacity='.8'/%3E%3Ccircle cx='9' cy='9' r='1' fill='%232a211c' fill-opacity='.12'/%3E%3C/svg%3E"); }
.case-step:nth-child(4n + 2) { background-color: var(--sky); }
.case-step:nth-child(4n + 3) { background-color: var(--sand); }
.case-step:nth-child(4n + 4) { background-color: var(--peach); }
.case-glance__tile { background-color: var(--tile); }

/* Frames by what the image is (zs_case_frame): browser window for website screenshots, phone for mobile
   screenshots, plain for photos, mockups and charts. Images are never cropped. */
.case-shot--plain { border: 0; background: transparent; box-shadow: 0 22px 44px -28px rgba(42, 33, 28, 0.45); }
.case-shot--plain img { border-radius: 16px; }
.case-shot--phone { justify-self: center; max-width: 300px; margin-inline: auto; padding: 12px; border-radius: 34px; background: #1e1e1e; border: 0; }
.case-shot--phone img { border-radius: 22px; }
.case-shot--tall { justify-self: center; max-width: 340px; margin-inline: auto; }
.case-mosaic .case-shot--phone, .case-mosaic .case-shot--tall { max-width: 260px; }

/* Section labels ("The challenge", "How we did it"): a small pill like "The results", never stretched by the grid. */
.case-chapter__label { justify-self: start; align-self: start; width: max-content; max-width: 100%; height: auto; margin: 0 0 12px; grid-column: auto; }
@media (min-width: 1024px) {
	.case-chapter.is-editorial .case-chapter__label { grid-column: 1; grid-row: 1; align-self: end; margin: 0; }
}
