/* Full-width first section; character = 45vw max, capped by viewport height for balance (see --kh3b-ar). */
.home-3d-banner {
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100vw;
	max-width: none;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 0;
	margin-bottom: 0;
	padding: 0;
	border-radius: 0;
	background: #f7f5f2;
	box-sizing: border-box;
}

/* Full-bleed hero: edge-to-edge, no margin, no rounded corners. */
.home-3d-banner.sticky-track.is-home-otot {
	left: 50%;
	right: 50%;
	margin: 0 -50vw;
	width: 100vw;
	max-width: none;
	border-radius: 0;
	overflow: hidden;
	box-shadow: none;
	min-height: 100vh;
	min-height: 100dvh;
}

.home-3d-banner__visual {
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	overflow: hidden;
	perspective: 950px;
}

/* WebGL noise + contour background (see home-3d-banner.js initNoiseBackground). */
.home-3d-banner__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

/*
 * Width target 45% viewport; never wider than screen minus padding.
 * When 45vw would make height > ~90dvh, shrink width so the box fits the visible height (balanced).
 * --kh3b-ar = image width / height (unitless), set in JS from onimain.png.
 */
.home-3d-banner__stage {
	position: relative;
	z-index: 1;
	isolation: isolate;
	width: min(42.75vw, calc((100% - 1.5rem) * 0.95), calc(85.5dvh * var(--kh3b-ar, 1)));
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--kh3b-aspect, 1);
	margin: 0;
	flex: 0 0 auto;
	transform-style: preserve-3d;
	transition: transform 220ms ease-out;
	will-change: transform;
	border-radius: 0;
	overflow: hidden;
	box-sizing: border-box;
	background: transparent;
}

.home-3d-banner__canvas {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: block;
	filter: none;
	background: transparent;
}

.home-3d-banner__fallback-image {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center center;
	opacity: 0;
	pointer-events: none;
}

.home-3d-banner__canvas.is-error + .home-3d-banner__fallback-image {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.home-3d-banner__stage {
		transition: none;
	}
}
