@charset "UTF-8";

/* 全体設定 */
html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Noto Serif JP", serif;
    background-color: #fcfaf2; /* 眩しさを抑えた、温かみのある和の生成り色 */
    color: #3a3a3a; /* 少し柔らかい墨色 */
    overflow-x: hidden;
}

/* --- 親しみやすい「本の表紙をめくるような」オープニング --- */
.opening-door-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 999;
    pointer-events: none;
    display: flex;
}

.door {
    width: 50%;
    height: 100vh;
    background-color: #333333; /* 真っ黒から、少し温かみのある消炭色へ */
    position: absolute;
    top: 0;
    transition: transform 1.6s cubic-bezier(0.66, 0, 0.2, 1);
}

.door-left {
    left: 0;
    transform: translateX(0);
    border-right: 1px solid #444444;
}

.door-right {
    right: 0;
    transform: translateX(0);
    border-left: 1px solid #444444;
}

/* 扉の中央に優しく浮かぶオープニングタイトル */
.opening-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.4em;
    font-size: 36px;
    color: #fcfaf2;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* アニメーションの流れ */
body.start-title .opening-title {
    opacity: 1; /* まずタイトルがふんわり見える */
}
body.fade-title .opening-title {
    opacity: 0; /* タイトルが静かに消える */
    transition: opacity 0.6s ease;
}
body.loaded .door-left {
    transform: translateX(-100%); /* 扉がひらく */
}
body.loaded .door-right {
    transform: translateX(100%);
}


/* --- ミニマルメニューボタン（2本線） --- */
.menu-trigger {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 200;
    cursor: pointer;
    width: 28px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-trigger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #3a3a3a;
    transition: transform 0.4s ease, background-color 0.4s ease;
}

.menu-trigger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.menu-trigger.active span:nth-child(2) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* --- 全画面オーバーレイメニュー --- */
.smart-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(252, 250, 242, 0.98); /* 背景と統一 */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.smart-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.smart-menu-overlay ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    text-orientation: mixed;
    gap: 50px;
}

.smart-menu-overlay li a {
    color: #3a3a3a;
    text-decoration: none;
    font-size: 18px;
    letter-spacing: 0.3em;
    font-weight: 500;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.smart-menu-overlay li a:hover {
    opacity: 0.5;
}


/* 各セクション共通 */
.section {
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    position: relative;
}

.vertical-text {
    text-orientation: mixed;
    letter-spacing: 0.3em;
}

/* --- 1. タイトルセクション --- */
.title-section .vertical-text {
    font-size: 48px;
    font-weight: 500;
    color: #3a3a3a;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 1.2s ease 0.4s, transform 1.2s ease 0.4s;
}

body.loaded .title-section .vertical-text {
    opacity: 1;
    transform: scale(1);
}

/* --- 2. サイトについてセクション --- */
.about-section .about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    height: auto;
    padding: 0 30px;
    box-sizing: border-box;
}

.about-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.about-body {
    font-size: 16px;
    line-height: 2.4;
    width: 60%;
    max-width: 650px;
    margin: 0 auto;
}

.about-body p {
    margin: 0 0 20px;
}
.about-body p:last-child {
    margin-left: 0;
}

/* --- 3. 言葉の種類セクション --- */
.words-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-right: 10%;
}

.words-container {
    display: flex;
    flex-direction: column;
    gap: 35px;
    font-size: 22px;
    letter-spacing: 0.2em;
    white-space: nowrap;
    position: absolute;
    top: 50%;
    right: 20%;
    transform: translateY(-40%);
    z-index: 5;
}

.word-item {
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}
.word-item:hover, .word-item.active {
    color: #8a9a86; /* 個別ページの自然観に合わせた優しい和風の緑（苔色） */
    transform: translateY(-2px); /* 少し弾むような親しみやすさ */
}

/* 言葉の起源解説パネル（画面の中央寄りに固定） */
.explanation-panel {
    position: absolute;
    top: 50%;
    left: 40%; /* 右側の文字群（container）と被らない、美しく収まる中央の配置 */
    transform: translate(-50%, -50%); /* 縦横の基準点を真ん中に合わせる */
    width: 45%;
    height: 75%;
    background-color: #ffffff;
    border: 1px solid #e2dfd5; 
    border-radius: 32px; 
    box-shadow: 0 6px 24px rgba(160, 150, 130, 0.06); 
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: center; /* パネル内の要素を水平中央に */
    align-items: center;     /* パネル内の要素を垂直中央に */
    z-index: 10;
    
    /* 最初から常時表示にするため、位置移動アニメーションを排除して固定 */
    opacity: 1;
    visibility: visible;
}

/* 解説テキストの基本設定 */
.explanation-content {
    text-orientation: mixed;
    font-size: 16px;
    line-height: 2.2;
    letter-spacing: 0.15em;
    height: 80%;
    display: none;
    opacity: 0;
}

/* アクティブになったテキストが中央でふわっと出現 */
.explanation-content.active {
    display: flex;             /* flexに変更して内部の要素を並べる */
    flex-direction: column;    /* 縦書きの進行方向に合わせる */
    justify-content: center;   /* 縦書きの文章全体を左右中央に寄せる */
    opacity: 1;
    margin: 0 auto;            /* 箱自体を中央に固定 */
    animation: fadeInContent 0.5s ease forwards;
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.explanation-content h3 {
    font-size: 19px;
    margin: 0 0 0 30px; /* 左側（縦書きの次の行方向）への余白 */
    font-weight: 700;
    color: #556253; 
}

/* --- 4. 漢字セクション --- */
.kanji-section .kanji-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.kanji-link {
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.kanji-link:hover {
    opacity: 0.8;
    transform: scale(1.03); /* 漢字自体にも少しふんわりとした動きを */
}

.kanji-wrap {
    text-orientation: mixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.yomi {
    font-size: 18px;
    letter-spacing: 0.15em;
    color: #777777;
    margin-left: 15px;
}

.kanji {
    font-size: 110px;
    font-weight: 500;
    line-height: 1;
    margin: 10px 0;
    color: #2b2b2b;
}

.meaning {
    font-size: 20px;
    font-family: "Noto Serif", serif;
    color: #777777;
    letter-spacing: 0.05em;
    margin-top: 20px;
    text-align: center;
}

/* --- 5. フッターセクション --- */
.footer-section {
    height: 30px;
    background-color: #939393; /* 真っ黒から少しマイルドな墨色へ */
    scroll-snap-align: end;
}