*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	/* Set by JS per scene — defaults to dawn */
	--fg: #f0cfa0;
	--fg-dim: rgba(240, 207, 160, 0.55);
	--fg-hud: rgba(240, 207, 160, 0.7);
	--fg-dot: rgba(240, 207, 160, 0.3);
	--fg-dotact: rgba(240, 207, 160, 0.9);
	--bg: #0a0a0f;
	--accent: #a0b4ff;
	--scrim: 0.18;
}

html {
	scroll-behavior: auto;
}

body {
	background: var(--bg);
	color: var(--fg);
	font-family: "Space Grotesk", sans-serif;
	overflow-x: hidden;
	cursor: crosshair;
}

/* ── Fixed canvas ─────────────────────────────────────── */
#webgl_canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	display: block;
}

/* ── HUD ──────────────────────────────────────────────── */
#hud {
	position: fixed;
	inset: 0;
	z-index: 10;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 1.5rem 2rem;
}

#hud-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

#hud-bottom {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

.mono {
	font-family: "Space Mono", monospace;
}

#scene_name {
	font-family: "Space Mono", monospace;
	font-size: clamp(0.65rem, 1.5vw, 0.78rem);
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--fg-hud);
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
	transition: color 1.2s ease;
}

#hud_pct {
	font-family: "Space Mono", monospace;
	font-size: clamp(0.65rem, 1.5vw, 0.78rem);
	letter-spacing: 0.12em;
	color: var(--fg-hud);
	opacity: 0.65;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
	transition: color 1.2s ease;
}

#prog_bar {
	width: 120px;
	height: 2px;
	background: rgba(255, 255, 255, 0.15);
	position: relative;
	overflow: hidden;
	border-radius: 2px;
}
#prog_fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	background: var(--fg-hud);
	opacity: 0.7;
	width: 0%;
	transition: width 80ms linear, background 1.2s ease;
}

/* Scene dots */
#scene_dots {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	position: fixed;
	right: 1.75rem;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	pointer-events: none;
}

.scene-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--fg-dot);
	transition: background 0.4s, transform 0.3s;
}

.scene-dot.active {
	background: var(--fg-dotact);
	transform: scale(1.5);
}

/* ── Scrollable content ───────────────────────────────── */
#scroll_track {
	position: relative;
	z-index: 5;
	pointer-events: none;
}

.scene-section {
	height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 0 2.5rem 4.5rem;
	pointer-events: none;
	position: relative;
}

/* Bottom scrim — gets more opaque as night approaches */
.scene-section::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 8, var(--scrim, 0.18)) 0%,
		rgba(0, 0, 8, calc(var(--scrim, 0.18) * 0.4)) 40%,
		transparent 70%
	);
	pointer-events: none;
	z-index: 0;
	transition: --scrim 0.5s;
}

.scene-section > * {
	position: relative;
	z-index: 1;
}

.scene-title {
	font-family: "Space Grotesk", sans-serif;
	font-weight: 700;
	font-size: clamp(2.8rem, 8vw, 6.5rem);
	line-height: 0.95;
	color: var(--fg);
	text-shadow: 0 2px 40px rgba(0, 0, 0, 0.7), 0 1px 4px rgba(0, 0, 0, 0.9);
	letter-spacing: -0.02em;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s ease, transform 0.7s ease, color 1.2s ease;
}

.scene-title.visible {
	opacity: 1;
	transform: none;
}

.scene-desc {
	font-family: "Space Grotesk", sans-serif;
	font-weight: 300;
	font-size: clamp(0.88rem, 2vw, 1.1rem);
	color: var(--fg);
	opacity: 0;
	max-width: 420px;
	margin-top: 0.75rem;
	line-height: 1.55;
	text-shadow: 0 1px 16px rgba(0, 0, 0, 0.85), 0 0px 4px rgba(0, 0, 0, 0.7);
	transform: translateY(10px);
	transition: opacity 0.7s ease 0.12s, transform 0.7s ease 0.12s, color 1.2s ease;
}

.scene-desc.visible {
	opacity: 0.88;
	transform: none;
}

/* h-line decorative */
.h-line {
	width: 36px;
	height: 1px;
	background: var(--fg);
	opacity: 0;
	margin-bottom: 1rem;
	transition: opacity 0.6s ease 0.05s, background 1.2s ease;
}

.h-line.visible {
	opacity: 0.4;
	width: 36px;
}

.scene-label {
	font-family: "Space Mono", monospace;
	font-size: clamp(0.58rem, 1.2vw, 0.72rem);
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--fg);
	opacity: 0.45;
	margin-bottom: 0.5rem;
	transition: color 1.2s ease;
}

/* ── Content extras ───────────────────────────────────── */
/* Call-to-action button (re-enables pointer events) */
.button {
	display: inline-block;
	pointer-events: auto;
	margin-top: 1.75rem;
	font-family: "Space Grotesk", sans-serif;
	font-weight: 500;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fg);
	text-decoration: none;
	padding: 0.85rem 1.7rem;
	border: 1px solid var(--fg-hud);
	background: rgba(255, 255, 255, 0.04);
	backdrop-filter: blur(5px);
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s,
		background 0.3s ease, color 0.3s ease, border-color 1.2s ease;
}

.button.visible {
	opacity: 1;
	transform: none;
}

.button:hover {
	background: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
}

.button:focus-visible {
	outline: 2px solid var(--fg);
	outline-offset: 3px;
}

/* Menu list */
.scene-menu {
	list-style: none;
	margin: 1.75rem 0 0;
	padding: 0;
	max-width: 460px;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
}

.scene-menu.visible {
	opacity: 1;
	transform: none;
}

.scene-menu li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1.5rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--fg-dot);
}

.scene-menu li:first-child {
	border-top: 1px solid var(--fg-dot);
}

.scene-menu .topic {
	font-family: "Space Grotesk", sans-serif;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--fg);
}

.scene-menu .md {
	font-family: "Space Grotesk", sans-serif;
	font-weight: 300;
	font-size: 0.85rem;
	color: var(--fg);
	opacity: 0.6;
	text-align: right;
	max-width: 24ch;
}

/* Footer scene */
.scene-footer {
	justify-content: flex-end;
}

.footer-inner {
	pointer-events: auto;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
}

.footer-inner.visible {
	opacity: 1;
	transform: none;
}

.divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 1rem;
}

.divider .line {
	width: 36px;
	height: 1px;
	background: var(--fg);
	opacity: 0.4;
}

.divider .diamond {
	width: 6px;
	height: 6px;
	background: var(--fg);
	transform: rotate(45deg);
	opacity: 0.8;
}

.footer-text {
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--fg);
	opacity: 0.5;
}

/* Mobile */
@media (max-width: 480px) {
	#hud {
		padding: 1rem 1.25rem;
	}
	#scene_dots {
		right: 1rem;
	}
	.scene-section {
		padding: 0 1.25rem 3rem;
	}
	.scene-menu li {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
	.scene-menu .md {
		text-align: left;
		max-width: none;
	}
}
