:root {
    /* Default Dark Mode (Slate & Ember) */
    --bg: #0F172A; /* Deep Slate */
    --surface: #1E293B;
    --text: #F8FAFC; /* Chalk */
    --text-muted: #94A3B8;
    --accent: #F97316; /* Terra Cotta / Ember */
    --accent-glow: rgba(249, 115, 22, 0.2);
    --border: rgba(255, 255, 255, 0.05);
    
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Outfit', sans-serif;
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg: #FDFCFB; /* Bone / Off-white */
    --surface: #FFFFFF;
    --text: #0F172A; /* Deep Slate */
    --text-muted: #475569;
    --accent: #C2410C; /* Deeper Terra Cotta */
    --accent-glow: rgba(194, 65, 12, 0.1);
    --border: rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    transition: background-color 0.8s ease, color 0.8s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

body.no-scroll {
    overflow: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(15deg);
}

.whatsapp-link {
    background: var(--accent);
    color: white !important;
    border: none !important;
}

.whatsapp-link:hover {
    background: var(--accent);
    filter: brightness(1.1);
}

/* Header Refinement */
header#main-nav {
    position: fixed;
    top: -1px; /* Solves subpixel rounding gaps on high-res mobile displays */
    left: 0; width: 100%;
    height: calc(91px + env(safe-area-inset-top, 0px));
    display: flex; justify-content: space-between; align-items: center;
    padding: calc(env(safe-area-inset-top, 0px) + 1px) 5% 0;
    z-index: 1000;
    transition: var(--transition);
    background: var(--bg); /* Opaque background prevents scrolling content leaks at status-bar */
    
    /* Hardware acceleration forces browser to layer the header above GPU-promoted scroll layers */
    transform: translate3d(0, 0, 0);
    will-change: transform, height, background;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Bulletproof top-extension block covers safe-area notch rounding gaps under any dynamic scroll state */
header#main-nav::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 0;
    width: 100%;
    height: 202px; /* 2px overlap */
    background: var(--bg);
    z-index: -1;
    transition: background 0.5s ease;
}

header#main-nav.scrolled {
    background: var(--bg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: calc(71px + env(safe-area-inset-top, 0px));
    padding: calc(env(safe-area-inset-top, 0px) + 1px) 5% 0;
}

header#main-nav.scrolled::before {
    background: var(--bg);
}

/* When mobile menu overlay is active, temporarily elevate header to z-index 1100 to show the 'X' toggle, while fading out other buttons */
body.no-scroll header#main-nav {
    z-index: 1100 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.no-scroll header#main-nav::before {
    display: none !important; /* Hide notch backdrop extension so it doesn't block the blurry overlay styling */
}

body.no-scroll header#main-nav .logo,
body.no-scroll header#main-nav .theme-toggle,
body.no-scroll header#main-nav .whatsapp-link,
body.no-scroll header#main-nav .nav-cta {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}

.logo {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap; /* Prevents logo text wrapping under any screen width */
}

.logo span { color: var(--accent); }

.nav-links-desktop {
    display: flex; gap: 50px;
}

/* Hide Mobile Menu Overlay on Desktop */
.nav-links-mobile {
    display: none;
}

.nav-item {
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    transition: var(--transition);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 1px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active { color: var(--text); }
.nav-item:hover::after, .nav-item.active::after { width: 100%; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-cta {
    padding: 10px 25px !important;
    font-size: 0.7rem !important;
    box-shadow: none !important;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text);
    transition: var(--transition);
}

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

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

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

/* Hero Section */
.hero {
    height: 110vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: calc(91px + 40px) 5% 40px; /* Top padding clears the fixed header cleanly on desktop */
    position: relative;
}

.hero-text {
    z-index: 10;
    padding-right: 50px;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}

.hero-title {
    font-size: clamp(4rem, 10vw, 9rem);
    font-weight: 800;
    line-height: 0.85;
    margin-bottom: 40px;
    letter-spacing: -0.05em;
}

.hero-visual {
    height: 80%;
    position: relative;
}

.hero-image-wrapper {
    width: 100%; height: 100%;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    overflow: hidden;
}

.hero-image-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
    background: transparent;
    filter: saturate(0.8) contrast(1.1);
    transition: transform 2s ease;
}

/* Gallery Section */
.gallery-section {
    padding: 120px 5% 80px; /* Reduced top padding for more reasonable desktop header spacing */
}

/* Category header block spacing */
.category-header-block {
    margin-bottom: 60px; /* Highly reasonable space between header and first artwork on desktop */
}

.section-title {
    font-family: var(--font-serif);
    font-size: 5rem;
    margin-bottom: 100px;
    text-align: center;
}

.artwork-grid {
    column-count: 2;
    column-gap: 80px;
}

.art-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 100px;
    position: relative;
    break-inside: avoid;
    cursor: pointer;
}

