/*
Theme Name: New NCW Portfolio
Theme URI: https://nabejun-coding-works.com
Author: Nabejun
Author URI: https://nabejun-coding-works.com
Description: モダンなポートフォリオサイト用テーマ
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: new-ncw
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    /* 横スクロールを完全に防ぐ */
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* 横スクロールを防ぐ */
    overflow-y: hidden;
    width: 100%;
    /* bodyも100%に */
}

#page {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* pageコンテナも横スクロールを防ぐ */
}

/* HOMEボタン（1）選択時はスクロール無効（メインビジュアルには適用しない） */

/* 他のボタン（2,3,4）選択時はスクロール有効 */
body:has(.cr-container input.cr-selector-img-2:checked),
body:has(.cr-container input.cr-selector-img-3:checked),
body:has(.cr-container input.cr-selector-img-4:checked),
body:has(.cr-container input.cr-selector-img-5:checked) {
    overflow-y: auto;
}

/* Container - フルスクリーン */
/* CSS変数：実際の表示高さ（JavaScriptで設定） */
:root {
    --vh: 1vh;
    /* デフォルト値、JavaScriptで上書き */
}

.cr-container {
    width: 100vw;
    width: 100%;
    /* 横スクロールバーを防ぐため100%を使用 */
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    /* スマホのメニューバーを考慮した実際の高さ */
    position: relative;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    overflow-x: hidden;
    /* 横方向のはみ出しを防ぐ */
}

/* スライダーコンテナは常に実際の表示高さ */
.cr-container {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    /* スマホのメニューバーを考慮した実際の高さ */
    overflow-x: hidden;
    /* 横方向ははみ出さないように */
    overflow-y: hidden;
    /* 縦方向も基本は隠す */
    position: relative;
}

/* HOMEボタン選択時は高さを自動調整してメインビジュアルが見切れないように */
.cr-container:has(input.cr-selector-img-1:checked) {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    /* スマホでは画面いっぱいに固定 */
    overflow-x: hidden;
    /* 横方向ははみ出さないように */
    overflow-y: hidden;
    /* スクロールさせない */
}

/* 下へスクロールボタン */
.scroll-down-btn {
    position: absolute;
    bottom: 100px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0));
    /* iPhoneのホームバーを考慮して配置 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.scroll-down-btn:hover {
    transform: translateX(-50%) scale(1.1);
}

.scroll-down-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.scroll-down-btn span {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* HOMEボタン選択時は非表示 */
.cr-container:has(input.cr-selector-img-1:checked) .scroll-down-btn {
    display: none;
}

/* 他のボタン選択時は表示 */
.cr-container:has(input.cr-selector-img-2:checked) .scroll-down-btn,
.cr-container:has(input.cr-selector-img-3:checked) .scroll-down-btn,
.cr-container:has(input.cr-selector-img-4:checked) .scroll-down-btn,
.cr-container:has(input.cr-selector-img-5:checked) .scroll-down-btn {
    display: flex;
}

/* バウンスアニメーション */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* 上へ戻るボタン */
.scroll-up-btn {
    position: fixed;
    bottom: 40px;
    bottom: calc(40px + env(safe-area-inset-bottom, 0));
    /* iPhoneのホームバーを考慮 */
    left: 50%;
    transform: translateX(-50%);
    /* 左右中央に配置 */
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(104, 171, 195, 0.2);
    border: 2px solid rgba(104, 171, 195, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.scroll-up-btn:hover {
    background: rgba(104, 171, 195, 0.4);
    transform: translateX(-50%) scale(1.1);
    /* 中央配置を維持しながら拡大 */
}

.scroll-up-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transform: rotate(180deg);
    /* 矢印を上向きに */
}

.scroll-up-btn span {
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* HOMEボタン選択時は非表示 */
.scroll-up-btn.hidden {
    display: none;
}

/* 上へバウンスアニメーション */
@keyframes bounceUp {

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

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* スクロール可能なコンテンツセクション */
.content-sections {
    width: 100%;
    background: #1a1a1a;
    position: relative;
    z-index: 1;
}

.content-section {
    display: none;
    min-height: 100vh;
    padding: 100px 5% 120px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* HOMEボタン選択時はコンテンツセクション非表示 */
body:has(.cr-container input.cr-selector-img-1:checked) .content-sections {
    display: none;
}

/* 各ボタンが選択されたときに対応するセクションを表示 */
body:has(.cr-container input.cr-selector-img-2:checked) .content-sections {
    display: block;
}

body:has(.cr-container input.cr-selector-img-2:checked) .content-sections #profile {
    display: flex;
}

body:has(.cr-container input.cr-selector-img-3:checked) .content-sections {
    display: block;
}

body:has(.cr-container input.cr-selector-img-3:checked) .content-sections #skill {
    display: flex;
}

body:has(.cr-container input.cr-selector-img-4:checked) .content-sections {
    display: block;
}

body:has(.cr-container input.cr-selector-img-4:checked) .content-sections #works {
    display: flex;
}

body:has(.cr-container input.cr-selector-img-5:checked) .content-sections {
    display: block;
}

body:has(.cr-container input.cr-selector-img-5:checked) .content-sections #contact {
    display: flex;
}

