/* Notadeepdive story kit: a full-screen opener, a reading column,
   pinned scroll sequences and small charts.
   Uses the theme's tokens (--paper, --ink, --line, --rust, --sans, --serif). */

.st {
	--night: #0b2040;
	--flame: #f26a3d;
	--cream: #f8f5ec;
	--st-muted: #5b5753;
	color: var(--ink, #152c43);
}

html:has(.st) {
	overflow-x: clip;
}

/* ---------- Opener ---------- */

.st-open {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	height: min(calc(100vh - 112px), 56.25vw);
	min-height: 480px;
	background: var(--night);
	color: #fff;
	overflow: hidden;
}

.st-open img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
}

.st-open-text {
	position: absolute;
	left: 6vw;
	bottom: 14%;
	width: min(46vw, 820px);
}

.st-kicker {
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: #ffb199;
}

.st-open h1 {
	margin: 14px 0 0;
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(44px, 5.4vw, 96px);
	font-weight: 500;
	line-height: 0.98;
	letter-spacing: -0.05em;
	color: #fff;
}

.st-by {
	margin: 22px 0 0;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
}

/* ---------- Homepage lead for a designed story ---------- */

.st-hero {
	position: relative;
	display: block;
	height: clamp(420px, 43vw, 620px);
	margin: 0 0 30px;
	background: var(--night);
	color: #fff;
	overflow: hidden;
	text-decoration: none;
}

.st-hero img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
	transition: transform 0.6s ease;
}

.st-hero:hover img {
	transform: scale(1.015);
}

.st-hero-text {
	position: absolute;
	left: 5%;
	bottom: 11%;
	width: min(46%, 640px);
}

.st-hero h1 {
	margin: 12px 0 0;
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(38px, 5vw, 72px);
	font-weight: 500;
	line-height: 0.98;
	letter-spacing: -0.05em;
	color: #fff;
}

.st-hero-deck {
	margin: 16px 0 0;
	font-family: var(--serif, Georgia, serif);
	font-size: 21px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.86);
}

/* ---------- Reading column ---------- */

.st-body {
	max-width: 650px;
	margin: 64px auto 90px;
	padding: 0 20px;
}

.st-body > p {
	margin: 0 0 25px;
	font-family: var(--serif, Georgia, serif);
	font-size: 24px;
	line-height: 1.54;
}

.st-body > h2 {
	margin: 58px 0 20px;
	font-family: var(--serif, Georgia, serif);
	font-size: 38px;
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.03em;
}

.st-body > p a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.14em;
}

