/**
 * NextExtManager — server-rendered homepage.
 *
 * Only the bits Tailwind utilities can't express cleanly: scroll-reveal,
 * keyframes (hero marquee, typing cursor, coming-soon pulse) and the CTA hover
 * gradient. Tailwind utilities + Alpine ship site-wide from the template.
 *
 * Shared across every brand. Brand-specific home decoration lives in its own
 * home-<brand>.css (e.g. home-joomcoder.css), loaded only for that brand.
 */

/* ── Horizontal-scroll guard ────────────────────────────────────
 * Contain decorative/reveal transforms so they can never cause horizontal scroll
 * on mobile (e.g. the Trust section's slide-in reveal sits 60px off-axis before it
 * enters the viewport). overflow-x:clip keeps overflow-y visible — no scroll
 * container, no sticky breakage. overflow-x:hidden is a fallback for pre-2022 Safari. */
.nxt-home-root {
	overflow-x: hidden;
	overflow-x: clip;
}

/* ── Scroll reveal ──────────────────────────────────────────────
 * Elements tagged [data-reveal] start offset + transparent; home.js adds
 * .is-visible when they enter the viewport. Offset direction/distance/delay are
 * driven by --reveal-tx / --reveal-ty / transition-delay set in home.js. */
[data-reveal] {
	opacity: 0;
	transform: translate(var(--reveal-tx, 0), var(--reveal-ty, 40px));
	transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
		transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
}

[data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* ── Hero dot-grid backdrop (recolors in dark) ─────────────────── */
.nxt-home-dots {
	background-image: radial-gradient(circle, #CBD5E1 1px, transparent 1px);
	background-size: 24px 24px;
}

[data-theme="dark"] .nxt-home-dots {
	background-image: radial-gradient(circle, #334155 1px, transparent 1px);
}

/* ── Hero tech carousel: seamless infinite scroll, pause on hover ─ */
.nxt-home-marquee {
	display: flex;
	width: max-content;
	animation: nxtHomeScroll 25s linear infinite;
}

.nxt-home-marquee:hover {
	animation-play-state: paused;
}

@keyframes nxtHomeScroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* ── Typing cursor ─────────────────────────────────────────────── */
.nxt-home-cursor {
	display: inline-block;
	width: 2px;
	height: 1.1em;
	margin-left: 1px;
	background: #2563EB;
	vertical-align: text-bottom;
	animation: nxtHomeCursorBlink 1s step-end infinite;
}

@keyframes nxtHomeCursorBlink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0; }
}

/* ── Coming-soon pulse dot ─────────────────────────────────────── */
.nxt-home-pulse {
	animation: nxtHomePulse 2s ease-in-out infinite;
}

@keyframes nxtHomePulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Hero CTA gradient (brand secondary; lightens on hover) ─────── */
.nxt-home-cta {
	background: linear-gradient(135deg, var(--nxt-secondary) 0%, var(--nxt-secondary-dark, var(--nxt-secondary)) 100%);
}

.nxt-home-cta:hover {
	background: linear-gradient(135deg, var(--nxt-secondary-light, var(--nxt-secondary)) 0%, var(--nxt-secondary-dark, var(--nxt-secondary)) 100%);
}

/* Respect reduced-motion: stop the looping/decorative animations.
 * (JoomCoder's brand hero animations are handled in home-joomcoder.css.) */
@media (prefers-reduced-motion: reduce) {
	[data-reveal] { opacity: 1; transform: none; transition: none; }
	.nxt-home-marquee { animation: none; }
	.nxt-home-cursor { animation: none; }
	.nxt-home-pulse { animation: none; }
}
