@charset "UTF-8";

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    /* アニメーション中に不要なスクロールバーが出ないようにする */
    overflow: hidden; 
    background-color: #000;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* 古いブラウザ用のフォールバック */
    height: 100dvh; /* 最新スマホ用（メニューバー対応） */
    background-color: #ffffff; /* 白い背景に変更 */
    z-index: 9999; /* 最前面に配置 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.is-loaded {
    opacity: 0;
    visibility: hidden; /* フェードアウト後にクリックを邪魔しないようにする */
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loading-logo-ink-container {
    width: 80px; /* SVGが綺麗に見えるサイズ */
    height: auto;
    position: relative;
}

.loading-logo-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible; /* 上から落ちてくるしずくが見えるようにする */
}

/* 不要になったCSS Keyframesは削除しました（SMILへ移行したため） */

.loading-text {
    font-family: 'Kiwi Maru', serif;
    color: #333333; /* 背景が白のため、文字をダークグレーに変更 */
    font-size: 14px;
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    /* 全体のゆっくりした点滅に戻す */
    animation: blink 2.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.loading-text span {
    display: inline-block;
    /* 個別の文字がピョンと跳ねるバウンドアニメーション */
    animation: letterBounce 1.5s infinite;
}

@keyframes letterBounce {
    0% { 
        transform: translateY(0); 
        animation-timing-function: ease-out; /* 上がるときは徐々に遅く */
    }
    10% { 
        transform: translateY(-8px); 
        animation-timing-function: ease-in;  /* 落ちるときは徐々に速く */
    }
    20%, 100% { 
        transform: translateY(0); 
    }
}

/* Container */
.entrance-container {
    display: flex;
    width: 100vw;
    height: 100vh; /* 古いブラウザ用のフォールバック */
    height: 100dvh; /* ファーストビューの高さ（メニューバー対応） */
    flex-direction: row; /* PCは横並び */
    position: relative;
    /* ホバー時のパネル拡張をスムーズにするため */
    transition: all 0.4s ease;
}

/* Panel */
.entrance-panel {
    flex: 1;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    /* パネル展開・縮小時のアニメーションをなめらかにするため、top, left, width, height にも transition を追加 */
    /* ホバー時のジッター軽減のため、flexは少し短く・スッと止まる設定（ease-out）に変更 */
    transition: flex 0.4s ease-out,
                top 0.7s cubic-bezier(0.77, 0, 0.175, 1),
                left 0.7s cubic-bezier(0.77, 0, 0.175, 1),
                width 0.7s cubic-bezier(0.77, 0, 0.175, 1),
                height 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Hover Effect for Panels (Flexbox) */
@media (hover: hover) {
    /* 初回マウス操作までホバーイベントを無効化（ロード直後にマウスが乗っていて勝手に広がるのを防ぐ） */
    /* タッチデバイス（スマホ）では適用させず、1回目のタップでそのまま遷移できるように制御 */
    body.wait-for-mouse .entrance-panel {
        pointer-events: none !important;
    }

    .entrance-container:hover .entrance-panel {
        /* 他のパネルは少し縮む */
        flex: 0.85;
    }
    .entrance-container .entrance-panel:hover {
        /* ホバーされたパネルは広がる（中央の黄色パネルの基準値） */
        flex: 1.3;
    }
    
    /* 青とピンクの両端パネルは、広がった時の最大幅（広がり具合）を明確に抑える */
    .entrance-container #panel-page1:hover,
    .entrance-container #panel-page3:hover {
        flex: 1.0;
    }
}

/* Background Image */
.panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #2c3e50; /* Dummy Background Fallback */
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Background Zoom on Hover */
/* .entrance-panel:hover .panel-bg {
    transform: scale(1.08);
} */

/* Overlay to darken background slightly for better text readability */
.panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* 初期状態は原色を活かす */
    z-index: 2;
    transition: background-color 0.4s ease;
}
.entrance-panel:hover .panel-overlay {
    background-color: rgba(255, 255, 255, 0.1); /* ホバー時は少し白く光らせて反応を見せる */
}

