/*
Vinyl Premium — scroll animation styles (spec: docs/ANCUONG-ANIMATION-REVIEW.md).

Six vanilla effects: section reveal + stagger, clip-path title reveal, SVG
underline draw, marquee strip, rAF stat counters (motion in animations.js)
and content-visibility for below-fold sections. Every motion rule is locked
inside
`@media (prefers-reduced-motion: no-preference)`; with reduce the page
renders in its final static state. The hidden initial states only apply to
elements that JS marks with .vp-anim, so no-JS visitors lose nothing.
*/

@media (prefers-reduced-motion: no-preference) {

	/* Section reveal — JS (animations.js) adds .vp-anim then .vp-anim-in once. */
	.vp-anim {
		opacity: 0;
		transform: translateY(16px);
	}

	.vp-anim-in {
		opacity: 1;
		transform: translateY(0);
		transition:
			opacity 0.35s ease-out,
			transform 0.35s ease-out;
	}

	/* Stagger — 35ms per grid child, first 8 children max. */
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(2) { transition-delay: 35ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(3) { transition-delay: 70ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(4) { transition-delay: 105ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(5) { transition-delay: 140ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(6) { transition-delay: 175ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(7) { transition-delay: 210ms; }
	:is(.vp-cats__grid, .vp-prods__grid, .vp-news__grid, .vp-projects__grid, .vp-why__grid, .vp-grid, .vp-why__stats) > .vp-anim:nth-child(8) { transition-delay: 245ms; }

	/* 2) Clip-path title reveal — sweeps open like a plank (An Cường ClipPathConner). */
	.vp-anim .vp-section__head .vp-section__title {
		clip-path: inset(0 100% 0 0);
	}

	.vp-anim-in .vp-section__head .vp-section__title {
		clip-path: inset(0 0 0 0);
		transition: clip-path 0.7s ease-out;
	}

	/* 3) SVG underline draw. */
	.vp-anim .vp-underline path {
		stroke-dasharray: 64;
		stroke-dashoffset: 64;
	}

	.vp-anim-in .vp-underline path {
		stroke-dashoffset: 0;
		transition: stroke-dashoffset 0.4s ease-out 0.25s;
	}

	/* Hero entrance — quick, opacity-only (never delays LCP, 0.4s max). */
	.vp-slide.is-active .vp-slide__caption-inner {
		animation: vp-hero-in 0.4s ease-out both;
	}

	@keyframes vp-hero-in {
		from { opacity: 0; }
		to { opacity: 1; }
	}

	/* Marquee motion — seamless translateX(-50%) over two equal groups. */
	.vp-marquee__track {
		animation: vp-marquee 22s linear infinite;
		will-change: transform;
	}

	.vp-marquee:hover .vp-marquee__track,
	.vp-marquee:focus-within .vp-marquee__track {
		animation-play-state: paused;
	}

	@keyframes vp-marquee {
		from { transform: translateX(0); }
		to { transform: translateX(-50%); }
	}
}

/* Marquee layout — overflow hidden always (page must never scroll sideways). */
.vp-marquee {
	overflow: hidden;
	background: var(--vp-white);
	border-block: 1px solid var(--vp-line);
	padding-block: 18px;
}

.vp-marquee__track {
	display: inline-flex;
	white-space: nowrap;
}

.vp-marquee__group {
	display: inline-flex;
	align-items: center;
	gap: 36px;
	padding-inline-end: 36px;
}

.vp-marquee__item {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--vp-muted);
}

.vp-marquee__dot {
	flex: none;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #b7895a;
}

/* Underline placement — static and fully visible without JS. */
.vp-underline {
	display: block;
	margin-top: 2px;
}

.vp-section__head--center .vp-underline {
	margin-inline: auto;
}

/* Stat counters block (why-us navy band) — static layout, motion in JS. */
.vp-why__stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 32px;
	margin-top: 64px;
	padding-top: 44px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.vp-stat {
	text-align: center;
}

.vp-stat__value {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	font-family: var(--vp-font-display);
	font-weight: 700;
	font-size: clamp(34px, 3.6vw, 52px);
	line-height: 1.1;
	color: #fff;
}

.vp-stat__suffix {
	font-size: 0.45em;
	font-weight: 600;
	color: var(--vp-accent);
}

.vp-stat__label {
	display: block;
	margin-top: 10px;
	font-size: 14px;
	color: var(--vp-muted-lt);
}

@media (max-width: 768px) {
	.vp-why__stats { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

/* Below-fold rendering cost — front-page sections from why-us onward. */
.vp-why,
.vp-projects,
.vp-video,
.vp-reviews,
.vp-news,
.vp-cta,
.vp-map {
	content-visibility: auto;
	contain-intrinsic-size: auto 600px;
}

/* CTA is a compact band (~380px) — a 600px placeholder makes the scrollbar
   jump when the real section renders. Track the band height instead. */
.vp-cta {
	contain-intrinsic-size: auto 380px;
}
