/* ================================================
   Animations - アニメーション定義
   ================================================ */

/* ================================================
   Ken Burns Effect - 画像ズーム効果
   ================================================ */

.ken-burns {
    animation: kenBurns 20s ease-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* ================================================
   Fade In & Slide Up - Antigravity スクロール効果
   ================================================ */

.fade-in-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* 遅延アニメーション */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* ================================================
   Parallax - パララックス効果
   ================================================ */

.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 200%;
    object-fit: cover;
    z-index: -1;
    will-change: transform;
}

/* ================================================
   Vertical Text Animation - 縦書きアニメーション
   ================================================ */

.vertical-char {
    display: inline-block;
    opacity: 0;
    transform: translateX(-20px);
    animation: verticalCharFadeIn 0.6s ease forwards;
}

@keyframes verticalCharFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 文字ごとの遅延（JavaScriptで動的に設定） */
.vertical-char:nth-child(1) {
    animation-delay: 0.05s;
}

.vertical-char:nth-child(2) {
    animation-delay: 0.1s;
}

.vertical-char:nth-child(3) {
    animation-delay: 0.15s;
}

.vertical-char:nth-child(4) {
    animation-delay: 0.2s;
}

.vertical-char:nth-child(5) {
    animation-delay: 0.25s;
}

.vertical-char:nth-child(6) {
    animation-delay: 0.3s;
}

.vertical-char:nth-child(7) {
    animation-delay: 0.35s;
}

.vertical-char:nth-child(8) {
    animation-delay: 0.4s;
}

.vertical-char:nth-child(9) {
    animation-delay: 0.45s;
}

.vertical-char:nth-child(10) {
    animation-delay: 0.5s;
}

.vertical-char:nth-child(11) {
    animation-delay: 0.55s;
}

.vertical-char:nth-child(12) {
    animation-delay: 0.6s;
}

.vertical-char:nth-child(13) {
    animation-delay: 0.65s;
}

.vertical-char:nth-child(14) {
    animation-delay: 0.7s;
}

.vertical-char:nth-child(15) {
    animation-delay: 0.75s;
}

.vertical-char:nth-child(16) {
    animation-delay: 0.8s;
}

.vertical-char:nth-child(17) {
    animation-delay: 0.85s;
}

.vertical-char:nth-child(18) {
    animation-delay: 0.9s;
}

.vertical-char:nth-child(19) {
    animation-delay: 0.95s;
}

.vertical-char:nth-child(20) {
    animation-delay: 1s;
}

/* ================================================
   Hover Animations - ホバーアニメーション
   ================================================ */

.hover-scale {
    transition: transform var(--transition-base);
}

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

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ================================================
   Image Reveal - 画像表示アニメーション
   ================================================ */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    z-index: 1;
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.revealed::before {
    transform: scaleX(0);
    transform-origin: right;
}

.image-reveal img {
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 1s ease, transform 1s ease;
}

.image-reveal.revealed img {
    opacity: 1;
    transform: scale(1);
}

/* ================================================
   Stagger Animation - スタガーアニメーション
   ================================================ */

.stagger-item {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ================================================
   Loading Animation - ローディングアニメーション
   ================================================ */

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-logo {
    animation: logoFadeIn 2s ease forwards;
}

/* ================================================
   Page Transition - ページ遷移
   ================================================ */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-primary);
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active {
    transform: translateY(0);
}

/* ================================================
   Scroll Progress Bar - スクロール進捗バー
   ================================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
    z-index: var(--z-index-header);
    transition: width 0.1s ease;
}

/* ================================================
   Text Shimmer - テキストシマー効果
   ================================================ */

.text-shimmer {
    background: linear-gradient(90deg,
            var(--color-text) 0%,
            var(--color-secondary) 50%,
            var(--color-text) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ================================================
   Floating Animation - 浮遊アニメーション
   ================================================ */

.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ================================================
   Underline Animation - アンダーラインアニメーション
   ================================================ */

.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width var(--transition-base);
}

.animated-underline:hover::after,
.animated-underline.active::after {
    width: 100%;
}

/* ================================================
   Blur In - ぼかしフェードイン
   ================================================ */

.blur-in {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 1s ease, filter 1s ease;
}

.blur-in.visible {
    opacity: 1;
    filter: blur(0);
}

/* ================================================
   Rotate In - 回転フェードイン
   ================================================ */

.rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
    transition: opacity 1s ease, transform 1s ease;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ================================================
   Split Text Animation - 分割テキストアニメーション
   ================================================ */

.split-text {
    overflow: hidden;
}

.split-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}

.split-word.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}