.esss-scene {
	--esss-scene-min-height: 100vh;
	--esss-stage-width: 100%;
	--esss-stage-height: 100vh;
	--esss-shape-width: 420px;
	--esss-shape-height: 280px;
	--esss-shape-background: #1f2937;
	--esss-shape-color: #ffffff;
	--esss-shape-radius: 24px;
	--esss-shape-rotation: 0deg;
	--esss-shape-scale: 1;
	--esss-shape-offset-x: 0px;
	--esss-shape-offset-y: 0px;
	--esss-parent-opacity: 1;
	--esss-parent-flip-x: 0deg;
	--esss-parent-flip-y: 0deg;
	--esss-child-flip-x: 0deg;
	--esss-child-flip-y: 0deg;
	--esss-child-stack: 0;
	--esss-child-spread-x: 0px;
	--esss-child-spread-y: 0px;
	position: relative;
	display: block;
	width: 100%;
	min-height: var(--esss-scene-min-height);
	box-sizing: border-box;
	isolation: isolate;
}

.esss-scene,
.esss-scene *,
.esss-scene *::before,
.esss-scene *::after {
	box-sizing: border-box;
}

.esss-scene__scroll-space {
	position: relative;
	width: 100%;
	min-height: inherit;
}

.esss-scene__viewport {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 100vh;
	overflow: hidden;
}

.esss-scene__stage {
	position: relative;
	width: var(--esss-stage-width);
	height: var(--esss-stage-height);
	min-height: 600px;
	max-width: 100%;
	perspective: 1200px;
	transform-style: preserve-3d;
}

.esss-scene__parent-layer,
.esss-scene__children-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	transform-style: preserve-3d;
}

.esss-scene__parent-layer {
	z-index: 2;
}

.esss-scene__children-layer {
	z-index: 3;
	visibility: hidden;
}
.esss-scene--initialized .esss-scene__children-layer {
	visibility: visible;
}

.esss-shape {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--esss-shape-width);
	height: var(--esss-shape-height);
	max-width: calc(100% - 32px);
	transform:
		translate3d(
			calc(-50% + var(--esss-shape-offset-x)),
			calc(-50% + var(--esss-shape-offset-y)),
			0
		);
	transform-style: preserve-3d;
	pointer-events: auto;
	will-change: transform;
}
.esss-shape--parent {
	--esss-parent-anchor-x: 0px;
	--esss-parent-anchor-y: 0px;
	--esss-parent-x: 0px;
	--esss-parent-y: 0px;

transform:
	translate3d(
		calc(
			-50% +
			var(--esss-shape-offset-x, 0px) +
			var(--esss-parent-anchor-x, 0px) +
			var(--esss-parent-x, 0px)
		),
		calc(
			-50% +
			var(--esss-shape-offset-y, 0px) +
			var(--esss-parent-anchor-y, 0px) +
			var(--esss-parent-y, 0px)
		),
		0
	)
	rotateX(var(--esss-parent-flip-x, 0deg))
	rotateY(var(--esss-parent-flip-y, 0deg));
opacity: var(--esss-parent-opacity, 1);
transform-style: preserve-3d;
backface-visibility: hidden;
}

.esss-shape--child {
	z-index: var(--esss-child-z-index, 3);
	transform:
		translate3d(
			var(--esss-child-spread-x, 0px),
			var(--esss-child-spread-y, 0px),
			calc(var(--esss-child-stack, 0) * -1px)
		);
	transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
.esss-shape--inactive {
	pointer-events: none;
}

.esss-shape--child .esss-shape__surface {
	opacity: var(--esss-child-opacity, 1);
	transform:
		rotate(var(--esss-shape-rotation))
		scale(var(--esss-shape-scale))
		rotateX(var(--esss-child-flip-x, 0deg))
		rotateY(var(--esss-child-flip-y, 0deg));
}


.esss-shape__surface {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	color: var(--esss-shape-color);
	background: var(--esss-shape-background);
	border-radius: var(--esss-shape-radius);
	transform:
		rotate(var(--esss-shape-rotation))
		scale(var(--esss-shape-scale));
	transform-origin: center;
	transform-style: preserve-3d;
	backface-visibility: hidden;
	box-shadow: 0 24px 70px rgb(15 23 42 / 18%);
	will-change: transform, opacity;
}

.esss-shape__content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 100%;
	padding: 40px;
	color: var(--esss-shape-color);
	text-align: center;
}

.esss-shape__title {
	margin: 0 0 16px;
	color: inherit;
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
}

.esss-shape__description {
	color: inherit;
	font-size: 1rem;
	line-height: 1.8;
	opacity: 0.86;
}

.esss-shape__description > :first-child {
	margin-top: 0;
}

.esss-shape__description > :last-child {
	margin-bottom: 0;
}

.esss-shape--rectangle {
	--esss-shape-radius: 0px;
}

.esss-shape--square {
	aspect-ratio: 1;
	height: auto;
	--esss-shape-radius: 0px;
}

.esss-shape--rounded-rectangle {
	--esss-shape-radius: 24px;
}

.esss-shape--circle {
	aspect-ratio: 1;
	height: auto;
	--esss-shape-radius: 50%;
}

.esss-shape--triangle .esss-shape__surface {
	border-radius: 0;
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.esss-shape--polygon .esss-shape__surface {
	border-radius: 0;
	clip-path: polygon(var(--esss-shape-polygon));
}

.esss-shape--triangle .esss-shape__content {
	padding-top: 30%;
	padding-right: 18%;
	padding-left: 18%;
}

.esss-scene__debug {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 100;
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 8px 12px;
	color: #ffffff;
	background: rgb(15 23 42 / 90%);
	border: 1px solid rgb(255 255 255 / 15%);
	border-radius: 6px;
	font: 12px/1.4 monospace;
	pointer-events: none;
}

.esss-scene__debug-progress {
	min-width: 42px;
	color: #22c55e;
	text-align: right;
}

.esss-scene--initialized {
	--esss-initialized: 1;
}

.esss-scene--reduced-motion .esss-shape,
.esss-scene--reduced-motion .esss-shape__surface {
	transition: none;
	animation: none;
	will-change: auto;
}

@media (max-width: 767px) {
.esss-scene__viewport {
	position: relative;
	top: auto;
	min-height: auto;
	overflow: visible;
}

	.esss-scene__viewport {
		min-height: auto;
		overflow: visible;
	}

	.esss-scene__stage {
		display: flex;
		align-items: center;
		justify-content: center;
		height: auto;
		min-height: 480px;
		padding: 40px 16px;
	}

	.esss-shape {
		width: var(--esss-shape-width);
		height: auto;
		min-height: 280px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.esss-scene {
		scroll-behavior: auto;
	}

	.esss-scene .esss-shape,
	.esss-scene .esss-shape__surface {
		transition-duration: 0.01ms;
		animation-duration: 0.01ms;
		animation-iteration-count: 1;
		will-change: auto;
	}
}
