/* --- [01. 基礎設定] --- */
body {
    margin: 0; padding: 0; 
    background-color: #e5e1de; /* light-brown へ変更 */
    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: #1b150c; /* dark-brown へ変更 */
    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; 
}

.sanlem-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; }
}

.sanlem-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;
}

.sanlem-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;
}

.sanlem-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: #1b150c; /* dark-brown へ変更 */
    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); }
}

.sanlem-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;
}

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

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

.sanlem-image-box {
    width: 100%;
    display: flex;
    justify-content: center;
    /* 上部を dark-brown、下部を light-brown へ繋ぐグラデーション */
    background: linear-gradient(to bottom, #1b150c 0%, #1b150c 30%, #e5e1de 85%, #e5e1de 100%);
    padding-top: 40px;
    padding-bottom: 0px;
    position: relative;
    margin-top: -1px;
}

.sanlem-image-box img {
    width: 55%;
    max-width: 480px;
    height: auto;
    aspect-ratio: 1 / 1; /* x_cosmic_web.png は 1254x1254 の正方形 */
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* --- [セクション2: コンテンツエリア] --- */
.light-brown-section { /* light-blue-section から書き換え */
    background-color: #e5e1de; /* light-brown へ変更 */
    color: #1b150c; /* 文字色を dark-brown へ */
    padding-bottom: 60px;
    margin-top: -1px; 
    padding-top: 1px;
    position: relative;
    overflow: hidden;
}

.light-brown-section .text-unit { color: #1b150c; } /* light-blue-section から書き換え */

/* --- [Triangle 装飾: スクロールインで一度だけ現れ、以後は静止] --- */
.tri-field {
    position: absolute;
    inset: -10%;
    z-index: 1; /* コンテンツの背後に配置 */
    pointer-events: none;
}

.tri {
    position: absolute;
    width: 220px;
    height: 220px;
    opacity: 0;
    translate: 0 26px;
    transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1), translate 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.tri-field.is-active .tri {
    opacity: var(--final-opacity, 1);
    translate: 0 0;
}

.tri:nth-of-type(2) { transition-delay: .12s; }
.tri:nth-of-type(3) { transition-delay: .24s; }
.tri:nth-of-type(4) { transition-delay: .36s; }
.tri:nth-of-type(5) { transition-delay: .48s; }
.tri:nth-of-type(6) { transition-delay: .6s; }

.tri-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(105,118,105,0.4), transparent);
    transform-origin: left center;
    filter: blur(.15px);
    box-shadow: 0 0 8px rgba(105,118,105,.05);
    opacity: .45;
}

.tri-line.a { width: 180px; top: 0; left: 20px; rotate: 0deg; }
.tri-line.b { width: 200px; top: 0; left: 20px; rotate: 60deg; }
.tri-line.c { width: 200px; top: 0; left: 200px; rotate: 120deg; }
.tri-line.inner { opacity: .2; }
.tri-line.i1 { width: 120px; top: 58px; left: 52px; rotate: 0deg; }
.tri-line.i2 { width: 120px; top: 58px; left: 52px; rotate: 60deg; }
.tri-line.i3 { width: 120px; top: 58px; left: 172px; rotate: 120deg; }

/* Triangle Positions & Sizes */
.t1 { top: 8%; left: 2%; transform: scale(1.8); }
.t2 { top: 15%; right: 5%; transform: scale(1.5) rotate(180deg); }
.t3 { bottom: 10%; left: 15%; transform: scale(2.0); }
.t4 { top: 40%; left: 10%; transform: scale(1.0); --final-opacity: 0.5; }
.t5 { top: 50%; right: 10%; transform: scale(1.2) rotate(180deg); --final-opacity: 0.5; }
.s1 { top: 70%; right: 20%; transform: scale(0.6); --final-opacity: 0.3; }

/* --- [セクション3: ダークネイビーエリア -> ベージュ(dark-brown)エリア] --- */
.dark-brown-section { /* dark-navy-section から書き換え */
    /* 宇宙背景を統合するため、背景を暗く透過させる */
    background: linear-gradient(to bottom, #e5e1de 0%, #09111d 15%, #010203 100%);
    color: #ffffff; /* 暗い背景色に合わせて白文字へ */
    padding: 80px 0;
    margin-top: -1px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* --- [統合：Cosmic Background CSS] スクロールインで一度だけ現れ、以後は静止 --- */
.cosmic {
    position: absolute;
    inset: 0;
    z-index: 1; /* 背景に配置 */
    opacity: 0;
    transition: opacity 2s ease;
}

.cosmic.is-active {
    opacity: 1;
}

.stars {
    position: absolute;
    inset: -200px;
    background-image: radial-gradient(circle, rgba(255,255,255,.9) 1px, transparent 1px);
    background-size: 180px 180px;
    opacity: .18;
}

.network {
    position: absolute;
    inset: 0;
}

.line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120,190,255,.95), transparent);
    transform-origin: left center;
    filter: blur(.3px);
    box-shadow: 0 0 12px rgba(120,190,255,.7), 0 0 24px rgba(120,190,255,.25);
    opacity: 0;
    scale: 0 1;
    transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), scale 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--d, 0s);
}

