/*
 * YeGesha Value Chain Story. The stage (the diagram) sticks to the viewport
 * while the chapters scroll over it; each chapter is one screen tall, so the
 * diagram reaches step N when chapter N sits in the middle of the view.
 * Same tokens and type as the cherry story (option A).
 */
.ygv {
	/* Brand Guidelines pp.30-31: primary #105136 and #CCB484, secondary #00311B,
	   #946239 and #BBB76D. Off-white is the site's own #F5F4F0. */
	--ygv-ground: #00311B; /* dark green, secondary */
	--ygv-field: #105136;  /* green, primary */
	--ygv-ink: #F5F4F0;    /* the site's off-white */
	--ygv-accent: #CCB484; /* tan, primary */
	--ygv-margin: clamp(20px, 6vw, 96px);
	--ygv-copy: 31rem;

	position: relative;
	background: var(--ygv-ground);
	color: var(--ygv-ink);
	isolation: isolate;
}

.ygv-stage {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	z-index: 0;
}

/* The diagram spans the top of the screen; the words sit beneath it. */
.ygv-figure {
	position: absolute;
	top: 120px;
	height: calc(70vh - 120px);
	height: calc(70svh - 120px);
	left: calc(var(--ygv-margin) * 0.5);
	right: calc(var(--ygv-margin) * 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ygv-figure > svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/*
 * Split layout, the usual chain: the lane fills the frame and the bag stands
 * beside it (under it on tablets and phones), so neither is shrunk to fit the
 * other.
 */
.ygv-figure--single {
	gap: 40px;
}

.ygv-figure--single > svg {
	flex: 1 1 0;
	width: 0;
	min-width: 0;
}

.ygv-figure--single .yg-bag {
	flex: 0 0 auto;
	height: min(92%, 22rem);
}

@media (max-width: 1023px) {
	.ygv-figure--single {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.ygv-figure--single > svg {
		flex: 1 1 0;
		width: 100%;
		height: 0;
		min-height: 0;
	}

	.ygv-figure--single .yg-bag {
		align-self: center;
		height: 46%;
	}
}

/*
 * The coffee bag (src/bag.js). It scales with its own width: type and lines
 * are in container units (cqi), so the bag reads the same at any size.
 */
.yg-bag {
	--bag: #CCB484;        /* kraft, in the brand tan */
	--bag-dark: #946239;   /* coffee brown */
	--bag-ink: #00311B;
	--bag-mark: #00311B;   /* the stamp, in the darkest brand ink */
	position: relative;
	aspect-ratio: 240 / 330;
	container-type: inline-size;
	transform-origin: 50% 50%;
	translate: 0 calc(var(--lift, 0) * -6px);
	filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .38));
	font-family: 'Open Sans', system-ui, sans-serif;
	line-height: 1.2; /* the theme sets a fixed body line-height; the bag needs its own */
}

.yg-bag-label * {
	line-height: 1.2;
}

.yg-bag--green {
	--bag: #105136;        /* green-700, as on the bag sticker */
	--bag-dark: #00311B;
	--bag-ink: #CCB484;    /* gold-500 */
}

.yg-bag-shape {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.yg-bag-body { fill: var(--bag); }

/* The vacuum brick: taller, square-shouldered, folded and taped at the top. */
.yg-bag--brick {
	--bag: #105136;        /* primary green: the foil reads lighter than the page */
	--bag-dark: #00311B;
	aspect-ratio: 220 / 340;
	filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .5));
}

.yg-brick-fold { fill: var(--bag-dark); }
.yg-brick-fold-line { fill: none; stroke: rgba(0, 0, 0, .3); stroke-width: 1; }
.yg-brick-tape { fill: rgba(204, 180, 132, .55); }
.yg-brick-crease { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 1.2; stroke-linejoin: round; }

