/* =========================================
   Aut-Scroll 2026 v0.1
   Base layout. Custom WebGL scrollbar first pass. No preloader yet.
========================================= */

:root {
	--paper: #e9dcc7;
	--ink: #f7efe1;
	--warm-dark: #15110d;
	--ui-edge: clamp(0.875rem, 3vw, 2.625rem);
	--rail-left: var(--ui-edge);
	--tool-rail-width: clamp(13rem, 20vw, 18rem);
	--tool-panel-gap: clamp(0.875rem, 2vw, 1.625rem);
	--tool-panel-right: clamp(1rem, 3vw, 3rem);
	--tool-panel-width: min(33vw, 38rem);
	--tool-pill-height: clamp(3.25rem, 5.5vh, 4.3rem);
	--tool-group-gap: clamp(0.45rem, 0.75vw, 0.7rem);
	--scroll-progress: 0;
	--hero-scroll-y: 0px;
}

* {
	box-sizing: border-box;
}

html {
	min-height: 100%;
	background: var(--warm-dark);
	scrollbar-width: none;
}

* {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

*::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

body {
	min-height: 100%;
	margin: 0;
	background: linear-gradient(180deg, #17120e 0%, #20160f 48%, #0f1710 100%);
	color: var(--ink);
	font-family: Arial, Helvetica, sans-serif;
	overscroll-behavior-x: none;
	-ms-overflow-style: none;
}

button {
	font: inherit;
}

.app {
	position: fixed;
	inset: 0;
	overflow: hidden;
	isolation: isolate;
}

#webgl-scene {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 1;
}

.hero-title {
	position: fixed;
	left: 50%;
	top: clamp(34px, 7vh, 88px);
	z-index: 9;
	width: min(980px, 86vw);
	margin: 0;
	color: #ffffff;
	font-family: "Bruno Ace SC", "Arial Black", Impact, sans-serif;
	font-size: clamp(42px, 7vw, 124px);
	font-weight: 400;
	line-height: 0.9;
	letter-spacing: -0.025em;
	text-align: center;
	text-transform: none;
	text-wrap: balance;
	opacity: 1;
	transform: translate3d(-50%, var(--hero-scroll-y), 0);
	transition: opacity 120ms linear;
	will-change: transform, opacity;
	pointer-events: none;
	user-select: none;
	text-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

html.fonts-pending:not(.fonts-ready) .hero-title {
	opacity: 0;
}


.hero-contact {
	position: fixed;
	left: 50%;
	top: clamp(15.5rem, 35vh, 29rem);
	z-index: 9;
	display: grid;
	gap: clamp(0.35rem, 0.8vh, 0.75rem);
	width: min(76rem, 90vw);
	margin: 0;
	color: rgba(255, 246, 224, 0.9);
	font-family: "Oxanium", Arial, Helvetica, sans-serif;
	font-size: clamp(1.85rem, 2.75vw, 3.8rem);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: 0.045em;
	text-align: center;
	text-transform: none;
	opacity: 0.92;
	transform: translate3d(-50%, var(--hero-scroll-y), 0);
	transition: opacity 120ms linear;
	will-change: transform, opacity;
	pointer-events: none;
	user-select: none;
	text-shadow: 0 0.45rem 1.1rem rgba(0, 0, 0, 0.34);
}

.hero-contact span {
	display: block;
}

html.fonts-pending:not(.fonts-ready) .hero-contact {
	opacity: 0;
}


#scroll-space {
	height: 1050vh;
	min-height: 6800px;
	pointer-events: none;
}

.tool-rail {
	position: fixed;
	left: var(--rail-left);
	top: 56%;
	z-index: 10;
	display: block;
	width: var(--tool-rail-width);
	height: calc((var(--tool-pill-height) * 4) + (var(--tool-group-gap) * 3));
	overflow: visible;
	transform: translateY(-50%);
	perspective: 900px;
	pointer-events: auto;
}

.tool-group {
	position: absolute;
	left: 0;
	top: 0;
	display: grid;
	gap: var(--tool-group-gap);
	width: 100%;
	overflow: visible;
	opacity: 0;
	transform: translate3d(-2.2rem, 0, 0);
	transition:
		opacity 240ms ease-out,
		transform 300ms ease-out;
	pointer-events: none;
}

.tool-group.is-active {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	pointer-events: auto;
}

.tool-pill {
	position: relative;
	width: 100%;
	min-height: var(--tool-pill-height);
	padding: 0 clamp(0.7rem, 1.3vw, 1.15rem) 0.15em;
	border: 0;
	border-radius: clamp(1rem, 1.5vw, 1.35rem);
	background:
		linear-gradient(180deg, rgba(255, 187, 44, 0.96), rgba(230, 120, 0, 0.86)),
		rgba(242, 148, 0, 0.8);
	box-shadow:
		0 0.625rem 1.125rem rgba(0, 0, 0, 0.34),
		inset 0 0.125rem 0 rgba(255, 235, 166, 0.58),
		inset 0 -0.1875rem 0 rgba(115, 58, 0, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-family: "Bruno Ace SC", "Arial Black", Impact, sans-serif;
	font-size: clamp(1.18rem, 1.75vw, 2rem);
	font-weight: 400;
	line-height: 1;
	text-align: center;
	letter-spacing: 0.028em;
	text-transform: none;
	cursor: pointer;
	transform: translate3d(0, 0, 0);
	transform-style: preserve-3d;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	overflow: visible;
	transition:
		box-shadow 0.25s ease-out,
		background-color 0.25s ease-out;
}


.tool-group .tool-pill {
	opacity: 0;
	transform: translate3d(-1.35rem, 0, 0);
	transition:
		opacity 230ms ease-out,
		transform 330ms ease-out,
		box-shadow 0.25s ease-out,
		background-color 0.25s ease-out;
}

.tool-group.is-active .tool-pill {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

.tool-group.is-active .tool-pill:nth-child(1) {
	transition-delay: 0ms;
}

.tool-group.is-active .tool-pill:nth-child(2) {
	transition-delay: 70ms;
}

.tool-group.is-active .tool-pill:nth-child(3) {
	transition-delay: 140ms;
}

.tool-group.is-active .tool-pill:nth-child(4) {
	transition-delay: 210ms;
}


.tool-pill-text {
	display: block;
	color: #ffffff;
	line-height: 1.08;
	padding: 0.12em 0.06em 0.2em;
	transform-origin: 50% 80%;
	text-shadow:
		0 1px 1px rgba(0, 0, 0, 0.38),
		0 0 3px rgba(0, 0, 0, 0.16);
	transform: translate3d(0, 0, 0);
	transform-style: preserve-3d;
	transition:
		color 0.25s ease-out,
		text-shadow 0.25s ease-out,
		transform 0.25s ease-out;
	pointer-events: none;
}

.tool-pill:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.7);
	outline-offset: 4px;
}

.tool-pill:active .tool-pill-text {
	transform: translate3d(2px, 2px, 0);
}

@media (hover: hover) and (pointer: fine) {
	.tool-pill:hover .tool-pill-text {
		color: #fff7d7;
		text-shadow:
			0 0 0 rgb(245, 245, 245),
			0 1px 0 rgb(214, 214, 214),
			0 2px 0 rgb(178, 178, 178),
			0 3px 0 rgb(129, 129, 129),
			0 6px 7px rgba(0, 0, 0, 0.58),
			0 0 14px rgba(255, 229, 142, 0.58);
		transform: translate3d(0, -6px, 16px) rotateX(8deg);
	}
}


.tool-pill.is-3d .tool-pill-text {
	color: #fff7d7;
	text-shadow:
		0 0 0 rgb(245, 245, 245),
		0 1px 0 rgb(214, 214, 214),
		0 2px 0 rgb(178, 178, 178),
		0 3px 0 rgb(129, 129, 129),
		0 4px 0 rgb(96, 96, 96),
		0 8px 9px rgba(0, 0, 0, 0.62),
		0 0 14px rgba(255, 229, 142, 0.54);
	transform: translate3d(0, -7px, 18px) rotateX(9deg);
}

.tool-pill.is-3d {
	box-shadow:
		0 15px 24px rgba(0, 0, 0, 0.42),
		inset 0 2px 0 rgba(255, 242, 183, 0.68),
		inset 0 -4px 0 rgba(105, 48, 0, 0.32);
}



.tool-info-panel {
	position: fixed;
	left: calc(var(--rail-left) + var(--tool-rail-width) + var(--tool-panel-gap));
	right: auto;
	top: 50%;
	z-index: 11;
	width: var(--tool-panel-width);
	min-height: clamp(7.5rem, 17vh, 10rem);
	padding: clamp(1rem, 1.65vw, 1.45rem);
	border: 1px solid rgba(255, 226, 178, 0.34);
	border-radius: clamp(1.1rem, 1.8vw, 1.6rem);
	background:
		linear-gradient(180deg, rgba(31, 24, 17, 0.92), rgba(13, 10, 8, 0.86)),
		rgba(16, 12, 9, 0.86);
	box-shadow:
		0 1.125rem 2.125rem rgba(0, 0, 0, 0.42),
		inset 0 0.0625rem 0 rgba(255, 235, 180, 0.16);
	color: #fff3d6;
	overflow: hidden;
	opacity: 0;
	transform: translate3d(-1.125rem, -50%, 0) scale(0.98);
	transition:
		opacity 180ms ease-out,
		transform 180ms ease-out;
	pointer-events: none;
	user-select: none;
}

.tool-info-panel.is-visible {
	opacity: 1;
	transform: translate3d(0, -50%, 0) scale(1);
}

.tool-info-title {
	display: block;
	margin: 0 0 0.5em;
	color: #ffffff;
	font-family: "Bruno Ace SC", "Arial Black", Impact, sans-serif;
	font-size: clamp(1.55rem, 2.35vw, 2.65rem);
	font-weight: 400;
	line-height: 0.95;
	letter-spacing: 0.04em;
	text-shadow:
		0 0.0625rem 0 rgb(205, 205, 205),
		0 0.125rem 0 rgb(150, 150, 150),
		0 0.25rem 0.3125rem rgba(0, 0, 0, 0.48);
}

.tool-info-copy {
	margin: 0;
	color: rgba(255, 239, 205, 0.86);
	font: 600 clamp(0.78rem, 1.05vw, 1rem)/1.45 "Oxanium", Arial, Helvetica, sans-serif;
	letter-spacing: 0.015em;
}


.metal-scrollbar {
	position: fixed;
	right: clamp(0.75rem, 1.35vw, 1.35rem);
	top: clamp(2rem, 5vh, 3.25rem);
	bottom: clamp(2rem, 5vh, 3.25rem);
	z-index: 18;
	display: none;
	width: clamp(0.95rem, 1.05vw, 1.25rem);
	height: auto;
	cursor: grab;
	pointer-events: auto;
	touch-action: none;
}

.metal-scrollbar.is-dragging {
	cursor: grabbing;
}


.stage-note {
	position: fixed;
	right: 14px;
	top: 12px;
	z-index: 12;
	min-width: 54px;
	padding: 7px 13px 8px;
	border: 1px solid rgba(255, 226, 178, 0.28);
	border-radius: 999px;
	background:
		linear-gradient(180deg, rgba(255, 187, 44, 0.92), rgba(224, 105, 0, 0.82)),
		rgba(242, 148, 0, 0.8);
	box-shadow:
		0 8px 16px rgba(0, 0, 0, 0.34),
		inset 0 2px 0 rgba(255, 235, 166, 0.52),
		inset 0 -3px 0 rgba(115, 58, 0, 0.26);
	color: #ffffff;
	font-family: "Bruno Ace SC", "Arial Black", Impact, sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
	pointer-events: auto;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.dissolve-lab {
	position: fixed;
	left: var(--ui-edge);
	top: clamp(0.75rem, 2vh, 1.25rem);
	z-index: 20;
	display: grid;
	gap: 0.28rem;
	width: min(13rem, 28vw);
	padding: 0.72rem 0.8rem 0.82rem;
	border: 1px solid rgba(255, 226, 178, 0.22);
	border-radius: 1rem;
	background:
		linear-gradient(180deg, rgba(22, 17, 13, 0.88), rgba(8, 7, 6, 0.72)),
		rgba(12, 10, 8, 0.76);
	box-shadow:
		0 1rem 2rem rgba(0, 0, 0, 0.34),
		inset 0 0.0625rem 0 rgba(255, 235, 180, 0.12);
	color: rgba(255, 239, 205, 0.88);
	font: 600 clamp(0.62rem, 0.78vw, 0.82rem)/1.2 "Oxanium", Arial, Helvetica, sans-serif;
	letter-spacing: 0.025em;
	pointer-events: auto;
	user-select: none;
}

.dissolve-lab strong {
	display: block;
	margin-bottom: 0.2rem;
	color: #ffffff;
	font-family: "Bruno Ace SC", "Arial Black", Impact, sans-serif;
	font-size: clamp(0.64rem, 0.82vw, 0.9rem);
	font-weight: 400;
	letter-spacing: 0.045em;
	text-transform: uppercase;
}

.dissolve-lab label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 1.05rem;
	cursor: pointer;
}

.dissolve-lab input {
	width: 0.78rem;
	height: 0.78rem;
	margin: 0;
	accent-color: #f4b33a;
}

.load-status {
	position: fixed;
	left: 50%;
	bottom: 18px;
	z-index: 11;
	padding: 8px 11px;
	border: 1px solid rgba(255, 226, 178, 0.26);
	border-radius: 999px;
	background: rgba(11, 9, 7, 0.68);
	color: rgba(255, 240, 209, 0.82);
	font: 12px/1.2 Arial, Helvetica, sans-serif;
	letter-spacing: 0.02em;
	opacity: 1;
	transform: translate3d(-50%, var(--hero-scroll-y), 0);
	transition: opacity 120ms linear;
	will-change: transform, opacity;
	pointer-events: none;
}

.load-status.is-hidden {
	display: none;
}

.orientation-prompt {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: none;
	place-items: center;
	padding: 24px;
	background: #14100d;
	color: #ffe9be;
}

.orientation-card {
	max-width: 300px;
	padding: 22px;
	border: 1px solid rgba(255, 226, 178, 0.36);
	border-radius: 18px;
	background: rgba(255, 228, 180, 0.08);
	text-align: center;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.orientation-card strong,
.orientation-card span {
	display: block;
}

.orientation-card strong {
	margin-bottom: 8px;
	font-size: 20px;
}

.orientation-card span {
	font-size: 14px;
	opacity: 0.78;
}

@media (max-width: 767px) and (orientation: landscape) {
	.orientation-prompt {
		display: grid;
	}
}


@media (min-width: 721px) and (max-width: 1100px) and (orientation: portrait) {
	:root {
		--ui-edge: clamp(1rem, 3vw, 2rem);
		--tool-rail-width: clamp(13rem, 26vw, 16rem);
		--tool-panel-gap: clamp(2rem, 5vw, 4rem);
		--tool-panel-right: clamp(1.25rem, 4vw, 3rem);
	}

	.tool-info-panel {
		left: calc(var(--rail-left) + var(--tool-rail-width) + var(--tool-panel-gap));
		right: var(--tool-panel-right);
		width: auto;
	}

	.hero-contact {
		top: clamp(18rem, 35vh, 24rem);
		font-size: clamp(1.65rem, 3.25vw, 2.65rem);
	}

	.tool-pill {
		font-size: clamp(1.1rem, 2.2vw, 1.7rem);
	}
}

@media (max-width: 720px) and (orientation: portrait) {
	:root {
		--ui-edge: clamp(0.75rem, 3vw, 1.15rem);
		--tool-pill-height: clamp(2.65rem, 12vw, 3.45rem);
		--tool-group-gap: clamp(0.45rem, 2vw, 0.7rem);
		--mobile-controls-bottom: calc(max(0.875rem, env(safe-area-inset-bottom)) + 1.875rem);
	}


	.dissolve-lab {
		left: var(--ui-edge);
		top: max(3.1rem, env(safe-area-inset-top));
		width: min(10.5rem, 42vw);
		padding: 0.52rem 0.58rem 0.6rem;
		gap: 0.18rem;
		font-size: clamp(0.48rem, 2vw, 0.66rem);
	}

	.dissolve-lab strong {
		font-size: clamp(0.5rem, 2.1vw, 0.68rem);
	}

	.dissolve-lab label {
		gap: 0.28rem;
		min-height: 0.92rem;
	}

	.dissolve-lab input {
		width: 0.64rem;
		height: 0.64rem;
	}

	.hero-title {
		top: 2.125rem;
		width: 88vw;
		font-size: clamp(2.375rem, 13vw, 4.75rem);
		letter-spacing: -0.03em;
	}

	.hero-contact {
		top: clamp(12rem, 34vh, 17rem);
		width: 90vw;
		font-size: clamp(1.25rem, 5.65vw, 1.95rem);
		line-height: 1.2;
		letter-spacing: 0.025em;
	}


	#scroll-space {
		height: 760vh;
	}

	.tool-rail {
		left: var(--ui-edge);
		top: auto;
		bottom: var(--mobile-controls-bottom);
		width: calc(100vw - (var(--ui-edge) * 2));
		height: calc((var(--tool-pill-height) * 2) + var(--tool-group-gap));
		transform: none;
		gap: clamp(0.5rem, 2.5vw, 0.75rem);
	}

	.tool-group {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--tool-group-gap);
	}

	.tool-group.is-active {
		display: grid;
	}

	.tool-group.is-active .tool-pill:nth-child(n + 3) {
		display: flex;
	}

	.tool-pill {
		min-height: var(--tool-pill-height);
		padding: 0 0.55em 0.12em;
		border-radius: clamp(0.8rem, 3.5vw, 1.15rem);
		font-size: clamp(0.92rem, 4.35vw, 1.35rem);
		letter-spacing: 0.012em;
	}

	.tool-pill-text {
		line-height: 1.05;
		padding-inline: 0.02em;
	}

	.tool-info-panel {
		left: var(--ui-edge);
		right: var(--ui-edge);
		top: auto;
		bottom: calc(var(--mobile-controls-bottom) + clamp(7rem, 29vw, 8.75rem));
		width: auto;
		min-height: auto;
		padding: clamp(0.8rem, 3.5vw, 1rem);
		transform: translate3d(0, 0.75rem, 0) scale(0.98);
	}

	.tool-info-panel.is-visible {
		transform: translate3d(0, 0, 0) scale(1);
	}

	.tool-info-title {
		font-size: clamp(1.25rem, 6vw, 1.8rem);
		margin-bottom: 0.35em;
	}

	.tool-info-copy {
		font-size: clamp(0.72rem, 3.2vw, 0.9rem);
		line-height: 1.34;
	}

	.stage-note {
		top: max(0.6rem, env(safe-area-inset-top));
		right: var(--ui-edge);
		min-width: auto;
		padding: 0.42em 0.7em 0.48em;
		font-size: clamp(0.55rem, 2.35vw, 0.75rem);
	}
}


.stage-note.is-off {
	background:
		linear-gradient(180deg, rgba(105, 111, 118, 0.92), rgba(49, 52, 56, 0.86)),
		rgba(70, 72, 75, 0.9);
	border-color: rgba(210, 220, 230, 0.32);
	box-shadow:
		0 8px 16px rgba(0, 0, 0, 0.34),
		inset 0 2px 0 rgba(240, 246, 255, 0.35),
		inset 0 -3px 0 rgba(0, 0, 0, 0.24);
	color: rgba(255, 255, 255, 0.9);
}
