.hesm,
.hesm * {
	box-sizing: border-box;
}

.hesm {
	--hesm-bg: #101e36;
	--hesm-deep-blue: #1f3a5f;
	--hesm-teal: #2cb1bc;
	--hesm-cyan: #62e7ef;
	display: grid;
	grid-template-columns: minmax(310px, 38%) minmax(0, 62%);
	width: 100%;
	min-height: 690px;
	margin: 28px auto;
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(circle at 72% 45%, rgba(31, 58, 95, 0.34), transparent 38%),
		linear-gradient(145deg, #0d1a30 0%, var(--hesm-bg) 58%, #0a172b 100%);
	border: 1px solid rgba(98, 231, 239, 0.16);
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(3, 9, 20, 0.28);
	isolation: isolate;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hesm__copy {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(34px, 5vw, 70px) clamp(28px, 4.5vw, 60px);
	background: linear-gradient(90deg, rgba(10, 23, 43, 0.5), transparent);
}

.hesm__story-title {
	margin: 0 0 22px;
	color: #fff;
	font-size: clamp(40px, 4.8vw, 66px);
	font-weight: 800;
	letter-spacing: -0.045em;
	line-height: 0.98;
	text-wrap: balance;
}

.hesm__intro {
	max-width: 35ch;
	margin: 0 0 24px !important;
	color: rgba(239, 245, 255, 0.82) !important;
	font-size: clamp(16px, 1.35vw, 19px) !important;
	font-weight: 450;
	line-height: 1.55 !important;
}

.hesm__story {
	max-width: 39ch;
	color: rgba(224, 234, 248, 0.76);
	font-size: clamp(14px, 1.12vw, 16px);
	line-height: 1.6;
}

.hesm__story p {
	margin: 0 0 14px !important;
	color: inherit !important;
	font: inherit !important;
}

.hesm__entity-term {
	display: inline;
	margin: 0;
	padding: 0 !important;
	color: #79e7ef !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font: inherit;
	font-weight: 760;
	line-height: inherit;
	text-align: inherit;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
	transition: color 220ms ease, text-shadow 220ms ease;
}

.hesm__entity-term:hover,
.hesm__entity-term:focus-visible,
.hesm__entity-term.is-active {
	color: #fff !important;
	background: transparent !important;
	outline: none;
	text-decoration: none !important;
	text-shadow: 0 0 13px rgba(98, 231, 239, 0.9);
}

.hesm__entity-term:focus-visible {
	outline: none;
	box-shadow: none !important;
	text-decoration: none !important;
}

.hesm__instruction {
	max-width: 390px;
	margin-top: 10px;
	padding: 14px 16px;
	color: #dffcff;
	background: rgba(44, 177, 188, 0.1);
	border: 1px solid rgba(98, 231, 239, 0.32);
	border-left: 3px solid var(--hesm-teal);
	border-radius: 5px;
	font-size: 13px;
	line-height: 1.45;
}

.hesm__map {
	position: relative;
	min-width: 0;
	min-height: 690px;
	padding-top: 50px;
}

.hesm__map-title {
	position: absolute;
	top: 16px;
	left: 50%;
	z-index: 2;
	display: flex;
	width: min(530px, calc(100% - 46px));
	align-items: center;
	gap: 12px;
	transform: translateX(-50%);
	color: rgba(219, 230, 246, 0.64);
	font-size: 11px;
	font-weight: 760;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}

.hesm__map-title::after {
	flex: 1;
	height: 1px;
	content: "";
	background: linear-gradient(90deg, rgba(98, 231, 239, 0.5), transparent);
}

.hesm__diagram {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 620px;
	overflow: visible;
}

.hesm__orbit {
	fill: none;
	stroke: rgba(44, 177, 188, 0.2);
	stroke-width: 1.5;
	stroke-dasharray: 2 10;
}

.hesm__relation {
	transition: opacity 180ms ease;
}

.hesm__relation-line {
	fill: none;
	stroke: #61d4dc;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 7 5;
	filter: drop-shadow(0 0 4px rgba(44, 177, 188, 0.55));
	transition: stroke 180ms ease, stroke-width 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.hesm__arrowhead {
	fill: #62e7ef;
}

.hesm__relation-label rect {
	fill: #09192c;
	stroke: rgba(98, 231, 239, 0.58);
	stroke-width: 1;
}

.hesm__relation-label text {
	fill: #dffcff;
	font-family: Inter, ui-sans-serif, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.hesm__node {
	color: #62e7ef;
	cursor: pointer;
	outline: none;
	transform-box: fill-box;
	transform-origin: center;
	transition: opacity 180ms ease, filter 180ms ease;
}

.hesm__node-halo {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	opacity: 0.22;
	transform-box: fill-box;
	transform-origin: center;
	transition: opacity 180ms ease;
}

.hesm__node-ring-outer {
	fill: rgba(7, 20, 38, 0.88);
	stroke: currentColor;
	stroke-opacity: 0.48;
	stroke-width: 2;
	transition: stroke-opacity 220ms ease, stroke-width 220ms ease;
}

.hesm__node-ring-inner {
	fill: #123a4f;
	stroke: currentColor;
	stroke-width: 2.5;
	filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 14px rgba(44, 177, 188, 0.25));
	transform-box: fill-box;
	transform-origin: center;
	transition: stroke-width 180ms ease, filter 180ms ease, transform 180ms ease;
}

.hesm__icon {
	fill: none;
	stroke: #fff;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hesm__node-label {
	fill: #fff;
	font-family: Inter, ui-sans-serif, sans-serif;
	font-size: 12px;
	font-weight: 760;
	paint-order: stroke;
	stroke: rgba(2, 10, 20, 0.36);
	stroke-width: 2px;
}

.hesm__node-label--central {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	stroke-width: 3px;
}

/* Seven distinct hues keep neighboring entities visually separable. */
.hesm__node--sunlight {
	color: #ffb448;
}

.hesm__node--sunlight .hesm__node-ring-inner {
	fill: #5a350c;
}

.hesm__node--wildflowers {
	color: #c97cff;
}

.hesm__node--wildflowers .hesm__node-ring-inner {
	fill: #41205f;
}

.hesm__node--pollinators {
	color: #8be35d;
}

.hesm__node--pollinators .hesm__node-ring-inner {
	fill: #214b20;
}

.hesm__node--seed-production {
	color: #ff718f;
}

.hesm__node--seed-production .hesm__node-ring-inner {
	fill: #5a1e35;
}

.hesm__node--birds {
	color: #63aaff;
}

.hesm__node--birds .hesm__node-ring-inner {
	fill: #173c68;
}

.hesm__node--seed-dispersal {
	color: #55e6ed;
}

.hesm__node--seed-dispersal .hesm__node-ring-inner {
	fill: #123f52;
}

.hesm__node--meadow-renewal {
	color: #35d6a0;
}

.hesm__node--meadow-renewal .hesm__node-ring-inner {
	fill: #124b3c;
}

.hesm__node:hover .hesm__node-halo,
.hesm__node:focus-visible .hesm__node-halo,
.hesm__node.is-active .hesm__node-halo {
	opacity: 0.38;
}

.hesm__node:hover .hesm__node-ring-inner,
.hesm__node:focus-visible .hesm__node-ring-inner,
.hesm__node.is-active .hesm__node-ring-inner {
	stroke-width: 4;
	filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 22px currentColor);
	transform: scale(1.045);
}

.hesm__node.is-related .hesm__node-ring-inner {
	stroke-width: 3.2;
}

.hesm__node:focus-visible .hesm__node-ring-outer {
	stroke: #fff;
	stroke-width: 3;
}

.hesm.has-selection .hesm__node:not(.is-active):not(.is-related) {
	opacity: 0.16;
}

.hesm.has-selection .hesm__node.is-related {
	opacity: 1;
}

.hesm.has-selection .hesm__relation:not(.is-active) {
	opacity: 0.14;
}

.hesm.has-selection .hesm__relation.is-active {
	opacity: 1;
}

.hesm.has-selection .hesm__relation.is-active .hesm__relation-line {
	stroke: #fff;
	stroke-width: 3;
	filter: drop-shadow(0 0 7px #52e4eb);
}

.hesm.has-selection .hesm__relation.is-active .hesm__relation-label rect {
	fill: rgba(16, 30, 54, 0.98);
	stroke: #82f2f5;
}

.hesm.has-selection .hesm__node.is-active {
	filter: saturate(1.18) brightness(1.12);
}

@media (prefers-reduced-motion: no-preference) {
	.hesm__relation-line {
		animation: hesm-flow 7s linear infinite;
	}

	.hesm__node.is-active .hesm__node-halo {
		animation: hesm-active-pulse 3.8s ease-in-out infinite;
	}

	@keyframes hesm-flow {
		to {
			stroke-dashoffset: -96;
		}
	}

	@keyframes hesm-active-pulse {
		0%, 100% {
			opacity: 0.18;
			transform: scale(0.96);
		}
		50% {
			opacity: 0.38;
			transform: scale(1.06);
		}
	}
}

@media (max-width: 920px) {
	.hesm {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.hesm__copy {
		padding-bottom: 24px;
	}

	.hesm__story-title .hesm__desktop-break {
		display: none;
	}

	.hesm__story-title {
		max-width: 100%;
		line-height: 1.04;
		white-space: normal;
		word-break: normal;
		overflow-wrap: normal;
	}

	.hesm__map {
		min-height: 0;
		padding: 52px 8px 26px;
	}

	.hesm__diagram {
		height: auto;
		min-height: 0;
		aspect-ratio: 700 / 650;
	}
}

@media (max-width: 580px) {
	.hesm {
		min-height: 0;
		border-radius: 4px;
	}

	.hesm__copy {
		padding: 34px 24px 24px;
	}

	.hesm__story-title {
		font-size: clamp(33px, 9.6vw, 42px);
		letter-spacing: -0.04em;
		line-height: 1.04;
	}

	.hesm__map {
		min-height: 0;
		padding: 46px 0 22px;
	}

	.hesm__map-title {
		top: 12px;
		width: calc(100% - 28px);
		font-size: 9px;
		white-space: normal;
	}

	.hesm__diagram {
		height: auto;
		min-height: 0;
	}
}
