/* 電腦版專屬微塵浮光粒子容器（預設隱藏，僅在電腦版啟用） */
.desktop-light-motes {
    display: none;
}

.scroll-down-hint { font-size: 12px; letter-spacing: 2px; color: #888; text-align: center; cursor: pointer; }
.scroll-hint-desktop { display: none; }
.scroll-hint-mobile { display: block; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); } 40% { transform: translate(-50%, -10px); } 60% { transform: translate(-50%, -5px); } }

/* 全域詩歌單行容器 */
.poem-line { display: block; }

.home-scrolling-content { padding: 100px var(--global-padding) 80px; background-color: transparent; }
.home-section-title { font-size: 16px; letter-spacing: 4px; color: var(--main-dark-color); margin-bottom: 40px; text-align: center; }

.enter-gallery-btn {
    display: inline-block;
    padding: 14px 42px;
    border: 1px solid var(--main-dark-color);
    color: var(--main-dark-color);
    font-size: 12px;
    letter-spacing: 4px;
    cursor: pointer;
    font-weight: 500;
    background: transparent;
    transition: all 0.4s ease;
}
@media (hover: hover) and (pointer: fine) {
    .enter-gallery-btn:hover {
        background: var(--main-dark-color);
        color: var(--text-light);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(49, 77, 96, 0.12);
    }
}

/* ───────────────────────────────────────────────────────
   桌面端（電腦版）首頁畫布配置
   ─────────────────────────────────────────────────────── */
