/* --- [01. 基礎設定] --- */
body {
    margin: 0; padding: 0; 
    background-color: #e4e4e4; /* クリア・クリスタル */
    color: #2d2d2d;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    position: relative; 
    overflow-x: hidden; 
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* --- [02. 質感ノイズ] --- */
body::before {
    content: ""; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04; 
    pointer-events: none; 
    z-index: 9998; 
}

main { position: relative; z-index: 1; }

section {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 35px;
    position: relative;
    z-index: 5;
}

/* --- [ふわっと表示のアニメーション設定] --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
                filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* --- [セクション1設定: TOP画像と右下ロゴ] --- */
.top-visual-section {
    width: 100%;
    height: 100vh;
    position: relative;
    background-color: #242626;
    margin-bottom: -1px;
    padding-bottom: 1px;
}

.top-visual-area {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; 
    object-position: center;
    vertical-align: bottom;
    box-shadow: none; 
}

.gialen-brand-box {
    position: absolute;
    right: 25px;
    bottom: 95px;
    text-align: right;
    z-index: 10;
}

@keyframes softSlideIn {
    0% { opacity: 0; transform: translateX(-20px); filter: blur(4px); }
    100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes lineFlowRight {
    0% { transform: scaleX(0); transform-origin: left; opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: scaleX(1); transform-origin: left; opacity: 0.6; }
}

.gialen-logo-en {
    width: 180px;
    max-width: 60vw;
    height: auto;
    display: block;
    margin: 0 0 0 auto;
    opacity: 0;
    animation: softSlideIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.4s;
}

.gialen-line {
    width: 180px;
    height: 1px;
    background-color: #ffffff;
    margin: 15px 0 15px auto;
    opacity: 0;
    transform: scaleX(0);
    animation: lineFlowRight 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.8s;
}

.gialen-logo-jp {
    width: 90px;
    max-width: 30vw;
    height: auto;
    display: block;
    margin: 0 0 0 auto;
    opacity: 0;
    animation: softSlideIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 1.2s;
}

/* --- [第1セクション: 背景色設定] --- */
.dark-bg {
    background-color: #242626;
    color: #ffffff;
    margin-top: -1px; 
    padding-top: 1px;
    position: relative;
    z-index: 2;
}

@keyframes messageFlow {
    0% { opacity: 0; transform: translateX(-30px); filter: blur(3px); }
    100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

.gialen-message-area {
    text-align: left;
    font-family: 'Noto Serif JP', serif;
    font-size: 22px;
    font-weight: 300;
    line-height: 2;
    letter-spacing: 0.13em;
    padding: 15px 0 40px;
    display: block;
    width: fit-content;
    margin: 0 auto;
}

.gialen-message-area span {
    display: block;
    opacity: 0;
    animation: messageFlow 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gialen-message-area span:nth-child(1) { animation-delay: 1.8s; }
.gialen-message-area span:nth-child(2) { animation-delay: 2.1s; }
.gialen-message-area span:nth-child(3) { animation-delay: 2.4s; }

.gialen-image-box {
    width: 100%;
    display: flex;
    justify-content: center;
    background: linear-gradient(to bottom, #242626 0%, #242626 30%, #e4e4e4 85%, #e4e4e4 100%);
    padding-top: 40px;
    padding-bottom: 0px;
    position: relative;
    margin-top: -1px;
}

.gialen-image-box img {
    width: 60%;
    max-width: 600px;
    height: auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* --- [セクション2: コンテンツエリア（光のグリッド移植）] --- */
.light-gray-section {
    background-color: #e4e4e4; 
    color: #242626;
    padding-bottom: 60px;
    margin-top: -1px; 
    padding-top: 1px;
    position: relative;
    overflow: hidden;
}

/* 広がる枠線 → 常時アニメーションをやめ、入れ子の固定枠線に変更 */
/* 4つの章それぞれに1つずつ配置。widthはclamp()でビューポート幅に応じて縮小し、
   スマホ幅でも固定pxのはみ出し・表示崩れが起きないようにする */
.expanding-box {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid #b0b0b0;
    z-index: -1; /* text-unit自身がz-index:10のスタッキングコンテキストになったため、見出し・本文より背面に回すには負の値が必要 */
    pointer-events: none;
}

.box1 { width: clamp(180px, 60vw, 340px); height: clamp(180px, 60vw, 340px); opacity: 0.45; transform: translate(-50%, -50%) rotate(0deg); }
.box2 { width: clamp(200px, 68vw, 420px); height: clamp(200px, 68vw, 420px); opacity: 0.38; transform: translate(-50%, -50%) rotate(8deg); }
.box3 { width: clamp(220px, 74vw, 500px); height: clamp(220px, 74vw, 500px); opacity: 0.32; transform: translate(-50%, -50%) rotate(-6deg); }
.box4 { width: clamp(240px, 80vw, 580px); height: clamp(240px, 80vw, 580px); opacity: 0.26; transform: translate(-50%, -50%) rotate(14deg); }

/* --- [セクション3: ダークグレーエリア (稲妻背景)] --- */
.dark-gray-section {
    background: linear-gradient(to bottom, #e4e4e4 0%, #242626 15%, #242626 100%);
    color: #ffffff;
    padding: 80px 0;
    margin-top: -1px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* --- [サブタイトル・共通設定] --- */
.text-unit .sub-title, 
.text-unit .inner-sub-title {
    display: block; font-size: 18.5px !important; font-weight: 600;
    margin-bottom: 45px; letter-spacing: 0.1em;
    border-top: 1px solid rgba(36, 38, 38, 1); border-bottom: 1px solid rgba(36, 38, 38, 1);
    padding: 15px 0; width: 100%; text-align: center;
    background: rgba(255, 255, 255, 0.02); box-sizing: border-box;
}

.dark-gray-section .text-unit .sub-title,
.dark-gray-section .text-unit .inner-sub-title {
    color: #ffffff; border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06); margin-top: 60px;
    position: relative; z-index: 10;
}

.text-unit h2 + .sub-title,
.text-unit h2 + .inner-sub-title { margin-top: 0 !important; }

.noto-serif { font-family: 'Noto Serif JP', serif; font-weight: 300; }
.text-unit { padding: 50px 0; position: relative; z-index: 10; }
.text-unit h2 { font-size: 32px; font-weight: 600; margin: 0 0 30px 0; letter-spacing: 0.1em; line-height: 1.6; }
.text-unit p { font-size: 1.1rem; font-weight: 500; margin: 0; opacity: 0.9; max-width: 700px; line-height: 2.2; text-align: justify; }
.text-unit .paragraph-spacing { margin-bottom: 30px; }

.conversion-area { display: flex; flex-direction: column; gap: 20px; align-items: center; padding: 80px 0 100px; position: relative; z-index: 10; }
.btn-purchase {
    display: flex; align-items: end; justify-content: center; width: 100%; max-width: 400px; padding: 22px 20px;
    border-radius: 2px; text-decoration: none; font-family: 'Noto Serif JP', serif; font-size: 18px;
    letter-spacing: 0.15em; transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1); position: relative; overflow: hidden; box-sizing: border-box;
}
.btn-purchase.primary { background-color: #242626; color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.btn-purchase.subscription { background-color: #ffffff; color: #bda16b; border: 1px solid #bda16b; }
.btn-purchase:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); opacity: 0.9; }
.btn-purchase.subscription:hover { background-color: #bda16b; color: #ffffff; }

.purchase-group { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.btn-purchase .type-word { font-size: 1.11em; }

.totop-button {
    position: fixed; right: 20px; bottom: 20px; width: 54px; height: 54px; background-color: #bda16b; color: #ffffff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 10px; font-weight: 200;
    z-index: 9999; box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    cursor: pointer; opacity: 0; visibility: hidden; text-align: center; line-height: 1.3; letter-spacing: 0.1em;
}
.totop-button.is-show { opacity: 1; visibility: visible; }

@media screen and (max-width: 768px) {
    .text-unit h2 { font-size: 28px; }
    .text-unit .sub-title, .text-unit .inner-sub-title { font-size: 0.95rem; padding: 12px 10px; }
    .text-unit p { font-size: 1.0rem; }
    .btn-purchase { font-size: 16px; max-width: 90%; }
}


@media screen and (max-width: 378px) {
    .text-unit h2 { font-size: 26px; }
    .btn-purchase {
        font-size: 15px;
    }
}

/* =============================================
   タブレット / PC レスポンシブ (768px以上)
   ============================================= */
@media (min-width: 768px) {
    .main-content {
        max-width: 960px;
        padding: 90px 55px 0;
    }

    .gialen-brand-box {
        right: 50px;
        bottom: 130px;
    }
    .gialen-logo-en { width: 240px; }
    .gialen-line    { width: 240px; }
    .gialen-logo-jp { width: 120px; }

    .gialen-message-area { font-size: 26px; }
    .gialen-image-box img { max-width: 740px; }

    .text-unit h2 {
        font-size: 32px;
        text-align: center;
        margin-bottom: 50px;
    }
    .text-unit .sub-title,
    .text-unit .inner-sub-title { font-size: 20px !important; }
    .text-unit .paragraph-spacing {
        margin-bottom: 50px;
    }

    .conversion-area {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 40px;
        padding: 80px 0 120px;
    }
    .purchase-group { width: auto; gap: 16px; }
    .btn-purchase { width: 280px; }

    .footer-kinchan-clip {
        top: -25px !important;
    }
    .footer-kinchan-left img {
        width: 80% !important;
    }
}

/* =============================================
   PC レスポンシブ (1024px以上)
   ============================================= */
@media (min-width: 1024px) {
    .main-content {
        max-width: 960px;
        padding: 120px 65px 0;
    }

    /* PC版TOPビジュアル: x_pro_g.png(750x470)の実比率に合わせて高さを自動算出し、クロップなしで全体を表示 */
    .top-visual-section {
        height: auto;
        aspect-ratio: 750 / 470;
        max-height: 100vh;
    }
    .top-visual-area {
        height: 100%;
        object-fit: contain;
    }

    .gialen-brand-box {
        right: 70px;
        bottom: 160px;
    }
    .gialen-logo-en { width: 300px; }
    .gialen-line    { width: 300px; }
    .gialen-logo-jp { width: 150px; }

    .gialen-message-area { font-size: 30px; }
    .gialen-image-box img { width: unset; max-width: 640px; }


    .text-unit {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .text-unit h2 { font-size: 40px; }
    .text-unit .sub-title,
    .text-unit .inner-sub-title { font-size: 22px !important; }
    .text-unit p {
        max-width: 850px;
    }
    .text-unit .paragraph-spacing {
        margin-bottom: 75px;
    }
    .btn-purchase {
        width: 320px;
        font-size: 20px;
        padding: 24px 20px;
    }
    .conversion-area { gap: 50px; }
}

/* --- [稲妻アニメーション用スタイル] --- */
/* セクション全体（数千px）ではなく画面の高さ分だけを描画し、スクロールに合わせてJS側で追従させる（軽量化） */
#lightningCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    z-index: 1;
    pointer-events: none;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    #lightningCanvas { display: none; }
}