@font-face {
	font-family: "ITW Montserrat";
	src: url("../fonts/montserrat-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "ITW Open Sans";
	src: url("../fonts/open-sans-latin.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

.itw-tree-wrapper {
	--itw-wood-light: #8f7a66;
	--itw-wood-dark: #6e5b4a;
	--itw-stem: #8b7660;
	--itw-ground: #dfdfd8;
	--itw-bg-center: #ffffff;
	--itw-bg-edge: #eef1ec;
	--itw-label-title: #16243f;
	--itw-label-subtitle: #6b6770;
	--itw-label-active: #882430;
	--itw-popup-bg: #ffffff;
	--itw-font-display: "ITW Montserrat", "Montserrat", "Helvetica Neue", Arial, sans-serif;
	--itw-font-body: "ITW Open Sans", "Open Sans", "Helvetica Neue", Arial, sans-serif;
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.itw-tree-wrapper * {
	box-sizing: border-box;
}

.itw-tree-wrapper.itw-has-backdrop {
	background: radial-gradient(ellipse 62% 58% at 50% 42%, var(--itw-bg-center) 0%, var(--itw-bg-center) 35%, var(--itw-bg-edge) 100%);
}

/* Stage: everything inside is sized in tree units (--u), one SVG viewBox
 * unit, so labels, leaves and popups keep the reference proportions at any
 * width. */

.itw-tree-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.itw-tree-stage {
	--u: calc(100cqw / 1760);
	container-type: inline-size;
	position: relative;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	aspect-ratio: 1760 / 1500;
}

.itw-tree-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.itw-ground {
	fill: var(--itw-ground);
}

/* Leaves */

.itw-leaf-stem {
	stroke: var(--itw-stem);
	stroke-width: 2.6;
	stroke-linecap: round;
}

.itw-leaf-vein {
	stroke: #ffffff;
	stroke-opacity: 0.22;
	stroke-width: 1.6;
	stroke-linecap: round;
}

.itw-leaf-text {
	fill: #ffffff;
	font-family: var(--itw-font-display);
	font-weight: 500;
	letter-spacing: 0.3px;
	text-anchor: middle;
	dominant-baseline: central;
	pointer-events: none;
}

.itw-cluster {
	cursor: pointer;
}

/* Branch labels */

.itw-branch-label {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform: translate(-50%, -50%);
	text-align: center;
	cursor: pointer;
	width: max-content;
	outline: none;
	z-index: 2;
	padding: calc(var(--u) * 6) calc(var(--u) * 10);
	margin-top: calc(var(--u) * 16);
}

.itw-branch-label.itw-open {
	z-index: 10;
}

.itw-branch-title {
	display: block;
	font-family: var(--itw-font-display);
	font-size: max(9px, calc(var(--u) * 24));
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.16em;
	margin-right: -0.16em;
	text-transform: uppercase;
	color: var(--itw-label-title);
	transition: color 0.25s ease;
}

.itw-branch-subtitle {
	display: block;
	font-family: var(--itw-font-display);
	font-size: max(8px, calc(var(--u) * 19));
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.15em;
	margin-right: -0.15em;
	text-transform: uppercase;
	color: var(--itw-label-subtitle);
	transition: color 0.25s ease;
}

.itw-branch-label.itw-open .itw-branch-title,
.itw-branch-label:focus-visible .itw-branch-title {
	color: var(--itw-label-active);
}

.itw-branch-label.itw-open .itw-branch-subtitle,
.itw-branch-label:focus-visible .itw-branch-subtitle {
	color: var(--itw-label-active);
	opacity: 0.85;
}

.itw-branch-label:focus-visible {
	outline: 2px solid var(--itw-label-active);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Popup */

.itw-popup {
	position: absolute;
	left: 50%;
	width: max(240px, calc(var(--u) * 484));
	padding: max(16px, calc(var(--u) * 32)) max(18px, calc(var(--u) * 36)) max(16px, calc(var(--u) * 30));
	background: var(--itw-popup-bg);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(22, 36, 63, 0.12), 0 2px 6px rgba(22, 36, 63, 0.05);
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
	cursor: auto;
}

.itw-popup::before {
	content: "";
	position: absolute;
	left: 50%;
	width: 12px;
	height: 12px;
	background: var(--itw-popup-bg);
	transform: translateX(-50%) rotate(45deg);
	border-radius: 2px;
}

.itw-popup-below .itw-popup {
	top: calc(100% + max(10px, calc(var(--u) * 26)));
	transform: translate(-50%, 6px);
}

.itw-popup-below .itw-popup::before {
	top: -5px;
}

.itw-popup-above .itw-popup {
	bottom: calc(100% + max(10px, calc(var(--u) * 26)));
	transform: translate(-50%, -6px);
}

.itw-popup-above .itw-popup::before {
	bottom: -5px;
}

.itw-branch-label.itw-open .itw-popup {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, 0);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.itw-popup-accent {
	display: block;
	width: max(22px, calc(var(--u) * 62));
	height: max(2px, calc(var(--u) * 4.5));
	border-radius: 2px;
	background: var(--itw-accent, #9a2c36);
	margin-bottom: max(10px, calc(var(--u) * 22));
}

.itw-popup-title {
	font-family: var(--itw-font-display);
	font-size: max(14px, calc(var(--u) * 25));
	font-weight: 600;
	line-height: 1.3;
	color: #16243f;
	margin-bottom: max(8px, calc(var(--u) * 16));
}

.itw-popup-desc {
	font-family: var(--itw-font-body);
	font-size: max(12px, calc(var(--u) * 21));
	line-height: 1.65;
	color: #6a6f78;
	margin-bottom: max(10px, calc(var(--u) * 18));
}

.itw-popup-tags {
	font-family: var(--itw-font-display);
	font-size: max(9.5px, calc(var(--u) * 16));
	font-weight: 600;
	line-height: 1.75;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #5b5f68;
}

/* Fade-in on scroll. The hidden state only exists once JS has added
 * .itw-pre-animate, so without JS the tree simply renders. */

.itw-tree-wrapper.itw-pre-animate .itw-tree-stage {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.8s ease, transform 0.8s ease;
}

.itw-tree-wrapper.itw-pre-animate.itw-in-view .itw-tree-stage {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.itw-tree-wrapper.itw-pre-animate .itw-tree-stage {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.itw-popup,
	.itw-branch-label.itw-open .itw-popup,
	.itw-branch-title,
	.itw-branch-subtitle {
		transition: none;
	}
}
