/* ==========================================
   CSS Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #212121;
    --color-background: #ffffff;
    --color-text: #212121;
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --color-hover: #000000;

    --header-height: 90px;
    --header-height-mobile: 60px;

    --transition-speed: 0.3s;

    /* Font families based on requirements */
    --font-title-ko: 'Pretendard', sans-serif;
    --font-title-en: 'Bebas Neue', sans-serif;
    --font-menu-ko: 'Pretendard', sans-serif;
    --font-menu-en: 'Poppins', sans-serif;
    --font-desc-ko: 'Pretendard', sans-serif;
    --font-desc-en: 'Lato', sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-desc-ko);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

body[lang="en"] {
    font-family: var(--font-desc-en);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--color-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================
   Header
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

.header-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-title-ko);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

body[lang="en"] .logo {
    font-family: var(--font-title-en);
    font-size: 28px;
    letter-spacing: 1px;
}

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-menu-ko);
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text);
    position: relative;
}

body[lang="en"] .nav-link {
    font-family: var(--font-menu-en);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-primary);
}

.nav-link:hover {
    color: var(--color-hover);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    list-style: none;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    border-bottom: 1px solid var(--color-border);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background-color: #f8f8f8;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lang-toggle {
    font-family: var(--font-menu-en);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
}

.lang-toggle:hover {
    background-color: var(--color-primary);
    color: var(--color-background);
    border-color: var(--color-primary);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 28px;
    justify-content: center;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transition: all var(--transition-speed) ease;
}

/* ==========================================
   Main Content
   ========================================== */
.main {
    margin-top: var(--header-height);
}

.section {
    padding: 80px 0;
}

.section-title {
    font-family: var(--font-title-ko);
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 48px;
    letter-spacing: -1px;
}

body[lang="en"] .section-title {
    font-family: var(--font-title-en);
    font-size: 42px;
    letter-spacing: 2px;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #fafafa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-title-ko);
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -2px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[lang="en"] .hero-title {
    font-family: var(--font-title-en);
    font-size: 80px;
    letter-spacing: 4px;
}

.hero-subtitle {
    font-family: var(--font-desc-ko);
    font-size: 22px;
    color: #ffffff;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body[lang="en"] .hero-subtitle {
    font-family: var(--font-desc-en);
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-text);
}

/* Artworks Section */
.artworks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 24px;
}

.category-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-menu-ko);
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    transition: all var(--transition-speed) ease;
}

body[lang="en"] .filter-btn {
    font-family: var(--font-menu-en);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-background);
    border-color: var(--color-primary);
}

.artworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.artwork-card {
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}

.artwork-card:hover {
    transform: translateY(-4px);
}

.artwork-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 16px;
}

.artwork-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-info {
    padding: 0 4px;
}

.artwork-title {
    font-family: var(--font-desc-ko);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}

body[lang="en"] .artwork-title {
    font-family: var(--font-desc-en);
}

.artwork-meta {
    font-family: var(--font-desc-ko);
    font-size: 13px;
    color: var(--color-text-light);
    font-weight: 300;
}

body[lang="en"] .artwork-meta {
    font-family: var(--font-desc-en);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
    font-size: 14px;
}

/* Contact Section */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-text);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background-color: #fafafa;
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
}

.footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-light);
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-container {
    position: relative;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    background-color: var(--color-background);
    border-radius: 8px;
    overflow: hidden;
    z-index: 2001;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 32px;
    color: var(--color-text);
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    transition: background-color var(--transition-speed) ease;
}

.modal-close:hover {
    background-color: var(--color-background);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-title {
    font-family: var(--font-title-ko);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

body[lang="en"] .modal-title {
    font-family: var(--font-title-en);
    font-size: 32px;
    letter-spacing: 1px;
}

.modal-meta {
    font-family: var(--font-desc-ko);
    font-size: 15px;
    color: var(--color-text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

body[lang="en"] .modal-meta {
    font-family: var(--font-desc-en);
}

.modal-description {
    font-family: var(--font-desc-ko);
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text);
}

body[lang="en"] .modal-description {
    font-family: var(--font-desc-en);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.modal-nav-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: background-color var(--transition-speed) ease;
}

.modal-nav-btn:hover {
    background-color: var(--color-background);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
    .artworks-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 32px;
    }

    .modal-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

    .header {
        height: var(--header-height-mobile);
    }

    .logo {
        font-size: 20px;
    }

    body[lang="en"] .logo {
        font-size: 24px;
    }

    .nav {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        right: 0;
        background-color: var(--color-background);
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-speed) ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 16px 24px;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-top: 1px solid var(--color-border);
        box-shadow: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero-title {
        font-size: 40px;
    }

    body[lang="en"] .hero-title {
        font-size: 48px;
    }

    .section-title {
        font-size: 28px;
        margin-bottom: 32px;
    }

    body[lang="en"] .section-title {
        font-size: 32px;
    }

    .section {
        padding: 60px 0;
    }

    .artworks-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 24px;
    }

    .artworks-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .artworks-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero {
        height: 70vh;
        min-height: 400px;
    }

    .hero-title {
        font-size: 40px;
    }

    body[lang="en"] .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 18px;
    }
}
