/* Section nav spans full width on top */
#section-nav {
	grid-column: 1 / -1;
	grid-row: 1;
}

/* Horizontal top navigation */
#section-nav {
	position: sticky;
	top: 75px;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: flex-start; /* Start from left to allow scrolling to overview */
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	background: var(--bg-light);
	border-radius: 0.85rem;
	box-shadow: var(--shadow-s);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

/* Center items on desktop when there's space */
@media (min-width: 992px) {
	#section-nav {
		justify-content: center;
	}
}

#section-nav::-webkit-scrollbar {
	display: none;
}

#section-nav a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 50rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	color: var(--text-muted);
	white-space: nowrap;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

#section-nav a .nav-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	font-size: 0.75rem;
	font-weight: 600;
	background: color-mix(in oklch, var(--text-muted) 15%, transparent);
	border-radius: 50%;
	margin-right: 0.25rem;
}

#section-nav a.active {
	background: var(--bs-primary);
	color: #fff;
	box-shadow: var(--shadow-s);
}

#section-nav a.active .nav-number {
	background: rgba(255, 255, 255, 0.25);
}

#section-nav a .nav-dot {
	color: var(--text-muted);
	opacity: 0.5;
	font-size: 0.5rem;
	line-height: 1;
}

#section-nav a.active .nav-dot {
	color: inherit;
	opacity: 0.7;
}

#section-nav a:not(.active):hover {
	background: var(--bs-secondary-bg);
	color: var(--text);
}


#section-nav a.active {
	animation: navPulse .6s ease
}