/*
 * We ALL Grow - Flow.
 *
 * Read from cp-all-designer we-all-grow.html:361-476, css/we-all-grow.css:882-1145,
 * 1168-1184 and 1247-1258.
 *
 * Colour, type, padding and the spaces between the parts arrive from the
 * Style tab and are not repeated here.
 *
 * The scene is drawn to its own width: every part of it, and the cards that
 * stand on it, are sized as a share of the board. The design writes those
 * shares in container units (cqw); here the script measures the board and
 * hands its hundredth over as --custom-we-all-grow-flow-u, a length in px,
 * and the window's height as --custom-we-all-grow-flow-screen. Without the
 * script the scene stands over the five cards, as it does on a tablet.
 *
 * Two layouts:
 *   the list — the scene, then the five cards under it (the default, and a
 *              tablet's, a phone's, and a reader's who asked for less movement);
 *   held     — [data-custom-held], set by the script on a desktop: the section
 *              holds the window while it is scrolled through, each card beside
 *              its climber.
 */

.custom-we-all-grow-flow {
	--custom-we-all-grow-flow-u: 12px;
	--custom-we-all-grow-flow-sky: #E2EAF5;
	--custom-we-all-grow-flow-card: #FFFFFF;
	--custom-we-all-grow-flow-edge-from: #16418C;
	--custom-we-all-grow-flow-edge-mid: #8FC9E4;
	--custom-we-all-grow-flow-edge-to: #E6F7FB;
	--custom-we-all-grow-flow-list-space: 20px;
	--custom-we-all-grow-flow-list-gap: 12px;
}

/* we-all-grow.css:894-899 — the sky runs from the top of the band to 51.745% of
   the board's width below the board's top, fading to white over the last 15%.
   The script writes where that is (--custom-we-all-grow-flow-sky-end). */
.custom-we-all-grow-flow .custom-we-all-grow-flow__pin {
	position: relative;
	background: linear-gradient(
		var(--custom-we-all-grow-flow-sky) 0,
		var(--custom-we-all-grow-flow-sky) calc(var(--custom-we-all-grow-flow-sky-end, 70%) - 15 * var(--custom-we-all-grow-flow-u)),
		rgba(255, 255, 255, 0) var(--custom-we-all-grow-flow-sky-end, 70%));
}

/* we-all-grow.css:887 */
.custom-we-all-grow-flow [data-custom-investor-head] {
	position: relative;
	z-index: 2;
}

