/* MPO Sustainability Framework — frontend styles
   Token system:
   --mpo-navy   #01224C  primary / hub / headings
   --mpo-sage   #3C9F20  pillar icon + connector accent
   --mpo-sage-2 #EAF1E9  pillar icon background wash
   --mpo-mist   #F3F6F5  section background
   --mpo-slate  #566270  body copy
   --mpo-gold   #C9A227  quote rule accent
*/

.mpo-sf {
	--mpo-navy: #01224c;
	--mpo-sage: #3c9f20;
	--mpo-sage-2: #eaf1e9;
	--mpo-line: #a9c7ac;
	--mpo-mist: #f3f6f5;
	--mpo-slate: #566270;
	--mpo-gold: #c9a227;
	--mpo-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--mpo-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	position: relative;
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 1.5rem;
	font-family: var(--mpo-body);
	color: var(--mpo-slate);
	box-sizing: border-box;
}
.mpo-sf *, .mpo-sf *::before, .mpo-sf *::after { box-sizing: inherit; }

.mpo-sf-columns {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: 2.5rem;
	align-items: center;
}

/* ---------- Diagram ---------- */

.mpo-sf-diagram {
	position: relative;
	width: 100%;
	max-width: 520px;
	aspect-ratio: 1 / 1;
	margin: 0 auto;
}

.mpo-sf-connectors {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.mpo-sf-ring {
	fill: none;
	stroke: var(--mpo-line);
	stroke-width: 0.24;
	stroke-dasharray: 1.6 1.8;
	stroke-linecap: round;
	opacity: 0;
	transition: opacity .6s ease .15s;
	animation: mpo-march 32s linear infinite;
}
.mpo-sf-spoke {
	stroke: var(--mpo-line);
	stroke-width: 0.2;
	stroke-dasharray: 1.3 1.5;
	stroke-linecap: round;
	fill: none;
	opacity: 0;
	transition: opacity .5s ease, stroke .3s ease, stroke-width .3s ease;
	animation: mpo-march 22s linear infinite;
}
.mpo-sf-dot {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mpo-sage);
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity .4s ease, background .3s ease, width .3s ease, height .3s ease;
	z-index: 4;
	pointer-events: none;
}

.mpo-sf-diagram.is-in-view .mpo-sf-dot { opacity: 1; }

.mpo-sf-dot.is-active {
	background: var(--mpo-sage);
	width: 9px;
	height: 9px;
}

.mpo-sf-diagram.is-in-view .mpo-sf-ring,
.mpo-sf-diagram.is-in-view .mpo-sf-spoke {
	opacity: 0.85;
}

.mpo-sf-spoke.is-active {
	stroke: var(--mpo-navy);
	stroke-width: 0.28;
	opacity: 0.9;
}

@keyframes mpo-march {
	to { stroke-dashoffset: -60; }
}

.mpo-sf-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.85);
	width: 34%;
	aspect-ratio: 1/1;
	border-radius: 50%;
	background: var(--mpo-navy);
	border: 1px solid var(--mpo-navy);
	box-shadow: 0 10px 30px -12px rgba(1, 34, 76, 0.45);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8%;
	font-family: var(--mpo-display);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	color: #fff;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	z-index: 3;
	opacity: 0;
	animation: mpo-hub-in .6s cubic-bezier(.2,.8,.3,1) .1s forwards, mpo-hub-breathe 5s ease-in-out 1s infinite;
}

.mpo-sf-hub-logo {
	display: block;
	width: 68%;
	max-width: 140px;
	margin-bottom: 0.5em;
	line-height: 0;
}
.mpo-sf-hub-logo img {
	width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

.mpo-sf-node-wrap {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 27%;
	z-index: 2;
	opacity: 0;
	animation: mpo-node-in .55s cubic-bezier(.2,.8,.3,1) forwards;
}
.mpo-sf-node-wrap:nth-of-type(1) { animation-delay: .22s; }
.mpo-sf-node-wrap:nth-of-type(2) { animation-delay: .30s; }
.mpo-sf-node-wrap:nth-of-type(3) { animation-delay: .38s; }
.mpo-sf-node-wrap:nth-of-type(4) { animation-delay: .46s; }
.mpo-sf-node-wrap:nth-of-type(5) { animation-delay: .54s; }

.mpo-sf-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	background: none;
	border: none;
	outline: none;
	padding: 0;
	cursor: pointer;
	font-family: var(--mpo-body);
	color: var(--mpo-navy);
}

