:root {
    /* Premium Dark Palette */
    --color-bg-main: #050505;
    /* Deepest Black */
    --color-bg-surface: #111111;
    --color-text-primary: #e6e6e6;
    /* Soft White */
    --color-text-secondary: #888888;
    --color-accent: #c5a47e;
    /* Muted Gold/Beige for elegance */

    --color-border: rgba(255, 255, 255, 0.08);

    /* Typography - Editorial Style */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --nav-height: 100px;
    --spacing-lg: 6rem;

    /* Transitions */
    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Only hide cursor if JS enables it */
body.custom-cursor-active,
body.custom-cursor-active * {
    cursor: none;
}

body {
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Base Link Styles */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Film Grain Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10000;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover State for Cursor */
body:hover .cursor-outline.hovered {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

/* Typography Overrides */
h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    /* Lighter for elegance */
    letter-spacing: -0.02em;
    line-height: 1;
}

h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 400;
}

/* Navbar - Centered Studio Style */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 4rem;
    z-index: 1000;
    background: transparent;
    /* Clean look */
    mix-blend-mode: difference;
    /* Ensures visibility on light images */
    color: white;
    /* Force white for difference mode */
}

.logo {
    grid-column: 2;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

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

.nav-socials {
    grid-column: 3;
    justify-self: end;
    display: flex;
    gap: 1.5rem;
    border: none;
    /* Removed border */
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: white;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.social-icon:hover {
    opacity: 1;
}

.nav-link {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: white;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Sections */
.section {
    display: none;
    padding: var(--spacing-lg) 5%;
    min-height: calc(100vh - var(--nav-height));
    opacity: 0;
}

.section.active {
    display: block;
    animation: fadeIn 0.8s forwards;
}

/* Hero Section */
#home {
    padding: 0;
    display: none;
    height: 100vh;
    width: 100%;
    position: relative;
    margin-top: calc(var(--nav-height) * -1);
    /* Full screen */
    overflow: hidden;
}

#home.active {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-main);
}

.home-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6)), url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding-top: 4rem;
}

.hero-content h1 {
    opacity: 0;
    animation: fadeInUp 1.2s var(--transition-smooth) 0.2s forwards;
    transform: translateY(30px);
    margin-bottom: 2rem;
    pointer-events: none;
    /* Let clicks pass through */
}

/* Home Interactive Menu */
.home-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 1.2s var(--transition-smooth) 0.5s forwards;
    transform: translateY(30px);
}

.home-link {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.home-link:hover {
    color: white;
    transform: scale(1.05);
}

/* Remove old btn styles if unused or keep generic */
.btn {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 1rem 3.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    margin-top: 2rem;
    text-transform: uppercase;
    color: white;
    cursor: pointer;
}

.btn:hover {
    background-color: white;
    color: black;
    border-color: white;
}

/* Portfolio Grid - Masonry Feel (Simulated) */
.grid {
    /* Note: JS injects column-width or column-count inline for the gallery view */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 4rem;
    padding: 2rem 0;
}

.card {
    background: transparent;
    overflow: visible;
    position: relative;
    cursor: pointer;
}

.card-img {
    width: 100%;
    display: block;
    /* No filter: grayscale here! */
    transition: transform 0.6s ease, box-shadow 0.3s ease;
    border-radius: 2px;
}

.card:hover .card-img {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* --- Filmstrip Gallery Layout --- */
.gallery-container {
    height: calc(100vh - var(--nav-height));
    display: grid;
    grid-template-rows: 1fr auto;
    padding-bottom: 2rem;
    overflow: hidden;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem 5%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    pointer-events: none;
    /* Protection */
}

.filmstrip-container {
    width: 100%;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--color-border);
}

.filmstrip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 50vw 0 50vw;
    /* Center active item padding approach or JS centering */
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    align-items: center;
    height: 100px;
}

.filmstrip::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.strip-thumb {
    height: 80px;
    min-width: 120px;
    /* Aspect ratio control */
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    pointer-events: auto;
    /* allow clicking */
}

.strip-thumb:hover {
    opacity: 0.8;
}

.strip-thumb.active {
    opacity: 1;
    height: 100px;
    /* Pop out */
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* Navigation Arrows (Absolute on Main) */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border);
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav-btn:hover {
    background: var(--color-accent);
    color: black;
    border-color: var(--color-accent);
}

.nav-prev {
    left: 2rem;
}

.nav-next {
    right: 2rem;
}

.card-overlay {
    position: relative;
    /* Below image */
    background: transparent;
    padding: 1.5rem 0;
    opacity: 1;
    /* Always visible */
    transform: none;
    color: var(--color-text-primary);
}

.card-title {
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    display: block;
    color: var(--color-text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Footer */
footer {
    padding: 4rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
    opacity: 0.5;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Image Protection */
.protect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    :root {
        --nav-height: auto;
        --spacing-lg: 3rem;
    }

    .navbar {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 1rem;
        gap: 1rem;
        background: rgba(0, 0, 0, 0.8);
        /* Semi-transparent bg for readability */
        mix-blend-mode: normal;
        /* Disable difference mode on mobile for safety */
        backdrop-filter: blur(10px);
    }

    .logo {
        grid-column: 1;
        grid-row: 1;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .nav-links {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .nav-socials {
        grid-column: 1;
        grid-row: 3;
        justify-self: center;
        margin-top: 0.5rem;
    }

    h1 {
        font-size: 3rem;
        /* Smaller hero title */
    }

    /* Disable Custom Cursor on Touch */
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    body.custom-cursor-active,
    body.custom-cursor-active * {
        cursor: auto !important;
    }
}