/* =========================================
   Variables & Reset
   ========================================= */
:root {
    --bg-color: #0c0c0b; /* Very deep, warm charcoal */
    --text-main: #efeee8; /* Soft pearl white */
    --text-muted: #888884;
    --accent: #dca85c; /* Subdued, elegant gold */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 5rem;
    --space-xl: 10rem;
    
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.loading {
    overflow: hidden;
}

::selection {
    background-color: rgba(220, 168, 92, 0.3);
    color: var(--text-main);
}

/* =========================================
   Preloader
   ========================================= */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preloader-text {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-style: italic;
    color: var(--text-main);
}

.preloader-sub {
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 10px;
}

/* =========================================
   Typography & Shared
   ========================================= */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.1;
}

.italic-serif {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.section-label {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: var(--space-md);
    display: inline-block;
}

/* =========================================
   Navigation
   ========================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 400;
}

.nav-brand span {
    color: var(--accent);
    font-style: italic;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: translateX(-101%);
    transition: transform 0.4s var(--ease-out-expo);
}

.nav-link:hover::after {
    transform: translateX(0);
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    min-height: 100vh;
    padding: 0 5%;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 2;
    margin-top: 5vh;
}

.hero-label {
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(4rem, 10vw, 11rem);
    display: flex;
    flex-direction: column;
    letter-spacing: -1px;
    line-height: 1.15;
}

.hero-title-line {
    display: block;
    padding-bottom: 0.1em; /* extra padding to prevent descender clipping if any */
}

.hero-title-line:nth-child(2) {
    padding-left: 8vw; /* Indent the second line for dynamic layout */
}

.hero-title-line:nth-child(3) {
    padding-left: 4vw;
}

.hero-image-wrapper {
    position: absolute;
    right: 5%;
    top: 25%;
    width: 28vw;
    height: 65vh;
    z-index: 1;
    overflow: hidden;
}

.hero-image-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 2;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%; /* Focus on the face if cropped */
    transform: scale(1.15); 
    filter: brightness(1) contrast(1); /* Reset to original for the final portrait */
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.scroll-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: rotate(-90deg);
    transform-origin: left center;
    margin-left: 15px;
    color: var(--text-muted);
}

.scroll-line-container {
    width: 1px;
    height: 80px;
    background-color: rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.scroll-line {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-main);
    animation: scrollDown 2.5s infinite var(--ease-out-expo);
}

/* =========================================
   Selected Works (Editorial Grid)
   ========================================= */
.work {
    padding: var(--space-xl) 5%;
    background-color: #080808;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: var(--space-md);
}

.section-title {
    font-size: clamp(3rem, 7vw, 7rem);
    letter-spacing: -1px;
}

.gallery-sub-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

.section-desc {
    max-width: 400px;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4rem 2rem;
}

/* Editorial Grid specific classes */
.gallery-item {
    position: relative;
    transform: translateZ(0);
}

.item-large { grid-column: 2 / 12; }
.item-square { grid-column: span 6; aspect-ratio: 1/1; }
.item-portrait { grid-column: span 4; }
.item-landscape { grid-column: span 8; }

/* Offsets for organic flow */
.gallery-item:nth-child(2) { margin-top: 10vw; }
.gallery-item:nth-child(3) { margin-top: -5vw; }
.gallery-item:nth-child(4) { margin-top: 5vw; }
.gallery-item:nth-child(6) { margin-top: 15vw; }

