/* --- Hero Section & Web3D Canvas --- */
#hero-section {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #0a0a0a;
}

#hero-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #111;
    transition: all 0.3s ease;
    /* 중요: 기본적으로 Iframe 터치 허용 (PC에서는 문제없음) */
    pointer-events: auto;
}

#bg-web3d-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 1s ease;
}

/* --- Hero Overlay & Typography --- */
.hero-overlay {
    pointer-events: none;
    z-index: 10;
    position: absolute;
    top: 40%;
    left: 120px !important;
    padding-left: 0 !important;
    transform: translateY(-50%);
    text-align: left;
    width: auto;
    transition: all 0.5s ease;
}

.hero-title {
    font-size: 5rem;
    font-weight: 800;
    font-family: var(--font-primary);
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    mix-blend-mode: overlay;
    margin-bottom: 5px;
    /* [Fixed] Reduced from 20px to 5px */
    /* Space for the line */
}

/* [Fixed] Restore original font for "for" */
.hero-title .lowercase-to {
    text-transform: lowercase;
    font-size: 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin: 0 5px;
    font-weight: 400;
    /* Standard weight */
    font-style: normal;
    /* No italic */
    font-family: inherit;
    /* Inherit primary font */
    opacity: 0.8;
}

/* [Fixed] Subtitle with Line ABOVE */
.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    padding-left: 0;
    /* Reset padding */
    margin-top: 10px;
    /* [Fixed] Reduced from 20px to 10px */
    display: inline-block;
}

/* Line Divider between Title and Bridging... */
.hero-subtitle::before {
    content: '';
    display: block;
    width: 320px;
    /* [Fixed] Increased from 60px to match DIGITAL TWIN approx width */
    height: 1px;
    background-color: #fff;
    opacity: 0.5;
    margin-bottom: 15px;
    /* Space between line and text */
}

.hero-subtitle-kr {
    display: block;
    margin-top: 25px;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    letter-spacing: -0.05em;
    line-height: 1.5;
}

/* --- Control Panel (New Table Style) --- */
.web3d-control-panel {
    margin-top: 35px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 15px;

    /* [UPDATED] Desktop: Left Align (Below Title at top:60%) */
    position: absolute;
    bottom: auto;
    top: 60%;
    left: 120px !important;
    /* [Fixed] Align with Title (120px) */
    margin-left: 0 !important;
    /* [Fixed] Reset negative margin */
    transform: none !important;
    z-index: 30;
}

/* Controls Components */
.ctrl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

/* [Mobile] Override for smaller screens to fix button crowding */
@media (max-width: 480px) {
    .ctrl-row {
        gap: 5px !important;
        /* [Fixed] Reduced gap */
    }

    .action-btn {
        flex: 1 !important;
        /* Expand to fill */
        padding: 10px 2px !important;
        /* [Fixed] Increase touch area, reduce side padding */
        font-size: 0.75rem !important;
        /* Keep font size */
        white-space: nowrap !important;
    }
}

.ctrl-label {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
}

.ctrl-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ctrl-btn-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    line-height: 1;
}

.ctrl-btn-circle:hover {
    background: #fff;
    color: #000;
}

.ctrl-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.ctrl-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover,
.color-btn.active {
    transform: scale(1.2);
    border-color: #fff;
}

.action-btn {
    flex: 1;
    padding: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #fff;
    color: #000;
}

#ctrl-anim {
    width: 140px !important;
    min-width: 140px !important;
    padding: 8px 5px !important;
    flex: none !important;
}

/* Guide Text Group in Panel */
.panel-guide {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 5px;
}

.panel-guide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

.guide-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.guide-text-group strong {
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
}

.guide-text-group span {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* [Web3D Section Overlay] Force Text Wrap */
.web3d-section .guide-text-group span {
    white-space: normal !important;
    word-break: keep-all;
}

/* --- Split Screen / Overlay Features --- */
#scroll-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    /* Desktop Left Half */
    height: 100%;
    z-index: 5;
    /* Above Iframe (0), Below Content (10) */
}

