/* =========================================
   STAGE PAGE
========================================= */

.stage-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.stage-title {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 40;

    margin: 0;

    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;

    transform: translateX(-50%);
}


/* =========================================
   3D GALLERY
========================================= */

.stage-gallery-section {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100vh;

    perspective: 1600px;
    perspective-origin: 50% 44%;

    user-select: none;
    touch-action: none;
}

.stage-scene {
    position: relative;

    width: min(72vw, 1050px);
    height: min(66vh, 680px);

    transform-style: preserve-3d;
    cursor: grab;
}

.stage-scene.is-dragging {
    cursor: grabbing;
}

.stage-ring {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 1px;
    height: 1px;

    transform-style: preserve-3d;
    transform:
        translate(-50%, -50%)
        rotateX(-7deg)
        rotateY(0deg);

    will-change: transform;
}


/* =========================================
   INDIVIDUAL IMAGE CARDS
========================================= */

.stage-card {
    position: absolute;
    top: 50%;
    left: 50%;

    display: block;

    margin: 0;
    padding: 0;

    border: 0;
    background: transparent;

    transform-style: preserve-3d;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.stage-card-inner {
    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background: #e8e8e8;

    transition:
        transform 300ms ease,
        filter 300ms ease,
        opacity 300ms ease;

    transform-origin: center center;
    will-change: transform;
}

.stage-card-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    pointer-events: none;
    -webkit-user-drag: none;
}

.stage-card:hover .stage-card-inner,
.stage-card:focus-visible .stage-card-inner {
    transform:
        translateZ(40px)
        scale(1.055);

    filter:
        brightness(1.03)
        drop-shadow(0 10px 18px rgba(0, 0, 0, 0.14));
}

.stage-card:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 6px;
}


/* 카드 크기 */

.stage-card.size-small {
    width: clamp(105px, 10vw, 150px);
    height: clamp(78px, 7.4vw, 112px);
}

.stage-card.size-medium {
    width: clamp(145px, 14vw, 210px);
    height: clamp(105px, 10.2vw, 153px);
}

.stage-card.size-large {
    width: clamp(185px, 18vw, 270px);
    height: clamp(135px, 13vw, 195px);
}


/* =========================================
   HOVER PREVIEW
========================================= */

.stage-preview {
    position: fixed;
    top: 92px;
    left: 24px;
    z-index: 45;

    width: min(560px, calc(100vw - 60px));

    opacity: 0;
    visibility: hidden;

    transform: translateY(8px);

    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 220ms ease;

    pointer-events: none;
}

.stage-preview.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.stage-preview-image-frame {
    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #e8e8e8;
}

.stage-preview-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.stage-preview-information {
    margin-top: 12px;
}

.stage-preview-site {
    margin: 0 0 10px;

    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
}

.stage-preview-title {
    margin: 0;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
}

.stage-preview-title span {
    display: block;
}

.stage-preview-title-en {
    margin-top: 1px;
}

.stage-preview-description {
    margin-top: 12px;
}

.stage-preview-description p {
    margin: 0;

    font-size: 12px;
    line-height: 1.42;
}

.stage-preview-description-en {
    margin-top: 0;
}



/* =========================================
   LIGHTBOX
========================================= */

.stage-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 42px 80px;

    background: rgba(0, 0, 0, 0.88);

    color: #ffffff;
}

.stage-lightbox[hidden] {
    display: none;
}

.stage-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.stage-lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(1100px, 100%);
    max-height: 100%;

    margin: 0;
}

.stage-lightbox-image {
    display: block;

    max-width: 100%;
    max-height: 68vh;

    object-fit: cover;
}

.stage-lightbox-caption {
    width: min(760px, 100%);

    margin-top: 20px;
}

.stage-lightbox-site {
    margin: 0 0 10px;

    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
}

.stage-lightbox-title {
    margin: 0;

    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}

.stage-lightbox-title span {
    display: block;
}

.stage-lightbox-title-en {
    margin-top: 1px;
}

.stage-lightbox-description {
    margin-top: 12px;
}