.yg-bag--brick .yg-sticker {
	top: 21%;
	left: 10%;
	right: 10%;
	bottom: 8%;
}
.yg-bag-gusset { fill: rgba(0, 0, 0, .12); }
.yg-bag-crimp { fill: var(--bag-dark); }
.yg-bag-crimp-line { stroke: rgba(0, 0, 0, .18); stroke-width: 1; }
.yg-bag-valve { fill: var(--bag-dark); stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
.yg-bag-valve-in { fill: rgba(0, 0, 0, .3); }

.yg-bag-label {
	position: absolute;
	top: 25%;
	left: 13%;
	right: 13%;
	bottom: 9%;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	color: var(--bag-ink);
}

.ygv .yg-bag-origin {
	margin: 0;
	padding-left: 0.2em; /* balances the letter-spacing after the last letter */
	color: var(--bag-ink);
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 12.5cqi;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.ygv .yg-bag-sub {
	margin: 2.4cqi 0 2cqi;
	font-size: 3.8cqi;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.72;
}

/* A field: its name over a blank line; "Unknown" is stamped across the line. */
.yg-bag-row {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin-top: 7.6cqi;
}

.yg-bag-key {
	font-size: 3.8cqi;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	opacity: 0.8;
}

/* The field's blank line, and the red strike drawn along it. */
.yg-bag-line {
	position: relative;
	display: block;
	width: 72%;
	height: max(1px, 0.5cqi);
	margin-top: 2.6cqi;
	background: rgba(0, 49, 27, .35);
}

.yg-bag-line i {
	z-index: 0;
	position: absolute;
	left: -4%;
	top: -0.4cqi;
	width: 108%;
	height: max(2px, 1.2cqi);
	background: var(--bag-mark);
	transform: scaleX(0);
	transform-origin: 0 50%;
}

.yg-bag-verdict {
	position: absolute;
	left: 50%;
	bottom: -2.4cqi;
	padding: 0.9cqi 2cqi 0.8cqi;
	border: max(1px, 0.5cqi) solid var(--bag-mark);
	background: var(--bag);
	color: var(--bag-mark);
	font-size: 3.4cqi;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	rotate: -4deg;
}

/* YeGesha's bag: the sticker, gold rules on green. */
.yg-sticker {
	top: 23%;
	left: 9%;
	right: 9%;
	bottom: 7%;
	display: grid;
	align-items: stretch;
	justify-items: stretch;
	grid-template-rows: auto 1fr;
	border: max(1px, 0.5cqi) solid var(--bag-ink);
}

.yg-sticker-head {
	padding: 4cqi 2cqi 3.4cqi;
	border-bottom: max(1px, 0.5cqi) solid var(--bag-ink);
}

.ygv .yg-sticker .yg-bag-origin {
	font-size: 10.5cqi;
	letter-spacing: 0.16em;
	padding-left: 0.16em;
}

.ygv .yg-sticker-estate {
	margin: 2cqi 0 0;
	color: var(--bag-ink);
	font-size: 4.6cqi;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.yg-sticker-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-auto-rows: 1fr;
	min-height: 0;
}

.yg-sticker-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 1.2cqi 2cqi;
	border-right: max(1px, 0.5cqi) solid var(--bag-ink);
	border-bottom: max(1px, 0.5cqi) solid var(--bag-ink);
}

.yg-sticker-cell:nth-child(2n) { border-right: 0; }
.yg-sticker-cell:nth-last-child(-n + 2) { border-bottom: 0; }

.yg-sticker-cell b {
	font-size: 5cqi;
	font-weight: 700;
	line-height: 1.1;
}

.yg-sticker-cell span {
	margin-top: 0.6cqi;
	font-size: 3.4cqi;
	line-height: 1.2;
	opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
	.yg-bag { translate: none; }
}

.ygv-fallback {
	display: block;
	max-width: 100%;
	max-height: 100%;
	height: auto;
	padding: 24px;
	background: #F5F4F0;
	box-sizing: border-box;
}

.ygv.is-ready .ygv-fallback {
	display: none;
}

.ygv-chapters {
	position: relative;
	z-index: 1;
	margin-top: -100vh;
	margin-top: -100svh;
}

.ygv-chapter {
	display: flex;
	align-items: flex-end;
	min-height: 100vh;
	min-height: 100svh;
	padding: 0 var(--ygv-margin) 6vh;
	padding-bottom: 6svh;
	box-sizing: border-box;
}

/* Wide screens: title, button and source on the left; the words on the right. */
.ygv-copy {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	column-gap: 72px;
	align-items: start;
	width: 100%;
}

.ygv .ygv-words > .ygv-text:first-child {
	margin-top: 0;
}

.ygv .ygv-title {
	margin: 0;
	color: var(--ygv-ink);
	font-family: 'Bluu Next', Georgia, 'Times New Roman', serif;
	font-weight: 700;
	font-size: clamp(2rem, 3vw, 3.125rem);
	line-height: 1.04;
	letter-spacing: 0;
	text-transform: uppercase; /* Brand Guidelines p.33: Bluu Next is uppercase only */
	text-wrap: balance;
}

.ygv h1.ygv-title {
	font-size: clamp(2.5rem, 4vw, 4rem);
}

.ygv .ygv-text {
	margin: 28px 0 0;
	color: var(--ygv-ink);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1.484rem; /* 1.1875rem + 25% */
	line-height: 1.5;
	text-wrap: pretty;
}

.ygv .ygv-source {
	margin: 24px 0 0;
	color: var(--ygv-ink);
	opacity: 0.72;
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1.094rem;
	line-height: 1.45;
}

.ygv .ygv-button {
	display: inline-block;
	margin-top: 28px;
	padding: 17px 28px;
	border-radius: 3px;
	background: var(--ygv-accent);
	color: var(--ygv-ground);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-decoration: none;
	text-transform: none;
	transition: background-color 200ms ease, transform 200ms cubic-bezier(.2, .7, .2, 1);
}

.ygv .ygv-button:hover {
	background: var(--ygv-ink);
	color: var(--ygv-ground);
	transform: translateY(-2px);
}

.ygv .ygv-button:active {
	background: var(--ygv-accent);
	transform: translateY(0) scale(.98);
}

.ygv .ygv-button:focus-visible {
	outline: 2px solid var(--ygv-ink);
	outline-offset: 4px;
}

/* The kicker over a chapter's title: what the next stretch of the story is about. */
.ygv .ygv-kicker {
	margin: 0 0 16px;
	color: var(--ygv-accent);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Progress rail (src/progress.js): wide screens only. */
.ygv-rail {
	position: absolute;
	top: 50%;
	left: 18px;
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	transform: translateY(-50%);
	z-index: 2;
	pointer-events: none;
}

.ygv-rail-name {
	margin-bottom: 10px;
	color: var(--ygv-accent);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	opacity: 0.8;
}

.ygv-rail i {
	--on: 0;
	display: block;
	width: 3px;
	height: 6px;
	border-radius: 2px;
	background: rgba(245, 244, 240, .25);
	transform: scaleY(calc(1 + var(--on) * 2.4));
	transform-origin: 50% 50%;
	margin: calc(var(--on) * 5px) 0;
	transition: background-color 200ms ease;
}

.ygv-rail i.is-past {
	background: rgba(245, 244, 240, .6);
}

.ygv-rail i.is-on {
	background: var(--ygv-accent);
}

@media (min-width: 1024px) {
	.ygv-rail {
		display: flex;
	}
}

/* Opening chapter: a quiet prompt to scroll, with a line that draws downward. */
.ygv .ygv-cue {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 32px 0 0;
	color: var(--ygv-accent);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1.172rem;
	font-weight: 600;
	line-height: 1.2;
}

.ygv .ygv-cue::after {
	content: '';
	width: 1px;
	height: 32px;
	background: currentColor;
	transform-origin: top;
	animation: ygv-cue 2.4s cubic-bezier(.2, .7, .2, 1) infinite;
}

@keyframes ygv-cue {
	0% { transform: scaleY(0); opacity: 1; }
	55% { transform: scaleY(1); opacity: 1; }
	100% { transform: scaleY(1); opacity: 0; }
}

/* Opening chapter rises in on load, without waiting for the script. */
@keyframes ygv-rise {
	from { opacity: 0; transform: translateY(28px); }
	to { opacity: 1; transform: none; }
}

.ygv-chapter:first-child .ygv-kicker,
.ygv-chapter:first-child .ygv-title,
.ygv-chapter:first-child .ygv-text,
.ygv-chapter:first-child .ygv-button,
.ygv-chapter:first-child .ygv-cue {
	animation: ygv-rise 1s cubic-bezier(.2, .7, .2, 1) both;
}
.ygv-chapter:first-child .ygv-text { animation-delay: 80ms; }
.ygv-chapter:first-child .ygv-button,
.ygv-chapter:first-child .ygv-cue { animation-delay: 160ms; }

/* Tablets and phones: one column of words under a taller diagram. */
@media (max-width: 1023px) {
	.ygv-figure {
		top: 92px;
		height: 52vh;
		height: 52svh;
		left: 8px;
		right: 8px;
	}

	.ygv-chapter {
		padding-bottom: 5vh;
		padding-bottom: 5svh;
	}

	/* One column, in reading order: title, words, button, source. */
	.ygv-copy {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		max-width: 34rem;
	}

	.ygv-head,
	.ygv-words {
		display: contents;
	}

	.ygv-title { order: 1; }
	.ygv-text { order: 2; }
	.ygv-button,
	.ygv-cue { order: 3; }
	.ygv-source { order: 4; }

	.ygv .ygv-words > .ygv-text:first-child {
		margin-top: 16px;
	}
}

@media (max-width: 767px) {
	.ygv-figure {
		top: 112px; /* clear of the logo in the site header */
		height: 36vh;
		height: 36svh;
	}

	.ygv-figure--single {
		height: 47vh;
		height: 47svh;
	}

	.ygv .ygv-title,
	.ygv h1.ygv-title {
		font-size: clamp(1.75rem, 7.5vw, 2.375rem);
	}

	.ygv .ygv-text {
		margin-top: 16px;
		font-size: 1.25rem;
		line-height: 1.5;
	}

	.ygv .ygv-text + .ygv-text {
		margin-top: 10px;
	}

	.ygv .ygv-source {
		margin-top: 18px;
		font-size: 1.016rem;
	}

	.ygv .ygv-button {
		margin-top: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ygv .ygv-button {
		transition: none;
	}

	.ygv-chapter:first-child .ygv-kicker,
	.ygv-chapter:first-child .ygv-title,
	.ygv-chapter:first-child .ygv-text,
	.ygv-chapter:first-child .ygv-button,
	.ygv-chapter:first-child .ygv-cue,
	.ygv .ygv-cue::after {
		animation: none;
	}
}

/*
 * Split layout: the YeGesha sequence. One scene per chapter, layered in the
 * figure and cross-faded by the script. Footage and photographs keep a 16:9
 * frame where the screen allows; drawings scale inside it. The map chapters
 * share one full-frame map.
 */
.ygy-scene {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: 0 auto;
	height: 100%;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	overflow: hidden;
	opacity: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The map fills the whole frame: it zooms from the estate to each appellation. */
.ygy-scene--map {
	aspect-ratio: auto;
	width: 100%;
}

/* Without the script, the harvest photograph stands in for the sequence. */
.ygy:not(.is-ready) .ygy-scene--image {
	opacity: 1;
}

.ygy-scene video,
.ygy-scene img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform-origin: 50% 50%;
}

.ygy-scene svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* A pair of photographs, the second laid over the first and faded in by the script. */
.ygy-scene--images img {
	position: absolute;
	inset: 0;
}

.ygy-scene--images img + img {
	opacity: 0;
}

/* The closing bag fills most of the frame's height. */
.ygy-scene--label .yg-bag {
	height: 94%;
}

/*
 * Where to next (yegesha_value_chain_next): three cards after the story.
 * The café, buying online, the sister farm.
 */
.ygv-next {
	--ygv-ground: #00311B;
	--ygv-field: #105136;
	--ygv-ink: #F5F4F0;
	--ygv-accent: #CCB484;
	padding: clamp(72px, 10vw, 140px) clamp(20px, 6vw, 96px);
	background: var(--ygv-ground);
	color: var(--ygv-ink);
}

.ygv-next-head {
	max-width: 44rem;
	margin: 0 auto 48px;
	text-align: center;
}

.ygv-next .ygv-kicker {
	margin: 0 0 16px;
	color: var(--ygv-accent);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ygv-next .ygv-title {
	margin: 0;
	color: var(--ygv-ink);
	font-family: 'Bluu Next', Georgia, 'Times New Roman', serif;
	font-size: clamp(2rem, 3vw, 3rem);
	font-weight: 700;
	line-height: 1.06;
	text-transform: uppercase;
	text-wrap: balance;
}

.ygv-next-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	max-width: 76rem;
	margin: 0 auto;
}

.ygv-next-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--ygv-field);
	border: 1px solid rgba(204, 180, 132, .22);
	transition: transform 300ms cubic-bezier(.2, .7, .2, 1), border-color 300ms ease;
}

.ygv-next-card:hover {
	transform: translateY(-4px);
	border-color: rgba(204, 180, 132, .55);
}

.ygv-next-media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.ygv-next-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms cubic-bezier(.2, .7, .2, 1);
}

