* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #F0F0F0;
    --content-bg: #FFFFFF;
    --text-color: #000000;
    --container-max-width: 500px;
    --base-font-size: 18px;
}

html {
    font-size: var(--base-font-size);
}

body {
    font-family: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    background-color: var(--content-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 스타일 */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    padding: 0 1.5rem;
    background-color: var(--content-bg);
    z-index: 100;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    width: 13rem;
    height: 4rem;
    object-fit: contain;
}

.nav-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 0.7;
}

.icon-btn svg,
.icon-btn img {
    display: block;
    width: 2rem;
    height: 2rem;
}

/* 콘텐츠 영역 */
.content {
    flex: 1;
    padding: 1rem 1.5rem 2rem;
    margin-top: 72px;
}

.home-footer {
    border-top: 1px solid #d8d8d8;
    background-color: #e3e3e3;
    padding: 0.7rem 1rem;
}

.home-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.9rem;
}

.home-footer-nav a {
    color: #6b6b6b;
    font-size: 0.74rem;
    line-height: 1.4;
    text-decoration: none;
}

.home-footer-nav a:hover {
    text-decoration: underline;
}

/* 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 1.5rem;
}

/* 카드 링크 */
.card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

/* 카드 이미지 컨테이너 - CLS 방지 */
.card-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--bg-color);
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 카드 이미지 */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    letter-spacing: -0.01em;
    padding: 0 0.2rem;
}

/* 로딩/에러 상태 */
.card-grid-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.language-toggle {
    margin-top: 1rem;
    position: relative;
    width: 100%;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.language-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 2.25rem;
    border: 1px solid #d89a76;
    background-color: #d89a76;
    color: #fff;
    border-radius: 999px;
    padding: 0 0.8rem;
    line-height: 1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.language-btn:hover {
    background-color: #cd8f6b;
}

.language-caret {
    position: absolute;
    right: 0.8rem;
    width: 0;
    height: 0;
    border-left: 0.38rem solid transparent;
    border-right: 0.38rem solid transparent;
    border-top: 0.5rem solid #fff;
}

.language-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 120;
}

.language-option {
    width: 100%;
    border: none;
    background: #fff;
    color: #1f2937;
    text-align: center;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.language-option + .language-option {
    border-top: 1px solid #f3f4f6;
}

.language-option:hover,
.language-option.is-active {
    background-color: #f8eee8;
    color: #c88660;
}

/* 반응형 디자인: 500px 이하 - 레이아웃 및 여백 조정 */
@media (max-width: 500px) {
    .header {
        height: 72px;
        padding: 0 1.2rem;
    }

    .nav-icons {
        gap: 0.8rem;
    }

    .content {
        padding: 0.8rem 1.2rem 1.5rem;
        margin-top: 72px;
    }

    .home-footer {
        padding: 0.65rem 0.85rem;
    }

    .card-grid {
        gap: 1.5rem 1.2rem;
    }

    .card-image {
        border-radius: 0.85rem;
        margin-bottom: 0.6rem;
    }
}

/* 반응형 디자인: 400px 이하 - rem 기반 전체 축소 */
@media (max-width: 400px) {
    html {
        font-size: 14px;
    }

    .header {
        height: 72px;
        padding: 0 1rem;
    }

    .content {
        padding: 0.75rem 1rem 1.25rem;
        margin-top: 72px;
    }

    .home-footer-nav {
        gap: 0.35rem 0.7rem;
    }

    .home-footer-nav a {
        font-size: 0.72rem;
    }

    .card-grid {
        gap: 1.25rem 1rem;
    }

    .card-image {
        border-radius: 0.75rem;
        margin-bottom: 0.5rem;
    }
}
