/* ============================================================
   KV SECTION v2
   ・背景スライダー：クロスフェード ＋ ケンバーンズ（15秒）
   ・テキスト：文字マスクリビール（clip-path）
   ============================================================ */

/* ---- セクション本体 ---- */
.kv-section {
    position: relative;
    width: 100%;
    height: 100svh;
    min-height: 560px;
    max-height: 1080px;
    overflow: hidden;
    background: #0F1A38; /* 読み込み中の背景色 */
}

/* ============================================================
   背景スライダーレイヤー
   ============================================================ */
.kv-bg-slider {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* 各スライドアイテム */
.kv-bg-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.45, 0, 0.55, 1);
    will-change: opacity;
}

.kv-bg-item.is-active {
    opacity: 1;
}

/* 画像コンテナ（ケンバーンズ適用先） */
.kv-bg-item__image {
    position: absolute;
    inset: -5%; /* ケンバーンズでハミ出ないようにマージン */
    background-size: cover;
    background-position: center;
    will-change: transform;
}

/* ---- ケンバーンズ：ズームイン ---- */
.kb-zoom-in {
    animation: kenburnsIn 16s ease-out forwards;
}

/* ---- ケンバーンズ：ズームアウト ---- */
.kb-zoom-out {
    animation: kenburnsOut 16s ease-out forwards;
}

@keyframes kenburnsIn {
    0%   { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1%, -1%); }
}

@keyframes kenburnsOut {
    0%   { transform: scale(1.12) translate(1%, 1%); }
    100% { transform: scale(1.0)  translate(0, 0); }
}

/* ---- YouTube 背景動画 ---- */
.kv-bg-item__video {
    position: absolute;
    inset: -15%;
    pointer-events: none;
}

.kv-bg-item__video iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- スライドオーバーレイ ---- */
.kv-bg-item__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to right,
            rgba(11, 19, 43, 0.72) 0%,
            rgba(11, 19, 43, 0.45) 50%,
            rgba(11, 19, 43, 0.25) 100%
        ),
        linear-gradient(
            to top,
            rgba(11, 19, 43, 0.60) 0%,
            transparent 40%
        );
    z-index: 1;
}

/* ---- スライドカウンター ---- */
.kv-counter {
    position: absolute;
    right: 2rem;
    bottom: 5rem;
    z-index: 10;
    display: flex;
    align-items: baseline;
    gap: .4rem;
    color: rgba(255,255,255,0.6);
}

.kv-counter__current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1;
}

.kv-counter__sep {
    font-size: .75rem;
}

.kv-counter__total {
    font-size: .875rem;
}

/* ---- プログレスバー ---- */
.kv-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 10;
}

.kv-progress__bar {
    height: 100%;
    background: linear-gradient(to right, var(--color-orange), var(--color-gold));
    width: 0%;
    transform-origin: left;
}

/* ---- ナビゲーション矢印 ---- */
.kv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
    backdrop-filter: blur(4px);
}

.kv-nav:hover {
    background: rgba(232,114,26,0.7);
    border-color: var(--color-orange);
    transform: translateY(-50%) scale(1.08);
}

.kv-nav--prev { left: 1.5rem; }
.kv-nav--next { right: 1.5rem; }


/* ============================================================
   前面テキストレイヤー
   ============================================================ */
.kv-catchcopy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    z-index: 10;
    padding-top: 0;
}

.kv-catchcopy__inner {
    max-width: 760px;
}

/* ---- EN ラベル ---- */
.kv-catchcopy__en {
    font-size: clamp(.65rem, 1.2vw, .8rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-orange-light);
    margin-bottom: var(--space-4);
    overflow: hidden;
}

/* ---- メインコピー ---- */
.kv-catchcopy__main {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.5vw, 4rem);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.3;
    margin-bottom: var(--space-6);
    text-shadow: 0 4px 32px rgba(0,0,0,0.25);
}

.kv-text-row {
    display: block;
    overflow: hidden;
}

.kv-catchcopy__accent {
    color: var(--color-orange-light);
}

/* ---- サブコピー ---- */
.kv-catchcopy__sub {
    font-size: var(--fs-lg);
    color: rgba(255,255,255,0.85);
    line-height: 1.8;
    margin-bottom: var(--space-10);
    overflow: hidden;
}

/* ---- CTAボタン ---- */
.kv-catchcopy__actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ============================================================
   テキストアニメーション
   ============================================================ */

/* -- 1文字ずつのマスクリビール -- */
.kv-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(60%) rotateX(-45deg);
    animation: charReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
    transform-origin: bottom center;
    /* 各文字の perspectiveのため親に perspective を */
}

.kv-catchcopy__main {
    perspective: 600px;
}

@keyframes charReveal {
    0% {
        opacity: 0;
        transform: translateY(60%) rotateX(-45deg);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* -- ライン単位のスライドイン -- */
.kv-line-reveal {
    display: block;
    opacity: 0;
    transform: translateX(-24px);
    animation: lineReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

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

/* -- CTAボタン フェードアップ -- */
.kv-btn-reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: btnReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

@keyframes btnReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   スクロールインジケーター
   ============================================================ */
.kv-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1s 3s ease both;
}

.kv-scroll-indicator__text {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: rgba(255,255,255,0.55);
}

.kv-scroll-indicator__line {
    display: block;
    width: 1px;
    height: 44px;
    overflow: hidden;
    position: relative;
}

.kv-scroll-indicator__line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.7), transparent);
    animation: scrollDrop 1.8s ease-in-out infinite;
}

@keyframes scrollDrop {
    0%   { transform: translateY(-100%); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* ============================================================
   アクセシビリティ：モーション低減
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .kv-char,
    .kv-line-reveal,
    .kv-btn-reveal {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .kb-zoom-in,
    .kb-zoom-out {
        animation: none !important;
    }

    .kv-progress__bar {
        transition: none !important;
    }
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 768px) {
    .kv-catchcopy__main {
        font-size: clamp(1.75rem, 7.5vw, 2.75rem);
    }

    .kv-catchcopy__sub {
        font-size: var(--fs-base);
    }

    .kv-catchcopy__actions {
        flex-direction: column;
    }

    .kv-catchcopy__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .kv-nav--prev { left: .75rem; }
    .kv-nav--next { right: .75rem; }

    .kv-counter { display: none; }

    .kv-scroll-indicator { bottom: 1.5rem; }
}
