/* ========================================
   Animation Styles
======================================== */

/* 基本的なアニメーション定義 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* アニメーションクラス */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.2s;
}

.fade-in-delay-2 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.4s;
}

.fade-in-delay-3 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.6s;
}

.fade-in.is-visible,
.fade-in-delay.is-visible,
.fade-in-delay-2.is-visible,
.fade-in-delay-3.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* セクションアニメーション */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

section.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* カード要素のアニメーション */
.overview-card,
.future-card,
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.section-visible .overview-card,
.section-visible .future-card,
.section-visible .feature-card {
    opacity: 1;
    transform: translateY(0);
}

.section-visible .overview-card:nth-child(1) { transition-delay: 0.1s; }
.section-visible .overview-card:nth-child(2) { transition-delay: 0.2s; }
.section-visible .overview-card:nth-child(3) { transition-delay: 0.3s; }

/* フェーズアニメーション */
.phase-item {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.phase-item.phase-visible {
    opacity: 1;
    transform: translateX(0);
}

.phase-marker {
    transform: scale(0);
    transition: transform 0.4s ease;
}

.phase-visible .phase-marker {
    transform: scale(1);
}

/* タイムラインのアニメーション */
.timeline-line {
    height: 0;
    transition: height 1.5s ease;
}

.section-visible .timeline-line {
    height: 100%;
}

/* 数値カウントアップ */
.story-number {
    display: inline-block;
    min-width: 100px;
}

/* ホバーエフェクト */
.hero-cta {
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero-cta:hover::before {
    width: 300px;
    height: 300px;
}

/* ギャラリーアニメーション */
.gallery-image {
    transition: opacity 0.3s ease;
}

.gallery-thumb {
    position: relative;
    overflow: hidden;
}

.gallery-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 144, 226, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumb:hover::after {
    opacity: 1;
}

/* QRコードアニメーション */
#qrcode {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.section-visible #qrcode {
    opacity: 1;
    transform: scale(1);
}

/* ローディングアニメーション */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* パルスアニメーション（強調用） */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* フローティングアニメーション */
.float {
    animation: float 3s ease-in-out infinite;
}

/* プレゼンテーションモード */
body.presentation-mode {
    overflow: hidden;
}

body.presentation-mode .navigation {
    transform: translateY(-100%);
}

body.presentation-mode section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 通知アニメーション */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: 0.875rem;
    z-index: 9999;
    transition: transform 0.3s ease;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* スクロールインジケーター */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    cursor: pointer;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

/* モバイルでのアニメーション軽量化 */
@media (max-width: 768px) {
    /* トランジション時間を短縮 */
    * {
        transition-duration: 0.3s !important;
    }
    
    /* 複雑なアニメーションを無効化 */
    .hero-cta::before,
    .gallery-thumb::after {
        display: none;
    }
    
    /* パララックス効果を無効化 */
    .hero-background {
        transform: none !important;
    }
}

/* アクセシビリティ: モーション設定を尊重 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}