.custom-we-all-grow-flow [data-custom-investor-title] {
	text-wrap: balance;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__hill {
	position: relative;
	display: block;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__board {
	position: relative;
	width: 100%;
	max-width: 100%;
}

/* we-all-grow.css:904, 1013 — the scene is cut off the drawing at its own shape */
.custom-we-all-grow-flow .custom-we-all-grow-flow__stage {
	position: relative;
	z-index: 1;
	overflow: hidden;
	aspect-ratio: 4269 / 2515;
}

/* we-all-grow.css:905-918 — every layer by its share of the drawing */
.custom-we-all-grow-flow .custom-we-all-grow-flow__frame {
	position: absolute;
	top: calc(-0.7028 * var(--custom-we-all-grow-flow-u));
	left: 0;
	width: 100%;
	aspect-ratio: 4269 / 2846;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__frame > img {
	position: absolute;
	display: block;
	height: auto;
	max-width: none;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__frame > .custom-we-all-grow-flow__bg {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__cloud { top: 20.509%; left: 11.668%; width: 76.663%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__stone { top: 37.847%; left: 11.321%; width: 77.359%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__plant { top: 71.586%; left: 36.699%; width: 43.665%; }

/* we-all-grow.css:920-933 — each climber where the drawing stands it */
.custom-we-all-grow-flow .custom-we-all-grow-flow__climber {
	opacity: 1;
	transition: opacity 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__climber[data-at="1"] { top: 49.958%; left: 11.255%; width: 12.215%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__climber[data-at="2"] { top: 42.23%; left: 26.263%; width: 10.093%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__climber[data-at="3"] { top: 34.515%; left: 39.171%; width: 13.501%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__climber[data-at="4"] { top: 23.558%; left: 53.6%; width: 14.809%; }
.custom-we-all-grow-flow .custom-we-all-grow-flow__climber[data-at="5"] { top: 16.793%; left: 68.07%; width: 9.738%; }

/* ------------------------------------------------------------------ */
/* The cards — the list (we-all-grow.css:1009-1045)                    */
/* ------------------------------------------------------------------ */

.custom-we-all-grow-flow .custom-we-all-grow-flow__list {
	position: static;
	display: grid;
	gap: var(--custom-we-all-grow-flow-list-gap);
	margin: var(--custom-we-all-grow-flow-list-space) 0 0;
	padding: 0;
	list-style: none;
}

/* a white card in a border that runs navy into pale blue, the leaf's corners */
.custom-we-all-grow-flow .custom-we-all-grow-flow__step {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	column-gap: 14px;
	margin: 0;
	padding: 12px 18px;
	border: 2px solid transparent;
	border-radius: 8px 28px 8px 28px;
	background:
		linear-gradient(var(--custom-we-all-grow-flow-card), var(--custom-we-all-grow-flow-card)) padding-box,
		linear-gradient(94deg, var(--custom-we-all-grow-flow-edge-from) 0%, var(--custom-we-all-grow-flow-edge-mid) 52%, var(--custom-we-all-grow-flow-edge-to) 100%) border-box;
	list-style: none;
	transition: opacity 400ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__step[hidden] {
	display: none;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__bulb {
	grid-row: span 2;
	width: 38px;
	height: auto;
	max-width: none;
	margin: 0;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__word,
.custom-we-all-grow-flow .custom-we-all-grow-flow__caption {
	display: block;
	font-size: 16px;
	line-height: 1.5;
}

/* we-all-grow.css:999-1001 */
.custom-we-all-grow-flow .custom-we-all-grow-flow__word {
	font-weight: 700;
}

.custom-we-all-grow-flow .custom-we-all-grow-flow__caption {
	font-weight: 400;
}

/* we-all-grow.css:1035-1048 — the card nearest the middle of the window, or
   the one pressed, is lit with its climber; the others step back */
.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__step {
	opacity: 0.45;
	transform: scale(0.985);
	cursor: pointer;
}

.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__step.is-cur {
	opacity: 1;
	transform: none;
	box-shadow: 0 10px 24px -12px rgba(22, 65, 140, 0.55);
}

.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__step:focus-visible {
	outline: 2px solid var(--custom-we-all-grow-flow-edge-from);
	outline-offset: 4px;
}

.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__step:active {
	transform: scale(0.97);
}

.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__climber {
	opacity: 0.32;
}

.custom-we-all-grow-flow [data-custom-cued] .custom-we-all-grow-flow__climber.is-cur {
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Held — a desktop (we-all-grow.css:934-998, 1168-1180, 1247-1258)    */
/* ------------------------------------------------------------------ */

/* the band is as tall as one window and four more half windows of scroll;
   the window is held at the top while it is scrolled through */
.custom-we-all-grow-flow[data-custom-held] {
	overflow: clip;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__track {
	height: var(--custom-we-all-grow-flow-track);
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__pin {
	position: sticky;
	top: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: var(--custom-we-all-grow-flow-screen);
}

/* the head, then the hill in what is left */
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__hill {
	display: flex;
	flex: 1 1 0;
	justify-content: center;
	min-height: 0;
}

/* the board as tall as the hill and as wide as the drawing's shape makes it */
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__board {
	width: auto;
	height: 100%;
	aspect-ratio: 4269 / 2515;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__stage {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__list {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
	margin: 0;
}

/* each card beside its climber; the scroll writes how much of it shows */
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step {
	position: absolute;
	column-gap: calc(0.94 * var(--custom-we-all-grow-flow-u));
	padding: calc(1.05 * var(--custom-we-all-grow-flow-u)) calc(2.4 * var(--custom-we-all-grow-flow-u)) calc(1.05 * var(--custom-we-all-grow-flow-u)) calc(2.34 * var(--custom-we-all-grow-flow-u));
	border-width: max(2px, calc(0.23 * var(--custom-we-all-grow-flow-u)));
	border-radius: calc(0.45 * var(--custom-we-all-grow-flow-u)) calc(3.2 * var(--custom-we-all-grow-flow-u)) calc(0.45 * var(--custom-we-all-grow-flow-u)) calc(3.2 * var(--custom-we-all-grow-flow-u));
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: none;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step[data-at="1"] { bottom: 53.148%; left: 6.591%; }
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step[data-at="2"] { bottom: 61.124%; left: 15.87%; }
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step[data-at="3"] { bottom: 67.473%; left: 36.017%; }
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step[data-at="4"] { right: 31.14%; bottom: 79.476%; }
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__step[data-at="5"] { right: 7.93%; bottom: 85.155%; }

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__bulb {
	width: calc(3.43 * var(--custom-we-all-grow-flow-u));
}

/* we-all-grow.css:996-1000 — clamp(14px, 1.9cqw, 26px), the word spaced .02em */
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__word,
.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__caption {
	font-size: clamp(14px, calc(1.9 * var(--custom-we-all-grow-flow-u)), 26px);
	line-height: 1.34;
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__word {
	letter-spacing: calc(0.038 * var(--custom-we-all-grow-flow-u));
}

.custom-we-all-grow-flow[data-custom-held] .custom-we-all-grow-flow__climber {
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.custom-we-all-grow-flow .custom-we-all-grow-flow__step,
	.custom-we-all-grow-flow .custom-we-all-grow-flow__climber {
		transition: none;
	}
}