@media (min-width: 1025px) { 
    .hero-canvas {
        position: relative;
        width: 100%;
        height: 100vh;
        height: 100svh;
        overflow: hidden;
        display: block; 
    }
    .hero-image-frame {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: none;
        box-shadow: none;
        background: transparent;
        z-index: 1;
    }
    /* 桌面端畫框覆寫淡入動畫：僅淡入不平移，消滅頂部白邊 */
    .splash-done .hero-image-frame.fade-up {
        animation: desktopFadeInOnly 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .hero-canvas::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 25vh; 
        background: linear-gradient(to bottom, transparent 0%, #f3f7fa 70%, #ffffff 100%);
        z-index: 2;
        pointer-events: none;
    }
    .desktop-light-motes {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 3;
        pointer-events: none;
        overflow: hidden;
    }
    .desktop-light-motes.paused .light-mote::before,
    .desktop-light-motes.paused .light-mote::after {
        animation-play-state: paused !important;
    }
    .light-mote {
        position: absolute;
        width: 1px;
        height: 1px;
        pointer-events: none;
    }
    .light-mote::before,
    .light-mote::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.85) 15%, rgba(255, 233, 177, 0.45) 40%, rgba(255, 223, 137, 0.05) 58%, rgba(255, 255, 255, 0) 70%);
        pointer-events: none;
        opacity: 0;
        will-change: transform, opacity;
    }
    .mote-1 { left: 15%; bottom: 8%; }
    .mote-2 { left: 35%; bottom: 4%; }
    .mote-3 { left: 55%; bottom: 10%; }
    .mote-4 { left: 75%; bottom: 6%; }
    .mote-5 { left: 25%; bottom: -5%; }
    .mote-6 { left: 48%; bottom: -2%; }
    .mote-7 { left: 68%; bottom: 12%; }
    .mote-8 { left: 88%; bottom: 2%; }

    .mote-1::before { width: 10px; height: 10px; animation: floatMote1 24s infinite linear; }
    .mote-1::after { width: 6px; height: 6px; animation: floatMote2 28s infinite linear 4s; margin-left: 20px; }

    .mote-2::before { width: 12px; height: 12px; animation: floatMote3 22s infinite linear 2s; }
    .mote-2::after { width: 8px; height: 8px; animation: floatMote4 26s infinite linear 7s; margin-left: -15px; }

    .mote-3::before { width: 9px; height: 9px; animation: floatMote1 20s infinite linear 5s; }
    .mote-3::after { width: 11px; height: 11px; animation: floatMote3 25s infinite linear 11s; margin-left: 30px; }

    .mote-4::before { width: 14px; height: 14px; animation: floatMote2 30s infinite linear; }
    .mote-4::after { width: 7px; height: 7px; animation: floatMote4 28s infinite linear 6s; margin-left: -25px; }

    .mote-5::before { width: 8px; height: 8px; animation: floatMote3 24s infinite linear 3s; }
    .mote-5::after { width: 12px; height: 12px; animation: floatMote1 27s infinite linear 9s; margin-left: 15px; }

    .mote-6::before { width: 13px; height: 13px; animation: floatMote4 29s infinite linear 1s; }
    .mote-6::after { width: 9px; height: 9px; animation: floatMote2 22s infinite linear 10s; margin-left: -20px; }

    .mote-7::before { width: 7px; height: 7px; animation: floatMote1 21s infinite linear 8s; }
    .mote-7::after { width: 10px; height: 10px; animation: floatMote3 26s infinite linear 14s; margin-left: 25px; }

    .mote-8::before { width: 11px; height: 11px; animation: floatMote2 25s infinite linear 5s; }
    .mote-8::after { width: 8px; height: 8px; animation: floatMote4 32s infinite linear 12s; margin-left: -10px; }
    .hero-bg-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('../images/tsubase/home-cover.jpg');
        background-size: cover;
        background-position: left center;
        mask-image: linear-gradient(to right, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 60%);
        -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 60%);
        z-index: 1;
        will-change: transform;
        transform: scale(1.08) translate3d(0, 0, 0);
        animation: desktopBgDrift 36s infinite ease-in-out; /* 悠風微動：自發性呼吸慢速漂移 */
    }
    .hero-text-layer {
        position: absolute;
        top: 18vh;
        right: 16vw; 
        height: 60vh;
        z-index: 3;
        writing-mode: vertical-rl;
        -webkit-writing-mode: vertical-rl;
        text-align: start;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* 取消父級集體 fade-up 動畫，改由子元素各自進行精細的進場動畫 */
    .splash-done .hero-text-layer.fade-up {
        animation: none;
        opacity: 1;
        transform: none;
    }

    /* 1. 標題自上方優雅滑入 */
    .hero-title-elegant {
        font-family: 'Noto Serif TC', serif;
        font-size: 44px;
        font-weight: 200; 
        letter-spacing: 28px; 
        color: var(--main-dark-color);
        margin: 0;
        margin-left: 0; 
        padding: 0;
        line-height: 1;
        opacity: 0;
        transform: translateY(-20px);
    }
    .splash-done .hero-title-elegant {
        animation: desktopTitleFadeIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s, textMoonGlow 6s infinite ease-in-out 1.7s;
    }

    /* 2. 詩歌裝飾線條生長與間距收緊 */
    .hero-poem-elegant {
        font-family: 'Noto Serif TC', serif;
        font-size: 15px; 
        font-weight: 300;
        color: #3b586c;
        margin: 0;
        margin-right: 60px; /* 收緊標題與詩歌之間的間距，增強協調性 */
        padding: 0;
        padding-right: 25px; 
        border-top: none;
        border-right: 1px solid rgba(113, 156, 176, 0); /* 隱藏原本的靜態邊框 */
        line-height: 2.8; 
        letter-spacing: 6px;
        position: relative;
    }
    .hero-poem-elegant::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 1px;
        height: 100%;
        background-color: rgba(113, 156, 176, 0.35);
        transform: scaleY(0);
        transform-origin: top;
    }
    .splash-done .hero-poem-elegant::after {
        animation: desktopPoemLineGrow 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
    }

    /* 3. 詩歌逐行淡入動畫 */
    .poem-line {
        display: block;
        opacity: 0;
        transform: translateX(12px);
        filter: blur(6px); /* 初始水墨暈染模糊 */
        will-change: transform, opacity, filter;
    }
    .splash-done .poem-line {
        animation: desktopPoemFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .splash-done .poem-line.line-1 { animation-delay: 0.8s; }
    .splash-done .poem-line.line-2 { animation-delay: 1.1s; }
    .splash-done .poem-line.line-3 { animation-delay: 1.4s; }
    .splash-done .poem-line.line-4 { animation-delay: 1.7s; }
    .scroll-down-hint { position: absolute; bottom: 5svh; left: 40px; transform: none; z-index: 4; margin: 0; animation: none; }
}

