/* scenes.css — scene-router: #stage и логика переключения сцен */

/* Экран 1 — полноэкранный контейнер сцен */
#stage {
	position: relative;
	width: 100%;
	height: 100vh;
	overflow: hidden;
	background-color: var(--color-ink);
	/* Базовый z-context для всего Экрана 1 */
	isolation: isolate;
}

/* Базовая сцена */
.scene {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	overflow: hidden;
}

/* Активная сцена */
.scene--active {
	display: flex;
}

/* Анимированное появление сцены */
.scene--enter {
	animation: scene-enter var(--dur-scene) var(--ease-cinematic) forwards;
}

@keyframes scene-enter {
	from {
		opacity: 0;
		transform: scale(var(--scene-zoom));
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Внутренний layout сцены — вертикальный скролл.
   Центрирование — через auto-margin у крайних детей, а НЕ через
   justify-content: center: с center при переполнении flex выталкивает
   верх контента за границу скролла и его невозможно доскроллить
   (обрезанный венок на мобилке). */
.scene__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding-top: var(--header-h);
	overflow-y: auto;
	scrollbar-width: none;
}

.scene__inner > :first-child {
	margin-top: auto;
}

.scene__inner > :last-child {
	margin-bottom: auto;
}

.scene__inner::-webkit-scrollbar {
	display: none;
}

/* Контент сцены */
.scene__content {
	position: relative;
	z-index: 2;
	padding: var(--space-l) var(--space-section-x);
}

/* Фон сцены (CSS-заглушки с img-слотами) */
.scene__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Оверлей поверх фона */
.scene__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* Общий фон-костёр (hero + welcome, вне сцен) */
#scene-fire-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	transition: transform var(--dur-scene) var(--ease-cinematic),
	opacity var(--dur-scene) var(--ease-cinematic);
}

/* Атмосферный фон остаётся на месте (без масштабирования — раньше это
   давало «шов» на welcome). Сам костёр живёт в #fire-front и переезжает. */
#scene-fire-bg[data-pose="hero"],
#scene-fire-bg[data-pose="zooming"],
#scene-fire-bg[data-pose="welcome"] {
	transform: none;
	opacity: 1;
}

/* Экран 2 — форма финала (под #stage). Высота по контенту с умеренным
   паддингом вместо min-height:100vh — меньше пустоты между экранами. */
#form-finale {
	position: relative;
	background-color: var(--color-ink);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: var(--space-l) var(--space-section-x);
}