.cosmic.is-active .line {
    opacity: .85;
    scale: 1 1;
}

.line::before, .line::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c9e8ff;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 14px rgba(180,220,255,.9), 0 0 28px rgba(180,220,255,.55);
}

.line::before { left: 0; }
.line::after { right: 0; }

.l1 { width: 520px; top: 10%; left: 2%; transform: rotate(16deg); --d: .05s; }
.l2 { width: 420px; top: 32%; left: 35%; transform: rotate(-22deg); --d: .1s; }
.l3 { width: 580px; top: 55%; left: 8%; transform: rotate(9deg); --d: .15s; }
.l4 { width: 420px; top: 72%; left: 42%; transform: rotate(-8deg); --d: .2s; }
.l5 { width: 320px; top: 20%; left: 60%; transform: rotate(38deg); --d: .25s; }
.l6 { width: 620px; top: 45%; left: -8%; transform: rotate(2deg); --d: .3s; }
.l7 { width: 380px; top: 80%; left: 58%; transform: rotate(-28deg); --d: .35s; }
.l8 { width: 540px; top: 4%; left: 28%; transform: rotate(-10deg); --d: .4s; }
.l9 { width: 340px; top: 40%; left: 70%; transform: rotate(14deg); --d: .45s; }
.l10 { width: 300px; top: 66%; left: 22%; transform: rotate(32deg); --d: .5s; }

.orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120,190,255,.35), transparent 70%);
    filter: blur(20px);
    mix-blend-mode: screen;
}

.o1 { width: 260px; height: 260px; top: 10%; left: 15%; }
.o2 { width: 340px; height: 340px; top: 50%; right: 10%; }
.o3 { width: 220px; height: 220px; bottom: 5%; left: 40%; }

/* --- [サブタイトル・共通設定] --- */
.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;
    /* 境界線を dark-brown に合わせて調整 */
    border-top: 1px solid rgba(60, 43, 34, 0.2); border-bottom: 1px solid rgba(60, 43, 34, 0.2); 
    padding: 15px 0; width: 100%; text-align: center;
    background: rgba(255, 255, 255, 0.2); box-sizing: border-box;
}

.dark-brown-section .text-unit .sub-title, /* dark-navy-section から書き換え */
.dark-brown-section .text-unit .inner-sub-title { /* dark-navy-section から書き換え */
    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.05); 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;
}
/* ボタン色を dark-brown へ */
.btn-purchase.primary { background-color: #1b150c; 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.2); opacity: 0.9; }
.btn-purchase.subscription:hover { background-color: #1b150c; 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: visible; text-align: center; line-height: 1.3; letter-spacing: 0.1em;
}
.totop-button.is-show { opacity: 1; visibility: visible; }

/* --- [OS設定でモーション低減が有効な場合は、演出を即時反映] --- */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up,
    .sanlem-logo-en, .sanlem-line, .sanlem-logo-jp, .sanlem-message-area span,
    .tri, .cosmic, .line {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@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%; }
}

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

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

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

    .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; }

    .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_s.png(750x470)の実比率に合わせて高さを自動算出し、クロップなしで全体を表示 */
    .top-visual-section {
        height: auto;
        aspect-ratio: 750 / 470;
        max-height: 100vh;
    }
    .top-visual-area {
        height: 100%;
        object-fit: contain;
    }

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

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

    .light-brown-section .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;
    }

    .btn-purchase {
        width: 320px;
        font-size: 20px;
        padding: 24px 20px;
    }
    .conversion-area { gap: 50px; }
}