/* ───────────────────────────────────────────────────────
   行動端（手機/平板）首頁畫布配置
   ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) { 
    .hero-canvas {
        position: relative;
        width: 100%;
        height: 100vh;
        height: 100svh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 5vw 0 7vw;
        box-sizing: border-box;
    }
    
    /* 🌸 手機版直立式質感畫框：防重疊並完整保留人像面容 */
    .hero-image-frame {
        position: relative;
        width: 44vw;
        height: 58vh;
        border: 1px solid rgba(49, 77, 96, 0.15);
        border-radius: 4px;
        overflow: hidden;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
        background-color: #f7f9fb;
        z-index: 1;
    }
    
    /* 🌸 木漏れ日 (Komorebi) 動態偏光濾鏡 */
    .hero-image-frame::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.08) 100%);
        mix-blend-mode: overlay;
        pointer-events: none;
        z-index: 2;
        opacity: 0;
        transition: opacity 1.5s ease 1s;
    }
    .splash-done .hero-image-frame::before {
        opacity: 1;
        animation: komorebiShift 12s ease-in-out infinite alternate;
    }
    
    .hero-bg-layer {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        background-image: url('../images/tsubase/home-cover.jpg');
        background-size: cover;
        background-position: 25% center; /* 精準定位人像面部細節 */
        opacity: 0.95; 
        z-index: 1;
        will-change: transform;
    }

    /* 🌸 人像慢速呼吸動畫 (Living Portrait Breathing) */
    .splash-done .hero-bg-layer {
        animation: mobileHeroBreathe 18s ease-in-out infinite alternate;
    }

    @keyframes mobileHeroBreathe {
        0% {
            transform: scale(1) translate(0, 0);
        }
        100% {
            transform: scale(1.08) translate(1.5%, -0.8%);
        }
    }

    @keyframes komorebiShift {
        0% {
            opacity: 0.3;
            transform: scale(1);
        }
        100% {
            opacity: 0.7;
            transform: scale(1.04);
        }
    }

    .hero-image-frame::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, transparent 80%, rgba(243, 247, 250, 0.1) 100%);
        pointer-events: none;
        z-index: 2;
    }

    .hero-text-layer {
        position: relative;
        height: 58vh;
        z-index: 2;
        writing-mode: vertical-rl;
        -webkit-writing-mode: vertical-rl;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        box-sizing: border-box;
    }

    .hero-title-elegant {
        font-family: 'Noto Serif TC', serif;
        font-size: clamp(28px, 4vw, 40px);
        font-weight: 300;
        letter-spacing: clamp(10px, 1.2vw, 18px);
        color: var(--main-dark-color);
        margin: 0;
        margin-left: clamp(20px, 3.5vw, 40px); 
        line-height: 1.2;
        text-shadow: none;
    }

    .hero-poem-elegant {
        font-family: 'Noto Serif TC', serif;
        font-size: clamp(13px, 1.8vw, 18px);
        font-weight: 300;
        margin: 0;
        padding: 0;
        padding-right: clamp(15px, 2vw, 25px);
        border-top: none;
        border-right: 1px solid rgba(113, 156, 176, 0.35);
        color: #3b586c;
        line-height: 2.8;
        letter-spacing: clamp(3.5px, 0.6vw, 6px);
        text-shadow: none;
    }

    .scroll-down-hint { 
        position: absolute; 
        bottom: calc(max(15px, env(safe-area-inset-bottom)) + 5px); 
        left: 50%; 
        transform: translateX(-50%); 
        z-index: 4; 
        margin: 0; 
        animation: bounce 2s infinite;
    }
    .home-scrolling-content { padding: 60px var(--mobile-padding) 40px; background-color: transparent; } 
}
