/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* AOS風のアニメーション */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* 会社概要テーブル特有のアニメーション */
.company-table[data-aos="fade-up"] {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.company-table[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

/* お問い合わせセクション特有のアニメーション */
.contact-intro[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-intro[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

.contact-form[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0.2s;
}

.contact-form[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ヘッダーのスクロールアニメーション */
.site-header.scrolled {
    background-color: rgba(73, 73, 73, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ローディングアニメーション */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f8f8;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Panwyzロゴコンテナ */
.loading-content {
    position: relative;
}

/* メインのPanwyzテキスト */
.loading-text {
    font-size: 72px;
    font-weight: 100;
    letter-spacing: -1px !important;
    color: #666666 !important;
    position: relative;
    display: inline-block;
    transform: scaleY(0.85); 
}

/* 文字を個別にアニメーション */
.loading-text span {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(90deg);
    animation: 
        letterFlip 0.6s ease forwards,
        letterFlipOut 0.4s ease 1.5s forwards; /* 1.5秒後に消えるアニメーション開始 */
}

/* アニメーションにもプレフィックス追加 */
@-webkit-keyframes letterFlip {
    0% {
        opacity: 0;
        -webkit-transform: translateY(50px) rotateX(90deg) scaleY(0.8);
        transform: translateY(50px) rotateX(90deg) scaleY(0.8);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0) rotateX(0deg) scaleY(0.8);
        transform: translateY(0) rotateX(0deg) scaleY(0.8);
    }
}

/* 表示タイミング */
.loading-text span:nth-child(1) { 
    animation-delay: 0.1s, 1.9s; /* P: 最後に消える */
}
.loading-text span:nth-child(2) { 
    animation-delay: 0.2s, 1.8s; /* a */
}
.loading-text span:nth-child(3) { 
    animation-delay: 0.3s, 1.7s; /* n */
}
.loading-text span:nth-child(4) { 
    animation-delay: 0.4s, 1.6s; /* w */
}
.loading-text span:nth-child(5) { 
    animation-delay: 0.5s, 1.5s; /* y */
}
.loading-text span:nth-child(6) { 
    animation-delay: 0.6s, 1.4s; /* z: 最初に消える */
}

/* 文字が3D回転しながら現れる */
@keyframes letterFlip {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(90deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* 文字が逆回転しながら消える */
@keyframes letterFlipOut {
    0% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) rotateX(-90deg);
    }
}

/* アンダーラインアニメーション */
.loading-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #666666, #888888);
    animation: 
        underlineExpand 0.8s ease 0.8s forwards,
        underlineCollapse 0.3s ease 1.9s forwards;
}

/* アンダーラインが伸びる */
@keyframes underlineExpand {
    0% {
        width: 0;
        left: 50%;
    }
    100% {
        width: 100%;
        left: 0;
    }
    
}
/* アンダーラインが縮む */
@keyframes underlineCollapse {
    0% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 50%;
    }
}

/* パルスエフェクト */
.loading-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 102, 102, 0.15), transparent);
    animation: pulse 2s ease infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ホバーエフェクト */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* パララックス効果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}