/* ==========================================================
   Client case studies with results (rs- classes)
   Markup: templates/views/assets/results.html. Homepage and Work page.
   ========================================================== */

/* layout: visual (screenshot + results card layered) beside the story */
.rs-cases {
	display: grid;
	gap: clamp(72px, 9vw, 128px);
}
.rs-case {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(32px, 5vw, 80px);
	align-items: center;
	scroll-margin-top: calc(var(--header-h, 72px) + 24px);
}
.rs-case:nth-child(even) {
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.rs-case:nth-child(even) .rs-vis {
	order: 2;
}
.rs-vis {
	position: relative;
	isolation: isolate;
	display: grid;
	min-width: 0;
}
.rs-vis::before {
	content: '';
	position: absolute;
	inset: 8% 4% 4%;
	z-index: -1;
	border-radius: 40px;
	background:
		radial-gradient(60% 60% at 30% 30%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%),
		radial-gradient(50% 50% at 80% 80%, color-mix(in srgb, var(--tone-2) 14%, transparent), transparent 70%);
	filter: blur(20px);
	pointer-events: none;
}
.rs-shot {
	width: 84%;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	box-shadow:
		0 1px 2px rgba(16, 24, 32, 0.05),
		0 24px 48px -28px rgba(15, 76, 129, 0.4),
		0 0 0 1px var(--line);
}
.rs-case:nth-child(even) .rs-shot {
	margin-left: auto;
}
.rs-shot-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 34px;
	padding: 0 14px;
	background: #f4f3ef;
	border-bottom: 1px solid var(--line);
}
.rs-shot-bar .dots {
	display: flex;
	gap: 5px;
}
.rs-shot-bar .dots i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d9d7d0;
}
.rs-shot-bar .url {
	flex: 1;
	max-width: 260px;
	height: 20px;
	margin: 0 auto;
	border-radius: 6px;
	display: grid;
	place-items: center;
	font: 400 11px/1 var(--font-mono);
	color: var(--subtle);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--line);
	white-space: nowrap;
	overflow: hidden;
}
.rs-shot-view {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--paper);
}
.rs-shot-view img {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: auto;
	will-change: transform;
	transition: transform 0.2s linear;
}
.rs-graph {
	width: 80%;
	margin: -22% 0 0 auto;
	z-index: 1;
}
.rs-case:nth-child(even) .rs-graph {
	margin-left: 0;
}

