/*
 * Implementation projects: the cards on a product page, the archive grid and
 * the facts panel on a project's own page all share one card.
 */

.sx-projects {
	margin-top: var( --wp--preset--spacing--60 );
}

.sx-projects__title {
	margin: 0 0 var( --wp--preset--spacing--40 );
	font-size: var( --sx-title-section );
	line-height: 1.2;
	/*
	 * Product names join their parts with a plus sign, which is no break
	 * opportunity: "Автосалон+Автосервіс+Автозапчастини," is one 35-character
	 * word, and in this heading it pushed a phone's page twice its own width.
	 */
	overflow-wrap: break-word;
}

.sx-projects__list,
.sx-projects-archive {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 320px, 1fr ) );
	gap: 1.5rem;
	align-items: start;
}

.sx-project {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1.75rem;
	border: 1px solid var( --wp--preset--color--accent-6 );
	border-radius: 16px;
	background: var( --wp--preset--color--base );
}

.sx-project__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

/*
 * min-width: 0 and a break of last resort. A flex item will not shrink below
 * its longest word, and one case is titled «Промприлад.Реновація» — twenty
 * characters with nowhere to break. On a 360px phone that one word pushed the
 * card's picture 29px past its own edge and gave the whole page nine pixels of
 * sideways scroll.
 */
.sx-project__title {
	min-width: 0;
	margin: 0;
	font-size: var( --wp--preset--font-size--medium );
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.sx-project__title a {
	color: inherit;
	text-decoration: none;
}

.sx-project__title a:hover {
	color: var( --sx-brand-text );
}

.sx-project__logo {
	flex: 0 0 auto;
	width: 110px;
}

.sx-project__logo img {
	display: block;
	width: 100%;
	height: 48px;
	object-fit: contain;
	object-position: right center;
}

.sx-project__industry {
	margin: 0.75rem 0 0;
	font-size: var( --wp--preset--font-size--small );
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --sx-brand-text );
}

/* The facts panel: a tinted block with an accent rule down its leading edge,
   the way the reference card sets the project's numbers apart from the prose. */
.sx-project__facts {
	margin: 1.25rem 0 0;
	padding: 1rem 1.25rem;
	border-inline-start: 3px solid var( --wp--preset--color--accent-1 );
	border-radius: 0 8px 8px 0;
	background: color-mix( in srgb, currentColor 4%, transparent );
}

.sx-project__fact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	font-size: var( --wp--preset--font-size--small );
}

.sx-project__fact + .sx-project__fact {
	margin-top: 0.5rem;
}

.sx-project__fact dt {
	margin: 0;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	opacity: 0.7;
}

.sx-project__fact dd {
	margin: 0;
	font-weight: 700;
}

.sx-project__done-title {
	margin: 1.5rem 0 0.75rem;
	font-size: var( --wp--preset--font-size--small );
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.7;
}

.sx-project__done {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var( --wp--preset--font-size--small );
	line-height: 1.6;
}

.sx-project__done li {
	position: relative;
	padding-inline-start: 1.6rem;
}

.sx-project__done li + li {
	margin-top: 0.5rem;
}

.sx-project__done li::before {
	content: "\2713";
	position: absolute;
	inset-inline-start: 0;
	color: var( --sx-brand-text );
	font-weight: 700;
}

/* Pushed to the bottom so the buttons line up across a row of uneven cards. */
.sx-project__cta {
	margin-top: auto;
	padding-top: 1.5rem;
}

.sx-project__more {
	display: inline-block;
	padding: 0.6rem 1.6rem;
	border: 1px solid var( --wp--preset--color--accent-1 );
	border-radius: 999px;
	color: var( --sx-brand-text );
	font-size: var( --wp--preset--font-size--small );
	font-weight: 600;
	text-decoration: none;
}

.sx-project__more:hover {
	background: var( --wp--preset--color--accent-1 );
	color: var( --wp--preset--color--base );
}