.stage-lightbox-description p {
    margin: 0;

    font-size: 13px;
    line-height: 1.5;
}

.stage-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;

    z-index: 220;

    width: 40px;
    height: 40px;

    padding: 0;
    border: 0;

    background: transparent;
    color: inherit;

    font-family: inherit;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
}

.stage-lightbox-arrow {
    position: absolute;
    top: 50%;
    z-index: 220;

    width: 52px;
    height: 52px;

    padding: 0;
    border: 0;

    background: transparent;
    color: inherit;

    font-family: inherit;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;

    transform: translateY(-50%);

    cursor: pointer;
}

.stage-lightbox-prev {
    left: 18px;
}

.stage-lightbox-next {
    right: 18px;
}

.stage-lightbox-close:hover,
.stage-lightbox-arrow:hover,
.stage-lightbox-close:focus-visible,
.stage-lightbox-arrow:focus-visible {
    opacity: 0.6;
}


/* =========================================
   LIGHTBOX OPEN STATE
========================================= */

body.stage-lightbox-open {
    overflow: hidden;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 1024px) {

    .stage-title {
        top: 22px;
    }

    .stage-scene {
        width: 86vw;
        height: 62vh;
    }

    .stage-preview {
        top: 84px;
        width: 250px;
    }

    .stage-lightbox {
        padding-right: 64px;
        padding-left: 64px;
    }
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .stage-page {
        min-height: 100svh;
    }

    .stage-title {
        position: absolute;
        top: 78px;

        width: calc(100% - 40px);

        font-size: 11px;
        text-align: center;
        white-space: normal;
    }

    .stage-gallery-section {
        min-height: 100svh;

        perspective: 1050px;
        perspective-origin: 50% 48%;
    }

    .stage-scene {
        width: 100vw;
        height: 54vh;
    }

    .stage-ring {
        transform:
            translate(-50%, -50%)
            rotateX(-5deg)
            rotateY(0deg);
    }

    .stage-card.size-small {
        width: 92px;
        height: 69px;
    }

    .stage-card.size-medium {
        width: 122px;
        height: 91px;
    }

    .stage-card.size-large {
        width: 152px;
        height: 114px;
    }

    .stage-preview {
        top: auto;
        right: 20px;
        bottom: 72px;
        left: 20px;

        width: auto;

        padding: 12px;

        background: rgba(255, 255, 255, 0.94);
    }

    .stage-preview-image-frame {
        display: none;
    }

    .stage-preview-information {
        margin-top: 0;
    }

    .stage-preview-site {
        margin-bottom: 7px;
    }

    .stage-preview-description {
        margin-top: 8px;
    }

    .stage-lightbox {
        align-items: flex-start;

        padding: 66px 20px 32px;

        overflow-y: auto;
    }

    .stage-lightbox-content {
        height: auto;
        min-height: 100%;
    }

    .stage-lightbox-figure {
        justify-content: flex-start;
    }

    .stage-lightbox-image {
        max-height: 54svh;
    }

    .stage-lightbox-caption {
        margin-top: 16px;
    }

    .stage-lightbox-arrow {
        top: auto;
        bottom: 14px;

        width: 44px;
        height: 44px;

        font-size: 22px;

        transform: none;
    }

    .stage-lightbox-prev {
        left: 14px;
    }

    .stage-lightbox-next {
        right: 14px;
    }

    .stage-lightbox-close {
        top: 12px;
        right: 12px;
    }
}


/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    .stage-preview,
    .stage-card-inner {
        transition: none;
    }
}

/* =========================================
   HOVER PREVIEW — FINAL SIZE OVERRIDE
   800 × 450 images (16:9)
========================================= */

@media (min-width: 701px) {
    .stage-preview {
        top: 92px !important;
        left: 24px !important;

        width: min(640px, calc(100vw - 72px)) !important;
        max-width: 640px !important;
    }

    .stage-preview-image-frame {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
    }

    .stage-preview-image {
        display: block !important;

        width: 100% !important;
        height: 100% !important;

        object-fit: contain !important;
        object-position: center !important;
    }
}
