:root {
  --color: rgb(240, 240, 240, 1);
  --rgb: 240, 240, 240;
  
  /* Z-index system */
  --z-background: -3;
  --z-hero-bg: -2;
  --z-hero: -1;
  --z-content: 0;
  --z-ui: 70;
  --z-cursor: 100000;
  --z-header: 50;
  --z-menu: 3000;
  --z-modal: 30000;
    
}

@font-face {
    font-family: 'Interop';
    src: url('https://raw.githubusercontent.com/payw-org/Interop/main/web/fonts/Interop-Light.woff2') format('woff2'),
         url('https://raw.githubusercontent.com/payw-org/Interop/main/web/fonts/Interop-Light.woff') format('woff');
    font-weight: 300;
    font-display: swap;
}

/* HTML 기본 설정 */
html {
    font-size: 14px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    cursor: none;
}

/* 전역 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important; /* 모든 요소에서 커서 숨김 */
}

html, main, body{ pointer-events: none;}

body {
    font-size: 1em;
    letter-spacing: 0.1em;
    font-family: 'times New Roman', Times, 'Interop', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    background-color: var(--color);
    line-height: 1.6;
    word-break: keep-all;
    z-index: var(--z-content);
    overflow-x: hidden;
}

a{
    color: var(--color);
    text-decoration-line: none;
}

/* 텍스트 가로 압축 */
p, h1, h2, h3, h4, h5, h6, span {
    /* transform: scaleX(0.975);
    transform-origin: top left; */
    color: var(--color);
} 

/* 공통 믹스 블렌드 모드 */
.blend-overlay { mix-blend-mode: overlay; }
.blend-exclusion { mix-blend-mode: exclusion; }
.blend-color-burn { mix-blend-mode: color-burn; }

