:root {
    --popup-bg: #f3f3f1;
    --popup-text: #111;
    --popup-muted: #777;
    --popup-blue: #1477df;
    --popup-card-width: clamp(235px, 19vw, 310px);
}

.popup-section,
.popup-section * { box-sizing: border-box; }

.popup-section {
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding: clamp(170px, 11vw, 210px) clamp(56px, 5vw, 80px) clamp(190px, 12vw, 220px);
    background: var(--popup-bg);
    color: var(--popup-text);
    font-family: var(--font-sans, Pretendard, sans-serif);
}

.popup-section__inner {
    position: relative;
    width: min(100%, 1520px);
    margin-inline: auto;
}

.popup-section__header {
    position: relative;
    z-index: 3;
    max-width: 700px;
}

.popup-section__label {
    margin: 0;
    color: var(--popup-blue);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}

.popup-section__accent-line {
    display: block;
    width: 2px;
    height: 17px;
    margin: 21px 0 30px;
    background: var(--popup-blue);
}

.popup-section__title {
    margin: 0;
    font-family: var(--font-serif, "Cormorant Garamond", serif);
    font-size: clamp(80px, 6.4vw, 106px);
    font-weight: 400;
    letter-spacing: -.045em;
    line-height: .9;
}

.popup-section__description {
    margin: 25px 0 0;
    color: var(--popup-muted);
    font-size: 15px;
    line-height: 1.8;
    word-break: keep-all;
}