.ygv-next-card:hover .ygv-next-media img {
	transform: scale(1.04);
}

.ygv-next-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 26px 26px 30px;
}

.ygv-next .ygv-next-kicker {
	margin: 0 0 10px;
	color: var(--ygv-accent);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ygv-next .ygv-next-title {
	margin: 0;
	color: var(--ygv-ink);
	font-family: 'Bluu Next', Georgia, 'Times New Roman', serif;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
	text-wrap: balance;
}

.ygv-next .ygv-next-text {
	flex: 1;
	margin: 14px 0 24px;
	color: var(--ygv-ink);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1.25rem;
	line-height: 1.5;
	opacity: 0.86;
}

.ygv-next .ygv-button {
	display: inline-block;
	padding: 15px 24px;
	border-radius: 3px;
	background: var(--ygv-accent);
	color: var(--ygv-ground);
	font-family: 'Open Sans', system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 200ms ease, transform 200ms cubic-bezier(.2, .7, .2, 1);
}

.ygv-next .ygv-button:hover { background: var(--ygv-ink); color: var(--ygv-ground); }
.ygv-next .ygv-button:active { background: var(--ygv-accent); transform: scale(.98); }
.ygv-next .ygv-button:focus-visible { outline: 2px solid var(--ygv-ink); outline-offset: 4px; }

.ygv-next .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 900px) {
	.ygv-next-cards {
		grid-template-columns: minmax(0, 1fr);
		max-width: 34rem;
	}

	.ygv-next-media {
		aspect-ratio: 16 / 9;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ygv-next-card,
	.ygv-next-media img,
	.ygv-next .ygv-button {
		transition: none;
	}

	.ygv-next-card:hover,
	.ygv-next-card:hover .ygv-next-media img {
		transform: none;
	}
}

/*
 * On Instagram: the six latest posts as a strip of reel covers, on the
 * primary green so it reads as its own section after the cards.
 */
.ygv-ig {
	background: var(--ygv-field);
	padding-top: clamp(64px, 8vw, 112px);
}

.ygv-ig-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	max-width: 76rem;
	margin: 0 auto 40px;
}