/* client + numbers */
.rs-body {
	min-width: 0;
}
.rs-who {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}
.rs-who .rs-num {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	font: 400 13px/1 var(--font-mono);
	color: #fff;
	background: linear-gradient(135deg, var(--tone), var(--tone-2));
	box-shadow: 0 10px 20px -12px var(--tone);
}
.rs-who h3 {
	font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.15 var(--font-display);
	letter-spacing: -0.025em;
}
.rs-who small {
	display: block;
	margin-top: 8px;
	font-size: 13.5px;
	color: var(--muted);
}
.rs-line-h {
	margin-top: 22px;
	font: 400 clamp(1.15rem, 1.6vw, 1.35rem)/1.45 var(--font-display);
	letter-spacing: -0.01em;
	color: var(--ink-2);
	text-wrap: balance;
}
.rs-kpis {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 26px;
	border-radius: 18px;
	background: #fff;
	box-shadow:
		0 0 0 1px var(--line),
		var(--shadow-sm);
	overflow: hidden;
}
.rs-kpis div {
	padding: 18px 16px;
	min-width: 0;
}
.rs-kpis div + div {
	border-left: 1px solid var(--line);
}
.rs-kpis b {
	display: block;
	font: 400 clamp(1.4rem, 2.1vw, 1.85rem)/1.1 var(--font-display);
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	background: linear-gradient(120deg, var(--tone), var(--tone-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.rs-kpis small {
	display: block;
	margin-top: 9px;
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--muted);
}

/* graph card */
.rs-graph {
	--tone: var(--blue);
	--tone-2: var(--cyan);
	position: relative;
	overflow: hidden;
	border-radius: 24px;
	background: #fff;
	box-shadow:
		var(--shadow-lg),
		0 0 0 1px var(--line);
}
.rs-graph::before {
	content: '';
	position: absolute;
	top: -160px;
	right: -120px;
	width: 360px;
	height: 360px;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--tone-2) 16%, transparent), transparent);
}
.rs-g-bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	height: 52px;
	padding: 0 22px;
	border-bottom: 1px solid var(--line);
	font: 400 12px/1 var(--font-mono);
	color: var(--muted);
}
.rs-g-bar .dots {
	display: flex;
	gap: 6px;
}
.rs-g-bar .dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #e4e1db;
}
.rs-g-bar em {
	margin-left: auto;
	font-style: normal;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	color: color-mix(in srgb, var(--tone) 85%, #101820);
	background: color-mix(in srgb, var(--tone) 9%, #fff);
}
.rs-g-bar em::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}
.rs-g-body {
	position: relative;
	padding: clamp(22px, 3vw, 34px);
}
.rs-g-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px 24px;
}
.rs-g-head small {
	display: block;
	font: 400 11px/1 var(--font-mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--subtle);
}
.rs-g-head b {
	display: block;
	margin-top: 10px;
	font: 400 clamp(2.4rem, 4.4vw, 3.5rem)/1 var(--font-display);
	letter-spacing: -0.045em;
	font-variant-numeric: tabular-nums;
	background: linear-gradient(120deg, var(--tone), var(--tone-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.rs-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 13px;
	color: var(--muted);
}
.rs-legend span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.rs-legend i {
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--c, #d9dce1);
}

/* A, paired bars (last year vs this year) */
.rs-rows {
	display: grid;
	gap: 22px;
	margin-top: 30px;
}
.rs-row-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 14.5px;
	color: var(--ink-2);
}
.rs-delta {
	font: 400 12.5px/1 var(--font-mono);
	padding: 5px 9px;
	border-radius: 999px;
	color: #00845a;
	background: rgba(0, 195, 137, 0.12);
	white-space: nowrap;
}
.rs-track {
	position: relative;
	height: 12px;
	margin-top: 10px;
	border-radius: 12px;
	background: var(--paper);
	overflow: hidden;
}
.rs-track + .rs-track {
	margin-top: 6px;
}
.rs-track i {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: var(--w);
	border-radius: inherit;
	transform-origin: left;
	transform: scaleX(0);
	transition: transform 1.4s var(--ease);
}
.rs-track.prev i {
	background: #cfd4db;
}
.rs-track.now i {
	background: linear-gradient(90deg, var(--tone), var(--tone-2));
	transition-delay: 0.25s;
}
.rs-track span {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	font: 400 10.5px/1 var(--font-mono);
	color: var(--subtle);
}
.rs-track.now span {
	color: #fff;
	mix-blend-mode: normal;
}
.rs-graph.is-in .rs-track i {
	transform: scaleX(1);
}
.rs-g-foot {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin-top: 28px;
}
.rs-g-foot div {
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--paper);
	box-shadow: inset 0 0 0 1px var(--line);
}
.rs-g-foot small {
	display: block;
	font: 400 10.5px/1 var(--font-mono);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--subtle);
}
.rs-g-foot b {
	display: block;
	margin-top: 8px;
	font: 400 22px/1 var(--font-display);
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

/* B, donut of actions */
.rs-donut-wrap {
	display: grid;
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	gap: clamp(24px, 4vw, 48px);
	align-items: center;
	margin-top: 26px;
}
.rs-donut {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
}
.rs-donut svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}
.rs-donut circle {
	fill: none;
	stroke-width: 15;
}
.rs-donut .bg {
	stroke: var(--paper);
}
.rs-donut .seg {
	stroke-linecap: butt;
	stroke-dasharray: 0 400;
	transition: stroke-dasharray 1.4s var(--ease);
}
.rs-donut-c {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	text-align: center;
}
.rs-donut-c b {
	font: 400 2rem/1 var(--font-display);
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
}
.rs-donut-c small {
	margin-top: 6px;
	font: 400 10.5px/1 var(--font-mono);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--subtle);
}
.rs-split {
	display: grid;
	gap: 4px;
}
.rs-split li {
	display: grid;
	grid-template-columns: 12px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px dashed var(--line-strong);
	font-size: 15px;
}
.rs-split li:last-child {
	border-bottom: 0;
}
.rs-split li i {
	width: 12px;
	height: 12px;
	border-radius: 4px;
	background: var(--c);
}
.rs-split li b {
	font: 400 20px/1 var(--font-display);
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}
.rs-split li small {
	display: block;
	margin-top: 3px;
	font-size: 12.5px;
	color: var(--subtle);
}

/* C, growth line */
.rs-line {
	position: relative;
	margin-top: 22px;
}
.rs-line svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}
.rs-line .grid {
	stroke: rgba(16, 24, 32, 0.06);
}
.rs-line .ln {
	stroke-dasharray: 1000;
	stroke-dashoffset: 1000;
	transition: stroke-dashoffset 2s var(--ease);
}
.rs-line .ar {
	opacity: 0;
	transition: opacity 1s var(--ease) 1.1s;
}
.rs-line .pt {
	opacity: 0;
	transform-box: fill-box;
	transform-origin: center;
	transform: scale(0.4);
	transition:
		opacity 0.4s 1.8s,
		transform 0.6s var(--ease) 1.8s;
}
.rs-line .ax {
	font: 400 11px var(--font-mono);
	fill: var(--subtle);
}
.rs-graph.is-in .rs-line .ln {
	stroke-dashoffset: 0;
}
.rs-graph.is-in .rs-line .ar {
	opacity: 1;
}
.rs-graph.is-in .rs-line .pt {
	opacity: 1;
	transform: none;
}
.rs-tip {
	position: absolute;
	right: 2%;
	top: -6px;
	padding: 9px 13px;
	border-radius: 12px;
	background: var(--ink);
	color: #fff;
	font-size: 13px;
	box-shadow: var(--shadow-md);
	opacity: 0;
	transform: translateY(8px);
	transition:
		opacity 0.5s 2s,
		transform 0.6s var(--ease) 2s;
}
.rs-tip small {
	display: block;
	font: 400 10.5px/1.4 var(--font-mono);
	color: #9aa3ae;
}
.rs-graph.is-in .rs-tip {
	opacity: 1;
	transform: none;
}
.rs-note {
	margin-top: 14px;
	font: 400 11px/1.5 var(--font-mono);
	color: var(--subtle);
}