/* 공통 버튼 스타일 */
.btn-base {
    background: rgba(var(--rgb), 0.8);
    backdrop-filter: blur(1rem);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.pop {
    background: rgba(var(--rgb), 0.8);
    backdrop-filter: blur(1rem);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.pop span{
    font-size: 1em;
    text-align: center;
    color: var(--color);
    mix-blend-mode: exclusion !important;
    aspect-ratio: 1/1;
    vertical-align: middle;
}

.pop:active{
    background: rgba(var(--rgb), 1);
}

/* Custom Cursor - 개선된 성능 */
.custom-cursor {
    position: fixed;
    width: 1.25em;
    height: 1.25em;
    border-radius: 50%;
    background-color: var(--color);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: var(--z-cursor);
    transition: transform 0.1s ease-out;
    will-change: transform;
    mix-blend-mode: exclusion;
}

/* 로딩 상태 시 인터랙션 비활성화 */
body.loading .hero-clear-container {
    display: none !important;
}

body.loading .hero-caption {
    opacity: 0 !important;
}

/* 로딩 상태 시 모든 hero 애니메이션 일시정지 */
body.loading .hero-bg,
body.loading .hero-bg-temp {
    transition: none !important;
    animation: none !important;
    opacity: 1;
}

body.loading .hero-video,
body.loading .hero-clear-video {
    transition: none !important;
    animation: none !important;
}

/* 헤더 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    padding: 1em;
    display: inline-flex;
    justify-content: flex-start;
    align-items: flex-start;
    row-gap: 0.5em;
    column-gap: 1em;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-wrap: wrap;
    width: calc(calc(100vw - 1em) / 2);
    mix-blend-mode: exclusion;

}

.header h1{
    color: var(--color);
    font-size: 1.75em;
    line-height: 100%;
    font-weight: lighter;
    letter-spacing: 0.1em;
}

.header h1.en{
    flex-grow: 1;
}

.header h1:last-of-type{
    line-height: 125%;
}


/* 타이틀 섹션 */
.title-section {
    position: sticky;
    width: 100dvw;
    height: 100dvh;
    margin: auto;
    z-index: 1000; /* hero section과 mix-blend-mode 위에 표시 */
    display: flex;
    box-sizing: border-box;
    mix-blend-mode: exclusion;
    overflow: none;
    padding: 1em;
    align-items: flex-start;
    gap: 0.5em;
}

.title-section h2 {
    font-size: clamp(1.25em, 1.875vw, 1.75em);
    transform-origin: center;
}

/* 메뉴 */ 

.menu-button {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 142px;
    height: 33px;
    background: white;
    cursor: pointer;
    transition: opacity 0.4s ease-in-out, width 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: var(--z-modal);
}

.menu-button-close {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 99px;
    height: 33px;
    background: white;
    cursor: pointer;
    transition: opacity 0.4s ease-in-out;
    z-index: var(--z-ui);
    overflow: visible !important;
}

.menu-button.bg{
    background-color: rgba(var(--rgb), 0.8);
    mix-blend-mode: overlay; 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.50) inset;
    /* Safari backdrop-filter 호환성 개선 */
    isolation: isolate;
    contain: layout style paint;
    transform: translateZ(0);
    clip-path: url(#menuBgClipInline);
    -webkit-clip-path: url(#menuBgClipInline);
}

.menu-button.text{
    mix-blend-mode: exclusion;
    clip-path: url(#menuTextClipInline);
    -webkit-clip-path: url(#menuTextClipInline);
    transition: opacity 0.3s ease-in-out;
}

.menu-button-close.bg{
    background-color: rgba(var(--rgb), 0.8);
    mix-blend-mode: overlay; 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.50) inset;
    /* Safari backdrop-filter 호환성 개선 */
    isolation: isolate;
    contain: layout style paint;
    transform: translateZ(0);
    clip-path: url(#closeBgClipInline);
    -webkit-clip-path: url(#closeBgClipInline);
    opacity: 0;
    overflow: visible !important;
}

.menu-button-close.text{
    background-color: white !important;
    mix-blend-mode: exclusion;
    clip-path: url(#closeTextClipInline);
    -webkit-clip-path: url(#closeTextClipInline);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.menu-popup{
    position: fixed;
    right: calc(99px + 1.25rem + 0.625rem);
    bottom: 1.25rem;
    max-width: 30em;
    min-width: 288px;
    width: 25vw;
    padding: 0.25rem 1rem 1.2rem 1rem;
    text-align: center;
    z-index: var(--z-ui); /* Safari backdrop-filter를 위해 더 높은 z-index */
    opacity: 0;
    /* position 기반 애니메이션으로 backdrop-filter 보존 */
    transition: opacity 0.4s ease-in-out, bottom 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.menu-popup.bg {
    mix-blend-mode: overlay;
    background-color: rgba(var(--rgb), 0.5);
    border-radius: 1.5rem;
    box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.50) inset;
    transition: opacity 0.4s ease-in-out, bottom 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.menu-popup.bgsafari {
    position: fixed;
    bottom: calc(1.25rem + 33px + 0.625rem);
    right: calc(99px + 1.25rem + 0.625rem);
    max-width: 30em;
    min-width: 288px;
    width: 25vw;
    padding: 0.25rem 1rem 1.2rem 1rem;
    text-align: center;
    border-radius: 1.5rem;
    -webkit-backdrop-filter: blur(2rem);
    backdrop-filter: blur(2rem);
    box-sizing: border-box;
    z-index: var(--z-ui);
    opacity: 0;
}

.menu-popup.list {
    mix-blend-mode: exclusion;
    color: #fff;
}

.menu-popup.list li{
    padding: 1rem;
    border-bottom: solid 0.5px #fff;
    list-style: none;
}

.menu-popup.list li a{
    text-decoration: none;
    color: #fff;
    display: block;
}

.menu-popup.list li:last-of-type{
    padding:0;
    padding-top: 5rem;
    border-bottom: 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
}

.menu-popup.list li:last-of-type a{
    text-align: center;
    flex: 1 0 0;
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.825rem;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: 0.75px;
    text-underline-offset: 1px;
    text-underline-position: from-font;
}

.superstorm{
    height: 0.725rem;
}


/* 히어로 섹션 - 개선된 구조 */
.hero {
    position: sticky; /* mix-blend-mode 호환성을 위해 fixed → sticky */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100lvh;
    overflow: hidden;
    z-index: var(--z-hero-bg) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    mix-blend-mode: color-burn;
}

.hero-bg, .hero-bg-temp {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100lvh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: F0F0F0;
    filter: blur(2.75em);
    transition: opacity 0.4s ease-in-out, filter 0.3s ease;
    will-change: opacity;
    z-index: var(--z-background);
}

/* temp 레이어는 기본적으로 숨김 */
.hero-bg-temp {
    opacity: 0;
    z-index: calc(var(--z-background) + 1); /* hero-bg 위에 배치 */
}

.hero.progressive-unblurred .hero-bg,
.hero.progressive-unblurred .hero-bg-temp {
    filter: blur(0);
}

/* 영상 요소 스타일 */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100lvh;
    object-fit: cover;
    z-index: var(--z-hero); /* hero-bg와 동일한 레이어 */
    filter: blur(2.75em);
    opacity: 1;
    pointer-events: none;
}

/* progressive-unblurred 상태에서 video blur 제거 */
.hero.progressive-unblurred .hero-video {
    filter: blur(0);
}

/* clear container 영상 요소 */
.hero-clear-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* clear video 표시 */
body.hero-interactive .hero-clear-video {
    opacity: 1;
}

/* 데스크탑 전용 hero 시스템 (769px 이상) */
@media (min-width: 769px) {
    .hero {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* 데스크탑용 clear layer 컨테이너만 추가 */
    .hero-clear-container {
        width: calc(calc(100vw - 2em) / 2);
        height: 100vh;
        position: fixed; /* hero section 외부에 있으므로 fixed로 중앙 배치 */
        top: 0;
        right: 0;
        overflow: hidden;
        z-index: 5; /* caption과 title 아래 배경으로 */
        box-shadow: 1px 1px 1px 0 rgba(255, 255, 255, 0.50) inset, 12px 12px 48px 0 rgba(255, 255, 255, 0.50);
        display: none; /* 기본 상태에서 숨김, interaction 시에만 표시 */
        /* mix-blend-mode 관련 속성 제거 - 이제 hero section 외부에 있음 */
    }
    
    .hero-clear-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 1; /* 테스트용: 기본적으로 보이도록 임시 설정 */
        transition: opacity 0.3s ease;
        /* mix-blend-mode 관련 속성 제거 - 부모가 hero section 외부에 있음 */
    }
    
    
    /* 마우스 인터랙션 시 - 데스크탑 전용 (이중 레이어 시스템) */
    .hero.interactive .hero-bg,
    .hero.interactive .hero-bg-temp {
        background-color: F0F0F0;
        filter: blur(2.75em); /* 두 레이어 모두 blur 상태 유지 */
    }
    
    /* 활성 배경 레이어는 exclusion mode 적용 (데스크탑 전용) */
    .hero.interactive .active-bg {
        mix-blend-mode: exclusion;
        filter: blur(2.75em); /* 다른 레이어와 동일한 blur */
    }
    
    /* clear layer 표시 - hero 외부에 있으므로 body 클래스로 제어 */
    body.hero-interactive .hero-clear-layer {
        opacity: 1;
    }
    
    /* clear container 표시 - hero 외부에 있으므로 body 클래스로 제어 */
    body.hero-interactive .hero-clear-container {
        display: block;
    }
    
    /* caption은 데스크탑에서 clear container가 표시될 때만 보임 */
    body.hero-interactive .hero-caption {
        opacity: 1;
    }

}

/* 히어로 캡션 */
.hero-caption {
    position: fixed;
    top: 50vh;
    left: 1em;
    padding-top: 0.5em;
    border-top: solid 0.5px var(--color);
    text-align: left;
    opacity: 0; /* 기본적으로 숨김 */
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    width: calc(calc(100vw - 2em) / 2);
    mix-blend-mode: exclusion;
}

.caption-text {
    width: 100%;
    font-size: 0.715em;
    line-height: 110%;
    margin-bottom: 0.25em;
    transform-origin: center;
    padding: 0;
}


/* 컨텐츠 섹션 */
.content {
    padding-top: 100vh;
    min-height: 100svh;
    position: relative;
    z-index: var(--z-hero);
    transition: opacity 0.5s ease-in-out;
    flex-direction: column;
    align-items: center;
    max-width: calc(100vw - 2em);
    margin: auto;

    display: flex
}
.content.active {
    opacity: 1;
}

.content-inner{
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 1rem;
    flex-shrink: 0;
    max-width: 100%;
    mix-blend-mode: exclusion;
}

.scope{
    display: grid;
    width: 100%;
    max-width: calc(100vw - 2em);
    flex-shrink: 0;
    grid-template-rows: 1fr;
    grid-template-columns: repeat(4, 1fr);
    transform-origin: auto;
}

.scope div{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: stretch;
    height: auto;
    font-size: clamp(1.75em, 3.5vw, 3em);
    line-height: 100%;
    aspect-ratio: 1/1.25;
    transform-origin: auto;
    padding: clamp(0.25em, 1vw , 0.75em)
}

.scope div:nth-child(1) { border-right: 0.5px solid #fff; border-left: 0.5px solid #FFF;}
.scope div:nth-child(2) { border-right: 0.5px solid #FFF;}
.scope div:nth-child(3) { border-right: 0.5px solid #FFF;}
.scope div:nth-child(4) { border-right: 0.5px solid #FFF;}

.scope_keywords{
    display: flex;
    align-items: center;
    align-content: center;
    gap: 0 !important;
    margin: 0;    
    padding: 0;
    flex-wrap: wrap;
    width: 100%;
    letter-spacing: 0;
    word-spacing: 0;
    line-height:0;
}


.scope_keywords li{
    list-style: none;
    display: inline-flex;
    gap: 0;
    justify-content: center;
    align-items: center;
    background-color: rgba(var(--rgb), 0.25);
    padding: 1em;
    border-radius: 100em;
    transform-origin: auto;
    aspect-ratio: 1/1;
}

.scope_keywords li span{
    vertical-align: middle;
    color: var(--color);
}


.pause-section{
    height: 80dvh;
    display: flex;
    align-items: center;
}
.pause-section-inner{
    display: flex;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;

}
.pause{
    width: calc(calc(100vw - 2em) / 2);
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    transform-origin: auto;
    flex-shrink: 0;
    margin-top: -0.5em;
}
.pause p{
    margin: auto;
    font-size: clamp(1.75em, 3.5vw, 3em);
    line-height: 1.375;
}

.table_list {
    width: 100%;
}

.table_list li {
    list-style: none;
    position: relative;
    padding-left: 2em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    text-align: left;
    border-bottom: solid var(--color) 0.5px;
}

.table_list.speciality li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em; /* 수직 정렬 조정 */
    width: 1em;
    height: 1em;
    background-image: url('assets/dot.svg');
    background-size: contain;
    background-repeat: no-repeat;
}
.table_list li:first-child {
    border-top: solid var(--color) 0.5px;
}

.CTA {
    margin-bottom: 12rem;
}

.CTA li{
    display: flex;
    flex-direction: row;
    padding-left: 0;
    align-content: space-between;
    list-style:none;
}

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

.CTA li a{
    text-align: right;
    flex-shrink: 0;
}

.CTA li a img{
    height: 1.1rem;
    width: auto;
    position: relative;
    top: 0.25rem;
}

.testimonial{
    overflow-x: scroll;
    width: 100%;
    overflow: visible;
    margin-bottom: 15em;
    position: relative;
    pointer-events: auto !important;
    z-index: var(--z-menu);
}

.testimonial ul {
    display: flex;
    width: auto;
    gap: 1rem;
    flex-direction: row;
    justify-content: flex-start;
    position: relative;
    left: 0;
    animation: marqueeSlide 20s linear infinite;
    transition: transform 0.3s ease-out;
    pointer-events: auto !important;
    z-index: var(--z-menu);
}

.testimonial ul:hover {
    animation-play-state: paused;
}

.testimonial ul.dragging {
    animation: none !important;
    transition: none !important;
}

@keyframes marqueeSlide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.testimonial li{
    display: inline-flex;
    width: clamp(288px, 20vw, 25rem);
    height: auto;
    aspect-ratio: 1/1.25;
    padding: 1.25rem;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    border-radius: 1rem;
    background-color: rgba(var(--rgb), 0.25);
    user-select: none;
    position: relative;
    z-index: var(--z-header);
    pointer-events: auto;
}


.testimonial li p:nth-child(1){ font-size: 12px; flex-shrink: 0; }
.testimonial li p:nth-child(2){ 
    flex-grow: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center;
}


/* SPA 페이지 관리 */

.page {
    display: none;
}

.page.active {
    display: block;
    mix-blend-mode: exclusion;

}

/* 홈 페이지 - 원래 구조 유지 */
#homePage {
    width: 100vw;
    pointer-events: none; /* 부모 요소가 선택되지 않도록 */
}

#homePage.active {
    display: block;
    pointer-events: none; /* 부모 요소가 선택되지 않도록 */
}

/* 자식 요소들은 개별적으로 pointer-events 활성화 */
#homePage * {
    pointer-events: auto;
}

/* 히어로 섹션 - 원래 스타일 복원 */
.hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    z-index: var(--z-hero);
    display: flex;
    justify-content: center;
    align-items: center;
    
}


/* 아카이브 페이지 스타일 */
.archive-page {
    min-height: 100dvh;
    padding-top: 20em; /* 헤더 높이 */
    color: var(--color);
    z-index: var(--z-content);
    position: relative;
}

.archive-content {
    padding: 0;
    max-width: calc(100% - 2em);
    margin: 0 auto;
    padding-bottom: 5em; /* 하단 여백 */
}

/* 프로젝트 플렉스 컨테이너 */
.project-table-container {
    width: 100%;
    pointer-events: auto;
}

/* 프로젝트 헤더 */
.project-table-header {
    display: flex;
    flex-direction: row;
    font-size: 8px;
    position: sticky;
    top: 10em;
}

.project-header-top{
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: calc(calc(100vw - 2em)/5);
}
.project-header-bottom {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: calc(calc(100vw - 2em)/5*4);
}

.project-table {
    display: flex;
    flex-direction: column;
}

.project-row {
    display: flex;
    flex-direction: row;
    font-size: 1em;
}

.project-row:hover {
    background-color: rgba(var(--rgb), .8);
    color: #000;
}

.project-row-top {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: calc(calc(100vw - 2em)/5);
}

.project-row-bottom {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: calc(calc(100vw - 2em)/5*4);
}

.project-cell {
    padding: 0.25rem 1rem 0.175rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    text-align: left;
}

.project-cell.noborder {
    border-top: none !important;
}

.project-cell.year {
    width: 3rem;
    flex-shrink: 0;
}

.project-cell.partner {
    max-width: 100%;
    flex-grow: 1;
}

.project-cell.project {
    flex-grow: 1;
    width: 70%;
}

.project-cell.category {
    flex-grow: 1;
    width: 30%;
}

.project-table .loading {
    text-align: center;
    padding: 2em;
    font-style: italic;
}

.project-table .error {
    text-align: center;
}


.footer {
    width: fit-content;
    height: fit-content;
    font-size: 0.714em;
    line-height: 1;
    position: fixed;
    mix-blend-mode: exclusion;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 10;
    color: var(--color);
}
.footer ul{
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    text-align: left;
}

.footer ul li{
    list-style: none;
}