.ygv-ig-head > div {
	max-width: 40rem;
}

.ygv-ig .ygv-next-text {
	margin: 16px 0 0;
}

.ygv-ig .ygv-button {
	flex: none;
}

.ygv-ig-posts {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
	max-width: 76rem;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.ygv-ig-posts li {
	margin: 0;
	padding: 0;
}

.ygv-ig-posts a {
	position: relative;
	display: block;
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border-radius: 3px;
	background: var(--ygv-ground);
}

.ygv-ig-posts img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms cubic-bezier(.2, .7, .2, 1), opacity 300ms ease;
}

.ygv-ig-posts a:hover img {
	transform: scale(1.04);
}

/* Reels carry a small play mark, as on Instagram. */
.ygv-ig-posts a.is-video::after {
	content: '';
	position: absolute;
	top: 12px;
	right: 12px;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent var(--ygv-ink);
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}

.ygv-ig-posts a:focus-visible {
	outline: 2px solid var(--ygv-ink);
	outline-offset: 3px;
}

/* Narrow screens: one swipeable row that runs to the screen's edge. */
@media (max-width: 900px) {
	.ygv-ig-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.ygv-ig-posts {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: min(42vw, 13rem);
		margin-right: calc(-1 * clamp(20px, 6vw, 96px));
		padding-right: clamp(20px, 6vw, 96px);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.ygv-ig-posts::-webkit-scrollbar {
		display: none;
	}

	.ygv-ig-posts li {
		scroll-snap-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ygv-ig-posts img {
		transition: none;
	}

	.ygv-ig-posts a:hover img {
		transform: none;
	}
}

/*
 * Our Story ([yegesha_story]). The same parts as the home page, told as the
 * company's history. It opens over the forest footage; then each chapter has
 * one scene. Chapters run four to eight lines, so on wide screens the scene
 * stands beside the words instead of above them, and the words read top to
 * bottom like a page.
 */
.ygs-hero {
	display: flex;
	align-items: flex-end;
	min-height: 100vh;
	min-height: 100svh;
	overflow: hidden;
}

.ygs-hero-media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.ygs-hero-media img,
.ygs-hero-media video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The footage arrives after the page has loaded and fades in over the still. */
.ygs-hero-media video {
	opacity: 0;
	transition: opacity .8s ease;
}

.ygs-hero-media video.is-playing {
	opacity: 1;
}

/* The footage darkens toward the words and into the story below. */
.ygs-hero-media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, var(--ygv-ground) 0%, rgba(0, 49, 27, .78) 32%, rgba(0, 49, 27, .3) 70%, rgba(0, 49, 27, .2) 100%);
}

.ygs-hero-copy {
	max-width: 52rem;
	padding: 0 var(--ygv-margin) 12vh;
	padding-bottom: 12svh;
}

.ygs-hero-copy .ygv-text {
	max-width: 38rem;
}

.ygs-hero-copy > * {
	animation: ygv-rise 1s cubic-bezier(.2, .7, .2, 1) both;
}

.ygs-hero-copy .ygv-title { animation-delay: 60ms; }
.ygs-hero-copy .ygv-text { animation-delay: 140ms; }
.ygs-hero-copy .ygv-cue { animation-delay: 220ms; }

/* Every chapter is read in one order: kicker, title, words, buttons. */
.ygs .ygv-copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.ygs .ygv-head,
.ygs .ygv-words {
	display: contents;
}

.ygs .ygv-kicker { order: 0; }
.ygs .ygv-title { order: 1; }
.ygs .ygv-text { order: 2; }
.ygs .ygv-links { order: 3; }

.ygs .ygv-words > .ygv-text:first-child {
	margin-top: 24px;
}

.ygs .ygv-text + .ygv-text {
	margin-top: 0.9em;
}

.ygv .ygv-links {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 32px 0 0;
}

.ygv .ygv-links .ygv-button {
	margin-top: 0;
}

/* A second button is the quieter one: outlined. */
.ygv .ygv-links .ygv-button + .ygv-button {
	background: transparent;
	color: var(--ygv-ink);
	box-shadow: inset 0 0 0 1.5px var(--ygv-accent);
}

.ygv .ygv-links .ygv-button + .ygv-button:hover {
	background: var(--ygv-ink);
	color: var(--ygv-ground);
	box-shadow: none;
}

/* The opening chapter is reached by scrolling here, so it rises in with the rest. */
.ygs .ygv-chapter:first-child .ygv-kicker,
.ygs .ygv-chapter:first-child .ygv-title,
.ygs .ygv-chapter:first-child .ygv-text,
.ygs .ygv-chapter:first-child .ygv-button {
	animation: none;
}

/* Scenes fill the frame here; photographs are cropped to it. */
.ygs .ygy-scene {
	aspect-ratio: auto;
	width: 100%;
}

.ygs .ygy-scene--label .yg-bag,
.ygs .ygy-scene--kraft .yg-bag {
	height: 84%;
	max-width: 92%;
}

.ygs .ygy-scene--image img,
.ygs .ygy-scene--images img {
	border-radius: 3px;
}

/* Three or more photographs take turns (yegesha.js), cross-fading. */
.ygy-scene--images.is-turning img {
	opacity: 0;
	transition: opacity 1.2s ease;
}

.ygy-scene--images.is-turning img.is-shown {
	opacity: 1;
}

/* Wide screens: the words on the left, the scene on the right. */
@media (min-width: 1024px) {
	.ygs .ygv-figure {
		top: 148px;
		bottom: 8vh;
		bottom: 8svh;
		height: auto;
		left: 52%;
		right: var(--ygv-margin);
	}

	.ygs .ygv-chapter {
		align-items: center;
		padding: 16vh var(--ygv-margin);
		padding-top: 16svh;
		padding-bottom: 16svh;
		padding-left: calc(var(--ygv-margin) + 24px); /* clear of the progress rail */
	}

	.ygs .ygv-copy {
		width: min(36rem, calc(52vw - var(--ygv-margin) * 2 - 24px));
	}
}

/*
 * Tablets and phones: the scene above, each chapter starting just beneath it.
 * The words scroll up under a band in the ground colour that holds the scene,
 * fading at its lower edge, so a long chapter reads line by line to the end.
 */