/* Mobile Scroll Zones (Hidden on PC) */
.touch-scroll-zone {
    display: none;
    position: absolute;
    top: 0;
    height: 100%;
    width: 15px;
    z-index: 25;
    background: transparent;
}

.touch-scroll-zone-left {
    left: 0;
}

.touch-scroll-zone-right {
    right: 0;
}

/* Old Guide (Hidden on Mobile) */
.hero-control-guide {
    margin-top: 35px;
    display: inline-flex;
    gap: 25px;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 25px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    align-items: center;
}

.hero-guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-align: left;
}

.hero-guide-text strong {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.hero-guide-text span {
    line-height: 1.3;
    display: block;
}

/* Mobile Toggle Btn (Hidden on PC) */
.mobile-toggle-btn {
    display: none;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scroll-indicator span {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
    opacity: 0.8;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.scroll-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    animation: scrollLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollLine {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}


/* =========================================
   [모바일 반응형 레이아웃 - Hero Section]
   ========================================= */
@media (max-width: 768px) {

    /* [타이틀] 상단 배치 */
    .hero-overlay {
        top: 12%;
        left: 5% !important;
        /* Force Left 5% */
        right: auto !important;
        transform: none;
        width: 90% !important;
        text-align: left !important;
        padding: 0 !important;
    }

    .hero-title {
        font-size: 2.0rem;
    }

    .hero-subtitle-kr {
        font-size: 0.85rem;
        margin-top: 15px;
    }

    /* [좌측] 조작 가이드 + 모드 스위치 -> Bottom Control Panel */
    .web3d-control-panel {
        position: absolute;
        bottom: 30px;
        top: auto;
        left: 50% !important;
        transform: translateX(-50%) !important;
        -webkit-transform: translateX(-50%) !important;
        margin-top: 0;
        margin-left: 0 !important;
        width: 90% !important;
        max-width: 400px;
        /* Ensure fit */
        max-width: none !important;
        /* User override */
        z-index: 30;
        right: auto !important;
    }

    /* Hide Desktop Split overlay on Mobile */
    #scroll-overlay {
        display: none;
    }

    /* Enable side touch zones & Remove margins logic */
    .touch-scroll-zone {
        display: block;
    }

    /* [Mobile] 3D Model Margins (Doubled) for Touch Scrolling */
    #hero-canvas-container {
        width: 80% !important;
        /* Doubled margins */
        left: 10% !important;
        /* Center it */
        height: 100%;
        top: 0;
        border-radius: 0;
        pointer-events: auto !important;
        /* Enable Model Interaction */
    }

    /* Iframe Interaction States */
    #hero-canvas-container.interactive {
        pointer-events: auto;
    }

    /* Old guide styles removal/override */
    .hero-control-guide {
        display: none;
    }

    .hero-guide-item {
        width: 100%;
        gap: 6px;
    }

    .hero-guide-text strong {
        font-size: 0.7rem;
    }

    .hero-guide-text span {
        font-size: 0.6rem;
        white-space: nowrap;
    }

    /* [신규] 모드 전환 버튼 스타일 (모바일 전용) */
    .mobile-toggle-btn {
        display: flex;
        width: 100%;
        margin-top: 5px;
        padding: 8px 0;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        color: #fff;
        font-size: 0.7rem;
        justify-content: center;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        transition: all 0.3s;
    }

    .mobile-toggle-btn.active {
        background: #fff;
        color: #000;
        font-weight: 600;
    }

    /* [중앙] 스크롤 인디케이터 */
    .scroll-indicator {
        bottom: 30px !important;
        left: 45%;
        transform: translateX(-50%);
        z-index: 20;
    }

    .scroll-indicator span {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }

    .scroll-indicator .line {
        height: 40px;
    }

    /* [Mobile] Slider Width Fix */
    .ctrl-slider {
        max-width: 80px !important;
    }
}