/* On a project's own page the card is the page, so it drops its frame. */
.sx-project-details .sx-project {
	padding: 0;
	border: 0;
	background: none;
}

.sx-project-products {
	margin-top: var( --wp--preset--spacing--50 );
}

.sx-project-products__title {
	margin: 0 0 0.75rem;
	font-size: var( --wp--preset--font-size--medium );
}

.sx-project-products__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sx-project-products__list a {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	border: 1px solid var( --wp--preset--color--accent-6 );
	border-radius: 999px;
	font-size: var( --wp--preset--font-size--small );
	text-decoration: none;
}

.sx-project-products__list a:hover {
	border-color: var( --sx-brand-text );
	color: var( --sx-brand-text );
}

@media ( max-width: 700px ) {
	.sx-projects__list,
	.sx-projects-archive {
		grid-template-columns: minmax( 0, 1fr );
	}

	.sx-project {
		padding: 1.25rem;
	}
}

/* ---------------------------------------------------------------------------
 * The projects archive.
 *
 * A browsing page, not a reading page: a picture leads every card, the
 * industry row narrows the grid, and the search box matches title, industry
 * and product name at once. Everything below filters in the browser — eight
 * cases is far too few to justify a round trip per keystroke.
 * ------------------------------------------------------------------------ */

.sx-cases {
	margin-bottom: var( --wp--preset--spacing--70 );
}

/*
 * The distance from the breadcrumb trail to the heading, made the same here as
 * on the blog and About.
 *
 * On those two the trail and the header are printed together, so the only
 * thing between them is the trail's own 24px bottom margin. Here they sit in
 * two separate editor groups, and the second one arrives with a top padding of
 * its own plus the block gap above it — 46px against 24, which is why the
 * heading sat visibly lower on this page than on the others when you clicked
 * between them.
 *
 * !important because the padding is written inline on the group by the editor,
 * and an inline declaration outranks any selector here. The alternative is
 * editing the page's stored blocks, which would fix this page and leave the
 * rule for the next one nowhere.
 */
.wp-block-group:has( > .sx-cases ) {
	margin-top: 0 !important;
	/*
	 * 24px, not 0. The trail's own bottom margin cannot reach across the group
	 * boundary — it collapses out of the group it ends — so zeroing this took
	 * the gap to nothing and the heading sat right under the trail. This
	 * padding stands in for that margin and has to stay equal to it: see
	 * .sx-crumbs in tokens.css.
	 */
	padding-top: 24px !important;
}

/* Heading, lead and the cube. The layout and the cube's size are shared with
   the blog and About headers — see "Page headers" in home-sections.css. Only
   the type belongs to this page. */

.sx-cases-hero__title {
	margin: 0;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.sx-cases-hero__lead {
	max-width: 46ch;
	margin: 1rem 0 0;
	color: var( --sx-text-secondary );
	font-size: 1.0625rem;
	line-height: 1.6;
}


/* The industry select and the search box. */
.sx-cases__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	/* The chips used to sit in a row of their own below this one; now they are
	   in it, so this margin carries the whole block's bottom spacing. */
	margin-bottom: var( --wp--preset--spacing--50 );
}

.sx-cases__field--search {
	position: relative;
}

.sx-cases__search {
	width: 260px;
	max-width: 100%;
	height: var( --sx-control-height );
	/*
	 * Room for the magnifier on the left and for the browser's own clear button
	 * on the right. It was the other way round, and the two landed on top of
	 * each other the moment anything was typed: a search input draws its own X
	 * at the trailing edge, and our icon was sitting there.
	 *
	 * Moved rather than the X suppressed. The X is the useful one — it empties
	 * a live filter in a tap — and the leading magnifier is where the header's
	 * own search box already puts it.
	 *
	 * The padding is declared below on a two-class selector, not here: the
	 * shared field styling in tokens.css matches input[type="search"], and an
	 * attribute selector outweighs a single class. Written here it lost, and
	 * the text ran under the magnifier.
	 */
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-md );
	background: var( --sx-white );
	color: var( --sx-text );
	font: inherit;
	font-size: 0.9375rem;
}