@media (max-width: 1023px) {
	.ygs .ygv-stage {
		--ygs-band: calc(92px + 44svh + 20px);
		z-index: 2;
		pointer-events: none;
	}

	.ygs .ygv-stage::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: calc(var(--ygs-band) + 28px);
		background: linear-gradient(to bottom, var(--ygv-ground) calc(100% - 28px), rgba(0, 49, 27, 0));
	}

	.ygs .ygv-figure {
		height: 44vh;
		height: 44svh;
	}

	.ygs .ygv-chapter {
		align-items: flex-start;
		padding-top: calc(92px + 44vh + 32px);
		padding-top: calc(92px + 44svh + 32px);
		padding-bottom: 14vh;
		padding-bottom: 14svh;
	}
}

@media (max-width: 767px) {
	.ygs .ygv-stage {
		--ygs-band: calc(112px + 34svh + 16px);
	}

	.ygs .ygv-figure {
		height: 34vh;
		height: 34svh;
	}

	.ygs .ygv-chapter {
		padding-top: calc(112px + 34vh + 24px);
		padding-top: calc(112px + 34svh + 24px);
	}

	.ygs-hero-copy {
		padding-bottom: 9vh;
		padding-bottom: 9svh;
	}

	.ygv .ygv-links .ygv-button {
		flex: 1 1 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ygs-hero-copy > * {
		animation: none;
	}
}

/*
 * Value Propositions ([yegesha_values]). Our Story's layout and engine, with
 * an opening of its own: the words and an index of the three commitments
 * beside a tall photograph, instead of footage behind the words.
 */
.ygp-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
	align-items: center;
	gap: clamp(32px, 6vw, 96px);
	min-height: 100vh;
	min-height: 100svh;
	padding: 200px var(--ygv-margin) 10vh;
	padding-bottom: 10svh;
}

.ygp-hero-copy {
	max-width: 46rem;
}

.ygp-hero-copy .ygv-text {
	max-width: 36rem;
}

.ygp-hero-copy > * {
	animation: ygv-rise 1s cubic-bezier(.2, .7, .2, 1) both;
}

.ygp-hero-copy .ygv-title { animation-delay: 60ms; }
.ygp-hero-copy .ygv-text { animation-delay: 140ms; }
.ygp-hero-copy .ygp-index { animation-delay: 220ms; }

/* The photograph, with a gold frame set off behind it. */
.ygp-hero-media {
	position: relative;
	margin: 0;
	justify-self: end;
	width: 100%;
	max-width: 30rem;
	animation: ygv-rise 1.2s 120ms cubic-bezier(.2, .7, .2, 1) both;
}

.ygp-hero-media::before {
	content: '';
	position: absolute;
	inset: 0;
	transform: translate(16px, 16px);
	border: 1.5px solid var(--ygv-accent);
	border-radius: 3px;
	opacity: .55;
}

.ygp-hero-media img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	max-height: 72vh;
	max-height: 72svh;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	border-radius: 3px;
}

/* The three commitments: number, name, and the line that is each chapter's title. */
.ygp-index ol {
	list-style: none;
	margin: 40px 0 0;
	padding: 0;
	border-top: 1px solid rgba(245, 244, 240, .18);
}

.ygp-index li {
	margin: 0;
	border-bottom: 1px solid rgba(245, 244, 240, .18);
}

.ygp-index a {
	display: grid;
	grid-template-columns: 3.2rem 1fr auto;
	align-items: baseline;
	gap: 4px 16px;
	padding: 18px 0;
	color: var(--ygv-ink);
	text-decoration: none;
}

.ygp-index-n {
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 1.25rem;
	color: var(--ygv-accent);
}

.ygp-index-name {
	font-family: 'Bluu Next', Georgia, serif;
	font-size: clamp(1.25rem, 1.6vw, 1.6rem);
	text-transform: uppercase;
	letter-spacing: .02em;
	transition: color .2s ease;
}

.ygp-index-line {
	font-size: .9375rem;
	color: rgba(245, 244, 240, .7);
	text-align: right;
}

.ygp-index a:hover .ygp-index-name,
.ygp-index a:focus-visible .ygp-index-name {
	color: var(--ygv-accent);
}

.ygp-index a:focus-visible {
	outline: 2px solid var(--ygv-accent);
	outline-offset: 4px;
}

html:has(.ygp-index) {
	scroll-behavior: smooth;
}

/* The scenes here are drawings, held a little in from the frame's edges. */
.ygp .ygy-scene--curve svg,
.ygp .ygy-scene--cupping svg,
.ygp .ygy-scene--horizon svg {
	max-width: 620px;
	margin: 0 auto;
}

@media (max-width: 1023px) {
	/* Tablets and phones: the photograph first, under the site header, fading into the words. */
	.ygp-hero {
		grid-template-columns: 1fr;
		gap: 0;
		min-height: 0;
		padding: 0 0 10vh;
		padding-bottom: 10svh;
	}

	.ygp-hero-media {
		order: -1;
		max-width: none;
		animation: none;
	}

	.ygp-hero-media::before {
		display: none;
	}

	.ygp-hero-media::after {
		content: '';
		position: absolute;
		inset: 0;
		background: linear-gradient(to top, var(--ygv-ground) 0%, rgba(0, 49, 27, .35) 45%, rgba(0, 49, 27, .55) 100%);
	}

	.ygp-hero-media img {
		height: 62vh;
		height: 62svh;
		max-height: none;
		aspect-ratio: auto;
		border-radius: 0;
	}

	.ygp-hero-copy {
		margin-top: -12vh;
		margin-top: -12svh;
		position: relative;
		padding: 0 var(--ygv-margin);
	}
}