.art-image-container {
    position: relative;
    background: transparent;
    border-radius: 0;
    overflow: hidden; /* Bulletproof mask for inner image scaling */
}

.art-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0;
}

/* Hover Zoom effect */
.art-card:hover .art-image-container img {
    transform: scale(1.03);
}

.art-details {
    margin-top: 30px;
    padding-left: 20px;
    border-left: 2px solid var(--accent); /* Thicker line for premium layout presence */
    transition: border-color 0.4s ease, padding-left 0.4s ease;
}

/* Tactile visual shift on hover */
.art-card:hover .art-details {
    border-left-color: var(--text);
    padding-left: 25px;
}

/* Artwork Status Line (Curator's Descriptive Card style) */
.art-status-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 5px;
    margin-bottom: 12px;
    font-family: var(--font-sans);
}

.art-status-line .status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background-color: var(--text-muted);
}

.art-status-line.status-available {
    color: #10b981;
}
.art-status-line.status-available .status-indicator {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.art-status-line.status-sold {
    color: #ef4444;
}
.art-status-line.status-sold .status-indicator {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.art-status-line.status-private-collection {
    color: var(--text-muted);
}
.art-status-line.status-private-collection .status-indicator {
    background-color: var(--text-muted);
}

.art-details {
    margin-top: 30px;
    padding-left: 20px;
    border-left: 1px solid var(--accent);
}

.art-name {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.art-price {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
}

/* Buttons */
.btn-cta {
    display: inline-block;
    padding: 20px 50px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    box-shadow: 0 10px 20px var(--accent-glow);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--accent-glow);
}

/* Utilities */
.fade-up { opacity: 0; transform: translateY(40px); transition: var(--transition); }
.fade-up.active { opacity: 1; transform: translateY(0); }

.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

/* Mobile-First Lightbox Immersive View */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--surface); /* Unified with info panel */
    display: none;
    opacity: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.lightbox-content {
    display: flex;
    flex-direction: column; /* Mobile Default */
    min-height: 100vh;
    width: 100%;
    padding-top: 70px; /* Offset for the lightbox header bar */
}

.lightbox-image-container {
    background: #000; /* Distinct image area */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    height: 60vh;
    width: 100%;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

.lightbox-info-panel {
    background: var(--surface);
    padding: 100px 8%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Prevent cutting off content at bottom */
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.info-label {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 5px;
}

.info-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 10px;
    color: var(--text);
}

.info-price {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 60px;
    letter-spacing: 0.05em;
}

.artwork-metrics {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 70px;
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.5; /* Whisper-thin labels */
    font-weight: 600;
}

.metric-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.inquiry-heading {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.inquiry-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    opacity: 0.8;
}

.inquiry-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-inquiry {
    display: flex;
    flex-direction: row; /* Horizontal layout for arrow */
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.05); /* Lighter base for visibility */
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    cursor: pointer;
}

.inquiry-content {
    display: flex;
    flex-direction: column;
}

.btn-inquiry .btn-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.btn-inquiry .btn-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.btn-arrow {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.3;
    transition: all 0.4s ease;
    transform: translateX(-10px);
}

.btn-inquiry:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 15px rgba(249, 115, 22, 0.1);
}

.btn-inquiry:hover .btn-arrow {
    opacity: 1;
    transform: translateX(0);
}

.btn-inquiry:active {
    transform: translateY(-2px) scale(0.98);
}

/* Close Button Enhancement */
.lightbox-close {
    position: fixed;
    top: 40px;
    right: 40px;
    font-size: 1.2rem;
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text);
    transition: all 0.3s ease;
    z-index: 2100;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
    background: var(--accent);
    color: #000;
    transform: rotate(90deg) scale(1.1);
}