/* Two classes, so this outweighs the input[type="search"] rule in tokens.css
   that would otherwise set the padding back to an even 16px on both sides. */
.sx-cases__field--search .sx-cases__search {
	padding: 0 14px 0 40px;
}

.sx-cases__search::placeholder {
	color: var( --sx-text-muted );
}

.sx-cases__search-icon {
	position: absolute;
	top: 50%;
	left: 13px;
	display: flex;
	color: var( --sx-text-muted );
	pointer-events: none;
	transform: translateY( -50% );
}

.sx-cases__search-icon svg {
	width: 17px;
	height: 17px;
}

/* The industry row. */
/*
 * Sideways rather than wrapping, the way the blog's category row works one
 * section over. Eight industries wrapped onto three ragged lines on a phone
 * and stopped reading as one control; scrolled, they stay a row and the first
 * project is a thumb's reach further up. The bar is hidden — the chips
 * themselves are the affordance that there is more to the right.
 */
.sx-cases__chips {
	display: flex;
	gap: 8px;
	min-width: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.sx-cases__chips::-webkit-scrollbar {
	display: none;
}

.sx-chip {
	flex: 0 0 auto;
	white-space: nowrap;
	height: 36px;
	padding: 0 18px;
	border: 1px solid var( --sx-border );
	border-radius: 999px;
	background: var( --sx-white );
	color: var( --sx-text-secondary );
	font: inherit;
	font-size: 0.875rem;
	line-height: 1;
	cursor: pointer;
	transition: color var( --sx-transition-fast ), border-color var( --sx-transition-fast ), background-color var( --sx-transition-fast );
}

.sx-chip:hover {
	border-color: var( --sx-brand-text );
	color: var( --sx-brand-text );
}

.sx-chip.is-active {
	border-color: var( --sx-brand-text );
	background: var( --sx-brand );
	color: var( --sx-white );
}

/* The grid. */
.sx-cases__grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 24px;
	align-items: stretch;
}

.sx-case {
	display: flex;
}

/*
 * Hidden by the filter, and by the initial count until "Показати ще" runs.
 * display:none rather than visibility, so the grid closes the gap.
 */
.sx-case[hidden] {
	display: none;
}

.sx-case__link {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-white );
	color: inherit;
	text-decoration: none;
	transition: border-color var( --sx-transition-base ), box-shadow var( --sx-transition-base ), transform var( --sx-transition-base );
}

.sx-case__link:hover {
	border-color: var( --sx-border-strong );
	box-shadow: var( --sx-shadow-card-hover );
	transform: translateY( -3px );
}

.sx-case__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var( --sx-neutral-100 );
}

.sx-case__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var( --sx-transition-slow );
}

/*
 * An upright picture in a wide frame: keep its top rather than its middle. A
 * cut-out on a transparent background also needs something behind it, or the
 * card's white shows through and the figure looks like it is falling out of
 * the frame.
 */
.sx-case__media--tall {
	background: var( --sx-neutral-100 );
}

.sx-case__media--tall img {
	object-position: center top;
}

.sx-case__link:hover .sx-case__media img {
	transform: scale( 1.04 );
}

.sx-case__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 18px 20px 20px;
}

.sx-case__industry {
	display: block;
	margin-bottom: 8px;
	color: var( --sx-text-muted );
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sx-case__title {
	display: block;
	color: var( --sx-text );
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
}

.sx-case__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin-top: 10px;
}

/* A tag is a product name, so it is the one here that runs long: "Альфа-Авто:
   Автосалон+Автосервіс+Автозапчастини" reached 262px inside a 238px row and
   poked three pixels past the card's own edge. min-width lets the flex item
   give way; the break is for names with no plus in them to break at. */