/* Content */
.panel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: #fff;
    text-align: center;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    pointer-events: none; /* クリックイベントを妨害しない */
    width: 100%;
    padding: 0 20px;
}

.panel-content h2 {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
    transform: translateY(20px);
    opacity: 0.9;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.panel-content p {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.5s ease 0.1s, opacity 0.5s ease 0.1s;
}

.entrance-panel:hover .panel-content h2 {
    transform: translateY(0);
    opacity: 1;
}

.entrance-panel:hover .panel-content p {
    transform: translateY(0);
    opacity: 1;
}

/* Dummy Background Colors for Initial Setup */
#panel-page1 .panel-bg { background-color: #5CB4E4; } /* パネル1：ブルー（さらに少し薄め） */
#panel-page2 .panel-bg { background-color: #FBD13E; } /* パネル2：イエロー（さらにほんの少し薄め） */
#panel-page3 .panel-bg { background-color: #F093AC; } /* パネル3：ピンク（さらに少し薄め） */

/* 
 * iframe Background (Page visual) 
 */
.panel-bg iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    pointer-events: none;
    opacity: 0.25; /* うすく表示 */
    /* 位置はJSが毎フレーム制御するため、transitionはopacityのみに限定 */
    transition: opacity 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

/* ホバー時の iframe 挙動 */
.entrance-panel:hover .panel-bg iframe {
    opacity: 0.4; /* ホバーで少し明るく */
}



/* ホバー時の iframe 挙動 */
.entrance-panel:hover .panel-bg iframe {
    opacity: 0.4; /* ホバーで少し明るく */
}

/* 
 * Expanding Animation (Click state) 
 */
.entrance-panel.is-expanding {
    /* JS側で inline style として position:fixed と座標を設定後、このクラスを付与 */
    transition: all 0.7s cubic-bezier(0.77, 0, 0.175, 1);
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100;
    flex: none;
    border: none;
}
.entrance-panel.is-expanding .panel-bg {
    transform: scale(1);
    background-color: #ffffff !important; /* iframe内のページ遷移時にエントランスのパネル色（黄色等）がチラつくのを防ぐ */
}
.entrance-panel.is-expanding .panel-bg iframe {
    opacity: 1; /* 全画面展開時はくっきりと表示 */
}
.entrance-panel.is-expanding .panel-content {
    opacity: 0;
    transition: opacity 0.3s ease; /* コンテンツはフェードアウトさせる */
}
.entrance-panel.is-expanding .panel-overlay {
    background-color: transparent;
    pointer-events: none; /* iframeのスクロールやクリックを妨害しないようにする */
}

/* Tablet & Mobile (Responsive) */
@media (max-width: 768px) {
    .entrance-container {
        flex-direction: column; /* タブレット以下は縦積み */
    }
    
    .entrance-panel {
        border-right: none;
        border-bottom: none; /* rowの境目の黒い線は取る */
        flex: 1; /* 縦3分割で均等に */
    }
    .entrance-panel:last-child {
        border-bottom: none;
    }

    /* 白コピーは非表示案 */
    .hover-catch-box {
        display: none !important;
    }

    /* スマホ版でのiframe横幅拡張バグ（iOS Safari等でPCサイトが親要素を押し広げる）を防止 */
    .panel-bg iframe {
        width: 10px !important;
        min-width: 100% !important;
    }

    /* 巨大文字のコンテナ設定（最初から表示・デスクトップ色踏襲） */
    .hover-huge-text {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow: hidden !important;
        
        /* デスクトップ版と同じ色味（乗算） */
        opacity: 0.35 !important;
        mix-blend-mode: multiply !important;
        /* ガクつき防止（GPUレイヤーの固定化） */
        transform: translateZ(0) !important; 
        backface-visibility: hidden !important;
        z-index: 5 !important;
        pointer-events: none !important;
        /* パネルが完全に戻りきって（0.7秒）からフェードインさせることで、レイアウト切り替え時のガクつきを隠す */
        transition: opacity 0.4s ease 0.75s !important;
    }

    #panel-page3 .hover-huge-text {
        opacity: 0.4 !important; /* ピンクのデスクトップ設定踏襲 */
    }

    /* 各パネルの配置（余白をなくして画面の端に密着させる） */
    #panel-page1 .hover-huge-text { align-items: flex-start !important; padding-left: 0 !important; }
    #panel-page2 .hover-huge-text { align-items: flex-end !important; padding-right: 0 !important; }
    #panel-page3 .hover-huge-text { align-items: flex-start !important; padding-left: 0 !important; }

    /* 文字色とバグ対策 */
    .hover-huge-text > span {
        font-size: 11dvh !important; /* 横幅に影響されないよう縦幅基準(dvh)に変更 */
        line-height: 1.1 !important; 
        margin: 0 !important;
        display: block !important;
        text-shadow: none !important; /* 影を解除 */
        white-space: nowrap !important; /* 改行させずに見切れさせる */
        backface-visibility: hidden !important; /* こちらもガクつき防止 */
        /* iOS Safariでmix-blend-modeが消えるバグを回避するため、不透明度を1未満にして強制スタッキングコンテキスト生成 */
        opacity: 0.99 !important; 
    }

    /* デスクトップ版と同じ色を復元し、揃っている側を意図的に見切れさせる（シフトさせる） */
    #panel-page1 .hover-huge-text > span { 
        color: #5CB4E4 !important; 
        font-size: 13dvh !important; /* 横幅に影響されないよう縦幅基準(dvh)に変更 */
        line-height: 0.85 !important; /* 行間を狭く */
        transform: translateX(-1.5vw) !important; /* 左へほんのわずかだけ押し出す */
    }
    #panel-page2 .hover-huge-text > span { 
        color: #FBD13E !important; 
        transform: translateX(1.5vw) !important; /* 右へほんのわずかだけ押し出す */
    }
    #panel-page3 .hover-huge-text > span { 
        color: #F093AC !important; 
        opacity: 0.85 !important; 
        font-size: 15dvh !important; /* 横幅に影響されないよう縦幅基準(dvh)に変更 */
        line-height: 0.8 !important; /* 文字を大きくした分、行間を詰める */
        transform: translateX(-1.5vw) !important; /* 左へほんのわずかだけ押し出す */
    }

    /* いずれかのパネルが展開中の時は、優先度を高くして全パネルの巨大文字を強制非表示にする */
    .entrance-container:has(.is-expanding) #panel-page1 .hover-huge-text,
    .entrance-container:has(.is-expanding) #panel-page2 .hover-huge-text,
    .entrance-container:has(.is-expanding) #panel-page3 .hover-huge-text {
        opacity: 0 !important;
        transition: opacity 0.3s ease !important; /* クリック時は全パネルですぐに消える */
    }
    
    /* 初めから表示させる (ホバー時のアニメーションを待たない) */
    .hover-huge-text .char {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    /* ホバーエフェクトの解除 (スマホ等のタッチデバイス考慮) */
    .entrance-container:hover .entrance-panel {
        flex: 1;
    }
    .entrance-container .entrance-panel:hover {
        flex: 1;
    }
}

