/**
 * スクロール出現アニメーション（デモ / 本番反映前プレビュー用）
 * prefers-reduced-motion: reduce では即時表示・動きなし
 */

:root {
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-duration: 0.85s;
    --stagger-step: 0.12s;
    --scroll-progress: 0;
}

/* --- 実績数字セクション --- */
.stats.section-padding {
    background: linear-gradient(180deg, #fff 0%, #f4f8fb 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 102, 204, 0.08);
    border: 1px solid #eef2f7;
}

.stat-number {
    display: block;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 900;
    color: #0066cc;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-suffix {
    font-size: 0.55em;
    font-weight: 700;
    margin-left: 0.1em;
}

.stat-label {
    margin: 10px 0 0;
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
}

.stat-desc {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- スクロール出現（動き OK のときのみ） --- */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        --reveal-x: 0px;
        --reveal-y: 32px;
        transform: translate3d(var(--reveal-x), var(--reveal-y), 0);
        transition:
            opacity var(--motion-duration) var(--motion-ease),
            transform var(--motion-duration) var(--motion-ease);
        transition-delay: calc(var(--stagger-index, 0) * var(--stagger-step));
        will-change: opacity, transform;
    }

    .scroll-reveal.is-visible {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    /* 横から現れるバリエーション（画像向け） */
    .scroll-reveal.scroll-reveal--from-left {
        --reveal-x: -36px;
        --reveal-y: 0px;
    }

    .scroll-reveal.scroll-reveal--from-right {
        --reveal-x: 36px;
        --reveal-y: 0px;
    }

    .mvv-statement.scroll-reveal {
        transition-duration: 0.95s;
    }

    .mvv-slideshow.scroll-reveal {
        transition-duration: 1s;
        transition-delay: calc(var(--stagger-index, 0) * var(--stagger-step) + 0.08s);
    }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

html.motion-reduce .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

/* --- スクロールの“おしゃれ感”（進捗インジケーター） --- */
@media (prefers-reduced-motion: no-preference) {
    .scroll-progress {
        position: fixed;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 9999;
        pointer-events: none;
        opacity: 0.9;
        mix-blend-mode: multiply;
    }

    .scroll-progress__rail {
        position: relative;
        width: 2px;
        height: 140px;
        background: rgba(15, 35, 64, 0.14);
        border-radius: 999px;
    }

    .scroll-progress__dot {
        position: absolute;
        left: 50%;
        top: 0;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(0, 102, 204, 0.95);
        box-shadow: 0 10px 24px rgba(0, 102, 204, 0.22);
        transform: translate(-50%, calc(var(--scroll-progress, 0) * 140px));
    }

    @media (max-width: 900px) {
        .scroll-progress {
            right: 10px;
        }
        .scroll-progress__rail {
            height: 110px;
        }
        .scroll-progress__dot {
            transform: translate(-50%, calc(var(--scroll-progress, 0) * 110px));
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress {
        display: none;
    }
}
