:root {
    --bg-color: #fcfbf9;
    /* Soft paper white */
    --text-primary: #1a1a1a;
    /* Soft black */
    --text-sec: #666;
    --accent: #d4cfc5;
    /* Hanji paper accent */
    --border: #e6e3dd;
    --modal-bg: rgba(252, 251, 249, 0.95);

    --font-kr: 'Noto Serif KR', serif;
    --font-en: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;

    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px; /* Accounts for the fixed header */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(252, 251, 249, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
}

.logo a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kr-subtitle {
    font-family: var(--font-kr);
    font-size: 1rem;
    color: var(--text-sec);
    font-weight: 300;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.cart-btn {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.cart-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.cart-btn:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: var(--font-en);
    font-size: 5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.2s ease forwards 0.3s;
}

.hero-subtitle {
    font-family: var(--font-kr);
    font-size: 1.5rem;
    color: var(--text-sec);
    font-weight: 300;
    letter-spacing: 5px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards 0.6s;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.9s;
}

.line {
    width: 1px;
    height: 60px;
    background-color: var(--text-primary);
    animation: lineGrow 2s ease-in-out infinite alternate;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lineGrow {
    0% {
        height: 0;
    }

    100% {
        height: 60px;
    }
}




.filter-fade-in {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.filter-fade-in.visible {
    opacity: 1;
}

/* Gallery Section */
.gallery-section {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kr-title {
    font-family: var(--font-kr);
    font-size: 1.2rem;
    color: var(--text-sec);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 4rem;
}

.art-card {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.art-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.img-container {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background-color: var(--accent);
    margin-bottom: 2rem;
    position: relative;
    cursor: pointer;
}

.art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-container:hover .art-img {
    transform: scale(1.05);
}

.art-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.art-title {
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.art-title-kr {
    font-family: var(--font-kr);
    font-size: 1.1rem;
    color: var(--text-sec);
    margin-bottom: 0.5rem;
}

.art-price {
    font-size: 1.1rem;
    font-weight: 300;
}

.buy-btn {
    align-self: flex-start;
    margin-top: 1rem;
    padding: 0 0 2px 0;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--text-sec);
    color: var(--text-sec);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
}

.buy-btn:hover {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-primary);
    background-color: transparent;
}

/* General Sections */
.about-section,
.exhibitions-section,
.contact-section {
    padding: 6rem 4rem;
    max-width: 1400px; /* Widened for better text flow */
    margin: 0 auto;
}

.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* About Section */
.about-content {
    text-align: center;
}

.about-layout {
    display: flex;
    gap: 5rem;
    align-items: center;
    text-align: left;
    margin-top: 3rem;
    max-width: 1200px;
    margin-inline: auto;
}

.about-img-container {
    flex: 0 0 45%;
    max-width: 550px;
    overflow: hidden;
    background-color: var(--accent);
}

.about-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.about-text {
    flex: 1;
}

.about-text p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.about-text .kr-text {
    font-family: var(--font-kr);
    font-size: 1.1rem;
    color: var(--text-sec);
}

/* Exhibitions Section */
.exhibition-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exhibition-item {
    display: flex;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    align-items: baseline;
}

.ex-year {
    font-family: var(--font-en);
    font-size: 1.5rem;
    color: var(--text-sec);
    min-width: 80px;
}

.ex-details h3 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.ex-details p {
    color: var(--text-sec);
}

/* Contact Section */
.contact-box {
    text-align: center;
    background-color: white;
    padding: 4rem;
    border: 1px solid var(--border);
    transition: transform 0.4s ease;
}

.contact-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.contact-email {
    display: inline-block;
    margin: 2rem 0;
    font-family: var(--font-en);
    font-size: 2rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-email:hover {
    opacity: 0.7;
}

.contact-address {
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Modal / Cart */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 3rem;
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateX(0);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    align-self: flex-end;
    color: var(--text-primary);
}

.section-title {
    font-family: var(--font-en);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: transparent;
    border: none;
    font-family: var(--font-en);
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-primary);
}

/* Gallery Grid */
.modal-title {
    font-family: var(--font-en);
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.cart-item-details h4 {
    font-family: var(--font-en);
    font-size: 1.1rem;
    font-weight: 500;
}

.cart-item-details p {
    font-family: var(--font-kr);
    font-size: 0.9rem;
    color: var(--text-sec);
}

.remove-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 0.5rem;
}

.cart-total {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-family: var(--font-en);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: none;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    background-color: #333;
}

.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.footer {
    padding: 4rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-kr {
    font-family: var(--font-kr);
    color: var(--text-sec);
    margin-top: 0.5rem;
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 4rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .gallery-section,
    .about-section,
    .exhibitions-section,
    .contact-section {
        padding: 6rem 2rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .nav {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 3rem;
        margin-top: 4rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .gallery-section,
    .about-section,
    .exhibitions-section,
    .contact-section {
        padding: 4rem 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .modal {
        padding: 2rem 1.5rem;
        max-width: 90%;
    }

    .exhibition-item {
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 1.5rem;
    }

    .contact-box {
        padding: 3rem 1.5rem;
    }

    .contact-email {
        font-size: 1.5rem;
        margin: 1.5rem 0;
    }

    .about-layout {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 3rem;
    }

    .footer {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .gallery-section,
    .about-section,
    .exhibitions-section,
    .contact-section {
        padding: 3rem 1rem;
    }

    .modal {
        max-width: 100%;
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }
}

/* Language Toggle & Links */
body[data-lang="en"] .lang-kr { display: none !important; }
body[data-lang="kr"] .lang-en { display: none !important; }

.lang-toggle-btn {
    background: transparent;
    border: 1px solid var(--text-primary);
    padding: 0.3rem 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.05rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.lang-toggle-btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
}

.art-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(252, 251, 249, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    font-size: 3rem;
    font-weight: 300;
    color: #1a1a1a;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.lightbox-close:hover {
    transform: scale(1.1);
}
.ad-image {
    cursor: zoom-in;
}

/* Mini Related Artworks */
.mini-related-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
}
.mini-related-title {
    font-family: var(--font-en);
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mini-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.mini-art-link {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f9f9f9;
}
.mini-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.mini-art-link:hover .mini-art-img {
    transform: scale(1.05);
}