@media (max-width: 450px) {
    .panel-content h2 {
        font-size: 2.6rem; /* h2をさらに少し大きく */
    }
    .panel-content p {
        font-size: 1.1rem; /* 2行目（サブタイトル）も一緒に大きく */
    }
}

/* Back to Entrance Button */
.back-to-entrance {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px; /* 角丸のピルシェイプ */
    padding: 10px 24px 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-icon-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.back-to-entrance:hover .back-icon-circle {
    transform: translateX(-3px); /* ホバー時に少し左に動くアニメーション */
}
.back-to-entrance:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px); /* 浮き上がるアニメーション */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.back-to-entrance.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .back-to-entrance {
        bottom: 20px;
        left: 20px;
        padding: 8px 20px 8px 16px;
        font-size: 12px;
    }
}

/* ==========================================================
   ヒーローテキスト（ペン書きSVGとリード文）
   ========================================================== */
#hero-text-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 画面中央 */
    padding-bottom: 0; 
    padding-top: 15vh; /* タイトルと筆記体をさらに下へずらす */
    pointer-events: none; /* 下のカラムをクリック可能にする */
    z-index: 50; /* パネル(1)より上、展開パネル(100)より下 */
    transition: opacity 0.5s ease;
}

/* パネル展開時は非表示にする */
#hero-text-overlay.is-hidden {
    opacity: 0;
}

