@charset "utf-8";

/* 인트로 언어 선택 페이지 */

.intro-lang__item {
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.intro-lang__item[aria-pressed="true"] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(35, 50, 255, 0.28);
}

.intro-lang__item:hover {
    background-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.intro-lang__item[aria-pressed="true"]:hover {
    background-color: var(--color-primary);
    transform: translateY(-2px);
}

.intro-lang__item:focus {
    outline: none;
}

.intro-lang__item:focus-visible {
    border-color: rgba(255, 255, 255, 0.5);
}

.intro-lang__flag {
    display: block;
    transform-origin: center center;
    transition:
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.3s ease;
}

@media (min-width: 768px) {
    .intro-lang__flag {
        transform-origin: center bottom;
    }
}

.intro-lang__item:hover .intro-lang__flag {
    transform: translateY(-3px) scale(1.08);
    filter: drop-shadow(0 6px 10px rgba(255, 255, 255, 0.22));
}

.intro-lang__item[aria-pressed="true"] .intro-lang__flag {
    transform: translateY(-2px) scale(1.06);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.intro-lang__item[aria-pressed="true"]:hover .intro-lang__flag {
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
}

.intro-lang__submit {
    background-color: #ffffff;
    color: #000619;
    cursor: not-allowed;
    opacity: 0.7;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        opacity 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.intro-lang__submit.is-ready {
    background-color: var(--color-primary);
    color: #ffffff;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 8px 24px rgba(35, 50, 255, 0.28);
}

.intro-lang__submit.is-ready:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.intro-lang__grids {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    max-width: 100%;
}

.intro-lang__row {
    display: grid;
    width: 100%;
    max-width: 100%;
    gap: 0.625rem;
}

/* 모바일: 1열 세로 배치 */
.intro-lang__row--top,
.intro-lang__row--bottom {
    grid-template-columns: minmax(0, 1fr);
}

/* 진입 인터랙션 — 배지 → 타이틀 → 카드 순차 → CTA */
.intro-lang__reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: intro-lang-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-lang__reveal--badge {
    animation-delay: 0.08s;
}

.intro-lang__reveal--title {
    animation-delay: 0.18s;
}

.intro-lang__row--top .intro-lang__reveal--item:nth-child(1) { animation-delay: 0.28s; }
.intro-lang__row--top .intro-lang__reveal--item:nth-child(2) { animation-delay: 0.35s; }
.intro-lang__row--top .intro-lang__reveal--item:nth-child(3) { animation-delay: 0.42s; }
.intro-lang__row--bottom .intro-lang__reveal--item:nth-child(1) { animation-delay: 0.49s; }
.intro-lang__row--bottom .intro-lang__reveal--item:nth-child(2) { animation-delay: 0.56s; }
.intro-lang__row--bottom .intro-lang__reveal--item:nth-child(3) { animation-delay: 0.63s; }
.intro-lang__row--bottom .intro-lang__reveal--item:nth-child(4) { animation-delay: 0.70s; }

.intro-lang__reveal--submit {
    animation-delay: 0.82s;
}

@keyframes intro-lang-reveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 태블릿: 고정폭 대신 fluid 열로 잘림 방지 */
@media (min-width: 768px) and (max-width: 1023px) {
    .intro-lang__grids {
        gap: 16px;
    }

    .intro-lang__row {
        gap: 12px;
        margin-left: auto;
        margin-right: auto;
    }

    .intro-lang__row--top {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: center;
        max-width: 560px;
    }

    .intro-lang__row--bottom {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        justify-content: center;
        max-width: 100%;
    }

    .intro-lang__item {
        min-height: 148px;
    }
}

/* PC(lg+): 기존 레이아웃 유지 */
@media (min-width: 1024px) {
    .intro-lang__grids {
        gap: 30px;
    }

    .intro-lang__row {
        gap: 30px;
        margin-left: auto;
        margin-right: auto;
    }

    /* 1행: 180×3 + gap 30×2 = 600px 중앙 */
    .intro-lang__row--top {
        grid-template-columns: repeat(3, 180px);
        justify-content: center;
        max-width: 600px;
    }

    /* 2행: 180×4 + gap 30×3 = 810px */
    .intro-lang__row--bottom {
        grid-template-columns: repeat(4, 180px);
        justify-content: center;
        max-width: 810px;
    }

    .intro-lang__item {
        min-height: 185px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .intro-lang__reveal {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .intro-lang__item,
    .intro-lang__submit,
    .intro-lang__flag {
        transition: none;
    }

    .intro-lang__item:hover,
    .intro-lang__submit.is-ready:hover {
        transform: none;
    }

    .intro-lang__item:hover .intro-lang__flag,
    .intro-lang__item[aria-pressed="true"] .intro-lang__flag,
    .intro-lang__item[aria-pressed="true"]:hover .intro-lang__flag {
        transform: none;
        filter: none;
    }
}