.popup-section__watermark {
    position: absolute;
    z-index: 0;
    top: 84px;
    right: 6.5%;
    color: #111;
    font-family: var(--font-serif, "Cormorant Garamond", serif);
    font-size: clamp(155px, 18vw, 330px);
    font-weight: 400;
    letter-spacing: -.065em;
    line-height: .75;
    opacity: .032;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.popup-slider {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: clamp(58px, 4.8vw, 78px);
}

.popup-slider__viewport {
    overflow: visible;
    width: calc(100% - 130px);
    padding-bottom: 28px;
    margin-inline: auto;
    cursor: grab;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.popup-slider__viewport.is-dragging { cursor: grabbing; }
.popup-slider__viewport:focus-visible {
    outline: 1px solid var(--popup-blue);
    outline-offset: 4px;
}

.popup-slider__stage {
    position: relative;
    height: clamp(500px, 37vw, 625px);
}

.popup-card {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: block;
    overflow: hidden;
    width: var(--popup-card-width);
    aspect-ratio: 25 / 34;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.84);
    pointer-events: none;
    box-shadow: 0 14px 38px rgba(17, 19, 22, .08);
    transition: left .48s cubic-bezier(.22, .72, .25, 1), opacity .35s ease, transform .48s cubic-bezier(.22, .72, .25, 1), box-shadow .35s ease;
}

.popup-card::after {
    position: absolute;
    z-index: 5;
    inset: 0;
    border: 1px solid rgba(20, 20, 20, .08);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.popup-card.is-prev,
.popup-card.is-next,
.popup-card.is-active {
    opacity: 1;
    pointer-events: auto;
}

.popup-card.is-prev {
    left: 22%;
    z-index: 1;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup-card.is-next {
    left: 78%;
    z-index: 1;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup-card.is-active {
    left: 50%;
    z-index: 3;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 24px 56px rgba(17, 19, 22, .15);
}

.popup-slider--count-2 .popup-card.is-active { left: 36%; }
.popup-slider--count-2 .popup-card.is-next { left: 64%; opacity: 1; }

.popup-slider--count-1 .popup-card.is-active {
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
}

.popup-card img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    transform: none;
    transition: transform .55s cubic-bezier(.2, .7, .2, 1);
    pointer-events: none;
}

.popup-card__overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(7, 10, 13, .15);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.popup-card__zoom {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    color: #fff;
    transform: translateY(7px);
    transition: transform .3s ease;
}

.popup-card__zoom svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.4;
}

.popup-card:hover img,
.popup-card:focus-visible img { transform: none; }
.popup-card:hover .popup-card__overlay,
.popup-card:focus-visible .popup-card__overlay { opacity: 1; }
.popup-card:hover .popup-card__zoom,
.popup-card:focus-visible .popup-card__zoom { transform: translateY(0); }
.popup-card:focus-visible { outline: 2px solid var(--popup-blue); outline-offset: 4px; }

.popup-slider__arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(17, 17, 17, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: #24262a;
    cursor: pointer;
    box-shadow: 0 9px 25px rgba(17, 19, 22, .08);
    transform: translateY(-50%);
    transition: border-color .25s ease, color .25s ease, background-color .25s ease;
}

.popup-slider__arrow--prev { left: 0; }
.popup-slider__arrow--next { right: 0; }
.popup-slider__arrow span { font-size: 25px; font-weight: 300; line-height: 1; }
.popup-slider__arrow:hover,
.popup-slider__arrow:focus-visible {
    border-color: var(--popup-blue);
    background: #fff;
    color: var(--popup-blue);
    outline: none;
}

.popup-slider__pagination {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 11px;
    margin-top: 26px;
}

.popup-slider__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #b8b9bc;
    cursor: pointer;
    transition: background-color .25s ease, transform .25s ease;
}

.popup-slider__dot:hover,
.popup-slider__dot:focus-visible,
.popup-slider__dot.is-active {
    background: var(--popup-blue);
    outline: none;
}

.popup-slider__dot:focus-visible { box-shadow: 0 0 0 3px rgba(20, 119, 223, .18); }
.popup-slider__dot.is-active { transform: scale(1.12); }

.popup-section__empty {
    display: grid;
    place-items: center;
    min-height: 480px;
    margin-top: 70px;
    border-top: 1px solid rgba(17, 17, 17, .1);
    border-bottom: 1px solid rgba(17, 17, 17, .1);
    color: #888;
    text-align: center;
}

.popup-section__empty span { color: var(--popup-blue); font-size: 12px; letter-spacing: .14em; }
.popup-section__empty p { margin: 12px 0 0; font-size: 14px; }

.popup-section.is-motion-ready .popup-section__label,
.popup-section.is-motion-ready .popup-section__accent-line,
.popup-section.is-motion-ready .popup-section__title,
.popup-section.is-motion-ready .popup-section__description,
.popup-section.is-motion-ready .popup-slider,
.popup-section.is-motion-ready .popup-slider__pagination {
    opacity: 0;
    transform: translateY(20px);
}

.popup-section.is-motion-ready.is-visible .popup-section__label,
.popup-section.is-motion-ready.is-visible .popup-section__accent-line,
.popup-section.is-motion-ready.is-visible .popup-section__title,
.popup-section.is-motion-ready.is-visible .popup-section__description,
.popup-section.is-motion-ready.is-visible .popup-slider,
.popup-section.is-motion-ready.is-visible .popup-slider__pagination {
    opacity: 1;
    transform: translateY(0);
}

.popup-section.is-motion-ready .popup-section__label { transition: opacity .55s ease, transform .65s cubic-bezier(.22, .75, .2, 1); }
.popup-section.is-motion-ready .popup-section__accent-line { transition: opacity .55s ease .06s, transform .65s cubic-bezier(.22, .75, .2, 1) .06s; }
.popup-section.is-motion-ready .popup-section__title { transition: opacity .7s ease .12s, transform .75s cubic-bezier(.22, .75, .2, 1) .12s; }
.popup-section.is-motion-ready .popup-section__description { transition: opacity .65s ease .2s, transform .7s cubic-bezier(.22, .75, .2, 1) .2s; }
.popup-section.is-motion-ready .popup-slider { transition: opacity .7s ease .3s, transform .78s cubic-bezier(.22, .75, .2, 1) .3s; }
.popup-section.is-motion-ready .popup-slider__pagination { transition: opacity .58s ease .43s, transform .66s cubic-bezier(.22, .75, .2, 1) .43s; }

/* Keep the three-card composition balanced while giving larger screens more presence. */
@media (min-width: 1280px) and (max-width: 1439px) {
    :root { --popup-card-width: clamp(246.75px, 19.95vw, 325.5px); }
}

@media (min-width: 1440px) {
    :root { --popup-card-width: clamp(258.5px, 20.9vw, 341px); }
}

@media (max-width: 1279px) {
    :root { --popup-card-width: clamp(210px, 24vw, 270px); }
    .popup-section { padding: 145px 38px 160px; }
    .popup-section__title { font-size: clamp(72px, 9vw, 92px); }
    .popup-slider__viewport { width: calc(100% - 110px); }
    .popup-slider__stage { height: clamp(440px, 48vw, 550px); }
    .popup-card.is-prev { left: 20%; }
    .popup-card.is-next { left: 80%; }
    .popup-slider__arrow { width: 52px; height: 52px; }
}

@media (max-width: 767px) {
    :root { --popup-card-width: min(68vw, 260px); }
    .popup-section { padding: 100px 20px 115px; }
    .popup-section__label { font-size: 11px; }
    .popup-section__accent-line { margin: 18px 0 27px; }
    .popup-section__title { font-size: clamp(56px, 17vw, 72px); }
    .popup-section__description { margin-top: 20px; font-size: 13px; }
    .popup-section__watermark { top: 63px; right: -10%; font-size: 31vw; opacity: .026; }
    .popup-slider { margin-top: 52px; }
    .popup-slider__viewport { width: 100%; }
    .popup-slider__stage { height: min(105vw, 500px); }
    .popup-card.is-active,
    .popup-slider--count-1 .popup-card.is-active { left: 50%; transform: translate(-50%, -50%) scale(1.08); }
    .popup-card.is-prev { left: -13%; opacity: 1; transform: translate(-50%, -50%) scale(.88); }
    .popup-card.is-next { left: 113%; opacity: 1; transform: translate(-50%, -50%) scale(.88); }
    .popup-slider--count-2 .popup-card.is-active { left: 32%; transform: translate(-50%, -50%) scale(1); }
    .popup-slider--count-2 .popup-card.is-next { left: 72%; transform: translate(-50%, -50%) scale(.88); }
    .popup-slider__arrow { top: auto; bottom: -66px; width: 46px; height: 46px; }
    .popup-slider__arrow--prev { left: calc(50% - 53px); }
    .popup-slider__arrow--next { right: calc(50% - 53px); }
    .popup-slider__arrow span { font-size: 21px; }
    .popup-slider__pagination { gap: 9px; margin-top: 82px; }
    .popup-slider__dot { width: 7px; height: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    .popup-card,
    .popup-card img,
    .popup-card__overlay,
    .popup-card__zoom {
        transition-duration: .01ms !important;
    }
}