.hero-svg-container {
    width: 80%;
    max-width: 1000px;
    padding: 0 20px;
}

.hero-svg-container svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 2px 8px rgba(0,0,0,0.4)); /* 少し影をつけて視認性アップ */
}

/* SVGのストロークアニメーション (pathLength="1" を使用) */
.hero-svg-container svg.svg-mobile {
    display: none;
}
.hero-svg-container svg.svg-desktop {
    display: block;
}

@media (max-width: 768px) {
    .hero-svg-container svg.svg-mobile {
        display: block;
        width: 100%;
        height: auto;
    }
    .hero-svg-container svg.svg-desktop {
        display: none;
    }
}

.hero-svg-container svg path,
.hero-svg-container svg line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    stroke-width: 13px; /* 元の12に限りなく近づけつつ、ほんの少しだけ太くする */
}

/* is-animatingクラスがついたらアニメーション開始 */
body.is-animating-svg .hero-svg-container svg path,
body.is-animating-svg .hero-svg-container svg line {
    /* 1つのパスを描く時間を短くし、インライン付与された--delayで開始を遅らせる */
    animation: dash-animation 0.6s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

/* リード文 */
.hero-lead-text {
    position: absolute;
    top: 68%; /* タイトルと筆記体と一緒に下へずらす */
    margin-top: 0; 
    font-family: 'Kiwi Maru', serif;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 500; /* 元の太さに戻す */
    -webkit-text-stroke: 0.3px #FFFFFF; /* ウェイトを上げずに輪郭線でほんのわずかに太らせる */
    color: #FFFFFF;
    opacity: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 0.05em;
}

/* スマホ限定の追加テキストは基本非表示 */
.mobile-only-lead {
    display: none;
}

body.is-animating-svg .hero-lead-text {
    /* 最後のパスが描き終わる頃にフェードイン (2.5s -> 1.7s) */
    animation: fade-in-up 1s ease-out 1.7s forwards; 
}

/* サブテキスト（筆記体） */
.hero-sub-text {
    font-family: 'Mrs Saint Delafield', cursive;
    color: rgba(255, 255, 255, 0.7); /* 半透明の白 */
    font-size: clamp(3.5rem, 6vw, 6rem); /* 画像のように少し大きめに */
    opacity: 0;
    
    /* 微調整：さらに左へ、少し上へ */
    margin-top: -4.5vw;
    margin-bottom: 4.5vw;
    margin-left: 0vw;
    
    pointer-events: none;
    transform: rotate(-8deg); /* 画像のように傾ける */
}

body.is-animating-svg .hero-sub-text {
    /* 左から右へ流れるように表示する手書き風アニメーションに変更 (少し長めの1.5秒でゆっくり書く) */
    animation: wipe-in-sub 1.5s ease-in-out 1.2s forwards;
}

@keyframes wipe-in-sub {
    0% {
        opacity: 0;
        clip-path: inset(-20% 100% -20% -20%);
    }
    1% {
        opacity: 1;
        clip-path: inset(-20% 100% -20% -20%);
    }
    100% {
        opacity: 1;
        clip-path: inset(-20% -20% -20% -20%);
    }
}

@keyframes dash-animation {
    0% {
        stroke-dashoffset: 1;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up-center {
    from {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ==========================================================
   センターカラム下部のメッセージ
   ========================================================== */
.center-bottom-message {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex; /* 横並びにする */
    align-items: center; /* 高さを合わせる */
    justify-content: center; /* 中央寄せ */
    gap: 12px; /* ロゴと文字の隙間 */
    pointer-events: none; /* クリックイベントを妨害しない */
    width: 100%;
    opacity: 0; /* アニメーション前は非表示 */
}

/* リード文と同じタイミングでフェードイン */
body.is-animating-svg .center-bottom-message {
    animation: fade-in-up-center 1s ease-out 1.7s forwards;
}

.center-bottom-message .bottom-logo {
    height: clamp(1.2rem, 1.6vw, 1.4rem); /* 文字のサイズに合わせて高さを調整 */
    width: auto;
    margin-bottom: 0; /* 下の余白をなくす */
    /* データ側にフチがついたため、CSS側は本来の黒い影のみ */
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.5));
}

.center-bottom-message .bottom-text {
    font-family: 'Kiwi Maru', serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #FFFFFF;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.mobile-only-br {
    display: none;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .mobile-only-br {
        display: block;
    }
    .center-bottom-message {
        bottom: 25px;
        flex-direction: column-reverse; /* ロゴを一番下に配置 */
        gap: 6px; /* ロゴとテキストの隙間 */
    }
    .center-bottom-message .bottom-logo {
        height: 1.1rem; /* スマホサイズで小さく */
        margin-bottom: 0;
    }
    .center-bottom-message .bottom-text {
        font-size: 0.85rem;
        white-space: normal; /* 折り返しを許可 */
        text-align: center; /* 複数行になるため中央揃え */
        line-height: 1.5; /* 行間を少しあける */
    }
}

/* ==========================================================
   ホバー時に出現する巨大テキスト（スクランブルアニメーション）
   ========================================================== */
.hover-huge-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 5;
    pointer-events: none;
    opacity: 0; /* デフォルトは非表示 */
    transition: opacity 0.3s ease;
    mix-blend-mode: multiply; /* 親要素に乗算をかけてスタッキングコンテキスト問題を解消 */
}

/* ホバー時の各パネルごとのベース透け感 */
#panel-page1:hover .hover-huge-text { opacity: 0.35; } /* 青は薄め */
#panel-page2:hover .hover-huge-text { opacity: 0.35; }  /* 黄色も薄めにして暗くならないように調整 */
#panel-page3:hover .hover-huge-text { opacity: 0.4; }  /* ピンクも薄め */

.hover-huge-text > span {
    font-size: 9vw;
    font-weight: 400; /* 筆記体等を活かすため太字を解除 */
    line-height: 0.9;
    white-space: nowrap;
    display: inline-block;
}

/* 1文字ごとの初期状態 */
.hover-huge-text .char {
    opacity: 0;
    filter: blur(8px);
    /* デフォルトは下にある要素なので下から（Y軸プラス） */
    transform: translateY(60px);
    transition: opacity 0s, transform 0s, filter 0s;
    display: inline-block;
}

/* パネル2（上配置）の文字は上から（Y軸マイナス）出現させる */
#panel-page2 .hover-huge-text .char {
    transform: translateY(-60px);
}

/* ホバー時の出現アニメーション（弾むイージング） */
.entrance-panel:hover .hover-huge-text .char {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.4s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

/* パネル2はID指定で初期位置を上書きしているため、ホバー時の位置もID指定でY=0にする */
#panel-page2:hover .hover-huge-text .char {
    transform: translateY(0);
}

/* 行や文字ごとのディレイはJSで設定するため、CSSでの固定ディレイは削除 */

/* ----------------------------------------------------------
   ホバー時に出現するキャッチコピー（白いボックス・横書き）
   ---------------------------------------------------------- */
.hover-catch-box {
    position: absolute;
    bottom: 12vh; /* 巨大文字に重なるように下部に配置 */
    left: 4vw; /* もう少し左に配置 */
    display: flex;
    flex-direction: row-reverse; /* 右から左へ（縦書きの行の並び順）横に並べる */
    gap: 12px; /* 行間（横方向の隙間） */
    z-index: 10; /* 巨大文字より前面 */
    align-items: flex-start; /* 上端揃え */
    pointer-events: none;
}
.hover-catch-box .catch-line {
    writing-mode: vertical-rl; /* 各ボックス内の文字を縦書きにする */
    background-color: #ffffff;
    color: #555555; /* もう少し薄いグレー */
    /* 上24px、左右6px、下は句読点の余白を考慮して8pxまで縮小 */
    padding: 24px 6px 8px 6px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Kiwi Maru', serif;
    letter-spacing: 0.1em;
    clip-path: inset(0 0 100% 0); /* 初期状態：下から完全にクリップ（上から下へのワイプ） */
    transition: clip-path 0s;
}

/* 1行目（右側）を一文字分上にずらす */
.hover-catch-box .catch-line:nth-child(1) {
    margin-top: -1.3em;
}

/* 2行目（中央）を一文字分下にずらす */
.hover-catch-box .catch-line:nth-child(2) {
    margin-top: 1.3em;
}



/* 特定の文字だけ色を変えるクラス */
.hover-catch-box .text-blue {
    color: #5CB4E4;
}
.hover-catch-box .text-yellow {
    color: #FBD13E;
}
.hover-catch-box .text-pink {
    color: #F093AC;
}

/* ホバー時の出現アニメーション */
.entrance-panel:hover .hover-catch-box .catch-line {
    clip-path: inset(0 0 0 0);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 行ごとの時間差（スタガー）設定 */
.entrance-panel:hover .hover-catch-box .catch-line:nth-child(1) { transition-delay: 0.2s; }
.entrance-panel:hover .hover-catch-box .catch-line:nth-child(2) { transition-delay: 0.4s; }
.entrance-panel:hover .hover-catch-box .catch-line:nth-child(3) { transition-delay: 0.6s; }

/* ----------------------------------------------------------
   各パネルごとの文字の配置と微調整
   ---------------------------------------------------------- */
#panel-page1 .hover-huge-text {
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 20px;
}
#panel-page1 .hover-huge-text > span { 
    font-family: 'Gelasio', serif; 
    color: #5CB4E4;
    /* 位置は単語コンテナで固定化し、アニメーションは内部の .char に任せる */
    transform: translate(-3vw, 7vh); 
    letter-spacing: -0.06em; /* 文字間を詰める */
}