/* コンテンツセクションのタイトルは不要なので削除 */

.content-section .section-content {
    max-width: 1200px;
    width: 100%;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.content-section .section-content p {
    margin-bottom: 20px;
}

/* プロフィールセクション */
#profile {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* スキルセクション */
#skill {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a3a 100%);
}

/* ワークスセクション */
#works {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

/* コンタクトセクション */
#contact {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* コンテンツセクション内の左右ナビゲーション矢印 */
.content-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-nav-arrow:hover {
    background: rgba(104, 171, 195, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 20px rgba(104, 171, 195, 0.5);
}

.content-nav-arrow-left {
    left: 30px;
}

.content-nav-arrow-right {
    right: 30px;
}

.content-nav-arrow svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* メインビジュアルタイトル */
.mv__title--wrap {
    position: absolute;
    top: 37%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
    width: 90%;
    max-width: 1200px;
    pointer-events: none;
}

/* 他のメニュー（2,3,4,5）がチェックされた時にメインビジュアルを非表示 */
.cr-container input.cr-selector-img-2:checked~.mv__title--wrap,
.cr-container input.cr-selector-img-3:checked~.mv__title--wrap,
.cr-container input.cr-selector-img-4:checked~.mv__title--wrap,
.cr-container input.cr-selector-img-5:checked~.mv__title--wrap,
.cr-container input.cr-selector-img-2:checked~.mv__description--wrap,
.cr-container input.cr-selector-img-3:checked~.mv__description--wrap,
.cr-container input.cr-selector-img-4:checked~.mv__description--wrap,
.cr-container input.cr-selector-img-5:checked~.mv__description--wrap {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.cr-container input.cr-selector-img-2:checked~.mv__title--wrap *,
.cr-container input.cr-selector-img-3:checked~.mv__title--wrap *,
.cr-container input.cr-selector-img-4:checked~.mv__title--wrap *,
.cr-container input.cr-selector-img-5:checked~.mv__title--wrap *,
.cr-container input.cr-selector-img-2:checked~.mv__description--wrap *,
.cr-container input.cr-selector-img-3:checked~.mv__description--wrap *,
.cr-container input.cr-selector-img-4:checked~.mv__description--wrap *,
.cr-container input.cr-selector-img-5:checked~.mv__description--wrap * {
    animation: none !important;
}

.mv__title {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: clamp(60px, 10vw, 150px);
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.1em;
    line-height: 1;
    margin: 0;
    opacity: 0;
    transform: translateY(30px);
}

/* タイピングアニメーション - フェーズ1（最初のタイピング） */
.mv__title--1 {
    animation:
        fadeInUp 0.5s ease-out 0.5s forwards,
        typing 1.5s steps(8) 0.5s forwards,
        titleFadeOut 0.8s ease-out 5s forwards;
    border-right: 3px solid #fff;
    white-space: nowrap;
    overflow: hidden;
    width: fit-content;
    margin: 0 auto;
}

.mv__title--2 {
    animation:
        fadeInUp 0.5s ease-out 2s forwards,
        typing 1.5s steps(7) 2s forwards,
        titleFadeOut 0.8s ease-out 5s forwards;
    border-right: 3px solid #fff;
    white-space: nowrap;
    overflow: hidden;
    width: fit-content;
    margin: 10px auto 0;
}

.mv__title--3 {
    animation:
        fadeInUp 0.5s ease-out 3.5s forwards,
        typing 1.5s steps(6) 3.5s forwards,
        titleFadeOut 0.8s ease-out 5s forwards;
    border-right: 3px solid #fff;
    white-space: nowrap;
    overflow: hidden;
    width: fit-content;
    margin: 10px auto 0;
}

/* タイトルフェードアウトアニメーション */
@keyframes titleFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* タイトル再登場アニメーション - フェーズ3 */
.mv__title--1,
.mv__title--2,
.mv__title--1 {
    animation:
        fadeInUp 0.5s ease-out 0.5s forwards,
        typing 1.5s steps(8) 0.5s forwards,
        titleFadeOut 0.8s ease-out 5s forwards,
        titleReappear 1s ease-out 14.7s forwards;
}

.mv__title--2 {
    animation:
        fadeInUp 0.5s ease-out 2s forwards,
        typing 1.5s steps(7) 2s forwards,
        titleFadeOut 0.8s ease-out 5s forwards,
        titleReappear 1s ease-out 14.9s forwards;
    margin-top: 5px;
}

.mv__title--3 {
    animation:
        fadeInUp 0.5s ease-out 3.5s forwards,
        typing 1.5s steps(6) 3.5s forwards,
        titleFadeOut 0.8s ease-out 5s forwards,
        titleReappear 1s ease-out 15.1s forwards;
    margin-top: 5px;
}

/* タイトル再登場 - top 35%の位置で表示 */
@keyframes titleReappear {
    0% {
        opacity: 0;
        transform: translateY(-30px);
        border-right: none;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        border-right: none;
    }
}

/* フェードインアップアニメーション */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* タイピングアニメーション */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* 説明文ラッパー */
.mv__description--wrap {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    margin-top: 0;
    z-index: 100;
    text-align: center;
    pointer-events: none;
}

/* PC版とスマホ版の表示切り替え */
.mv__description-pc {
    display: block;
}

.mv__description-sp {
    display: none;
}

/* 説明文 - タイピングアニメーション（フェーズ2） */
.mv__description {
    font-size: clamp(14px, 2vw, 18px);
    color: #fff;
    text-shadow:
        0 0 15px rgba(0, 0, 0, 0.95),
        0 2px 8px rgba(0, 0, 0, 0.9);
    line-height: 1.8;
    margin: 5px auto 0;
    opacity: 0;
    font-weight: 300;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    width: fit-content;
}

/* 説明文1行目 */
/* PC版の説明文1行目 */
.mv__description-pc .mv__description--1 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 6s forwards,
        descriptionTyping1 2.5s steps(30) 6s forwards,
        removeBorder 0.1s linear 8.5s forwards,
        descriptionMoveDown 1s ease-out 12s forwards;
}

/* PC版の説明文2行目 */
.mv__description-pc .mv__description--2 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 8.5s forwards,
        descriptionTyping2 3s steps(35) 8.5s forwards,
        removeBorder 0.1s linear 11.5s forwards,
        descriptionMoveDown 1s ease-out 12s forwards;
}

