/* =========================================================
   1. BASE STYLES & TRAP MODE (スクロールロックと背景)
   ========================================================= */
body {
    background-color: #ffffff;
    color: #333333;
}

/* トラップ発動時：メインページのスクロールを完全に禁止する */
body.is-dark {
    overflow: hidden;
    cursor: crosshair;
}

/* 異常空間のCRTスキャンライン・エフェクト */
body.is-dark::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
}

/* =========================================================
   2. ESCAPE BUTTON (左上の←マーク)
   ========================================================= */
.escape-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    color: #d30000;
    cursor: pointer;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease, transform 0.3s ease;
    text-shadow: 0 0 10px rgba(211, 0, 0, 0.5);
}

.escape-btn:hover {
    transform: translateX(-10px);
    /* ホバー時に少し左に動く */
}

/* トラップ発動時にフェードイン */
body.is-dark .escape-btn {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   3. ARG SECTION STYLES (共通の骨格・タイポグラフィ)
   ========================================================= */
.section {
    padding: 100px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 4rem;
}

.sticky-left {
    position: sticky;
    top: 120px;
    height: fit-content;
}

/* インデックス */
.index {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: #999;
    letter-spacing: 0.1em;
    position: relative;
    padding-left: 1.5rem;
}

.index::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background-color: #000;
}

body.is-dark .index {
    color: #444;
}

body.is-dark .index::before {
    background-color: #d30000;
    box-shadow: 0 0 8px #d30000;
}

/* 見出し・テキスト */
.section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #ffffff;
    letter-spacing: 0.05em;
}

body.is-dark .section-title {
    color: #ffffff;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

.section-lead {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: 4rem;
    color: #333;
}

body.is-dark .section-lead {
    color: #cccccc;
}

.statement-box {
    margin-bottom: 3rem;
    border-left: 3px solid #111;
    padding-left: 1.5rem;
}

body.is-dark .statement-box {
    border-left-color: #333;
}

.sub-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: #111;
}

body.is-dark .sub-label {
    color: #ffffff;
}

.mid-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

body.is-dark .mid-text {
    color: #999;
}

/* ハッシュタグ */
.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.work-tags span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    background-color: #f4f4f4;
    color: #555;
    border-radius: 2px;
    transition: background-color 0.3s, color 0.3s;
}

body.is-dark .work-tags span {
    background-color: #111;
    color: #555;
}

body.is-dark .work-tags span:hover {
    background-color: #d30000;
    color: #fff;
    cursor: default;
}

/* =========================================================
   4. BOUNDARY WARNING (境界への警告メッセージ)
   ========================================================= */
.boundary-warning-block {
    text-align: center;
    padding: 4rem 0 10rem;
    background-color: #ffffff;
    transition: opacity 0.3s ease;
}

body.is-dark .boundary-warning-block {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.warning-line {
    width: 40px;
    height: 1px;
    background-color: #111;
    margin: 0 auto 2rem;
}

.warning-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #111;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.warning-subtext {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.1em;
}

/* =========================================================
   5. THE VOID & RECRUITMENT SECTION (全画面トラップ)
   ========================================================= */
.boundary-void {
    height: 100vh;
    width: 100%;
}

/* 調査員募集を「画面全体を覆うレイヤー」に変更し、この中だけスクロール可能にする */
.recruitment-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #050505;
    /* 背景を完全に黒く塗りつぶす */
    z-index: 9000;
    overflow-y: auto;
    /* このセクション内部のみスクロール可能 */
    padding: 100px 5%;
    box-sizing: border-box;

    /* 初期状態は透明でクリック不可 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
    /* 不気味にフワッとフェードイン */
}

/* 暗転時（トラップ発動時）にフェードイン */
body.is-dark .recruitment-section {
    opacity: 1;
    pointer-events: auto;
}

/* 箇条書きリスト */
.requirement-list {
    list-style: none;
    padding: 0;
}

.requirement-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.requirement-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

body.is-dark .requirement-list li::before {
    color: #d30000;
}

/* status-msg のデザインを警告色に変更 */
.status-msg {
    font-family: 'Courier New', monospace;
    /* 無機質なフォントに変更 */
    font-size: 0.8rem;
    color: #d30000;
    /* 警告の赤 */
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
    border: 1px solid #d30000;
    padding: 10px;
    background: rgba(211, 0, 0, 0.05);
}

/* =========================================================
   6. UNSTABLE ENTRY BUTTON (狂ったボタン)
   ========================================================= */
.apply-action {
    margin-top: 4rem;
    text-align: left;
    padding-bottom: 100px;
    /* 下部余白 */
}

.apply-button {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #000;
    background-color: #fff;
    padding: 1rem 3rem;
    text-decoration: none;
    border: 1px solid #fff;
    position: relative;
}

body.is-dark .apply-button {
    cursor: cell;
}

body.is-dark .apply-button:hover {
    background-color: transparent;
    color: #fff;
    border-color: #d30000;
    animation: button-shake 0.2s infinite;
    box-shadow: inset 0 0 10px rgba(211, 0, 0, 0.5);
}

@keyframes button-shake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(-2px, 1px) rotate(-1deg);
    }

    50% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    75% {
        transform: translate(-1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* =========================================================
   7. HEADER HIDE EFFECTS
   ========================================================= */
body.is-dark .header {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
}

body:not(.is-dark) .header {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* アニメーション用クラス */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1023px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sticky-left {
        position: static;
        margin-bottom: 1rem;
    }

    .boundary-void {
        height: 70vh;
    }

    .escape-btn {
        font-size: 2rem;
        top: 15px;
        left: 15px;
    }
}

/* ====================== INVESTIGATION FILES - COMPLETE & CONFLICT-FREE ====================== */

/* ファイルグリッド */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
}

/* カード本体（競合解消） */
.file-card {
    background: #0a0a0a;
    border: 2px solid #222;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 480px;
    cursor: default;
    /* 全体クリックではなく部分クリックにする */
}

.file-card:hover {
    border-color: #d30000;
    transform: translateY(-12px);
    box-shadow: 0 0 30px rgba(211, 0, 0, 0.5);
}

/* カード上部フレーム（クリックでモーダル） */
.card-frame {
    flex: 1;
    position: relative;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.card-frame:hover {
    filter: brightness(1.08);
}

/* カード内要素 */
.file-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.file-status {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(211, 0, 0, 0.95);
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.73rem;
    padding: 5px 12px;
    letter-spacing: 1px;
    border: 1px solid #d30000;
    z-index: 2;
}

.file-title {
    font-size: 1.35rem;
    margin: 0 0 0.8rem 0;
    color: #fff;
    padding: 0 1.5rem;
}

.mid-text {
    padding: 0 1.5rem;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #aaa;
}

/* 解析開始ボタン */
.card-start-btn {
    display: block;
    margin: 0 1.2rem 1.2rem 1.2rem;
    padding: 0.9rem 1.5rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: #fff;
    background-color: transparent;
    border: 2px solid #d30000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.card-start-btn:hover {
    background-color: #d30000;
    color: #000;
    transform: translateY(-2px);
}

/* モーダル（提供されたものを強化） */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.97);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #111;
    border: 3px solid #d30000;
    max-width: 780px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 0 60px rgba(211, 0, 0, 0.6);
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.8rem;
    color: #d30000;
    cursor: pointer;
    z-index: 10001;
    padding: 8px 12px;
}

.close-btn:hover {
    color: #ff5555;
    background: rgba(211, 0, 0, 0.1);
}

.modal-image {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    margin-bottom: 1.8rem;
    border: 1px solid #333;
}

.modal-action {
    margin-top: 2rem;
    text-align: center;
}