/* 반응형 디자인 */
@media (max-width: 768px) {
    .header{
        width: 100%;
    }
    .pause-section-inner{
        flex-direction: column;
    }
    .pause{
        width:100%;
        flex-grow:1;
        flex-shrink: 0;
        height: 50dvh;
    }
    
    .archive-content {
    padding: .5rem;
    max-width: calc(100% - 1rem);
    margin: 0 auto;
    padding-bottom: 5rem; /* 하단 여백 */
}
    body.hero-interactive .hero{
        mix-blend-mode: normal !important;
    }
    .project-cell.category {
    display:none;
}
    /* 모바일에서 데스크탑 hero 요소들 숨김 */
    .hero-clear-container {
        display: none !important;
    }
    
    /* 모바일 caption 기본 스타일 및 숨김 */
    .hero-caption {
        width: calc(100vw - 2em);
        opacity: 0;
    }
    
    /* JavaScript에서 추가하는 visible 클래스로 caption 표시 */
    .hero-caption.visible {
        opacity: 1;
    }    
    /* Mobile 메뉴 버튼 스타일 - menu-button만 세로형으로 변경 */
    .menu-button {
        width: 43px;
        height: 132px;
    }
    
    .menu-button.bg{
        clip-path: url(#menuBgClipMobile);
        -webkit-clip-path: url(#menuBgClipMobile);
    }
    
    .menu-button.text{
        clip-path: url(#menuTextClipMobile);
        -webkit-clip-path: url(#menuTextClipMobile);
        grid-template-columns: repeat(2, 1fr);
        aspect-ratio: 1/1;
        margin-right: 1px;
    }
    
    .scope{
        width: calc(100vw - 2rem);
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scope div{font-size: 1.75em; width: 100%; aspect-ratio: 1/1 !important; height: auto;}

    .scope div:nth-child(1) { border-left: 0; border-right: 0.5px solid #FFF; border-bottom: 0.5px solid #FFF;}
    .scope div:nth-child(2) { border-right: 0; border-bottom: 0.5px solid #FFF; padding-left: 0.75em;}
    .scope div:nth-child(4) { border-right: 0; padding-left: 0.75em;}
    
    .testimonial{
        width: 100%; 
        overflow: visible !important;
    }

    .menu-popup{
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    max-width: calc(100vw - 2.5rem);
    width: 320px;
    min-width: 288px;}
    
    .menu-popup.bgsafari{
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    max-width: calc(100vw - 2.5rem);
    width: 320px;
    min-width: 288px;}
    
    /* 모바일에서 닫기 버튼 숨김 */
    .menu-button-close {
        display: none !important;
    }
    
    .table_list{
        width: calc(100vw - 2rem);
    }
    
    /* 프로젝트 플렉스 모바일 */
.project-table-container {
    max-width: calc(100vw - 2rem);
}

.project-table-header {
    display: none; /* 모바일에서 헤더 숨기기 */
}

.project-row {
    flex-direction: column; /* 모바일에서 세로 방향으로 변경 */
}

.project-row-top{
    width: 100%;
    max-width: 100%;
}
    .project-row-bottom{
        width: 100%; 
        max-width: 100%;
        padding-left: 3rem;
    }

    .footer ul{
        flex-direction: column;
        gap:0.35rem;
    }
}

@media (max-width: 480px) {
    .title-section h2 {
        font-size: 1.25em;
        padding: 0 1em;
    }
    
    .CTA li{
    display: flex;
    flex-direction: row;
    padding-left: 0;
    align-content: flex-start;
    list-style:none;
    
}

.CTA li p{
    padding: 0;
    flex-grow: 1;
    transform-origin: 0 0;
}

.CTA li a{
    flex-grow: 1;
}
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .hero-bg {
        transition: none !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 🔋 ENERGY OPTIMIZATION: 메뉴 애니메이션을 CSS로 최적화 */

/* 메뉴 버튼 애니메이션 상태 */
.menu-button {
    transition: width 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 메뉴 배경 morphing 애니메이션 */
@keyframes menuShrink {
    0% { width: 43px; height: 33px; x: 99; rx: 16.5; }
    15% { width: 40px; height: 33px; x: 99; rx: 16.5; }
    30% { width: 35px; height: 33px; x: 99; rx: 16.5; }
    45% { width: 30px; height: 33px; x: 99; rx: 16.5; }
    60% { width: 25px; height: 25px; x: 99; y: 4px; rx: 12.5; }
    75% { width: 15px; height: 15px; x: 99; y: 9px; rx: 7.5; }
    85% { width: 10px; height: 10px; x: 99; y: 11.5px; rx: 5; }
    95% { width: 5px; height: 5px; x: 99; y: 14px; rx: 2.5; }
    100% { width: 0px; height: 0px; x: 99; y: 16.5px; rx: 0; }
}

@keyframes menuExpand {
    0% { width: 0px; height: 0px; x: 99; y: 16.5px; rx: 0; }
    5% { width: 5px; height: 5px; x: 99; y: 14px; rx: 2.5; }
    15% { width: 10px; height: 10px; x: 99; y: 11.5px; rx: 5; }
    25% { width: 15px; height: 15px; x: 99; y: 9px; rx: 7.5; }
    40% { width: 25px; height: 25px; x: 99; y: 4px; rx: 12.5; }
    55% { width: 30px; height: 33px; x: 99; y: 0px; rx: 16.5; }
    70% { width: 35px; height: 33px; x: 99; rx: 16.5; }
    85% { width: 40px; height: 33px; x: 99; rx: 16.5; }
    100% { width: 43px; height: 33px; x: 99; rx: 16.5; }
}

@keyframes circleShift {
    0% { cx: 16.5px; }
    15% { cx: 19.5px; }
    30% { cx: 24.5px; }
    45% { cx: 29.5px; }
    60% { cx: 34.5px; }
    75% { cx: 44.5px; }
    85% { cx: 49.5px; }
    95% { cx: 54.5px; }
    100% { cx: 59.5px; }
}

@keyframes circleShiftReverse {
    0% { cx: 59.5px; }
    5% { cx: 54.5px; }
    15% { cx: 49.5px; }
    25% { cx: 44.5px; }
    40% { cx: 34.5px; }
    55% { cx: 29.5px; }
    70% { cx: 24.5px; }
    85% { cx: 19.5px; }
    100% { cx: 16.5px; }
}

/* 애니메이션 적용을 위한 클래스 */
.menu-animating-shrink #animatedRect {
    animation: menuShrink 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.menu-animating-shrink #animatedCircle1 {
    animation: circleShift 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.menu-animating-shrink #animatedCircle2 {
    animation: circleShift 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.05s;
}

.menu-animating-shrink #animatedCircle3 {
    animation: circleShift 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.1s;
}

.menu-animating-expand #animatedRect {
    animation: menuExpand 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.menu-animating-expand #animatedCircle1 {
    animation: circleShiftReverse 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.menu-animating-expand #animatedCircle2 {
    animation: circleShiftReverse 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.05s;
}

.menu-animating-expand #animatedCircle3 {
    animation: circleShiftReverse 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.1s;
}

/* 텍스트 페이드 애니메이션 */
.menu-text-fade-out {
    opacity: 0 !important;
    transition: opacity 0.2s ease-out !important;
}

.menu-text-fade-in {
    opacity: 1 !important;
    transition: opacity 0.3s ease-in !important;
}

/* 로딩 애니메이션 제거됨 */

/* Landscape orientation 방지 - 모바일에서만 적용 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        z-index: var(--z-modal);
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    body::after {
        content: '화면을 세로로 회전해 주세요\A더 나은 경험을 위해 세로 모드를 사용해주세요';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 1.2em;
        text-align: center;
        white-space: pre-line;
        z-index: var(--z-modal);
        font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
        padding: 2rem;
        line-height: 1.6;
    }
    
    /* Landscape 상태에서 모든 콘텐츠 숨기기 */
    .hero, .header, .content, .menu-button, .menu-button-close, .footer {
        display: none !important;
    }
}

/* ============================================================================
   🔋 ENERGY OPTIMIZATION: Intersection Observer 기반 애니메이션
   ============================================================================ */

/* 기본 상태: 애니메이션 대기 */
.content,
.project-table-container,
.archive-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Intersection Observer 트리거: 뷰포트에 진입했을 때 */
.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 스타일 애니메이션 최적화 */
.animate-in {
    will-change: transform, opacity;
}

/* 모션 감소 설정 사용자 대응 */
@media (prefers-reduced-motion: reduce) {
    .content,
    .project-table-container,
    .archive-content {
        transition: none;
        opacity: 1;
        transform: none;
    }
}