/* パネル1のキャッチコピーはもう少し右へずらす */
#panel-page1 .hover-catch-box {
    left: 12vw;
    bottom: auto;
    top: 10vh; /* 黄色パネル（page2）と高さを合わせる */
}



#panel-page2 .hover-huge-text {
    justify-content: flex-start; /* 上端基準に変更 */
    align-items: center;
    padding-top: 0; /* 上辺とくっつけるため余白を削除 */
}
#panel-page2 .hover-huge-text > span:first-child {
    margin-top: -1.5vw; /* フォントの内部余白を詰めて上辺にぴったりくっつける */
}
#panel-page2 .hover-huge-text > span { 
    font-family: 'Monoton', cursive; 
    color: #FBD13E;
    font-size: 8vw; /* 少し小さく */
}

/* パネル2のキャッチコピーは上部の巨大文字に重ねる */
#panel-page2 .hover-catch-box {
    bottom: auto;
    top: 10vh; /* 縦書きになったので少し上に配置 */
    left: 50%;
    transform: translateX(-50%);
    align-items: flex-start; /* 上端揃え */
}
/* パネル2のキャッチコピーも一文字分下にずらす（共通の margin-top: 1.3em が適用される） */

#panel-page3 .hover-huge-text {
    justify-content: flex-end;
    align-items: flex-end;
    padding-right: 10px;
    padding-bottom: 0; /* 下辺とくっつけるため余白を削除 */
}
#panel-page3 .hover-huge-text > span:last-child {
    margin-bottom: -2vw; /* フォント下部の見えない余白を詰めてぴったりくっつける */
}
#panel-page3 .hover-huge-text > span { 
    font-family: 'Damion', cursive; 
    color: #F093AC;
    font-size: 10.5vw; /* ピンク文字は少し大きめ（12vwから微調整） */
    opacity: 0.85; /* 暗くせずに少し薄く（透明度を追加） */
}

