:root {
    --bg-color: #000000;
    --text-primary: #FFFFFF;
    --text-secondary: #888888;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Space Grotesk', sans-serif;
    --font-mono: 'Space Grotesk', monospace;
    --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Header & Navigation */
.blur-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(5, 5, 5, 0.4);
    transition: transform 0.4s var(--ease-editorial);
}

.blur-header.nav-hidden {
    transform: translateY(-100%);
}

.header-logo {
    border: none;
    padding: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.header-logo-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-transform: uppercase;
}

.nav-logo-img {
    display: block;
    height: 60px;
    width: auto;
    object-fit: contain;
}

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

.header-nav a {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity 0.4s var(--ease-editorial);
    display: inline-block;
}

.header-nav a:hover {
    opacity: 0.5;
}


main {
    position: relative;
    z-index: 1;
}

/* Typography Base */
.section-title {
    font-family: var(--font-sans);
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    height: 300vh;
    position: relative;
    background-color: var(--bg-color);
}
#hero-canvas {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
}
.hero-text-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin-top: -100vh;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.text-group {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0 24px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}
.text-group.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}
.text-group.exit {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);
    filter: blur(10px);
}

/* Desktop alternating text sides */
@media screen and (min-width: 769px) {
    #segment-1, #segment-3 {
        left: 0;
        transform: translate(0, -50%);
        width: 45%;
    }
    #segment-1.active, #segment-3.active, #segment-1.exit, #segment-3.exit {
        transform: translate(0, -50%);
    }

    #segment-2 {
        left: auto;
        right: 0;
        transform: translate(0, -50%);
        width: 45%;
    }
    #segment-2.active, #segment-2.exit {
        transform: translate(0, -50%);
    }
}

.serif-headline {
    font-family: var(--font-sans);
    font-size: clamp(1.8rem, 3.5vw, 3.5rem);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

.mono-subhead {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0.4;
    animation: bounce 2.5s var(--ease-editorial) infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -10px);
    }
}

/* Sections Global */
section:not(.hero) {
    padding: 150px 4rem;
    max-width: 1600px;
    margin: 0 auto;
    background-color: var(--bg-color);
}

/* About Section */
.about-section {
    background-color: #000000 !important;
    display: flex;
    justify-content: center;
    text-align: center;
}

.about-content {
    max-width: 800px;
}

.about-headline {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.highlight-font {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-primary);
}

.about-body {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Selected Works - 2x2 Grid */
.projects {
    transition: background-color 0.8s var(--ease-editorial);
}

.projects:has(.project-card:hover) {
    background-color: #020202;
}

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

.works-grid:has(.project-card:hover) .project-card:not(:hover) {
    opacity: 0.3;
    filter: grayscale(100%);
}

.project-card {
    background: transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: opacity 0.8s var(--ease-editorial), filter 0.8s var(--ease-editorial);
}

.card-image-container {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s var(--ease-editorial), filter 1.5s var(--ease-editorial);
    filter: grayscale(100%);
    transform: translateY(var(--parallax-y, 0)) scale(1.1);
    /* Use CSS var for parallax */
}

.card-image-container .hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s var(--ease-editorial);
    z-index: 1;
    pointer-events: none;
}

.project-card:hover .card-image-container img {
    filter: grayscale(0%);
    transform: translateY(var(--parallax-y, 0)) scale(1.155);
    /* 1.05x of 1.1 */
}

.project-card:hover .card-image-container .hover-video {
    opacity: 1;
}

.view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s var(--ease-editorial);
    pointer-events: none;
}

.project-card:hover .view-overlay {
    opacity: 1;
}

.view-overlay span {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    transform: translateY(20px);
    transition: transform 0.5s var(--ease-editorial);
}

.project-card:hover .view-overlay span {
    transform: translateY(0);
}

.card-info {
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.card-info h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
}

.card-info p {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* The Sizzle (Full Bleed) */
.sizzle-bleed {
    max-width: 100%;
    padding: 100px 0 !important;
}

.youtube-ghost-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    background-color: #0a0a0a;
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 1s ease;
}

.ghosted-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 2;
    pointer-events: none;
    object-fit: cover;
}

@media (min-aspect-ratio: 16/9) {
    .ghosted-iframe {
        height: 56.25vw;
    }
}

@media (max-aspect-ratio: 16/9) {
    .ghosted-iframe {
        width: 177.78vh;
    }
}

/* Showreel Gallery */
.gallery-header {
    margin-bottom: 4rem;
}

