/* ============================================
   hero-slider: sanggong.co.kr 스타일 인터랙티브 메인 비주얼
   - 물결 파동 + 이미지 슬라이드 전환 + 텍스트 애니메이션
   ============================================ */

/* ===== 전체 레이아웃: 흰색 배경 + 액자형 컨텐츠 영역 ===== */
body.prototype-03 {
    background: #fff;
    padding: 0;
    box-sizing: border-box;
}

#main-canvas-container {
    padding: 40px;
    overflow: hidden;
    border-radius: 12px;
    min-height: calc(100vh - 80px - 80px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

/* 페이퍼로지(Paperlogy) 8 ExtraBold — 타이틀용 */
@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

/* #main-canvas-container 안에서 꽉 채움 */
.hero-slider {
    position: relative;
    margin: 0;
    width: 100%;
    min-height: calc(100vh - 80px - 80px);
    height: calc(100vh - 80px - 80px);
    overflow: hidden;
    background: #fff;
    border-radius: inherit;
    box-sizing: border-box;
    cursor: none;
}

/* 배경 레이어 */
.hero-slider__bg,
#visual-wrapper {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    pointer-events: none;
}

#visual-section,
.hero-visual-section {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 12px;
}

#visual-section .hero-bg-video,
.hero-visual-section .hero-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transform-origin: center center;
    filter: url(#liquid-filter);
}

#visual-wrapper.hero-bg--transitioning .hero-bg-video,
.hero-slider__bg.hero-bg--transitioning .hero-bg-video {
    will-change: filter, opacity;
}

.hero-bg-video.hero-bg-video--ontop {
    z-index: 10;
}

#visual-section .hero-bg-video[data-index="0"] { z-index: 5; }
#visual-section .hero-bg-video[data-index="1"] { z-index: 4; }
#visual-section .hero-bg-video[data-index="2"] { z-index: 3; }
#visual-section .hero-bg-video[data-index="3"] { z-index: 2; }
#visual-section .hero-bg-video[data-index="4"] { z-index: 1; }

.hero-visual-section .hero-bg-video[data-index="0"] { z-index: 5; }
.hero-visual-section .hero-bg-video[data-index="1"] { z-index: 4; }
.hero-visual-section .hero-bg-video[data-index="2"] { z-index: 3; }
.hero-visual-section .hero-bg-video[data-index="3"] { z-index: 2; }
.hero-visual-section .hero-bg-video[data-index="4"] { z-index: 1; }

#visual-section .hero-bg-video:not(.is-active),
.hero-visual-section .hero-bg-video:not(.is-active) {
    opacity: 0;
    pointer-events: none;
}

#visual-section .hero-bg-video.is-active,
.hero-visual-section .hero-bg-video.is-active {
    opacity: 1;
}

/* 텍스트 콘텐츠 레이어: 화면 중앙 배치 */
.hero-slider__content-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-slider__content-layer > * {
    pointer-events: auto;
}