.st-body > p a:hover {
	color: var(--rust, #a33119);
}

.st-body blockquote {
	margin: 0 0 25px;
	padding-left: 22px;
	border-left: 2px solid var(--rust, #a33119);
}

/* The article ending the theme supplies: the Google button and the newsletter band. */

.st-after {
	max-width: 920px;
	margin: -30px auto 70px;
	padding: 0 20px;
}

.st-after .ndc {
	margin-top: 0;
}

/* The share row under the opener, as on every other article. */

.st-top {
	max-width: 650px;
	margin: 26px auto 0;
	padding: 0 20px;
}

.st-top:has(.st-listen) {
	max-width: 760px;
}

.st-top + .st-body {
	margin-top: 34px;
}

.st-top-in {
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line, #b4b0a4);
}

.st-top .sharebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 18px;
	margin: 0;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 13px;
}

.st-top .sharebar > span {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--rust, #a33119);
}

.st-top .sharebar > a,
.st-top .sharebar > button:not(.st-listen) {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink, #152c43);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.st-top .sharebar .prefer {
	margin-left: auto;
}

/* Listen: a button in the share row, and a player bar along the bottom while it plays. */

.st-top .sharebar .st-listen {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	min-height: 0;
	margin-left: auto;
	padding: 0 12px;
	border: 1px solid #8a8c8e;
	border-radius: 4px;
	background: transparent;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	color: #545658;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.18s ease, color 0.18s ease;
}

.st-top .sharebar .st-listen:hover,
.st-top .sharebar .st-listen.is-on {
	border-color: var(--ink, #152c43);
	color: var(--ink, #152c43);
}

.st-top .sharebar .st-listen + .prefer {
	margin-left: 10px;
}

.st-player {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
	height: 60px;
	padding: 0 max(20px, calc(50vw - 640px));
	background: var(--ink, #152c43);
	color: #f8f5ec;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.22);
	transform: translateY(100%);
	transition: transform 0.25s ease;
}

.st-player.is-open {
	transform: none;
}

.st-player button {
	flex: none;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.st-player .st-play {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #f8f5ec;
	color: var(--ink, #152c43);
}

.st-player .st-name {
	flex: 0 1 260px;
	min-width: 0;
	overflow: hidden;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.st-player input[type="range"] {
	flex: 1 1 200px;
	min-width: 60px;
	height: 4px;
	accent-color: #f26a3d;
	cursor: pointer;
}

.st-player .st-time {
	flex: none;
	color: rgba(248, 245, 236, 0.82);
}

.st-player .st-speed {
	min-width: 44px;
	height: 30px;
	border: 1px solid rgba(248, 245, 236, 0.5);
	border-radius: 4px;
	font-weight: 600;
}

.st-player .st-close {
	width: 30px;
	height: 30px;
	font-size: 20px;
	line-height: 1;
	opacity: 0.8;
}

@media (max-width: 800px) {
	.st-top .sharebar .st-listen {
		margin-left: 0;
	}

	.st-top .sharebar .st-listen + .prefer {
		margin-left: auto;
	}

	.st-player {
		gap: 10px;
		padding: 0 14px;
	}

	.st-player .st-name {
		display: none;
	}
}

/* ---------- Pinned sequences ---------- */

.st-seq {
	position: relative;
	width: 100vw;
	margin: 60px 0 60px calc(50% - 50vw);
	background: var(--night);
	color: var(--cream);
}

.st-stage {
	position: sticky;
	top: 0;
	box-sizing: border-box;
	height: 100vh;
	height: 100svh;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 7vw 0 0;
}

.st-g {
	width: min(52vw, 820px);
}

.st-cards {
	position: relative;
	z-index: 2;
	width: min(31vw, 410px);
	margin-left: 7vw;
	padding-bottom: 52vh;
	pointer-events: none;
}

.st-card {
	pointer-events: auto;
	margin: 0 0 82vh;
	padding: 22px 24px 24px;
	background: var(--cream);
	color: var(--ink, #152c43);
	border-radius: 3px;
	box-shadow: 0 14px 44px rgba(0, 0, 0, 0.32);
	font-family: var(--serif, Georgia, serif);
	font-size: 23px;
	line-height: 1.4;
}

.st-card:last-child {
	margin-bottom: 0;
}

.st-card small {
	display: block;
	margin-top: 12px;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 12px;
	line-height: 1.4;
	color: var(--st-muted);
}

/* Shared pieces of the graphics */

.g-title {
	margin: 0 0 26px;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: rgba(248, 245, 236, 0.72);
}

.st-g,
.st-g * {
	box-sizing: border-box;
}

.st-g {
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-variant-numeric: tabular-nums;
}

/* Sequence 1: the loss, year by year */

.g-row {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	margin: 0 0 18px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.g-row.on {
	opacity: 1;
	transform: none;
}

.g-y {
	font-size: 17px;
	font-weight: 500;
	text-align: right;
	color: rgba(248, 245, 236, 0.86);
}

.g-track {
	display: flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
	height: 26px;
}

.g-bar {
	flex: 0 0 auto;
	width: 0;
	height: 24px;
	background: var(--cream);
	border-radius: 0 4px 4px 0;
	transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.g-bar.is-first {
	background: var(--flame);
}

.g-bar.is-range {
	background: rgba(248, 245, 236, 0.42);
}

.g-bar.has-next {
	border-radius: 0;
}

.g-row.on .g-bar.on,
.g-row.on .g-bar:not([data-from]) {
	width: var(--w);
}

.g-v {
	display: none;
	margin-left: 10px;
	font-size: 18px;
	font-weight: 650;
	white-space: nowrap;
	color: var(--cream);
	animation: st-fade 0.6s ease both;
}

.g-v.on {
	display: block;
}

.g-v.is-quiet {
	font-size: 15px;
	font-weight: 500;
	color: rgba(248, 245, 236, 0.8);
	white-space: normal;
}

.g-notes {
	position: relative;
	min-height: 104px;
	margin: 26px 0 0 74px;
}

.g-note {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.45s ease;
	font-size: 15px;
	line-height: 1.5;
	color: rgba(248, 245, 236, 0.86);
}

.g-note.on {
	opacity: 1;
}

.g-note b {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: rgba(248, 245, 236, 0.72);
}

.g-note ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.g-note li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	max-width: 380px;
	padding: 3px 0;
	border-bottom: 1px solid rgba(248, 245, 236, 0.16);
}

/* Sequence 2: one $100 product */

.g-big {
	display: flex;
	align-items: baseline;
	gap: 16px;
	margin: 0 0 22px;
}

.g-big-l {
	font-size: 17px;
	color: rgba(248, 245, 236, 0.86);
}

.g-big-n {
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(56px, 6.4vw, 96px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--cream);
}

.g-split {
	position: relative;
	display: flex;
	gap: 2px;
	height: 56px;
	margin: 0 0 40px;
}

.g-seg {
	flex: 0 0 auto;
	height: 100%;
	transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.g-seg.is-merchant {
	background: var(--cream);
}

.g-seg.is-jumia {
	background: var(--flame);
	border-radius: 0 4px 4px 0;
}

.g-mark {
	position: absolute;
	top: -10px;
	bottom: -10px;
	left: calc(90.909% + 2px);
	width: 1px;
	background: rgba(248, 245, 236, 0.6);
}

.g-mark span {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	padding-top: 4px;
	font-size: 12px;
	white-space: nowrap;
	color: rgba(248, 245, 236, 0.72);
}

.g-legend {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.g-legend div {
	font-size: 15px;
	line-height: 1.4;
	color: rgba(248, 245, 236, 0.86);
}

.g-legend i {
	display: inline-block;
	width: 11px;
	height: 11px;
	margin-right: 8px;
	border-radius: 2px;
	background: var(--cream);
}

.g-legend i.is-jumia {
	background: var(--flame);
}

.g-legend strong {
	display: block;
	margin-top: 2px;
	font-size: 28px;
	font-weight: 650;
	color: var(--cream);
}

.g-legend em {
	font-style: normal;
	font-size: 13px;
	color: rgba(248, 245, 236, 0.72);
}

/* Sequence 3: cocoa */

.g-cocoa {
	position: relative;
	min-height: min(70vh, 620px);
}

.g-pane {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.g-pane.on {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.6s ease;
}

.g-sacks {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 10px 8px;
	margin: 0 0 30px;
}

.g-sacks img {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0.13;
	filter: grayscale(1);
	transition: opacity 0.7s ease, filter 0.7s ease;
}

.g-sacks img.on {
	opacity: 1;
	filter: none;
}

.g-stats {
	display: flex;
	gap: 44px;
}

.g-stats div {
	font-size: 13px;
	line-height: 1.4;
	color: rgba(248, 245, 236, 0.72);
}

.g-stats strong {
	display: block;
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(34px, 3.6vw, 54px);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.03em;
	color: var(--cream);
}

.g-trade {
	display: flex;
	align-items: center;
	gap: 3.4vw;
}

.g-phone {
	width: 24%;
	height: auto;
}

.g-eq {
	font-family: var(--serif, Georgia, serif);
	font-size: 56px;
	color: rgba(248, 245, 236, 0.72);
}

.g-fill {
	position: relative;
	width: 34%;
}

.g-fill img {
	display: block;
	width: 100%;
	height: auto;
}

.g-fill .is-ghost {
	opacity: 0.15;
	filter: grayscale(1);
}

.g-fill .is-level {
	position: absolute;
	inset: 0;
	clip-path: inset(var(--cut, 100%) 0 0 0);
	transition: clip-path 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.g-kg {
	font-size: 13px;
	line-height: 1.4;
	color: rgba(248, 245, 236, 0.72);
}

.g-kg strong {
	display: block;
	font-family: var(--serif, Georgia, serif);
	font-size: clamp(48px, 5.4vw, 84px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--cream);
}

/* ---------- Small charts in the reading column ---------- */

.st-chart {
	margin: 44px 0;
	padding: 22px 0 16px;
	border-top: 2px solid var(--ink, #152c43);
	border-bottom: 1px solid var(--line, #b4b0a4);
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-variant-numeric: tabular-nums;
}

.st-chart h3 {
	margin: 0 0 18px;
	font-family: var(--sans, Inter, system-ui, sans-serif);
	font-size: 17px;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: 0;
}

.c-row {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	margin: 0 0 9px;
}

.c-row.is-wide {
	grid-template-columns: 178px minmax(0, 1fr);
}

.c-y {
	font-size: 14px;
	text-align: right;
	color: var(--st-muted);
}

.c-track {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.c-bar {
	flex: 0 0 auto;
	width: var(--w);
	height: 18px;
	background: var(--ink, #152c43);
	border-radius: 0 4px 4px 0;
}

.c-bar.is-first {
	background: var(--flame);
}

.c-bar.is-before {
	background: #8d99a8;
}

.c-v {
	font-size: 14px;
	font-weight: 650;
	white-space: nowrap;
}

.c-group {
	margin: 0 0 16px;
}

.c-group > b {
	display: block;
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 650;
}

.c-legend {
	display: flex;
	gap: 18px;
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--st-muted);
}

.c-legend i {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	border-radius: 2px;
	background: var(--ink, #152c43);
}

.c-legend i.is-first {
	background: var(--flame);
}

.c-legend i.is-before {
	background: #8d99a8;
}

.st-chart figcaption {
	margin: 14px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--st-muted);
}

@keyframes st-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* ---------- Phones ---------- */

@media (max-width: 800px) {
	.st-hero {
		height: auto;
		aspect-ratio: 9 / 14;
	}

	.st-hero img {
		object-position: center bottom;
	}

	.st-hero-text {
		left: 20px;
		right: 20px;
		top: 6%;
		bottom: auto;
		width: auto;
	}

	.st-hero h1 {
		font-size: clamp(32px, 9.4vw, 48px);
	}

	.st-open {
		height: auto;
		min-height: 0;
		aspect-ratio: 9 / 16;
		max-height: 100svh;
	}

	.st-open img {
		object-position: center bottom;
	}

	.st-open-text {
		left: 20px;
		right: 20px;
		top: 9%;
		bottom: auto;
		width: auto;
	}

	.st-open h1 {
		font-size: clamp(40px, 12vw, 60px);
	}

	.st-body {
		margin: 38px auto 60px;
	}

	.st-body > p {
		font-size: 19px;
		line-height: 1.58;
		margin-bottom: 21px;
	}

	.st-body > h2 {
		font-size: 29px;
		margin: 44px 0 16px;
	}

	.st-seq {
		margin: 44px 0 44px calc(50% - 50vw);
	}

	.st-stage {
		align-items: flex-start;
		justify-content: center;
		padding: 11vh 20px 0;
	}

	.st-g {
		width: 100%;
	}

	.st-cards {
		width: auto;
		margin: 0 20px;
		padding-bottom: 46vh;
	}

	.st-card {
		margin-bottom: 78vh;
		padding: 18px 20px 20px;
		font-size: 19px;
	}

	.g-title {
		margin-bottom: 18px;
	}

	.g-row {
		grid-template-columns: 40px minmax(0, 1fr);
		gap: 10px;
		margin-bottom: 14px;
	}

	.g-y {
		font-size: 14px;
	}

	.g-bar {
		height: 20px;
	}

	.g-v {
		margin-left: 7px;
		font-size: 15px;
	}

	.g-v.is-quiet {
		font-size: 13px;
	}

	.g-notes {
		margin: 18px 0 0;
		min-height: 120px;
	}

	.g-note {
		font-size: 14px;
	}

	.g-split {
		height: 44px;
		margin-bottom: 34px;
	}

	.g-legend strong {
		font-size: 23px;
	}

	.g-cocoa {
		min-height: 48vh;
	}

	.g-pane {
		justify-content: flex-start;
	}

	.g-sacks {
		gap: 6px 5px;
		margin-bottom: 20px;
	}

	.g-stats {
		gap: 26px;
	}

	.g-trade {
		gap: 14px;
	}

	.g-eq {
		font-size: 34px;
	}

	.g-fill {
		width: 32%;
	}

	.c-row.is-wide {
		grid-template-columns: 124px minmax(0, 1fr);
	}

	.c-y,
	.c-v {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.st-g *,
	.g-row,
	.g-pane {
		transition: none !important;
		animation: none !important;
	}
}
