/**
 * Home fork vis — 6-gate spider, folder centred, all elements absolute
 */

.sh-fork {
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

/* ─── Two-column layout ─── */
.sh-fork__layout {
	display: grid;
	gap: 2rem 3rem;
	align-items: center;
}

@media (min-width: 760px) {
	.sh-fork__layout {
		grid-template-columns: 1fr 1fr;
	}
}

/* ─── Text side ─── */
.sh-fork .sh-intro {
	margin-bottom: 0;
	max-width: none;
}

.sh-fork .sh-intro h2 {
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	margin-bottom: 0.75rem;
}

.sh-fork .sh-intro p {
	font-size: 1.02rem;
	line-height: 1.75;
}

.sh-fork__points {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}

.sh-fork__points li {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	font-size: 0.95rem;
	line-height: 1.6;
}

.sh-fork__points li::before {
	content: "";
	flex-shrink: 0;
	width: 0.5rem;
	height: 0.5rem;
	margin-top: 0.45em;
	border-radius: 999px;
	background: var(--sh-gold, #ffaa01);
}

.sh-fork__cta {
	margin-top: 1.65rem;
}

/* ─── Stage: 1:1 square, everything inside is absolute ─── */
.sh-fork__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border: 1px solid var(--sh-line, rgba(15, 45, 72, 0.12));
	border-radius: var(--sh-radius, 14px);
	background:
		radial-gradient(ellipse 80% 60% at 50% 50%, rgba(26, 74, 110, 0.09), transparent 68%),
		linear-gradient(165deg, #fafaf8 0%, #f0ede4 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.85),
		0 8px 32px rgba(11, 34, 56, 0.07);
	overflow: hidden;
	isolation: isolate;
}

/* ─── SVG: full-stage overlay ─── */
.sh-fork__lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
	direction: ltr;
}

.sh-fork__path {
	fill: none;
	stroke: rgba(26, 74, 110, 0.16);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-dasharray: var(--len, 220);
	stroke-dashoffset: var(--len, 220);
	transition:
		stroke 0.4s ease,
		stroke-width 0.4s ease,
		stroke-dashoffset 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.sh-fork__stage.is-drawn .sh-fork__path {
	stroke-dashoffset: 0;
}

.sh-fork__stage.is-on-0 .sh-fork__path[data-fork="0"],
.sh-fork__stage.is-on-1 .sh-fork__path[data-fork="1"],
.sh-fork__stage.is-on-2 .sh-fork__path[data-fork="2"],
.sh-fork__stage.is-on-3 .sh-fork__path[data-fork="3"],
.sh-fork__stage.is-on-4 .sh-fork__path[data-fork="4"],
.sh-fork__stage.is-on-5 .sh-fork__path[data-fork="5"] {
	stroke: var(--sh-gold, #ffaa01);
	stroke-width: 2.5;
	filter: drop-shadow(0 0 5px rgba(255, 170, 1, 0.4));
}

.sh-fork__bead {
	fill: var(--sh-gold, #ffaa01);
	opacity: 0;
	filter: drop-shadow(0 0 5px rgba(255, 170, 1, 0.65));
	transition: opacity 0.2s ease;
}

.sh-fork__stage.is-traveling .sh-fork__bead {
	opacity: 1;
}

/* ─── Gate rows: absolutely positioned top / bottom ─── */
.sh-fork__gates {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.4rem;
	padding-inline: 0.6rem;
}

.sh-fork__gates--top {
	top: 0.6rem;
}

.sh-fork__gates--bottom {
	bottom: 0.6rem;
}

.sh-fork__gate {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.38rem 0.25rem;
	text-align: center;
	text-decoration: none;
	color: var(--sh-blue-ink, #0b2238);
	background: rgba(255, 255, 255, 0.68);
	border: 1px solid rgba(15, 45, 72, 0.1);
	border-radius: 999px;
	opacity: 0.42;
	transition:
		opacity 0.3s ease,
		border-color 0.3s ease,
		background 0.3s ease,
		box-shadow 0.3s ease;
}

.sh-fork__gate:hover,
.sh-fork__gate:focus-visible {
	text-decoration: none;
	color: var(--sh-blue-ink, #0b2238);
	opacity: 0.9;
}

.sh-fork__gate strong {
	font-size: 0.73rem;
	font-weight: 800;
	line-height: 1.2;
}

.sh-fork__stage.is-drawn .sh-fork__gate {
	opacity: 0.55;
}

.sh-fork__stage.is-on-0 .sh-fork__gate[data-fork-gate="0"],
.sh-fork__stage.is-on-1 .sh-fork__gate[data-fork-gate="1"],
.sh-fork__stage.is-on-2 .sh-fork__gate[data-fork-gate="2"],
.sh-fork__stage.is-on-3 .sh-fork__gate[data-fork-gate="3"],
.sh-fork__stage.is-on-4 .sh-fork__gate[data-fork-gate="4"],
.sh-fork__stage.is-on-5 .sh-fork__gate[data-fork-gate="5"],
.sh-fork__stage.is-static .sh-fork__gate {
	opacity: 1;
	background: #fff;
	border-color: rgba(255, 170, 1, 0.65);
	box-shadow: 0 2px 8px rgba(255, 170, 1, 0.18);
}

.sh-fork__stage.is-static .sh-fork__gate {
	border-color: rgba(15, 45, 72, 0.12);
	box-shadow: none;
}

/* ─── Folder: pinned to exact vertical centre ─── */
.sh-fork__folder {
	position: absolute;
	z-index: 3;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
}

.sh-fork__folder svg {
	width: clamp(3.25rem, 10%, 4.5rem);
	height: auto;
	filter: drop-shadow(0 5px 10px rgba(11, 34, 56, 0.18));
}

.sh-fork__folder span {
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: var(--sh-blue-deep, #123552);
}

/* ─── Mobile ─── */
@media (max-width: 759px) {
	.sh-fork__layout {
		grid-template-columns: 1fr;
	}

	.sh-fork__stage {
		max-width: 26rem;
		margin-inline: auto;
	}

	.sh-fork .sh-intro {
		text-align: center;
	}

	.sh-fork__points {
		text-align: start;
		max-width: 26rem;
		margin-inline: auto;
	}
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
	.sh-fork__path,
	.sh-fork__gate {
		transition: none !important;
	}

	.sh-fork__bead {
		opacity: 0 !important;
		transition: none !important;
	}
}
