/* ============================================
   MXOHO Animations - Scroll Reveal & Micro-interactions
   v1.0 - 2026-08-24
   策略：克制动效，高端质感，尊重 prefers-reduced-motion
   ============================================ */

/* ---- 滚动入场动画基础类 ---- */
[data-animate] {
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-animate].is-visible { opacity: 1; transform: none; }

/* 上浮淡入（默认） */
[data-animate="fade-up"] { transform: translateY(36px); }
/* 左滑入 */
[data-animate="fade-left"] { transform: translateX(-36px); }
/* 右滑入 */
[data-animate="fade-right"] { transform: translateX(36px); }
/* 缩放淡入 */
[data-animate="scale-in"] { transform: scale(0.92); }
/* 纯淡入 */
[data-animate="fade"] { transform: none; }

/* 交错延迟（data-delay 属性驱动） */
[data-delay="1"] { transition-delay: 0.08s; }
[data-delay="2"] { transition-delay: 0.16s; }
[data-delay="3"] { transition-delay: 0.24s; }
[data-delay="4"] { transition-delay: 0.32s; }
[data-delay="5"] { transition-delay: 0.40s; }
[data-delay="6"] { transition-delay: 0.48s; }

/* ---- 按钮光泽扫过效果 ---- */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
}
.btn-shine:hover::after { left: 130%; }

/* ---- 卡片金色光晕（hover 增强） ---- */
.product-card,
.feature-card,
.testimonial-card,
.sustain-card {
    position: relative;
}
.product-card::before,
.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(212,163,115,0);
    transition: box-shadow 0.4s ease;
    pointer-events: none;
    z-index: 1;
}
.product-card:hover::before,
.feature-card:hover::before {
    box-shadow: 0 0 0 1px rgba(212,163,115,0.45), 0 24px 48px rgba(27,67,50,0.14);
}

/* ---- 图片 hover 缩放 + 滤镜 ---- */
.product-image,
.factory-video-wrap,
.contact-map-embed {
    overflow: hidden;
}
.product-image img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}
.product-card:hover .product-image img {
    transform: scale(1.06);
    filter: saturate(1.08);
}

/* ---- 导航栏链接下划线动画增强 ---- */
.nav-menu > li > a::after {
    height: 2px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-light));
    border-radius: 2px;
}

/* ---- 章节标题装饰线动画 ---- */
.section-header .eyebrow::after {
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

/* ---- 数字滚动计数器 ---- */
.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ---- 渐入式 hero 标题 ---- */
.hero-content > *,
.page-hero-content > * {
    opacity: 0;
    transform: translateY(28px);
    animation: hero-reveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-content > *:nth-child(1), .page-hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2), .page-hero-content > *:nth-child(2) { animation-delay: 0.3s; }
.hero-content > *:nth-child(3), .page-hero-content > *:nth-child(3) { animation-delay: 0.45s; }
.hero-content > *:nth-child(4), .page-hero-content > *:nth-child(4) { animation-delay: 0.6s; }
.hero-content > *:nth-child(5), .page-hero-content > *:nth-child(5) { animation-delay: 0.75s; }
@keyframes hero-reveal {
    to { opacity: 1; transform: none; }
}

/* ---- 页脚链接 hover 微移 ---- */
.footer-links a {
    display: inline-block;
    transition: transform 0.25s ease, color 0.25s ease;
}
.footer-links a:hover {
    transform: translateX(4px);
    color: var(--color-secondary);
}

/* ---- 徽章/标签脉冲（推荐/畅销） ---- */
.badge-featured, .product-tag {
    position: relative;
}
.product-tag::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: rgba(212,163,115,0.4);
    opacity: 0;
    z-index: -1;
    animation: tag-glow 2.4s ease-in-out infinite;
}
@keyframes tag-glow {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.08); }
}

/* ---- 品牌色背景的区块微光浮动 ---- */
.sustainability-section::after,
.project-cta-banner::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -80px;
    width: 360px;
    height: 360px;
    background: rgba(212,163,115,0.05);
    border-radius: 50%;
    animation: float-slow 12s ease-in-out infinite;
}
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

/* ---- 表单 focus 金色光晕增强 ---- */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(212,163,115,0.18), 0 0 0 1px var(--color-secondary) inset;
}

/* ---- 页面加载淡入 ---- */
body { animation: page-fade-in 0.5s ease; }
@keyframes page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--color-primary), var(--color-primary-dark));
    border-radius: 6px;
    border: 2px solid var(--color-bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-secondary-dark); }

/* ---- 尊重 reduced-motion 偏好 ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-animate] { opacity: 1 !important; transform: none !important; }
    .hero-content > *, .page-hero-content > * { opacity: 1 !important; transform: none !important; }
}