/* D, Core Web Vitals zones */
.rs-vit {
	display: grid;
	gap: 22px;
	margin-top: 28px;
}
.rs-vit p {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 14.5px;
	color: var(--ink-2);
}
.rs-vit p small {
	margin-left: 6px;
	font: 400 11px/1 var(--font-mono);
	color: var(--subtle);
}
.rs-vit p b {
	font: 400 15px/1 var(--font-mono);
	color: #0b6b4f;
}
.rs-vit p.sc {
	margin-top: 7px;
	font: 400 10.5px/1 var(--font-mono);
	color: var(--subtle);
}
.rs-zone {
	position: relative;
	display: flex;
	gap: 3px;
	height: 10px;
	margin-top: 10px;
}
.rs-zone i {
	width: var(--z);
	border-radius: 5px;
	background: #00a676;
	opacity: 0.85;
}
.rs-zone i:nth-child(2) {
	background: #f0b429;
	opacity: 0.7;
}
.rs-zone i:nth-child(3) {
	background: #e06a5f;
	opacity: 0.6;
}
.rs-zone em {
	position: absolute;
	top: 50%;
	left: 100%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border-radius: 50%;
	background: #fff;
	box-shadow:
		0 0 0 4px #0b6b4f,
		0 6px 12px -4px rgba(16, 24, 32, 0.4);
	transition: left 1.6s var(--ease);
}
.rs-graph.is-in .rs-zone em {
	left: max(var(--p), 9px);
}
.rs-vit > div:nth-child(2) em {
	transition-delay: 0.2s;
}
.rs-vit > div:nth-child(3) em {
	transition-delay: 0.4s;
}

/* copy */
.rs-ro {
	display: grid;
	gap: 0;
	margin-top: 28px;
}
.rs-ro div {
	display: grid;
	grid-template-columns: 112px 1fr;
	gap: 16px;
	padding: 18px 0;
	border-top: 1px solid var(--line-strong);
}
.rs-ro div:last-child {
	border-bottom: 1px solid var(--line-strong);
}
.rs-ro dt {
	font: 400 11px/1.6 var(--font-mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--subtle);
}
.rs-ro dd {
	margin: 0;
	color: var(--ink-2);
	font-size: 15.5px;
	line-height: 1.65;
}
.rs-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
}
.rs-tags span {
	padding: 6px 12px;
	border-radius: 999px;
	font: 400 12px/1 var(--font-mono);
	color: var(--ink-2);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--line-strong);
}

@media (max-width: 1100px) {
	.rs-case,
	.rs-case:nth-child(even) {
		grid-template-columns: 1fr;
		gap: 36px;
	}
	.rs-case:nth-child(even) .rs-vis {
		order: 0;
	}
	.rs-vis {
		max-width: 820px;
	}
	.rs-body {
		max-width: 720px;
	}
}
@media (max-width: 640px) {
	.rs-shot,
	.rs-case:nth-child(even) .rs-shot {
		width: 92%;
		margin: 0;
	}
	.rs-graph,
	.rs-case:nth-child(even) .rs-graph {
		width: auto;
		margin: -14% 0 0 6%;
	}
	.rs-donut-wrap {
		grid-template-columns: 1fr;
		justify-items: center;
	}
	.rs-donut {
		max-width: 180px;
	}
	.rs-split {
		width: 100%;
	}
	.rs-ro div {
		grid-template-columns: 1fr;
		gap: 6px;
	}
	.rs-g-bar span.t {
		display: none;
	}
	.rs-kpis div {
		padding: 14px 12px;
	}
	.rs-kpis b {
		font-size: 1.3rem;
	}
	.rs-kpis small {
		font-size: 11.5px;
	}
	.rs-legend {
		gap: 10px;
		font-size: 12px;
	}
}
@media (max-width: 380px) {
	.rs-kpis {
		grid-template-columns: 1fr;
	}
	.rs-kpis div {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 12px;
	}
	.rs-kpis div + div {
		border-left: 0;
		border-top: 1px solid var(--line);
	}
	.rs-kpis small {
		margin-top: 0;
		text-align: right;
	}
}
@media (prefers-reduced-motion: reduce) {
	.rs-track i,
	.rs-line .ln,
	.rs-line .ar,
	.rs-line .pt,
	.rs-tip,
	.rs-donut .seg,
	.rs-zone em {
		transition: none !important;
	}
}