.mpo-sf-node-panel { display: none; }

.mpo-sf-node-icon {
	position: relative;
	width: 100%;
	aspect-ratio: 1/1;
	max-width: 84px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ccc;
	box-shadow: 0 6px 16px -10px rgba(1,34,76,.35);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22%;
	color: var(--mpo-sage);
	transition: transform .6s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}
.mpo-sf-node-icon svg { width: 100%; height: 100%; }
.mpo-sf-node-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }

.mpo-sf-node-icon::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--mpo-navy);
	opacity: 0;
	transform: scale(1);
	pointer-events: none;
}
.mpo-sf-node-icon.is-rippling::after {
	animation: mpo-ripple .55s ease-out;
}
@keyframes mpo-ripple {
	from { opacity: 0.6; transform: scale(1); }
	to   { opacity: 0; transform: scale(1.55); }
}

.mpo-sf-node-label {
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.01em;
}

/* Rotation/scale hover only for devices that can actually hover with a
   precise pointer — prevents the state getting "stuck" after a tap on
   touchscreens, which don't have a real hover state. */
@media (hover: hover) and (pointer: fine) {
	.mpo-sf-node:hover .mpo-sf-node-icon {
		transform: translateY(-4px) scale(1.12) rotate(12deg);
		box-shadow: 0 0 0 1px #ccc, 0 12px 22px -10px rgba(1,34,76,.4);
	}
}
.mpo-sf-node:focus-visible .mpo-sf-node-icon {
	transform: translateY(-4px) scale(1.12) rotate(12deg);
	box-shadow: 0 0 0 1px #ccc, 0 12px 22px -10px rgba(1,34,76,.4);
}
.mpo-sf-node:focus-visible { outline: 2px solid var(--mpo-navy); outline-offset: 4px; border-radius: 8px; }
.mpo-sf-node:active .mpo-sf-node-icon {
	transform: scale(0.95);
	transition-duration: .12s;
}

.mpo-sf-node[aria-pressed="true"] .mpo-sf-node-icon {
	background: var(--mpo-sage);
	color: #fff;
	border-color: #fff;
	transform: translateY(-3px) scale(1.08);
	box-shadow: 0 0 0 1px var(--mpo-sage), 0 14px 26px -10px rgba(60,159,32,.5);
}

@keyframes mpo-hub-in {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(0.85); }
}
@keyframes mpo-hub-breathe {
	0%, 100% { box-shadow: 0 10px 30px -12px rgba(1,34,76,.25); }
	50%      { box-shadow: 0 12px 34px -10px rgba(1,34,76,.35); }
}
@keyframes mpo-node-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---------- Side panel (default quote, swaps to pillar description) ---------- */

.mpo-sf-side {
	position: relative;
	max-width: 380px;
	padding-left: 0.5rem;
}
.mpo-sf-side-mark {
	display: block;
	font-family: var(--mpo-display);
	font-weight: 600;
	font-size: 3rem;
	line-height: 1;
	color: var(--mpo-navy);
	margin-bottom: 0.25rem;
}
.mpo-sf-side-eyebrow {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mpo-sage);
	min-height: 1em;
	margin-bottom: 0.35rem;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .3s ease, transform .3s ease;
}
.mpo-sf-side-eyebrow.is-visible { opacity: 1; transform: none; }

.mpo-sf-side-text-wrap { min-height: 6.5rem; }
.mpo-sf-side-text {
	margin: 0;
	font-family: var(--mpo-display);
	font-weight: 500;
	font-size: 18px;
	line-height: 1.42;
	color: var(--mpo-navy);
	opacity: 1;
	transform: translateY(0);
	transition: opacity .28s ease, transform .28s ease;
}
.mpo-sf-side-text.is-swapping {
	opacity: 0;
	transform: translateY(8px);
}
.mpo-sf-side-text.is-quote { font-style: italic; }

.mpo-sf-side-attribution {
	margin: 0.6rem 0 0;
	font-size: 0.85rem;
	color: var(--mpo-slate);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	transition: opacity .28s ease;
}
.mpo-sf-side-attribution.is-hidden { opacity: 0; }