.gallery-filters {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: color 0.4s var(--ease-editorial);
    padding: 0.5rem 0;
    display: inline-block;
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
}

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-item {
    transition: opacity 0.5s var(--ease-editorial), transform 0.5s var(--ease-editorial);
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.hidden {
    opacity: 0;
    transform: translateY(20px);
    position: absolute;
    /* Take out of document flow */
    pointer-events: none;
    visibility: hidden;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #111;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-editorial), filter 0.5s var(--ease-editorial);
    filter: grayscale(100%);
}

.gallery-item:hover .gallery-thumb img,
.gallery-item:active .gallery-thumb img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.gallery-item h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.gallery-subhead {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Loading Box for both video sections */
.loading-box {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-box span {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    animation: pulse 2s var(--ease-editorial) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Footer */
.massive-footer {
    background-color: var(--bg-color);
    padding: 150px 4rem 50px 4rem;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

.massive-text {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 8vw;
    letter-spacing: -0.04em;
    line-height: 0.8;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0.9;
}

.contact-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: -1rem;
}

.contact-details a {
    font-family: var(--font-mono);
    font-size: 16px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.4s var(--ease-editorial);
    display: inline-block;
}

.contact-details a:hover {
    color: var(--text-primary);
}

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

.footer-links a {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity 0.4s var(--ease-editorial);
    display: inline-block;
}

.footer-links a:hover {
    opacity: 0.5;
}

.copyright {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4rem;
}

/* Reveal Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s var(--ease-editorial), transform 1.5s var(--ease-editorial);
}

.reveal-text.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-card {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.5s var(--ease-editorial), transform 1.5s var(--ease-editorial);
}

.reveal-card.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-slide-up {
    transform: translateY(100%);
    transition: transform 1.2s var(--ease-editorial);
}

.reveal-slide-up.active {
    transform: translateY(0);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s var(--ease-editorial);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-container {
    width: 90vw;
    max-width: 1400px;
    height: 90vh;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-header {
    padding: 2rem 3rem 1rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.modal-tabs {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
}

.modal-tabs::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.modal-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.modal-tab-btn.active,
.modal-tab-btn:hover {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-primary);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    position: relative;
}

/* Modal Grid for Assets */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.asset-item {
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 16/9;
}

.asset-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: grayscale(100%);
}

.asset-item:hover img,
.asset-item:active img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.asset-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asset-item:hover .asset-play-overlay {
    opacity: 1;
}

.asset-play-icon {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.asset-play-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

/* Storyboard Slider */
.storyboard-slider {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    scroll-snap-type: x mandatory;
    height: 100%;
    align-items: center;
    padding-bottom: 1rem;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    scrollbar-width: thin;
}

.storyboard-slide {
    flex: 0 0 80%;
    max-width: 900px;
    scroll-snap-align: center;
    border-radius: 4px;
    overflow: hidden;
    height: 70vh;
}

.storyboard-slide img,
.storyboard-slide embed {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Theater Player Overlay */
.theater-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.theater-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.theater-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 25;
}

.theater-player-container {
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.theater-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- THE MOBILE SANDBOX --- */
@media screen and (max-width: 768px) {
    /* 1. Reset Core Viewport Constraints */
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100% !important;
    }

    /* 2. Fix Hero Section Mobile Scaling */
    .hero {
        height: 300vh !important;
        min-height: 300vh !important;
        padding: 0 !important;
        display: block !important;
    }
    #hero-canvas {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 100vw !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
    .hero-text-container {
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        width: 100% !important;
        margin-top: -100vh !important;
    }
    .text-group {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        padding: 0 15px !important;
    }
    .text-group.active {
        transform: translate(-50%, -50%) !important;
    }

    .serif-headline {
        font-size: clamp(1.2rem, 5vw, 2rem) !important;
        line-height: 1.3 !important;
        letter-spacing: 4px !important;
    }
    
    .mono-subhead {
        font-size: 9px !important;
        letter-spacing: 2px !important;
    }

    /* 3. Fix Section Padding & Widths */
    section:not(.hero),
    .massive-footer {
        padding: 60px 20px !important; 
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. Fix Header Layout */
    .blur-header {
        padding: 15px 20px !important;
        flex-direction: row !important; /* Forces logo to the left, nav to the right */
        justify-content: space-between !important;
        align-items: center !important;
    }

    .header-nav {
        gap: 1rem !important;
    }

    .header-nav a {
        font-size: 10px !important; /* Scales down to prevent horizontal wrap */
    }

    /* 5. Fix Grids to Single Column */
    .works-grid,
    .asset-grid {
        grid-template-columns: 1fr !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* 6. Fix About Section Text Constraints */
    .about-headline {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }
    
    .about-body {
        font-size: 0.95rem !important;
        text-align: left !important;
    }

    /* 7. Fix Massive Footer Text Overflow */
    .massive-text {
        font-size: 12vw !important; /* Scales fluidly with mobile viewport */
        white-space: normal !important;
        text-align: center !important;
        line-height: 1 !important;
    }
    
    .contact-details {
        margin-top: 1rem !important;
    }

    /* 8. Fix Modal/Slider Overflows */
    .modal-container {
        width: 95vw !important;
        height: 85vh !important;
    }
    
    .modal-header {
        padding: 1.5rem !important;
    }
    
    .modal-content {
        padding: 1.5rem !important;
    }

    .storyboard-slider {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .storyboard-slide {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        flex: 0 0 auto !important;
    }

}