@media (max-width: 767px) {
	.ygp-index a {
		grid-template-columns: 2.4rem 1fr;
	}

	.ygp-index-line {
		grid-column: 2;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	html:has(.ygp-index) {
		scroll-behavior: auto;
	}

	.ygp-hero-copy > *,
	.ygp-hero-media {
		animation: none;
	}
}

/*
 * Typed headlines (src/type.js): the first headline on Home, Our Story and
 * Value Propositions. The plugin sets .ygt-on just before the headline, so
 * it is hidden until typing starts; if the script never runs, it appears
 * after three seconds anyway. Letters keep their place and only fade in.
 */
.ygt-on .ygp-hero h1.ygv-title,
.ygt-on .ygs-hero h1.ygv-title,
.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child h1.ygv-title {
	opacity: 0;
	animation: ygt-fallback 0s 3s forwards;
}

@keyframes ygt-fallback {
	to { opacity: 1; }
}

.ygt-on .ygp-hero h1.ygv-title.ygt,
.ygt-on .ygs-hero h1.ygv-title.ygt,
.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child h1.ygv-title.ygt {
	opacity: 1;
	animation: none;
}

.ygt-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ygt-w {
	display: inline-block;
	white-space: nowrap;
}

.ygt-c {
	position: relative;
	opacity: 0;
	transition: opacity .12s ease-out;
}

.ygt-c.is-on {
	opacity: 1;
}

/* The caret: a thin gold bar after the last letter, out of the flow. */
.ygt-c.is-caret::after {
	content: '';
	position: absolute;
	left: 100%;
	top: .08em;
	bottom: .1em;
	width: max(2px, .055em);
	margin-left: .05em;
	background: var(--ygv-accent);
}

.ygt.is-typed .ygt-c.is-caret::after {
	animation: ygt-blink 1.1s steps(1) 2, ygt-out .4s 2.2s ease forwards;
}

/*
 * The words under a typed headline wait for it: hidden until the last letter
 * is typed (.ygt-done, set by type.js), then they rise in. If the script never
 * runs they appear after five seconds.
 */
.ygt-on :is(.ygp-hero-copy, .ygs-hero-copy) > :is(.ygv-text, .ygp-index, .ygv-cue),
.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child :is(.ygv-text, .ygv-button, .ygv-links, .ygv-cue, .ygv-source) {
	opacity: 0;
	animation: ygt-show .8s ease 5s both;
}

.ygt-on :is(.ygp-hero-copy, .ygs-hero-copy).ygt-done > :is(.ygv-text, .ygp-index, .ygv-cue),
.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child .ygt-done :is(.ygv-text, .ygv-button, .ygv-links, .ygv-cue, .ygv-source) {
	opacity: 1;
	animation: ygv-rise .9s cubic-bezier(.2, .7, .2, 1) both;
}

/* The paragraph first, then what follows it. */
.ygt-on :is(.ygp-hero-copy, .ygs-hero-copy).ygt-done > :is(.ygp-index, .ygv-cue),
.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child .ygt-done :is(.ygv-button, .ygv-links, .ygv-cue, .ygv-source) {
	animation-delay: .16s;
}

@keyframes ygt-show {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

@keyframes ygt-blink {
	50% { opacity: 0; }
}

@keyframes ygt-out {
	to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ygt-on :is(.ygp-hero-copy, .ygs-hero-copy) > :is(.ygv-text, .ygp-index, .ygv-cue),
	.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child :is(.ygv-text, .ygv-button, .ygv-links, .ygv-cue, .ygv-source),
	.ygt-on .ygp-hero h1.ygv-title,
	.ygt-on .ygs-hero h1.ygv-title,
	.ygt-on .ygv:not(.ygy) .ygv-chapter:first-child h1.ygv-title {
		opacity: 1;
		animation: none;
	}
}

/*
 * Trial: every piece of copy typed (YEGESHA_TYPE_ALL, .ygt-all). Copy and
 * buttons are hidden until their block types; if the script never runs,
 * they appear after six seconds. "#ygt-x" matches nothing: it only lifts
 * these rules above the page's own entrance animations.
 */
html.ygt-all :is(.ygv-kicker, .ygv-title, .ygv-text, .ygv-next-kicker, .ygv-next-title, .ygv-next-text, .ygp-index-n, .ygp-index-name, .ygp-index-line, .ygv-cue, .ygv-source, .ygv-button, #ygt-x) {
	opacity: 0;
	animation: ygt-show .8s ease 6s both;
}

/* Once the script runs, the safety reveal is off: copy waits for its turn. */
html.ygt-all.ygt-run :is(.ygv-kicker, .ygv-title, .ygv-text, .ygv-next-kicker, .ygv-next-title, .ygv-next-text, .ygp-index-n, .ygp-index-name, .ygp-index-line, .ygv-cue, .ygv-source, .ygv-button, #ygt-x) {
	animation: none;
}

html.ygt-all.ygt-all.ygt-all :is(.ygv-kicker, .ygv-title, .ygv-text, .ygv-next-kicker, .ygv-next-title, .ygv-next-text, .ygp-index-n, .ygp-index-name, .ygp-index-line, .ygv-cue, .ygv-source, #ygt-x).ygt {
	opacity: 1;
	animation: none;
}

html.ygt-all.ygt-all.ygt-all .ygt-done :is(.ygv-button, #ygt-x) {
	opacity: 1;
	animation: ygv-rise .9s cubic-bezier(.2, .7, .2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
	html.ygt-all :is(.ygv-kicker, .ygv-title, .ygv-text, .ygv-next-kicker, .ygv-next-title, .ygv-next-text, .ygp-index-n, .ygp-index-name, .ygp-index-line, .ygv-cue, .ygv-source, .ygv-button, #ygt-x) {
		opacity: 1;
		animation: none;
	}
}

/*
 * The SCA assessments (Value Propositions, Transparency): a dialog over the
 * page, one sheet per lot drawn after the Coffee Value Assessment's Combined
 * Form. The sheet is paper and ink: off-white ground, dark green type, marks
 * in coffee brown as if made by hand; Part 1 beside Part 2, row by row.
 */
.ygc {
	--ygc-ground: #00311B;
	--ygc-field: #105136;
	--ygc-cream: #F5F4F0;
	--ygc-gold: #CCB484;
	--ygc-ink: #00311B;
	--ygc-mark: #946239;
	--ygc-line: rgba(0, 49, 27, .16);
	--ygc-soft: rgba(0, 49, 27, .62);

	width: min(1120px, calc(100% - 48px));
	max-width: none;
	height: min(calc(100dvh - 48px), 1040px);
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: var(--ygc-ground);
	color: var(--ygc-cream);
	font-family: 'Open Sans', system-ui, sans-serif;
	box-shadow: 0 40px 120px rgba(0, 20, 10, .55);
	overflow: hidden;
}

.ygc[open] {
	animation: ygc-in .45s cubic-bezier(.2, .7, .2, 1) both;
}

.ygc::backdrop {
	background: rgba(0, 22, 12, .72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

@keyframes ygc-in {
	from { opacity: 0; transform: translateY(18px) scale(.985); }
	to { opacity: 1; transform: none; }
}

html:has(dialog.ygc[open]) {
	overflow: hidden;
}

.ygc-panel {
	display: grid;
	grid-template-rows: auto auto minmax(0, 1fr) auto;
	height: 100%;
}

.ygc-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 32px 36px 0;
}

.ygc-kicker {
	margin: 0 0 12px;
	color: var(--ygc-gold);
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
}

.ygc-title {
	margin: 0;
	color: var(--ygc-cream);
	font-family: 'Bluu Next', Georgia, serif;
	font-size: clamp(1.6rem, 2.6vw, 2.25rem);
	font-weight: 700;
	line-height: 1.05;
	text-transform: uppercase;
}

.ygc-intro {
	max-width: 44rem;
	margin: 0 0 18px;
	color: rgba(245, 244, 240, .78);
	font-size: 1rem;
	line-height: 1.55;
}

.ygc-close {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1.5px solid rgba(245, 244, 240, .35);
	border-radius: 50%;
	background: transparent;
	color: var(--ygc-cream);
	cursor: pointer;
	transition: border-color .2s ease, background-color .2s ease;
}

.ygc-close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.ygc-close:hover { border-color: var(--ygc-gold); background: rgba(245, 244, 240, .06); }
.ygc-close:focus-visible { outline: 2px solid var(--ygc-gold); outline-offset: 3px; }

/* One tab per lot: its name and its total. */
.ygc-tabs {
	display: flex;
	gap: 10px;
	padding: 24px 36px 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.ygc-tab {
	flex: none;
	display: inline-flex;
	align-items: baseline;
	gap: 12px;
	padding: 12px 18px;
	border: 1.5px solid rgba(245, 244, 240, .22);
	border-radius: 3px;
	background: transparent;
	color: var(--ygc-cream);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.ygc-tab-name {
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.ygc-tab-score {
	color: var(--ygc-gold);
	font-size: .9375rem;
	font-weight: 600;
}

.ygc-tab:hover { border-color: var(--ygc-gold); }
.ygc-tab[aria-selected="true"] { background: var(--ygc-cream); border-color: var(--ygc-cream); color: var(--ygc-ink); }
.ygc-tab[aria-selected="true"] .ygc-tab-score { color: var(--ygc-mark); }
.ygc-tab:focus-visible { outline: 2px solid var(--ygc-gold); outline-offset: 3px; }

.ygc-body {
	padding: 20px 36px 28px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* The sheet. */
.ygc-sheet {
	padding: 30px 32px 24px;
	border-radius: 4px;
	background: var(--ygc-cream);
	color: var(--ygc-ink);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 18px 50px rgba(0, 20, 10, .35);
}

.ygc-sheet:focus-visible { outline: 2px solid var(--ygc-gold); outline-offset: 4px; }

.ygc-sheet-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 28px;
	padding-bottom: 22px;
	border-bottom: 2px solid var(--ygc-ink);
}

.ygc-form {
	margin: 0 0 4px;
	color: var(--ygc-soft);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.ygc-lot-name {
	margin: 0;
	font-family: 'Bluu Next', Georgia, serif;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.ygc-fields {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, auto));
	justify-content: start;
	gap: 8px 26px;
	margin: 0;
}

.ygc-fields dt {
	color: var(--ygc-soft);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.ygc-fields dd {
	margin: 4px 0 0;
	font-size: .9375rem;
	font-weight: 600;
}

.ygc-roast-bar {
	position: relative;
	display: block;
	width: 96px;
	height: 8px;
	margin-top: 9px;
	border-radius: 4px;
	background: linear-gradient(90deg, #E6D6B8, #946239 55%, #3B2414);
}

.ygc-roast-bar i {
	position: absolute;
	top: -5px;
	left: calc(var(--v) * 100%);
	width: 2.5px;
	height: 18px;
	margin-left: -1px;
	border-radius: 2px;
	background: var(--ygc-ink);
}

/* The total, ringed by hand as on the paper. */
.ygc-total {
	position: relative;
	display: grid;
	justify-items: center;
	padding: 10px 26px;
}

.ygc-total span {
	color: var(--ygc-soft);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.ygc-total strong {
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1;
	color: var(--ygc-mark);
}

.ygc-total svg {
	position: absolute;
	inset: -6px -10px;
	width: calc(100% + 20px);
	height: calc(100% + 12px);
	fill: none;
	stroke: var(--ygc-mark);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	overflow: visible;
}

/* The form's two parts, as a dark band across the sheet. */
.ygc-parts {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	margin-top: 22px;
	background: var(--ygc-ink);
	color: var(--ygc-cream);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.ygc-parts span { padding: 9px 16px; }
.ygc-parts span + span { border-left: 1px solid rgba(245, 244, 240, .25); }

.ygc-row {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	border-bottom: 1px solid var(--ygc-line);
}

.ygc-desc { padding: 20px 22px 20px 16px; }
.ygc-aff { padding: 20px 16px 20px 22px; border-left: 1px solid var(--ygc-line); }

.ygc-row-title {
	margin: 0 0 14px;
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
}

/* Intensity, 0-15, on the form's light-to-dark line. */
.ygc-bar {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	margin: 0 0 10px;
}

.ygc-bar-name { font-size: .875rem; font-weight: 600; }

.ygc-track {
	position: relative;
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, #E2DFD5, #7E8C82 60%, var(--ygc-ink));
}

.ygc-track i {
	position: absolute;
	top: -6px;
	left: calc(var(--v) * 100%);
	width: 3px;
	height: 20px;
	margin-left: -1.5px;
	border-radius: 2px;
	background: var(--ygc-mark);
	transform-origin: 50% 100%;
}

.ygc-ends {
	display: flex;
	justify-content: space-between;
	margin: -2px 0 14px calc(6.5rem + 12px);
	color: var(--ygc-soft);
	font-size: .625rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.ygc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.ygc-chips li {
	padding: 4px 11px;
	border: 1px solid rgba(0, 49, 27, .28);
	border-radius: 999px;
	font-size: .8125rem;
	line-height: 1.4;
}

.ygc-chips.is-tastes li { border-color: var(--ygc-mark); color: var(--ygc-mark); }

.ygc-chips li.ygc-chips-label {
	padding-left: 0;
	border: 0;
	color: var(--ygc-soft);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.ygc-note {
	margin: 12px 0 0;
	color: var(--ygc-ink);
	font-size: .9375rem;
	font-style: italic;
	line-height: 1.5;
}

.ygc-plain {
	margin: 0;
	color: var(--ygc-soft);
	font-size: .875rem;
	line-height: 1.5;
}

/* Liking, 1-9: the chosen number filled in. */
.ygc-score {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.ygc-score-name { font-size: .875rem; font-weight: 600; }

.ygc-dots {
	display: flex;
	gap: 4px;
}

.ygc-dots i {
	display: grid;
	place-items: center;
	line-height: 1;
	width: 22px;
	height: 22px;
	border: 1px solid rgba(0, 49, 27, .35);
	border-radius: 50%;
	color: var(--ygc-soft);
	font-size: .625rem;
	font-style: normal;
	font-weight: 600;
}

.ygc-dots i.is-on {
	border-color: var(--ygc-mark);
	background: var(--ygc-mark);
	color: var(--ygc-cream);
}

.ygc-sheet-foot p {
	margin: 16px 0 0;
	color: var(--ygc-soft);
	font-size: .8125rem;
	line-height: 1.5;
}

/* The method: the sum worked in the margin, as a cupper would, down to the ringed total. */
.ygc-math {
	margin-top: 28px;
	padding: 20px 24px 18px;
	border: 1px dashed var(--ygc-line);
	border-radius: 10px;
}

.ygc-math-title {
	margin: 0 0 12px;
	color: var(--ygc-soft);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.ygc-math ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ygc-step;
}

.ygc-math li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 24px;
	align-items: baseline;
	padding: 9px 0;
	border-top: 1px solid var(--ygc-line);
	counter-increment: ygc-step;
	font-size: .9375rem;
	line-height: 1.45;
}

.ygc-math li:first-child { border-top: 0; }

.ygc-math li span::before {
	content: counter(ygc-step) '.';
	display: inline-block;
	min-width: 1.5em;
	color: var(--ygc-soft);
}

.ygc-math li b {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-align: right;
	color: var(--ygc-mark);
}

.ygc-math li.is-total {
	border-top: 1.5px solid var(--ygc-ink);
}

.ygc-math li.is-total b {
	font-family: 'Bluu Next', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
}

.ygc-math p { margin-top: 12px; }

/* Drawing in: marks, scores and the ring, row by row. */
.ygc-sheet.is-drawn .ygc-track i { animation: ygc-mark .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--r) * 90ms + 120ms); }
.ygc-sheet.is-drawn .ygc-dots i.is-on { animation: ygc-dot .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--r) * 90ms + 220ms); }
.ygc-sheet.is-drawn .ygc-total svg { transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1) .75s; stroke-dashoffset: 0; }

@keyframes ygc-mark {
	from { opacity: 0; transform: scaleY(0); }
	to { opacity: 1; transform: none; }
}

@keyframes ygc-dot {
	from { background: transparent; color: var(--ygc-soft); transform: scale(.6); }
	to { transform: none; }
}

/* The scan, to download. */
.ygc-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 22px;
	padding: 16px 36px 18px;
	border-top: 1px solid rgba(245, 244, 240, .14);
}

.ygc-download {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	border-radius: 3px;
	background: var(--ygc-gold);
	color: var(--ygc-ground);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .2s ease, transform .2s cubic-bezier(.2, .7, .2, 1);
}

.ygc-download svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ygc-download small { font-size: .8125rem; font-weight: 400; opacity: .8; }
.ygc-download:hover { background: var(--ygc-cream); transform: translateY(-2px); }
.ygc-download:focus-visible { outline: 2px solid var(--ygc-cream); outline-offset: 3px; }

.ygc-foot-note {
	margin: 16px 0 0;
	color: rgba(245, 244, 240, .7);
	font-size: .875rem;
	line-height: 1.5;
}

/* Tablets: the header's fields under the lot name. */
@media (max-width: 1023px) {
	.ygc-sheet-head { grid-template-columns: minmax(0, 1fr) auto; }
	.ygc-fields { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, auto)); }
}

/* Phones: the dialog fills the screen; each row's two parts stack. */
@media (max-width: 759px) {
	.ygc {
		width: 100%;
		height: 100dvh;
		border-radius: 0;
	}
	.ygc-head { padding: 16px 16px 0; align-items: center; }
	.ygc-kicker { margin-bottom: 6px; font-size: .6875rem; }
	.ygc-title { font-size: 1.3rem; }
	.ygc-close { width: 40px; height: 40px; }
	.ygc-intro { font-size: .9375rem; }
	.ygc-tabs { gap: 6px; padding: 14px 12px 0; }
	.ygc-tab { flex: 1 1 0; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; }
	.ygc-tab-name { font-size: 1rem; }
	.ygc-tab-score { font-size: .8125rem; }
	.ygc-body { padding: 14px 12px 20px; }
	.ygc-sheet { padding: 20px 16px 18px; }
	.ygc-sheet-head { gap: 16px; }
	.ygc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ygc-total { padding: 8px 18px; }
	.ygc-total strong { font-size: 2rem; }
	.ygc-parts { display: none; }
	.ygc-row { grid-template-columns: 1fr; }
	.ygc-desc { padding: 18px 0 8px; }
	.ygc-aff { padding: 8px 0 18px; border-left: 0; }
	.ygc-desc::before,
	.ygc-aff::before {
		display: block;
		margin-bottom: 8px;
		color: var(--ygc-soft);
		font-size: .625rem;
		font-weight: 600;
		letter-spacing: .14em;
		text-transform: uppercase;
	}
	.ygc-desc::before { content: 'Descriptive'; }
	.ygc-aff::before { content: 'Affective'; }
	.ygc-bar,
	.ygc-score { grid-template-columns: 5.5rem minmax(0, 1fr); }
	.ygc-ends { margin-left: calc(5.5rem + 12px); }
	.ygc-dots { gap: 3px; }
	.ygc-dots i { width: 20px; height: 20px; }
	.ygc-foot { padding: 10px 12px 12px; }
	.ygc-math { padding: 16px 14px 14px; }
	.ygc-math li { grid-template-columns: 1fr; font-size: .875rem; }
	.ygc-math li b { text-align: left; padding-left: 1.5em; }
	.ygc-math li.is-total { grid-template-columns: 1fr auto; }
	.ygc-download { width: 100%; flex-wrap: wrap; justify-content: center; gap: 2px 10px; padding: 12px 16px; }
	.ygc-download small { flex-basis: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.ygc[open],
	.ygc-sheet.is-drawn .ygc-track i,
	.ygc-sheet.is-drawn .ygc-dots i.is-on { animation: none; }
	.ygc-total svg { stroke-dashoffset: 0; }
	.ygc-sheet.is-drawn .ygc-total svg { transition: none; }
}