.sx-case__tag {
	min-width: 0;
	color: var( --sx-text-muted );
	font-size: 0.8125rem;
	overflow-wrap: break-word;
}

/*
 * A middot between products. It belongs to the tag before it, not the one
 * after: as a ::before on the following tag it became the first thing on the
 * line whenever the list wrapped, so a card read "· BAS Управління торгівлею".
 * Inside the preceding item it can never start a line.
 */
.sx-case__tag:not( :last-child )::after {
	margin-left: 10px;
	color: var( --sx-neutral-300 );
	content: "\00B7";
}

.sx-case__more {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	margin-top: auto;
	padding-top: 14px;
	color: var( --sx-brand-text );
	font-size: 0.875rem;
	font-weight: 600;
}

.sx-case__more span {
	transition: transform var( --sx-transition-fast );
}

.sx-case__link:hover .sx-case__more span {
	transform: translateX( 3px );
}

.sx-cases__empty {
	margin: var( --wp--preset--spacing--50 ) 0 0;
	color: var( --sx-text-secondary );
	text-align: center;
}

.sx-cases__more {
	display: flex;
	justify-content: center;
	margin-top: var( --wp--preset--spacing--50 );
}

/*
 * The script hides this once nothing is left to reveal, and "display: flex"
 * above beats the browser's own rule for [hidden] — so the button stayed on
 * screen at the end of the list, promising more projects than there are.
 */
.sx-cases__more[hidden] {
	display: none;
}

.sx-cases__more-btn {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	height: var( --sx-control-height );
	padding: 0 26px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-md );
	background: var( --sx-white );
	color: var( --sx-text );
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color var( --sx-transition-fast ), color var( --sx-transition-fast );
}

.sx-cases__more-btn:hover {
	border-color: var( --sx-brand-text );
	color: var( --sx-brand-text );
}

.sx-cases__more-icon {
	display: flex;
	color: var( --sx-brand-text );
}

.sx-cases__more-icon svg {
	width: 16px;
	height: 16px;
}

