/* ============================================================
   高端官网动效技术栈 · 兜底样式
   必须引入：保证库加载失败 / 减少动效 / 无 JS 时内容可见
   ============================================================ */

/* ---------- 默认态：无 JS 时内容必须可见 ---------- */
.reveal {
	opacity: 1;
}

/* ---------- 有 JS 且动效可用时才隐藏（由 motion-stack.js 加 motion-ready） ---------- */
.motion-ready .reveal {
	opacity: 0;
	will-change: transform, opacity;
}
.motion-ready .reveal.is-in,
.motion-ready .reveal.gsap-done {
	opacity: 1;
}

/* GSAP 接管后由行内样式控制，这里只兜底 */
.motion-ready .reveal[style*="opacity"] {
	opacity: inherit;
}

/* ---------- 库加载失败：全部可见 ---------- */
.no-motion .reveal,
.no-motion .reveal-group > .reveal {
	opacity: 1 !important;
	transform: none !important;
	will-change: auto;
}

/* ---------- 减少动效偏好：全部可见且无过渡 ---------- */
.reduce-motion .reveal,
.reduce-motion .reveal-group > .reveal {
	opacity: 1 !important;
	transform: none !important;
	will-change: auto;
}
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
	animation-duration: .01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: .01ms !important;
	scroll-behavior: auto !important;
}

/* 系统级减少动效（双保险） */
@media (prefers-reduced-motion: reduce) {
	.reveal,
	.reveal-group > .reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ---------- 视差与横向：降级时归位 ---------- */
.no-motion [data-parallax],
.reduce-motion [data-parallax] {
	transform: none !important;
}
.no-motion [data-horizontal],
.reduce-motion [data-horizontal] {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.no-motion .h-track,
.reduce-motion .h-track {
	transform: none !important;
}

/* ---------- Lenis 必需 ---------- */
html.lenis,
html.lenis body {
	height: auto;
}
.lenis.lenis-smooth {
	scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
	overflow: hidden;
}

/* ---------- 横向滚动容器 ---------- */
[data-horizontal] {
	overflow: hidden;
}
.h-track {
	display: flex;
	align-items: center;
	width: max-content;
	will-change: transform;
}

/* ---------- Pinning 结构 ---------- */
[data-pin] {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 80px;
	align-items: start;
}
.pin-fixed {
	position: sticky;
	top: 120px;
	will-change: transform;
}

/* 移动端取消 pin */
@media (max-width: 768px) {
	[data-pin] {
		grid-template-columns: 1fr;
		gap: 40px;
	}
	.pin-fixed {
		position: static;
		height: auto;
	}
}

/* ---------- 文字解码：无障碍 ---------- */
[data-scramble] {
	/* 解码中避免换行跳动 */
	display: inline-block;
	min-height: 1em;
}

/* ---------- Swiper 视差层 ---------- */
.swiper-banner .slide-inner {
	width: 100%;
	height: 100%;
	will-change: transform;
}


/* ============================================================
   标题 3D 翻转（flip-title）
   ============================================================ */
.flip-title {
	perspective: 900px;
}
.flip-title span {
	display: inline-block;
	transform-origin: 50% 100%;
	will-change: transform, opacity;
}

/* ============================================================
   按钮磁吸（magnetic）
   ============================================================ */
.magnetic {
	display: inline-block;
	will-change: transform;
}

/* 库失败 / 减少动效：内容必须可见 */
.no-motion .flip-title span,
.reduce-motion .flip-title span {
	opacity: 1 !important;
	transform: none !important;
}
.no-motion .magnetic,
.reduce-motion .magnetic {
	transform: none !important;
}