.mpo-sf-side-rule {
	width: 46px;
	height: 3px;
	margin-top: 1rem;
	background: var(--mpo-sage);
	border-radius: 2px;
	transition: background .3s ease;
}
.mpo-sf-side-rule.is-pillar { background: var(--mpo-sage); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.mpo-sf-hub, .mpo-sf-node-wrap { animation: none; opacity: 1; }
	.mpo-sf-ring, .mpo-sf-spoke, .mpo-sf-dot { animation: none; }
	.mpo-sf-connector, .mpo-sf-node-icon { transition: none; }
	.mpo-sf-node-icon.is-rippling::after { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.mpo-sf-columns { grid-template-columns: 1fr; }
	.mpo-sf-side { max-width: 480px; margin: 0 auto; text-align: center; padding-left: 0; }
	.mpo-sf-side-rule { margin-left: auto; margin-right: auto; }
}

@media (max-width: 640px) {
	.mpo-sf-connectors { display: none; }

	/* The quote becomes a fixed intro above the pillar list rather than a
	   panel that swaps — each pillar gets its own inline answer instead
	   (below), so it's always visible right where it was tapped. */
	.mpo-sf-columns { display: flex; flex-direction: column; }
	.mpo-sf-side { order: -1; margin-bottom: 1.5rem; }
	.mpo-sf-side-eyebrow { display: none; }

	.mpo-sf-diagram {
		aspect-ratio: auto;
		max-width: 460px;
		width: 100%;
		display: flex;
		flex-direction: column;
		gap: 0.6rem;
	}
	.mpo-sf-hub {
		position: static;
		transform: none;
		width: 100%;
		aspect-ratio: auto;
		border-radius: 14px;
		padding: 1.1rem 1rem;
		margin-bottom: 0.4rem;
		animation: none;
		opacity: 1;
	}

	.mpo-sf-node-wrap {
		position: static;
		transform: none;
		width: 100%;
		opacity: 1;
		animation: none;
		background: var(--mpo-mist);
		border-radius: 12px;
		overflow: hidden;
		transition: background .3s ease;
	}
	.mpo-sf-node-wrap.is-open { background: #fff; box-shadow: 0 1px 0 var(--mpo-sage) inset; }

	.mpo-sf-node-wrap:last-child { margin-bottom: 70px; }

	/* The dot markers are laid out by JS to sit next to each row's own
	   icon (see positionMobileDots in frontend.js) rather than the
	   desktop hub-and-spoke trig positions. Only the open row's dot
	   should be visible, so it reads as a "you are here" marker. */
	.mpo-sf-diagram.is-in-view .mpo-sf-dot { opacity: 0; }
	.mpo-sf-diagram.is-in-view .mpo-sf-dot.is-active { opacity: 1; }

	.mpo-sf-node {
		flex-direction: row;
		justify-content: flex-start;
		text-align: left;
		width: 100%;
		min-height: 48px;
		padding: 0.65rem 1rem;
		/* Comfortable thumb target per platform guidance (~44-48px). */
	}
	.mpo-sf-node-icon {
		width: 44px;
		max-width: 44px;
		height: 44px;
		flex-shrink: 0;
		/* Base rule's "padding: 22%" is meant for the 84px desktop circle;
		   left as-is it resolves against the row's width (not this 44px
		   box), producing ~60px of padding and forcing the circle back
		   out to ~120px. Fixed px padding keeps the glyph proportioned
		   inside the actual 44px mobile size. */
		padding: 10px;
	}
	.mpo-sf-node[aria-pressed="true"] .mpo-sf-node-icon {
		/* On mobile the icon still fills to show which row is open, but
		   without the desktop lift/shadow that assumed a light backdrop. */
		transform: none;
		box-shadow: 0 0 0 1px var(--mpo-sage);
	}

	.mpo-sf-node-panel {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows .35s cubic-bezier(.2,.8,.3,1);
	}
	.mpo-sf-node-panel.is-open { grid-template-rows: 1fr; }
	.mpo-sf-node-panel-inner { overflow: hidden; }
	.mpo-sf-node-panel-inner p {
		margin: 0;
		padding: 0 1rem 0.85rem 1rem;
		font-size: 0.88rem;
		line-height: 1.55;
		color: var(--mpo-slate);
	}
}