/* スマホ版の説明文1行目 */
.mv__description-sp .mv__description--1 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 6s forwards,
        descriptionTyping1 1.5s steps(30) 6s forwards,
        removeBorder 0.1s linear 7.5s forwards,
        descriptionMoveDown 1s ease-out 13.5s forwards;
}

/* スマホ版の説明文2行目 */
.mv__description-sp .mv__description--2 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 7.5s forwards,
        descriptionTyping2 2s steps(35) 7.5s forwards,
        removeBorder 0.1s linear 9.5s forwards,
        descriptionMoveDown 1s ease-out 13.5s forwards;
}

/* スマホ版の説明文3行目 */
.mv__description-sp .mv__description--3 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 9.5s forwards,
        descriptionTyping3 1.2s steps(20) 9.5s forwards,
        removeBorder 0.1s linear 10.7s forwards,
        descriptionMoveDown 1s ease-out 13.5s forwards;
}

/* スマホ版の説明文4行目 */
.mv__description-sp .mv__description--4 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 10.7s forwards,
        descriptionTyping4 1.5s steps(20) 10.7s forwards,
        removeBorder 0.1s linear 12.2s forwards,
        descriptionMoveDown 1s ease-out 13.5s forwards;
}

/* スマホ版の説明文5行目 */
.mv__description-sp .mv__description--5 {
    border-right: 3px solid #fff;
    animation:
        fadeInUp 0.5s ease-out 12.2s forwards,
        descriptionTyping5 1s steps(15) 12.2s forwards,
        removeBorder 0.1s linear 13.2s forwards,
        descriptionMoveDown 1s ease-out 13.5s forwards;
}