.item-visual {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #111;
    transform: translateZ(0); /* Hardware acceleration for video glitching */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.gallery-container .item-visual {
    height: auto;
    min-height: 300px;
}

.item-visual video, .item-visual img {
    width: 100%;
    height: auto; /* Fluid height for true form */
    display: block;
    object-fit: contain; /* Keep images in true form */
    transition: transform 1.2s var(--ease-out-expo), filter 1.2s var(--ease-out-expo), opacity 0.8s ease;
    filter: brightness(0.9) saturate(0.9);
    opacity: 0; /* Hidden until loaded */
}

.item-visual.is-loaded video,
.item-visual.is-loaded img {
    opacity: 1;
}

.item-visual.is-loaded .asset-loader {
    opacity: 0;
    pointer-events: none;
}

.masonry-item .item-visual img {
    height: auto;
    object-fit: contain; /* Keep images in true form */
}

.gallery-item:hover .item-visual video, 
.gallery-item:hover .item-visual img {
    transform: scale(1.03);
    filter: brightness(1) saturate(1.1);
}

.item-info {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
}

.item-meta {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.item-info h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
}

/* =========================================
   Gallery Numbering (CSS Counters)
   ========================================= */
.gallery-container, .masonry-grid {
    counter-reset: work-counter;
}

.gallery-item, .masonry-item {
    counter-increment: work-counter;
    position: relative;
}

.gallery-item::before, .masonry-item::before {
    content: counter(work-counter, decimal-leading-zero);
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    color: var(--text-main);
    opacity: 0;
    z-index: 10;
    transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
    pointer-events: none;
}

.gallery-item:hover::before, .masonry-item:hover::before {
    opacity: 0.8;
    transform: translateY(-5px);
}

/* =========================================
   Asset Loader / Spinner
   ========================================= */
.asset-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
    transition: opacity 0.4s ease;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =========================================
   Gallery Layouts
   ========================================= */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4rem; /* Increased for premium feel */
}

/* =========================================
   Drawings & Concepts (Masonry)
   ========================================= */
.masonry-grid {
    column-count: 3;
    column-gap: 4rem; /* Increased spacing */
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 3rem;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
        column-gap: 0;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 4rem; /* Increased spacing */
    opacity: 0; /* Prepared for GSAP scroll reveal */
    transform: translateY(30px);
}

/* =========================================
   About Studio Section
   ========================================= */
.about {
    padding: var(--space-xl) 5%;
}

.about-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 8vw;
    align-items: center;
}

.about-title {
    font-size: clamp(2.5rem, 5vw, 5rem);
    margin-bottom: var(--space-md);
    line-height: 1;
}

.about-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: var(--space-lg);
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    border-radius: 100px;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s var(--ease-out-expo);
    z-index: -1;
}

.btn-primary:hover {
    color: var(--bg-color);
}

.btn-primary:hover::before {
    transform: scaleY(1);
}

.about-visual {
    width: 100%;
    height: 80vh;
    overflow: hidden;
}

/* =========================================
   Footer
   ========================================= */
/* =========================================
   Footer / Contact Redesign
   ========================================= */
.footer {
    padding: var(--space-xl) 5% 4rem;
    background-color: #030303;
}

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

.footer-main-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 10%;
    margin-bottom: var(--space-xl);
}

.footer-info h2 {
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.9;
    margin-bottom: 2.5rem;
}

.footer-info p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.meta-dot {
    width: 6px;
    height: 6px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    position: relative;
}

.meta-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: inherit;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

.contact-channels {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.channel {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1.5rem;
}

.channel-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.channel-link {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
    display: block;
}

.channel-link:hover {
    color: var(--accent);
    transform: translateX(10px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 3rem;
}

.footer-nav {
    display: flex;
    gap: 3rem;
}

.footer-nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-copyright {
    text-align: right;
    color: var(--text-muted);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
    .gallery-container {
        display: flex;
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .gallery-item {
        margin-top: 0 !important;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-visual {
        height: 50vh;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 2rem 5%;
    }
    
    .nav-links {
        display: none; /* Hide on mobile for now, or implement humburger */
    }
    
    .hero-image-wrapper {
        position: relative;
        right: auto; top: auto;
        width: 100%;
        height: 50vh;
        margin-top: var(--space-md);
    }
    
    .hero-title-line:nth-child(2), .hero-title-line:nth-child(3) {
        padding-left: 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .footer-main-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-info h2 {
        font-size: 3.5rem;
    }

    .footer-contact-main {
        align-items: flex-start;
        text-align: left;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer-nav {
        flex-direction: column;
        gap: 1.5rem;
    }
}