/* パネル3のキャッチコピーは青パネルと対になるように右側に配置 */
#panel-page3 .hover-catch-box {
    left: auto;
    right: 12vw;
    bottom: auto;
    top: 10vh; /* 他2つと高さを合わせる */
}

/* 展開時は強制的に非表示にする (!importantで優先度を上げる) */
.entrance-panel.is-expanding .hover-huge-text,
.entrance-panel.is-expanding .hover-catch-box {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

/* ----------------------------------------------------------
   マウスストーカー（click! ボタン）
   ---------------------------------------------------------- */
.mouse-stalker {
    position: fixed;
    top: 0;
    left: 0;
    width: 55px;
    height: 55px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    pointer-events: none; /* クリック等を邪魔しないようにする */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%) scale(0); /* デフォルトは非表示(極小) */
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    mix-blend-mode: normal;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 表示時のクラス（滑らかにポップアップ） */
.mouse-stalker.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* パルスアニメーション（波紋のように広がる） */
.mouse-stalker::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    animation: stalker-pulse 1.5s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 中の「click!」文字の点滅（ふわっ、ふわっとフェード） */
.mouse-stalker .stalker-text {
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: #333;
    letter-spacing: 0.05em;
    animation: stalker-fade 1.5s infinite ease-in-out;
    transition: color 0.3s ease;
}

/* 各カラムごとの文字色変更 */
.mouse-stalker.color-panel-page1 .stalker-text {
    color: #5CB4E4; /* 青カラムの色 */
}
.mouse-stalker.color-panel-page2 .stalker-text {
    color: #FBD13E; /* 黄カラムの色 */
}
.mouse-stalker.color-panel-page3 .stalker-text {
    color: #F093AC; /* ピンクカラムの色 */
}

@keyframes stalker-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes stalker-fade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* カラム展開中・展開後は強制的に消す */
body:has(.is-expanding) .mouse-stalker {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0) !important;
}