/* Lightbox Header Bar (Option 2.A) */
.lightbox-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--surface); /* Matching main site surface theme color */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 2200;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .lightbox-header-bar {
    background: rgba(253, 252, 251, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.lightbox-brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.lightbox-brand span {
    color: var(--accent);
}

/* Nesting overrides for the close button inside the header bar */
.lightbox-header-bar .lightbox-close {
    position: static;
    font-size: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Desktop Expansion Refinement */
@media (min-width: 1024px) {
    .lightbox-content {
        flex-direction: row;
    }

    .lightbox-image-container {
        flex: 1; /* More space for the info panel balance */
        height: calc(100vh - 70px);
        position: sticky;
        top: 70px;
        padding: 80px;
    }

    .lightbox-info-panel {
        flex: 1; /* Balanced 50/50 split on desktop */
        padding: 0 10%;
        border-left: 1px solid rgba(255,255,255,0.05);
    }
}

/* Footer Section */
.main-footer {
    padding: 100px 5%;
    background: var(--surface);
    margin-top: 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 80px;
}

.footer-brand .logo {
    margin-bottom: 25px;
}

.footer-text {
    color: var(--text-muted);
    max-width: 450px;
    font-size: 1.1rem;
}

.footer-heading {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    margin-bottom: 30px;
    color: var(--accent);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    header#main-nav { height: calc(81px + env(safe-area-inset-top, 0px)); padding: calc(env(safe-area-inset-top, 0px) + 1px) 5% 0; }
    
    .logo {
        font-size: 1.5rem; /* Scales logo font-size down for tablet/mobile */
    }
    
    .nav-links-desktop {
        display: none; /* Hides desktop navigation bar on mobile */
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        bottom: -100px; /* Extended below bottom viewport edge to block dynamic address bar gap leaks */
        left: auto;
        right: -100%;
        width: 100%; 
        height: calc(100dvh + 100px); /* 100px taller than dynamic viewport height */
        height: calc(100% + 100px);
        min-height: -webkit-fill-available;
        /* Translucent slate base overlaid with a gorgeous brand-orange ambient radial light glow */
        background: radial-gradient(circle at 50% 40%, rgba(249, 115, 22, 0.08) 0%, transparent 60%), rgba(15, 23, 42, 0.72);
        backdrop-filter: blur(35px) saturate(190%);
        -webkit-backdrop-filter: blur(35px) saturate(190%); /* World-class blurry ambient glassmorphism backdrop */
        flex-direction: column;
        justify-content: center;
        align-items: flex-start; /* Left aligned curator index */
        padding: 0 12%; /* Generous side padding */
        gap: 30px;
        transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
        display: flex;
        border-left: 1px solid rgba(255, 255, 255, 0.03);
        
        /* Hardware acceleration to prevent compositor layering bleed-through */
        transform: translate3d(0, 0, 0);
        will-change: transform, right;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    [data-theme="light"] .nav-links {
        /* Translucent light mode base overlaid with a soft warm brand-orange radial light glow */
        background: radial-gradient(circle at 50% 40%, rgba(194, 65, 12, 0.05) 0%, transparent 60%), rgba(253, 252, 251, 0.72);
        border-left: 1px solid rgba(0, 0, 0, 0.03);
    }

    .nav-links.active { right: 0; }
    
    .nav-item { 
        font-size: 1.15rem; 
        font-family: var(--font-sans); 
        font-weight: 300;
        text-transform: uppercase;
        letter-spacing: 0.25em;
        color: var(--text-muted);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 20px;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        opacity: 0;
        transform: translateY(20px);
    }

    /* Staggered slide entry animation when menu is opened */
    .nav-links.active .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links.active .nav-item:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active .nav-item:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active .nav-item:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active .nav-item:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.active .nav-item:nth-child(5) { transition-delay: 0.5s; }

    /* Curator list numbers index prefix */
    .nav-item::before {
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--accent);
        letter-spacing: 0.1em;
        opacity: 0.6;
        transition: all 0.4s ease;
    }

    .nav-item:nth-child(1)::before { content: "01"; }
    .nav-item:nth-child(2)::before { content: "02"; }
    .nav-item:nth-child(3)::before { content: "03"; }
    .nav-item:nth-child(4)::before { content: "04"; }
    .nav-item:nth-child(5)::before { content: "05"; }

    .nav-item:hover, .nav-item.active { 
        color: var(--text); 
        padding-left: 10px;
    }

    .nav-item:hover::before {
        transform: scale(1.1);
        opacity: 1;
    }

    /* Studio tagline details at footer overlay */
    .nav-links::after {
        content: "Art as Prayer. Community as Spirit.";
        position: absolute;
        bottom: 150px; /* Shifted up by 100px to account for the bottom viewport safety extension */
        left: 12%;
        font-size: 0.62rem;
        text-transform: uppercase;
        letter-spacing: 0.25em;
        color: var(--accent); /* Glowing bright amber brand accent color */
        opacity: 0.9;
        font-family: var(--font-sans);
        font-weight: 600;
    }

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

    .hero { 
        grid-template-columns: 1fr; 
        height: auto; 
        padding: 150px 5% 100px;
        min-height: 100vh;
    }
    
    .hero-text { text-align: center; margin-bottom: 60px; padding-right: 0; }
    .hero-title { font-size: clamp(3.5rem, 15vw, 6rem); }
    .hero-visual { height: 500px; }

    .artwork-grid { column-count: 1; column-gap: 0; }
    .section-title { font-size: 3.5rem; }

    .gallery-section {
        padding: 95px 5% 60px; /* Highly reasonable spacing from header bottom to category title on mobile */
    }
    
    .category-header-block {
        margin-bottom: 40px; /* Highly reasonable space from title to first image on mobile */
    }
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; gap: 50px; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 20px; }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem; /* Ultra safe scaling for small screens to prevent any overlap */
    }
    .hero-title { font-size: 3rem; }
    .hero-visual { height: 400px; }
    .section-title { font-size: 2.5rem; }
    .nav-cta { display: none; }
}