/* 説明文タイピングアニメーション1行目 */
@keyframes descriptionTyping1 {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* 説明文タイピングアニメーション2行目 */
@keyframes descriptionTyping2 {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* 説明文3行目のタイピングアニメーション（スマホ版） */
@keyframes descriptionTyping3 {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* 説明文4行目のタイピングアニメーション（スマホ版） */
@keyframes descriptionTyping4 {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* 説明文5行目のタイピングアニメーション（スマホ版） */
@keyframes descriptionTyping5 {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* カーソル（border）を削除 */
@keyframes removeBorder {
    to {
        border-right: none;
    }
}

/* 説明文が下に移動 - WORKSの下の位置へ */
@keyframes descriptionMoveDown {
    0% {
        transform: translateY(0);
        border-right: 3px solid #fff;
        opacity: 1;
    }

    50% {
        border-right: none;
    }

    100% {
        transform: translateY(42vh);
        border-right: none;
        opacity: 1;
    }
}

/* Labels - メニューボタン */
.cr-container label {
    font-style: normal;
    width: 20%;
    height: 80px;
    cursor: pointer;
    color: #fff;
    line-height: 80px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    float: left;
    position: absolute;
    bottom: 0;
    bottom: env(safe-area-inset-bottom, 0);
    /* iPhoneのホームバーを考慮 */
    z-index: 1000;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    /* 波紋アニメーションがボタンの領域から出ないように */
}

/* ヘッダーが上部に固定された時 */
body.header-fixed .cr-container label {
    position: fixed;
    top: 0;
    bottom: auto;
}

.cr-container label:hover {
    background: rgba(0, 0, 0, 0.85);
    border-top-color: rgba(104, 171, 195, 0.8);
}

.cr-container label.cr-label-img-1 {
    left: 0;
}

.cr-container label.cr-label-img-2 {
    left: 20%;
}

.cr-container label.cr-label-img-3 {
    left: 40%;
}

.cr-container label.cr-label-img-4 {
    left: 60%;
}

.cr-container label.cr-label-img-5 {
    left: 80%;
}

.cr-container label:before {
    content: '';
    width: 100%;
    height: 3px;
    background: rgba(104, 171, 195, 0);
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
}

/* ヘッダーが上部に固定された時、アクティブボーダーを下部に */
body.header-fixed .cr-container label:before {
    top: auto;
    bottom: 0;
}

.cr-container label:after {
    width: 1px;
    height: 100%;
    content: '';
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 0;
    right: 0;
}

.cr-container label.cr-label-img-5:after {
    width: 0;
}

.cr-container input.cr-selector-img-1:checked~label.cr-label-img-1,
.cr-container input.cr-selector-img-2:checked~label.cr-label-img-2,
.cr-container input.cr-selector-img-3:checked~label.cr-label-img-3,
.cr-container input.cr-selector-img-4:checked~label.cr-label-img-4,
.cr-container input.cr-selector-img-5:checked~label.cr-label-img-5 {
    color: #68abc3;
    background: rgba(0, 0, 0, 0.9);
}

.cr-container input.cr-selector-img-1:checked~label.cr-label-img-1:before,
.cr-container input.cr-selector-img-2:checked~label.cr-label-img-2:before,
.cr-container input.cr-selector-img-3:checked~label.cr-label-img-3:before,
.cr-container input.cr-selector-img-4:checked~label.cr-label-img-4:before,
.cr-container input.cr-selector-img-5:checked~label.cr-label-img-5:before {
    background: rgba(104, 171, 195, 1);
}

/* Hide radio buttons */
.cr-container input {
    display: none;
}

/* ラベルテキストのラッパー */
.cr-container label .label-text {
    position: relative;
    display: inline-block;
    z-index: 2;
}

/* アクティブでないボタンに波紋エフェクト */
.cr-container input:not(:checked)+label .label-text::before,
.cr-container input:not(:checked)+label .label-text::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 50px;
    border: 2px solid rgba(104, 171, 195, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: ripple 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 2つ目の波紋（遅延させて波が広がる感じに） */
.cr-container input:not(:checked)+label .label-text::after {
    animation-delay: 1s;
    border-color: rgba(104, 171, 195, 0.4);
}

/* アクティブなボタンの波紋は非表示 */
.cr-container input:checked+label .label-text::before,
.cr-container input:checked+label .label-text::after {
    display: none;
}

/* 波紋アニメーション（横長の楕円） */
@keyframes ripple {
    0% {
        width: 50px;
        height: 35px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        width: 120px;
        height: 85px;
        opacity: 0;
    }
}

/* Background images container */
.cr-bgimg {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    /* スマホのメニューバーを考慮した実際の高さ */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    background: #000;
}

.cr-bgimg div {
    width: 25%;
    height: 100%;
    position: relative;
    float: left;
    overflow: hidden;
}

.cr-bgimg div span {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    text-indent: -9000px;
    background-repeat: no-repeat;
    background-size: 400% 100%;
}

/* スライダー背景画像 - header.phpで動的に出力されます */

/* 各パネルで画像の異なる部分を表示（4分割） - デフォルト */
.cr-bgimg div:nth-child(1) span {
    background-position: 0% center;
}

.cr-bgimg div:nth-child(2) span {
    background-position: 33.333% center;
}

.cr-bgimg div:nth-child(3) span {
    background-position: 66.666% center;
}

.cr-bgimg div:nth-child(4) span {
    background-position: 100% center;
}

/* カバー表示モード: 各パネルに画像全体を表示 */
.display-cover .cr-bgimg div span {
    background-size: cover;
    background-position: center center;
}

/* Animations */
.cr-bgimg div span {
    opacity: 0;
    -webkit-transition: opacity 0.5s linear 0s;
    -moz-transition: opacity 0.5s linear 0s;
    -o-transition: opacity 0.5s linear 0s;
    -ms-transition: opacity 0.5s linear 0s;
    transition: opacity 0.5s linear 0s;
}

.cr-container input.cr-selector-img-1:checked~.cr-bgimg div span:nth-child(1),
.cr-container input.cr-selector-img-2:checked~.cr-bgimg div span:nth-child(2),
.cr-container input.cr-selector-img-3:checked~.cr-bgimg div span:nth-child(3),
.cr-container input.cr-selector-img-4:checked~.cr-bgimg div span:nth-child(4),
.cr-container input.cr-selector-img-5:checked~.cr-bgimg div span:nth-child(5) {
    opacity: 1;
    -webkit-animation: slideOut 0.6s ease-in-out 0s;
    -moz-animation: slideOut 0.6s ease-in-out 0s;
    -o-animation: slideOut 0.6s ease-in-out 0s;
    -ms-animation: slideOut 0.6s ease-in-out 0s;
    animation: slideOut 0.6s ease-in-out 0s;
}

@-webkit-keyframes slideOut {
    0% {
        left: -150px;
    }

    100% {
        left: 0px;
    }
}

@-moz-keyframes slideOut {
    0% {
        left: -150px;
    }

    100% {
        left: 0px;
    }
}

@-o-keyframes slideOut {
    0% {
        left: -150px;
    }

    100% {
        left: 0px;
    }
}

@-ms-keyframes slideOut {
    0% {
        left: -150px;
    }

    100% {
        left: 0px;
    }
}

@keyframes slideOut {
    0% {
        left: -25vw;
        opacity: 0.5;
    }

    100% {
        left: 0;
        opacity: 1;
    }
}

/* Titles */
.cr-titles {
    width: 100%;
    height: calc(100vh - 80px);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    text-align: center;
    pointer-events: none;
}

.cr-titles h3 {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    opacity: 0;
    -webkit-transition: opacity 0.8s ease-in-out 0s;
    -moz-transition: opacity 0.8s ease-in-out 0s;
    -o-transition: opacity 0.8s ease-in-out 0s;
    -ms-transition: opacity 0.8s ease-in-out 0s;
    transition: opacity 0.8s ease-in-out 0s;
    transform: translateY(-50%);
    padding: 0 20px;
}


.cr-titles h3 span:nth-child(1) {
    font-family: 'Arial Narrow', Arial, sans-serif;
    font-size: clamp(50px, 8vw, 120px);
    font-weight: 700;
    display: block;
    letter-spacing: 0.1em;
    text-shadow: 0px 0px 20px rgba(0, 0, 0, 0.5), 0px 0px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.cr-titles h3 span:nth-child(2) {
    letter-spacing: 0.05em;
    display: inline-block;
    font-size: clamp(16px, 2vw, 24px);
    padding: 15px 30px;
    font-style: italic;
    font-family: Cambria, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
    border-radius: 5px;
}

/* HOMEボタン選択時はタイトル非表示（メインビジュアルを表示） */
.cr-container input.cr-selector-img-1:checked~.cr-titles h3:nth-child(1) {
    opacity: 0;
}

/* 他のボタン選択時はタイトルを表示 */
.cr-container input.cr-selector-img-2:checked~.cr-titles h3:nth-child(2),
.cr-container input.cr-selector-img-3:checked~.cr-titles h3:nth-child(3),
.cr-container input.cr-selector-img-4:checked~.cr-titles h3:nth-child(4),
.cr-container input.cr-selector-img-5:checked~.cr-titles h3:nth-child(5) {
    opacity: 1;
}

/* コンテンツセクション - レスポンシブ */
@media screen and (max-width: 768px) {
    .content-section {
        padding: 80px 5% 100px;
        min-height: calc(100vh - 70px - env(safe-area-inset-bottom, 0));
        min-height: calc(var(--vh, 1vh) * 100 - 70px - env(safe-area-inset-bottom, 0));
        /* ヘッダー高さ + ホームバー分を引いた高さで統一 */
    }

    .content-section .section-content {
        font-size: clamp(14px, 3vw, 18px);
    }

    .content-nav-arrow {
        width: 50px;
        height: 50px;
        top: auto;
        bottom: 30px;
        /* 一番下に配置 */
        transform: translateY(0);
    }

    .content-nav-arrow:hover {
        transform: translateY(0) scale(1.1);
    }

    .content-nav-arrow-left {
        left: 15px;
    }

    .content-nav-arrow-right {
        right: 15px;
    }

    .content-nav-arrow svg {
        width: 20px;
        height: 20px;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {

    /* スマホ表示：750×1200の画像をフルサイズで表示（オーバーフローなし） */
    .cr-bgimg {
        width: 100%;
        /* 画面幅に合わせる */
    }

    .cr-bgimg div {
        width: 25%;
        /* 通常の4分割に戻す */
    }

    /* スマホ版画像（750×1200）の表示設定 */
    .cr-bgimg div span {
        background-size: 400% 100%;
        /* 4分割を維持 */
        background-position-y: center;
        /* 縦位置を中央に */
    }

    .cr-container label {
        font-size: 14px;
        letter-spacing: 1px;
        height: 70px;
        height: calc(70px + env(safe-area-inset-bottom, 0));
        /* ヘッダー高さ + iPhoneのホームバー分 */
        line-height: 70px;
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        /* ボタンのテキストがホームバーに被らないように */
    }

    .cr-titles h3 span:nth-child(1) {
        font-size: clamp(40px, 10vw, 80px);
    }

    .cr-titles h3 span:nth-child(2) {
        font-size: clamp(14px, 3vw, 18px);
        padding: 12px 20px;
    }

    /* メインビジュアル - タブレット */
    .mv__title {
        font-size: clamp(50px, 8vw, 100px);
    }

    .mv__description--wrap {
        width: 95%;
    }

    .mv__description {
        font-size: clamp(13px, 2.5vw, 16px);
    }
}

@media screen and (max-width: 480px) {

    /* スマホ表示：750×1200の画像をフルサイズで表示（オーバーフローなし） */
    .cr-bgimg {
        width: 100%;
        /* 画面幅に合わせる */
    }

    .cr-bgimg div {
        width: 25%;
        /* 通常の4分割に戻す */
    }

    /* スマホ版画像（750×1200）の表示設定 */
    .cr-bgimg div span {
        background-size: 400% 100%;
        /* 4分割を維持 */
        background-position-y: center;
        /* 縦位置を中央に */
    }

    .cr-container label {
        font-size: 12px;
        height: 60px;
        height: calc(60px + env(safe-area-inset-bottom, 0));
        /* ヘッダー高さ + iPhoneのホームバー分 */
        line-height: 60px;
        letter-spacing: 0.5px;
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        /* ボタンのテキストがホームバーに被らないように */
    }

    .cr-titles h3 {
        padding: 0 15px;
    }

    /* コンテンツセクションの高さを統一 */
    .content-section {
        min-height: calc(100vh - 60px - env(safe-area-inset-bottom, 0));
        min-height: calc(var(--vh, 1vh) * 100 - 60px - env(safe-area-inset-bottom, 0));
        /* ヘッダー高さ + ホームバー分を引いた高さで統一 */
    }

    /* 左右矢印を小さく、一番下に配置 */
    .content-nav-arrow {
        width: 45px;
        height: 45px;
        top: auto;
        bottom: 25px;
        transform: translateY(0);
    }

    .content-nav-arrow:hover {
        transform: translateY(0) scale(1.1);
    }

    .content-nav-arrow-left {
        left: 10px;
    }

    .content-nav-arrow-right {
        right: 10px;
    }

    .content-nav-arrow svg {
        width: 18px;
        height: 18px;
    }

    /* メインビジュアル - モバイル */
    .mv__title--wrap {
        width: 95%;
    }

    .mv__title {
        font-size: clamp(40px, 12vw, 70px);
        letter-spacing: 0.05em;
        line-height: 1.1;
        /* 行間を少し開ける */
    }

    .mv__title--2,
    .mv__title--3 {
        margin-top: 8px;
        /* タイトル間の間隔も少し広げる */
    }

    /* タイトル再登場時の位置調整（モバイル） - top 45%の位置へ */
    @keyframes titleReappear {
        0% {
            opacity: 0;
            transform: translateY(-30px);
            border-right: none;
        }

        100% {
            opacity: 1;
            transform: translateY(-5vh);
            border-right: none;
        }
    }

    /* スマホ版：HOMEページのコンテナを画面いっぱいに固定 */
    .cr-container:has(input.cr-selector-img-1:checked) {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        /* 画面いっぱいに固定（スクロールさせない） */
        min-height: calc(var(--vh, 1vh) * 100);
        overflow-y: hidden;
        /* 縦スクロール無効 */
    }

    .mv__description--wrap {
        width: 98%;
        max-width: 100%;
        top: 35%;
        /* 初期位置を少し上に */
    }

    /* スマホ版では改行の多いバージョンを表示 */
    .mv__description-pc {
        display: none;
    }

    .mv__description-sp {
        display: block;
    }

    .mv__description {
        font-size: 13px;
        /* フォントサイズを大きく */
        line-height: 1.8;
        /* 行間も少し広げる */
        white-space: nowrap;
        /* タイピングアニメーションのために必須 */
        overflow: hidden;
        /* タイピングアニメーションのために必須 */
        text-align: center;
    }

    /* モバイルでは説明文を短縮表示 */
    .mv__description--1,
    .mv__description--2,
    .mv__description--3,
    .mv__description--4,
    .mv__description--5 {
        white-space: nowrap;
        /* タイピングアニメーションのために必須 */
        overflow: hidden;
        /* タイピングアニメーションのために必須 */
        width: fit-content;
        max-width: 95%;
        /* 画面からはみ出さないように */
        margin: 5px auto 0;
        /* 中央配置、間隔を少し広げる */
    }

    /* スマホ版：説明文が下に移動するアニメーション（画面から切れないように調整） */
    @keyframes descriptionMoveDown {
        0% {
            transform: translateY(0);
            border-right: 3px solid #fff;
            opacity: 1;
        }

        50% {
            border-right: none;
        }

        100% {
            transform: translateY(calc(18vh + 20px));
            /* スマホ版では移動距離を短く + 20px下げる */
            border-right: none;
            opacity: 1;
        }
    }
    
    /* 上へ戻るボタン（スマホ版） */
    .scroll-up-btn {
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0));
        left: 50%;
        transform: translateX(-50%);
        /* 左右中央を維持 */
        width: 50px;
        height: 50px;
        padding: 8px;
    }
    
    .scroll-up-btn:hover {
        transform: translateX(-50%) scale(1.1);
        /* 中央配置を維持しながら拡大 */
    }
    
    .scroll-up-btn svg {
        width: 25px;
        height: 25px;
    }
    
    .scroll-up-btn span {
        font-size: 9px;
    }
}

/* reCAPTCHAバッジの非表示 */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}