@import url('https://fonts.googleapis.com/css2?family=Yuji+Syuku&display=swap');

body {
    font-family: 'Yuji Syuku', serif;
    margin: 0;
    padding: 0;
    background-color: #2a2a2a;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}

/* スクロール領域: 実際のスクロールを可能にするが、見た目はその場で変化 */
.scroll-container {
    position: relative;
    height: 300vh; /* スクロール量を確保（3倍の高さ） */
}

/* 動画コンテナ: 固定配置でその場に固定 */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
}

/* コンテンツオーバーレイ: 動画の上に重ねて表示 */
.content-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2;
    opacity: 0; /* 初期状態では非表示 */
    pointer-events: none; /* 初期状態ではクリック不可 */
    overflow-y: auto; /* 縦スクロールを有効化 */
}

/* 動画要素: フルスクリーン表示 */
.video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* アスペクト比を保ちながら画面を埋める */
    opacity: 1;
    transition: opacity 1s ease-in-out;
    filter: blur(0px) brightness(1);
    will-change: filter; /* パフォーマンス最適化 */
}

/* ループ動画は初期状態で非表示 */
#loop-video {
    opacity: 0;
}

header {
    background-color: #342C22;
    padding: 1.5rem 8rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 120px;
    border-bottom-right-radius: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.15rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.3s ease;
}

nav a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

nav a:hover::after {
    width: 100%;
}

nav a.active::after {
    width: 100%;
}

/* スクロール指示 */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    text-align: center;
    color: #000;
    font-size: 1.3rem;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-text {
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.scroll-arrow {
    font-size: 2.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

main {
    max-width: 1400px;
    margin: 6rem auto 3rem auto;
    padding: 3.5rem 8rem;
    background-color: rgba(230, 230, 230, 0.95);
    background-image: repeating-linear-gradient(
        transparent,
        transparent 3.5rem,
        rgba(180, 180, 180, 0.3) 3.5rem,
        rgba(180, 180, 180, 0.3) calc(3.5rem + 1px)
    );
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 50px rgba(0,0,0,0.4);
    border-radius: 2px;
    color: #2a2a2a;
    min-height: calc(100vh - 6rem);
}

.title {
    font-size: 3rem;
    text-align: left;
    margin-bottom: 5rem;
    padding-left: 3rem;
    color: #1a1a1a;
    font-weight: 500;
    letter-spacing: 0.15em;
    opacity: 0;
    transform: translateY(50px);
}

.text-content {
    margin-top: 3rem;
}

.content {
    font-size: 1.9rem;
    margin-bottom: 3.5rem;
    color: #2a2a2a;
    line-height: 3.5rem;
    text-align: left;
    font-weight: 400;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ランダムインデント（階段状配置） */
.indent-1 { padding-left: 2rem; }
.indent-2 { padding-left: 5rem; }
.indent-3 { padding-left: 8rem; }
.indent-4 { padding-left: 11rem; }
.indent-5 { padding-left: 3.5rem; }

/* 会話文のスタイル */
.dialogue {
    font-weight: 500;
    letter-spacing: 0.08em;
}

/* 心の声 */
.thought {
    font-style: italic;
    color: #4a4a4a;
}

/* 強調文 */
.emphasis {
    font-weight: 600;
    font-size: 2.1rem;
}

/* マーカー風ハイライト */
.highlight {
    background: linear-gradient(transparent 60%, rgba(255, 240, 100, 0.6) 60%);
    padding: 0.2em 0.3em;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* 太字テキスト */
.bold-text {
    font-weight: 700;
}

/* 章ナビゲーション */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(42, 42, 42, 0.2);
}

.nav-link {
    font-size: 1.5rem;
    color: #2a2a2a;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #2a2a2a;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #1a1a1a;
}

.nav-link:hover::after {
    width: 100%;
}
