/* ================================================
   ふわっと柔らかいアニメーション - PC・モバイル共通
   ================================================ */

/* ===== キーフレームアニメーション ===== */

/* フェードイン + 上からふわっと */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* フェードイン + 下からふわっと */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* フェードイン + 左からふわっと */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* フェードイン + 右からふわっと */
@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ふわふわ浮遊アニメーション */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 小さな浮遊アニメーション */
@keyframes floatSmall {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* スケールアップ */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* パルス効果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== 基本の柔らかい遷移設定 ===== */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ヘッダーアニメーション ===== */
header {
    animation: fadeInDown 1s ease-out;
}

.logo a {
    animation: fadeInLeft 1.2s ease-out 0.2s both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo a:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ナビゲーションメニュー */
.main-nav a {
    animation: fadeInDown 1s ease-out both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav a:nth-child(1) { animation-delay: 0.1s; }
.main-nav a:nth-child(2) { animation-delay: 0.2s; }
.main-nav a:nth-child(3) { animation-delay: 0.3s; }
.main-nav a:nth-child(4) { animation-delay: 0.4s; }

.main-nav a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ===== ヒーローセクションアニメーション ===== */
.hero {
    animation: scaleIn 1.5s ease-out;
}

.hero-content {
    animation: fadeInUp 1.8s ease-out 0.5s both;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero h1 {
    animation: fadeInUp 1.5s ease-out 0.8s both;
}

.tagline {
    animation: fadeInUp 1.5s ease-out 1.0s both;
}

.hero-buttons {
    animation: fadeInUp 1.5s ease-out 1.2s both;
}

/* ボタンホバー効果 - PC用調整 */
.btn-primary, .btn-secondary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* PC用：光エフェクトを削除 */
@media (min-width: 769px) {
    .btn-primary::before,
    .btn-secondary::before {
        display: none; /* PC版では光効果を無効化 */
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: translateY(-2px); /* 軽微なホバー効果のみ */
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        transition: all 0.2s ease;
    }
}

/* モバイル用：光エフェクト維持 */
@media (max-width: 768px) {
    .btn-primary::before,
    .btn-secondary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s ease;
    }

    .btn-primary:hover::before,
    .btn-secondary:hover::before {
        left: 100%;
    }

    .btn-primary:hover,
    .btn-secondary:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }
}

/* ===== セクションアニメーション ===== */
.section-wrapper {
    animation: fadeInUp 1s ease-out both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-wrapper:nth-of-type(1) { animation-delay: 0.2s; }
.section-wrapper:nth-of-type(2) { animation-delay: 0.4s; }
.section-wrapper:nth-of-type(3) { animation-delay: 0.6s; }
.section-wrapper:nth-of-type(4) { animation-delay: 0.8s; }

.section-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* セクションタイトル */
.section-wrapper h2 {
    animation: fadeInLeft 1.2s ease-out both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-wrapper:nth-of-type(1) h2 { animation-delay: 0.4s; }
.section-wrapper:nth-of-type(2) h2 { animation-delay: 0.6s; }
.section-wrapper:nth-of-type(3) h2 { animation-delay: 0.8s; }
.section-wrapper:nth-of-type(4) h2 { animation-delay: 1.0s; }

/* ===== 画像アニメーション ===== */
img {
    animation: scaleIn 1.5s ease-out both;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ===== フロート効果 - 無効化 ===== */
.float-animation {
    /* animation: float 6s ease-in-out infinite; 揺れ効果を削除 */
}

.float-small {
    /* animation: floatSmall 4s ease-in-out infinite; 揺れ効果を削除 */
}

/* ===== カードホバー効果 ===== */
.card, .service-item, .feature-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.card:hover, .service-item:hover, .feature-item:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* ===== モバイル最適化アニメーション ===== */
@media (max-width: 768px) {
    /* モバイルでは軽量化 */
    * {
        transition: all 0.2s ease;
    }
    
    .hero-content {
        animation: fadeInUp 1.2s ease-out 0.3s both;
    }
    
    .section-wrapper:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    /* 浮遊効果をより軽く - 無効化 */
    .float-animation {
        /* animation: floatSmall 8s ease-in-out infinite; 揺れ効果を削除 */
    }
}

/* ===== パフォーマンス最適化 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 追加の柔らかい効果 ===== */

/* テキスト選択時の柔らかい色 */
::selection {
    background: rgba(185, 156, 80, 0.3);
    color: inherit;
}

/* スクロールバーの柔らかいスタイル */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* ===== ローディングアニメーション ===== */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes loading2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* 高級感のある浮遊アニメーション */
@keyframes luxuryFloat {
    0%, 100% {
        transform: perspective(1000px) rotateX(2deg) translateY(0px);
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.6),
            0 12px 24px rgba(0, 0, 0, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.1),
            inset 0 -1px 2px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: perspective(1000px) rotateX(2deg) translateY(-8px);
        box-shadow: 
            0 35px 70px rgba(0, 0, 0, 0.7),
            0 18px 36px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(255, 255, 255, 0.15),
            inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    }
}