@media (max-width: 768px) {
    /* 画面中央（＝真ん中の黄色のrow）に配置するためズレをリセット */
    #hero-text-overlay {
        padding-top: 0;
    }
    
    /* SVGアニメーション自体も少し大きくする */
    .hero-svg-container svg {
        transform: scale(1.25);
        transform-origin: center bottom;
    }

    /* リード文をSVG・筆記体のすぐ下に相対配置で積むことで中央揃えにする */
    .hero-lead-text {
        position: relative;
        top: auto;
        margin-top: 35px; /* SVG拡大に伴う調整 */
        font-size: clamp(1rem, 4vw, 1.3rem); /* スマホ版だけ16px程度に */
        line-height: 1.6;
        text-align: center;
    }

    .mobile-only-lead {
        display: inline;
    }

    /* 筆記体の位置をスマホサイズに合わせて微調整 */
    .hero-sub-text {
        margin-top: -3vw;
        margin-bottom: 0;
        font-size: clamp(2rem, 9vw, 3.2rem); /* 端末に合わせてフレキシブルに縮小し改行を防ぐ */
        white-space: nowrap; /* 念のため改行禁止を指定 */
    }
}

/* ==========================================================
   スマホ版用：タップ波紋（パルス）エフェクト
   ========================================================== */
.pulse-ripple {
    position: fixed;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* クリックを邪魔しない */
    z-index: 9999;
    animation: pulse-ripple-anim 0.6s ease-out forwards;
}

@keyframes pulse-ripple-anim {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 4px;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        border-width: 0px;
    }
}
