/* Global Styles */

@font-face {
    font-family: 'ABC Diatype';
    src: url('/assets/ABCDiatype-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #e9e8e6;
    /* Keeping Glimpse background as requested previously */
    --text-primary: #111111;
    --text-secondary: #888888;
    --font-family: 'ABC Diatype', Helvetica, Arial, sans-serif;
    --spacing-sides: 15px;
    --spacing-top: 15px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 13px;
    /* Miles jay uses small typography */
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-top) var(--spacing-sides);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    z-index: 10002;
    background-color: var(--bg-color);
    /* Solid background instead of fade */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle hard line */
    gap: 1.5rem;
}

.nav-brand {
    color: var(--text-primary);
    font-weight: 600;
}

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

.nav-links a.active {
    color: var(--text-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-top: calc(var(--spacing-top) + 40px);
    width: 100%;
}

/* Homepage specific */
.work-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 50px;
    gap: 40px;
    /* Space between projects */
}

.project-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 2rem;
}

/* Custom Cursor */
body,
a,
button,
img {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
    color: white;
    /* Will invert against background */
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    transition: font-size 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    margin-top: 8px;
    /* Visually center the asterisk glyph */
}

.custom-cursor.hovering {
    font-size: 48px;
}

/* Footer */
.site-footer {
    width: 100%;
    padding: 60px var(--spacing-sides) 20px var(--spacing-sides);
    font-size: 13px;
    color: var(--text-primary);
    z-index: 100;
    margin-top: auto;
}

/* Info Bio Body */
.bio-body {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-primary);
    width: 33.333%;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .bio-body, .info-page .contact-links {
        width: 100%;
        margin-left: 0 !important;
    }
}

.film-strip-wrapper {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.film-strip {
    display: flex;
    gap: 1.4px;
    /* Divider lines between images */
    height: auto;
    /* Allow aspect ratio to define size */
    padding: 1.4px;
    background-color: #111111;
    border: 1.4px solid #111111;
    /* Outer thick border */
    border-radius: 2px;
    /* Less rounded outer strip */
    box-sizing: border-box;
    width: 100%;
}

.film-strip-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    border-radius: 0;
    /* Sharp inner images */
    overflow: hidden;
    cursor: pointer;
}

.film-strip-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    filter: sepia(5%) contrast(102%) saturate(90%);
    transition: opacity 0.2s;
}

.film-strip-item:hover img {
    opacity: 0.85;
}

.hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.hover-video.playing {
    opacity: 1;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px var(--spacing-sides);
    font-size: 13px;
}

.project-title {
    color: var(--text-primary);
    font-weight: 600;
}

.project-client {
    color: var(--text-secondary);
}

.project-duration {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ---------------- Info Page ---------------- */
.info-page {
    padding: 40px var(--spacing-sides);
    display: flex;
    flex-direction: column;
}

.bio-headline {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 20px;
    color: var(--text-primary);
    max-width: 900px;
}

.bio-sub {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 60px;
    font-size: 13px;
}

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

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

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 2px;
    /* Match film strip gap */
    margin-bottom: 50px;
}

.info-grid-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.info-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 20px;
    padding-bottom: 40px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .film-strip-wrapper {
        padding: 0 var(--spacing-sides);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------- Project Page ---------------- */
.project-page {
    display: flex;
    flex-direction: column;
    padding-top: 40px;
}

.project-header {
    padding: 0 var(--spacing-sides);
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.project-title-large {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-client-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

.project-video-wrapper {
    width: 100vw;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.custom-video-container {
    position: relative;
    width: 70%;
    /* Videos 30% smaller */
    aspect-ratio: 16 / 9;
    background-color: transparent;
}

.custom-video-container iframe {
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let overlay handle clicks */
}

.custom-video-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-video-container:hover .custom-video-ui {
    opacity: 1;
}

.play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    /* Uses custom asterisk cursor */
}

.play-pause-btn svg {
    width: 20px;
    height: 20px;
}

.bottom-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.custom-video-progress {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: none;
}

.progress-bar-bg {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: transparent;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 12px;
    background: white;
}

.mute-btn {
    background: none;
    border: none;
    color: white;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: none;
}

.fullscreen-btn {
    background: none;
    border: none;
    color: white;
    cursor: none;
    display: flex;
    align-items: center;
}

.fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    /* Spacing between grid items */
    width: 100vw;
    margin-bottom: 60px;
    padding: 0 var(--spacing-sides);
    /* Keep some padding on edges if desired, or set to 0 for full bleed */
    box-sizing: border-box;
}

.gallery-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: 1px solid #111111;
    /* Thin filmic black border */
    border-radius: 2px;
    /* Less rounded corners */
}

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

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

    .film-strip {
        height: auto;
    }

    .film-strip-item:nth-child(n+4) {
        display: none;
    }

    .film-strip-item img {
        aspect-ratio: 4 / 3;
    }
}

/* Credits Dropdown */
.project-info-container {
    padding: 0 var(--spacing-sides);
    margin: 20px 0 40px 0;
}

.info-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.info-toggle-btn:hover,
.info-toggle-btn[aria-expanded="true"] {
    color: var(--text-primary);
}

.credits-dropdown {
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.credits-content {
    padding-top: 15px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
    font-weight: 300;
}

.credits-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 17, 17, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-img {
    max-width: 60vw;
    max-height: 60vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    cursor: none;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: none;
    line-height: 1;
    padding: 10px;
    z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    padding: 20px;
    z-index: 1001;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        font-size: 30px;
        padding: 10px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: 15px; right: 15px; font-size: 30px; }
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: none;
}

#splash-loader {
    position: absolute;
    font-size: 12px;
    letter-spacing: 2px;
    z-index: 2;
    transition: opacity 0.6s ease;
    font-weight: 500;
}

.splash-video-container {
    width: 60%;
    aspect-ratio: 16/9;
    position: relative;
    pointer-events: none; /* Let overlay handle clicks/hovers */
    transition: opacity 1.5s ease;
}

.splash-video-container iframe {
    width: 100%;
    height: 100%;
}

#splash-cursor {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 2.1vw;
    font-weight: 600;
    color: white;
    mix-blend-mode: difference;
    pointer-events: none;
    transform: translate(-50%, -50%); /* Centered on mouse */
    opacity: 0;
    z-index: 10001;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .splash-video-container {
        width: 90%;
    }
    #splash-cursor {
        font-size: 4.8vw;
    }
}

/* Seamless image fade */
.opacity-0 {
    opacity: 0 !important;
    transform: translateY(15px);
}
.fade-in-item {
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}