@media ( max-width: 1024px ) {
	.sx-cases__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 782px ) {
	.sx-cases__tools {
		flex-direction: column;
		align-items: stretch;
		/*
		 * nowrap, and it is load-bearing.
		 *
		 * Turned on its side, a wrapping flex container sizes each column to
		 * its own contents rather than to the box around it — so the chips,
		 * 997px of them laid end to end, made a column 997px wide and took the
		 * whole page sideways with them. Their own overflow-x never came into
		 * it: the strip was not too small for its contents, it had simply grown
		 * to fit them.
		 *
		 * With one line, stretch has the container's width to work with and the
		 * chips scroll inside it as intended. align-self on the chips does not
		 * fix this — measured, it leaves them at 997 — because the item is
		 * stretched to its line, and the line is the thing that grew.
		 */
		flex-wrap: nowrap;
	}

	/*
	 * The strip runs to the edges of the screen, and its right edge fades.
	 *
	 * Scrolling was already what happened here; nothing about it said so. The
	 * row ended in a clean cut at the page's own margin, which reads as a row
	 * that stops rather than one that continues — hence "the filters do not
	 * fit". Both halves of this fix that: a chip sliced by the edge of the
	 * screen is the oldest signal there is that something carries on past it,
	 * and the fade keeps the slice from looking like a mistake.
	 *
	 * Wrapping instead was measured and rejected: eight industries at this
	 * width take five rows, 168px of filters above the first project — the
	 * stack that the select was removed to avoid. Three, with the chips shrunk
	 * to where they read as small print.
	 *
	 * The negative margin and the padding are the same value, so the first chip
	 * still starts on the page's own left margin; only the strip behind it
	 * reaches further.
	 */
	.sx-cases__chips {
		margin-inline: calc( -1 * var( --wp--style--root--padding-left, 20px ) );
		padding-inline: var( --wp--style--root--padding-left, 20px );
		-webkit-mask-image: linear-gradient( to right, #000 calc( 100% - 32px ), transparent );
		mask-image: linear-gradient( to right, #000 calc( 100% - 32px ), transparent );
	}

	/*
	 * The search box carries a width for the desktop row. Left at that on a
	 * phone it was wider than the screen, and because it is in normal flow the
	 * whole page went with it — every card title was clipped at the right edge.
	 * min-width:0 lets the flex item shrink; without it "width:100%" is only a
	 * floor.
	 */
	.sx-cases__field {
		min-width: 0;
		width: 100%;
	}

	.sx-cases__field--search .sx-cases__search {
		flex: 1 1 auto;
		min-width: 0;
		width: 100%;
	}

	.sx-cases__grid {
		grid-template-columns: minmax( 0, 1fr );
	}
}

/* The photographs on a project's own page — the product carousel, restyled
 * only where a photo needs different framing from a screenshot. */
.sx-project-gallery {
	margin-top: var( --wp--preset--spacing--60 );
}

.sx-project-gallery__title {
	margin: 0 0 var( --wp--preset--spacing--40 );
	font-size: var( --sx-title-section );
	line-height: 1.2;
}

/* A screenshot is shown whole; a photograph is cropped to one height so the
 * row does not step up and down as it scrolls. */
.sx-project-gallery .sx-shots__item {
	flex: 0 0 min( 420px, 78% );
}

.sx-project-gallery .sx-shots__btn img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* ---------------------------------------------------------------------------
 * The project page.
 *
 * A case is read, not scanned: most of it is ordinary prose held to one
 * measure, and the interface only appears where it earns its place — the
 * numbered challenges, one picture after the long section, a row of compact
 * solution cards. Everything here sizes from the same two variables so a page
 * with four sections and a page with nine look like the same page.
 * ------------------------------------------------------------------------ */

.sx-case-page {
	--sx-case-measure: 720px;
	margin-bottom: var( --wp--preset--spacing--70 );
	font-size: 1.0625rem;
	line-height: 1.68;
}

.sx-case-section {
	margin-top: 78px;
}

.sx-case-h2 {
	margin: 0 0 26px;
	font-size: var( --sx-title-section );
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.02em;
}

.sx-case-h3 {
	margin: 0 0 12px;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

/* One measure for everything meant to be read — about 75 characters. */
.sx-case-prose {
	max-width: var( --sx-case-measure );
	color: var( --sx-text-secondary );
}

.sx-case-prose p {
	margin: 0 0 18px;
}

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

.sx-case-prose strong,
.sx-case-prose b {
	color: var( --sx-text );
}

.sx-case-prose a {
	color: var( --sx-brand-text );
}

/* Hero */
.sx-case-hero {
	display: grid;
	/*
	 * minmax( 0, … ), not a bare 1fr. A grid track written as 1fr is really
	 * minmax( auto, 1fr ), and that auto floor is the item's min-content size —
	 * for an image that is its own pixel width, whatever the CSS says. The
	 * Промприлад cover is 320px wide, so on a 320px phone the track refused to
	 * go below 320 and carried the whole hero, and the page with it, off the
	 * right edge. A zero floor lets the track shrink and the image scale.
	 */
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1fr );
	gap: 52px;
	align-items: center;
	margin-top: 26px;
}

.sx-case-hero__eyebrow {
	margin: 0;
	color: var( --sx-brand-text );
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/*
 * The one page title that is not --sx-title-page, and the reason is the copy,
 * not the design: these titles are sentences, not names. The longest runs 130
 * characters ("Інтеграція з CRM Toyota TUA, AI-системою T.A.R.A.S. та …"), and
 * the hero puts them in a 634px column beside the photograph — at 48px that is
 * seven lines and 328px of headline above the fold, which buries the picture it
 * is meant to introduce. At this size it is four.
 *
 * The real fix is shorter case titles, or a hero whose title spans the full
 * width above the media. Until one of those happens, this stays a step down.
 */
.sx-case-hero__title {
	margin: 16px 0 0;
	font-size: var( --sx-title-page );
	line-height: 1.14;
	letter-spacing: -0.022em;
	text-wrap: balance;
	/*
	 * Case titles carry company names, and a company name is where the line
	 * breaker runs out of options: "Промприлад.Реновація" is joined by a full
	 * stop, which offers no break, and at this size it is 313px against a 280px
	 * column. Every other title on the site is made of ordinary words, so this
	 * only ever fires on the awkward ones.
	 */
	overflow-wrap: break-word;
}

.sx-case-hero__lead {
	margin: 20px 0 0;
	max-width: 46ch;
	color: var( --sx-text-secondary );
}

.sx-case-hero__img {
	overflow: hidden;
	border-radius: 20px;
	box-shadow: var( --sx-shadow-screenshot );
	aspect-ratio: 16 / 10;
}

.sx-case-hero__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * The facts under the hero are one quiet line, not a row of cards: they are
 * reference, and a card each would give them the weight of the headline.
 */
.sx-case-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 34px;
	margin: 34px 0 0;
	padding-top: 20px;
	border-top: 1px solid var( --sx-border );
	color: var( --sx-text-secondary );
	font-size: 0.97rem;
}

/*
 * Each fact is a flex item, so it will not shrink below its longest word, and
 * the values here are the longest strings on the page — a product name joined
 * by plus signs, a list of integrations with API names in it. Left alone, one
 * of them takes the whole page sideways on a 320px screen. Applied to the item
 * rather than to any one fact, because the next long value will be somewhere
 * else again.
 */
.sx-case-facts > span {
	min-width: 0;
	overflow-wrap: break-word;
}

.sx-case-facts b {
	color: var( --sx-text-muted );
	font-weight: 600;
}

/* Challenges: a number and a paragraph, nothing else. */
.sx-challenge {
	display: grid;
	grid-template-columns: 68px minmax( 0, 1fr );
	gap: 4px 10px;
	max-width: 820px;
	padding: 22px 0;
	border-top: 1px solid var( --sx-border );
}

.sx-challenge:last-of-type {
	border-bottom: 1px solid var( --sx-border );
}

.sx-challenge__n {
	grid-row: span 2;
	color: var( --sx-brand-text );
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.sx-challenge__t {
	font-size: 1.12rem;
	font-weight: 600;
}

.sx-challenge__d {
	margin: 0;
	color: var( --sx-text-secondary );
	font-size: 1rem;
}

/* The long section. */
.sx-work + .sx-work {
	margin-top: 44px;
}

.sx-work p {
	margin: 0 0 12px;
}

.sx-work__list {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.sx-work__list li {
	position: relative;
	margin-top: 10px;
	padding-left: 24px;
}

.sx-work__list li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 12px;
	width: 7px;
	height: 7px;
	border-radius: 2px;
	background: var( --sx-brand );
}

/* One picture after the reading, full grid width. */
.sx-case-shot {
	margin: 52px 0 0;
	overflow: hidden;
	border-radius: var( --sx-radius-lg );
	box-shadow: var( --sx-shadow-screenshot );
}

.sx-case-shot .sx-shots__btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.sx-case-shot .sx-shots__btn img {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * The rest of the gallery: reachable from the lightbox, which collects every
 * trigger on the page, so these only need to exist — not to be seen competing
 * with the one picture that was chosen to lead.
 *
 * Written with the same two classes as the rule above it on purpose. As plain
 * .sx-case-shot__more it lost to ".sx-case-shot .sx-shots__btn { width: 100% }"
 * and every one of these hidden buttons came out a full viewport wide, sitting
 * 20px in from the left — which is exactly how much a case page scrolled
 * sideways.
 */
.sx-case-shot .sx-shots__btn.sx-case-shot__more {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.sx-case-shot__cap {
	margin: 14px 0 0;
	color: var( --sx-text-muted );
	font-size: 0.9rem;
}

.sx-case-shot__count {
	color: var( --sx-text-muted );
}

/* Figures — only ever printed when the client confirmed them. */
.sx-case-figures {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 56px;
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid var( --sx-border );
}

.sx-case-figure__n {
	display: block;
	font-size: 2.2rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.sx-case-figure__l {
	display: block;
	margin-top: 4px;
	color: var( --sx-text-secondary );
	font-size: 0.95rem;
}

/* Used solutions. */
.sx-case-sols {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 14px;
	max-width: 900px;
}

.sx-case-sol {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 15px 17px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-md );
}

/*
 * A white plate under the mark whatever the surface: brand logos are drawn for
 * light grounds, and this row sits on the page background.
 */
.sx-case-sol__logo {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	min-width: 48px;
	height: 34px;
	padding: 0 7px;
	border: 1px solid var( --sx-border );
	border-radius: 6px;
	background: var( --sx-white );
}

.sx-case-sol__logo svg {
	width: 34px;
	height: 22px;
}

.sx-case-sol__logo img {
	display: block;
	width: auto;
	height: 18px;
}

.sx-case-sol__n {
	display: block;
	font-size: 0.97rem;
	font-weight: 600;
	line-height: 1.3;
}

.sx-case-sol__k {
	display: block;
	margin-top: 3px;
	color: var( --sx-text-muted );
	font-size: 0.82rem;
}

/* The product row. */
.sx-case-product {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 26px;
	flex-wrap: wrap;
	max-width: 900px;
	padding: 24px 30px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	color: inherit;
	text-decoration: none;
	transition: border-color var( --sx-transition-base ), box-shadow var( --sx-transition-base );
}

.sx-case-product + .sx-case-product {
	margin-top: 12px;
}

.sx-case-product:hover {
	border-color: var( --sx-border-strong );
	box-shadow: var( --sx-shadow-card );
}

/*
 * The half of the fix the template cannot do. A flex item will not shrink below
 * its longest word, so even with a <wbr> offered at every plus the name kept its
 * full 382px and took the page with it. min-width lets it shrink to the space
 * there is; break-word is the last resort for a name with no plus in it at all.
 */
.sx-case-product__text {
	min-width: 0;
}

.sx-case-product__n {
	display: block;
	font-size: 1.15rem;
	font-weight: 600;
	overflow-wrap: break-word;
}

.sx-case-product__d {
	display: block;
	margin-top: 6px;
	color: var( --sx-text-secondary );
	font-size: 0.97rem;
}

.sx-case-product__l {
	flex: 0 0 auto;
	color: var( --sx-brand-text );
	font-size: 0.97rem;
	font-weight: 600;
}

/* Other projects. */
.sx-case-more {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 24px;
}

.sx-case-card a {
	display: block;
	overflow: hidden;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-white );
	color: inherit;
	text-decoration: none;
	transition: border-color var( --sx-transition-base ), box-shadow var( --sx-transition-base ), transform var( --sx-transition-base );
}

.sx-case-card a:hover {
	border-color: var( --sx-border-strong );
	box-shadow: var( --sx-shadow-card-hover );
	transform: translateY( -3px );
}

.sx-case-card__img {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var( --sx-neutral-100 );
}

.sx-case-card__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var( --sx-transition-slow );
}

.sx-case-card a:hover .sx-case-card__img img {
	transform: scale( 1.04 );
}

.sx-case-card__body {
	display: block;
	padding: 18px 20px 20px;
}

.sx-case-card__k {
	display: block;
	color: var( --sx-text-muted );
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sx-case-card__t {
	display: block;
	margin-top: 9px;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
}

.sx-case-card__m {
	display: block;
	margin-top: 14px;
	color: var( --sx-brand-text );
	font-size: 0.95rem;
	font-weight: 600;
}

/*
 * The closing invitation.
 *
 * Quieter than the card that closes every other page, and on the same surface.
 * It was a hairline rule and a button on bare white, which was a deliberate
 * choice while the other card was simply a filled panel: a case study is a
 * long read, and a banner stuck to the end of a story competes with the story.
 *
 * What changed is the other card. It now carries a slowly drifting gradient,
 * and against that a rule on white no longer reads as restraint — it reads as
 * something nobody finished. So this takes the panel, the corners and the same
 * ground, and leaves out the two things that make the other one loud: the
 * artwork and the movement. Held still, the gradient is a surface rather than
 * an effect.
 */
.sx-case-cta {
	margin-top: 78px;
	padding: 36px 40px;
	border-radius: var( --sx-radius-lg );
	background: var( --sx-gradient-drift );
}

.sx-case-cta p {
	max-width: 56ch;
	margin: 0;
	color: var( --sx-text-secondary );
}

.sx-case-cta__btn {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	margin-top: 24px;
	padding: 15px 28px;
	border-radius: var( --sx-radius-btn );
	background: var( --sx-brand );
	color: var( --sx-white ) !important;
	font-weight: 600;
	text-decoration: none;
}

.sx-case-cta__btn:hover {
	background: var( --sx-brand-hover );
}

/* The same 700px and the same 24px the other card steps down to, so the two
   are still recognisably one thing on a phone. Written after the rule above
   rather than up with the other breakpoints in this file: a media query adds
   no weight, so a block placed earlier would lose the padding to it. */
@media ( max-width: 700px ) {
	.sx-case-cta {
		padding: 24px;
	}
}

/*
 * A case migrated from the old site: one long description with headings of its
 * own. It keeps the reading measure, and its headings are pulled down to the
 * page's own scale so they do not out-shout the section titles around them.
 */
.sx-case-prose--legacy h2 {
	margin: 34px 0 12px;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var( --sx-text );
}

.sx-case-prose--legacy h3 {
	margin: 26px 0 10px;
	font-size: 1.1rem;
	color: var( --sx-text );
}

.sx-case-prose--legacy ul,
.sx-case-prose--legacy ol {
	margin: 14px 0;
	padding-left: 22px;
}

.sx-case-prose--legacy li {
	margin-top: 8px;
}

.sx-case-prose--legacy figure {
	margin: 26px 0;
}

.sx-case-prose--legacy img {
	height: auto;
	border-radius: var( --sx-radius-md );
}

@media ( max-width: 1023px ) {
	/* Same zero floor as the two-column rule above — this is the width where it
	   actually mattered, since one column has to hold the cover on its own. */
	.sx-case-hero {
		grid-template-columns: minmax( 0, 1fr );
		gap: 30px;
	}

	.sx-case-sols,
	.sx-case-more {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@media ( max-width: 782px ) {
	.sx-case-page {
		font-size: 1rem;
	}

	/*
	 * A case title is a sentence, and spelled out in full it took three lines
	 * of the trail before the page had even started. One line, cut short — the
	 * heading right underneath says the same thing in full.
	 */
	.sx-case-page .sx-crumbs__current {
		overflow: hidden;
		max-width: 100%;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.sx-case-section {
		margin-top: 56px;
	}

	.sx-challenge {
		grid-template-columns: minmax( 0, 1fr );
		gap: 6px;
	}

	.sx-challenge__n {
		grid-row: auto;
		font-size: 1.25rem;
	}

	.sx-case-product {
		padding: 22px;
	}
}

/* The credit under a hero photograph that is not ours. */
.sx-case-hero__credit {
	margin: 10px 0 0;
	color: var( --sx-text-muted );
	font-size: 0.82rem;
	line-height: 1.5;
}