/* 슬라이드별 텍스트: 기본 숨김, active만 표시 */
.hero-slider__slide {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    max-width: 1180px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hero-slider__slide--active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 타이틀: 페이퍼로지 8 ExtraBold + 크게 */
.hero-slider__title {
    font-family: "Paperozi", "Pretendard Variable", sans-serif;
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* 서브텍스트 */
.hero-slider__sub {
    font-family: "Paperozi", "Pretendard Variable", sans-serif;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2.5rem;
    line-height: 1.5;
}

/* 버튼 영역: 원형 버튼 나란히 */
.hero-slider__btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.hero-slider__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    font-family: "Paperozi", "Pretendard Variable", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    padding: 0.75rem;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.hero-slider__btn::after {
    content: " →";
    font-weight: 800;
}

/* 자세히 보기: 흰색 테두리 원 */
.hero-slider__btn--outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.hero-slider__btn--outline:hover {
    background: #fff;
    border-color: #fff;
    color: #0a0a0a;
}

/* 제작문의: 파란색 채움 원 (커서 원과 동일) */
.hero-slider__btn--fill {
    background: var(--color-main);
    color: #fff;
    border: none;
}

.hero-slider__btn--fill:hover {
    background: #000;
    color: #fff;
}


/* 공통: 호버 시 배경 검정, 글자 흰색 */
.hero-slider__btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* 네비게이션 */
.hero-slider__nav {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.hero-slider__nav > * {
    pointer-events: auto;
}

.hero-slider__indicators {
    position: absolute;
    left: clamp(1.5rem, 4vw, 3rem);
    bottom: clamp(1.5rem, 4vw, 3rem);
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-slider__indicator {
    background: none;
    border: none;
    padding: 0 0 0 1.5rem;
    min-height: 25px;
    font-family: "Paperozi", "Pretendard Variable", sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: left;
    transition: color 0.3s ease;
    position: relative;
}

.hero-slider__indicator::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s ease;
}

.hero-slider__indicator.is-active {
    color: #fff;
}

/* 활성 인디케이터: 슬라이드 전환까지 남은 시간을 보여주는 원형 로딩(시계 방향) */
@property --indicator-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.hero-slider__indicator.is-active::after {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        #fff 0deg,
        #fff var(--indicator-angle),
        transparent var(--indicator-angle)
    );
    /* 불릿(반경 3px)과 링 사이 5px 간격 → 링 안쪽 반경 8px */
    mask: radial-gradient(circle at center, transparent 8px, black 8px);
    -webkit-mask: radial-gradient(circle at center, transparent 8px, black 8px);
    animation: hero-indicator-progress 6s linear forwards;
    pointer-events: none;
}

@keyframes hero-indicator-progress {
    from {
        --indicator-angle: 0deg;
    }
    to {
        --indicator-angle: 360deg;
    }
}

/* 활성 변경 시 애니메이션 재시작 (JS에서 클래스 토글 시 자동) */
.hero-slider__indicator:not(.is-active)::after {
    display: none;
}

.hero-slider__indicator:hover {
    color: rgba(255, 255, 255, 0.9);
}

.hero-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* 화살표 호버 시: 원 커서와 같은 청록색으로 합쳐진 느낌 */
.hero-slider__arrow:hover {
    color: var(--color-main);
    opacity: 1;
}

.hero-slider__arrow--prev {
    left: clamp(1rem, 2vw, 2rem);
}

.hero-slider__arrow--next {
    right: clamp(1rem, 2vw, 2rem);
}

/* 커스텀 원형 커서 (청록 테두리, 히어로 섹션 내에서만) */
.hero-slider__cursor {
    --hero-cursor-size: 40px;
    position: fixed;
    left: 0;
    top: 0;
    width: var(--hero-cursor-size);
    height: var(--hero-cursor-size);
    margin-left: calc(var(--hero-cursor-size) / -2);
    margin-top: calc(var(--hero-cursor-size) / -2);
    border: 2px solid var(--color-main);
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

.hero-slider__cursor.is-visible {
    opacity: 1;
}

/* 화살표 위에 있을 때: 원이 커지면서 화살표를 둘러싼 느낌, 외곽선은 얇게 */
.hero-slider__cursor.is-on-arrow {
    transform: scale(2.2);
    border-width: 1px;
    border-color: var(--color-main);
}

/* 인디케이터 위에 있을 때: .hero-slider__indicator::after 링 형태(14px 원형 링) */
.hero-slider__cursor.is-on-indicator {
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    transform: none;
    border-width: 2px;
    border-color: #000;
}

/* 모바일: main-canvas-container + hero 깨짐 방지, SVG 필터 제거, 커스텀 커서 비활성화 */
@media (max-width: 768px) {
    #main-canvas-container {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        min-height: 0;
        height: auto;
        border-radius: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hero-slider {
        margin: 0;
        width: 100%;
        min-height: calc(100vh - 60px);
        height: calc(100vh - 60px);
        border-radius: 0;
        cursor: auto;
    }

    #visual-wrapper,
    #visual-section,
    .hero-visual-section {
        border-radius: 0;
    }

    #visual-section .hero-bg-video,
    .hero-visual-section .hero-bg-video {
        filter: none;
    }

    .hero-slider__slide {
        padding: 1rem 1rem;
    }

    .hero-slider__title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .hero-slider__sub {
        font-size: clamp(0.9375rem, 2.5vw, 1.125rem);
        margin-bottom: 1.5rem;
    }

    .hero-slider__btns {
        gap: 0.75rem;
    }

    .hero-slider__btn {
        width: 110px;
        height: 110px;
        font-size: 0.875rem;
    }

    .hero-slider__indicators {
        left: 1rem;
        bottom: 1rem;
    }

    .hero-slider__arrow--prev {
        left: 0.5rem;
    }

    .hero-slider__arrow--next {
        right: 0.5rem;
    }

    .hero-slider__arrow {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    #main-canvas-container {
        padding: 0;
    }

    .hero-slider {
        min-height: 55vh;
        max-height: calc(100vh - 56px);
    }

    .hero-slider__title {
        font-size: clamp(1.75rem, 9vw, 2.75rem);
    }

    .hero-slider__btn {
        width: 90px;
        height: 90px;
        font-size: 0.8125rem;
    }
}
