/* ===========================================================================
   Mode: SCROLL — whole book on one vertical scroll; a fixed illustration
   crossfades behind text panels as you move down.
   =========================================================================== */

body.m-scroll { background: var(--night); }

/* Fixed illustration behind everything */
.sbg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}
.sbg__layer {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	opacity: 0;
	transform: scale(1.04);
	transition: opacity 0.8s var(--ease);
	will-change: opacity;
}
.sbg__layer.is-active { opacity: 1; }
.sbg__veil {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(90% 70% at 50% 45%, transparent 30%, rgba(6, 10, 16, 0.5) 100%),
		linear-gradient(to bottom, rgba(6, 10, 16, 0.55), rgba(6, 10, 16, 0.35) 40%, rgba(6, 10, 16, 0.7));
}

/* Vertical "water" progress rail */
.rail {
	position: fixed;
	top: 0; bottom: 0; left: 0;
	width: 4px;
	z-index: 40;
	background: rgba(255, 255, 255, 0.06);
}
.rail__fill {
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 0%;
	background: linear-gradient(to bottom, var(--sea-light), var(--sea));
	box-shadow: 0 0 14px 1px rgba(127, 198, 216, 0.45);
}
.rail__count {
	position: fixed;
	left: 16px;
	bottom: 18px;
	z-index: 40;
	font-family: var(--display);
	font-size: 0.95rem;
	letter-spacing: 0.12em;
	color: var(--ink);
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

/* Intro */
.scroll-hero {
	position: relative;
	z-index: 1;
	min-height: 94vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 40px 24px;
	gap: 10px;
}
.scroll-hero h1 {
	font-family: var(--display);
	font-weight: 600;
	font-size: clamp(2.6rem, 1.6rem + 4vw, 4.6rem);
	margin: 0;
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}
.scroll-hero p { margin: 0; color: var(--ink-dim); font-style: italic; font-size: 1.2rem; }
.scroll-hero .cue {
	margin-top: 40px;
	font-size: 0.8rem;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--ink-dim);
	animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Scenes */
.scene {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14vh clamp(22px, 5vw, 40px);
}
.scene__panel {
	max-width: 620px;
	background: rgba(8, 14, 21, 0.78);
	border: 1px solid var(--panel-line);
	border-radius: 16px;
	padding: clamp(24px, 4vw, 44px);
	box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(12px) saturate(1.2);
	-webkit-backdrop-filter: blur(12px) saturate(1.2);
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.scene.in .scene__panel { opacity: 1; transform: none; }
.scene__n {
	font-family: var(--display);
	font-size: 0.8rem;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--sea-light);
	display: block;
	margin-bottom: 14px;
}
.scene__p {
	margin: 0;
	font-size: clamp(1.1rem, 0.9rem + 0.65vw, 1.4rem);
	line-height: 1.66;
	text-wrap: pretty;
}

/* End */
.scroll-end {
	position: relative;
	z-index: 1;
	min-height: 82vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 18px;
	padding: 40px 24px 120px;
}
.scroll-end h2 {
	font-family: var(--display);
	font-weight: 600;
	font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
	margin: 0;
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}
.scroll-end a {
	color: var(--sea-light);
	text-decoration: none;
	font-family: var(--display);
	font-size: 1.15rem;
	border: 1px solid var(--panel-line);
	border-radius: 999px;
	padding: 8px 22px;
}
.scroll-end a:hover { background: rgba(255, 255, 255, 0.07); }

@media (prefers-reduced-motion: reduce) {
	.sbg__layer { transition: opacity 0.15s linear; }
	.scene__panel { opacity: 1; transform: none; }
	.scroll-hero .cue { animation: none; }
}
