/* ================= RESET ================= */

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

html, body {
    background: #000;
    color: #fff;
    font-family: serif;
    overflow-x: hidden;
    cursor: none;
}

/* ================= CUSTOM CURSOR ================= */

.cursor-dot,
.cursor-ring {
    position: fixed;
    pointer-events: none;
    z-index: 999999;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: #e0462e;
    border-radius: 50%;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e0462e;
    border-radius: 50%;
}

/* ================= LOADER ================= */

html.loading,
body.loading {
    overflow: hidden;
}

#loader {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    transition: opacity 1.2s ease;
}

.loader-text {
    width: 320px;
    opacity: 0;
    animation: fadeText 1.2s ease forwards;
    animation-delay: 0.4s;
}

.loader-accent {
    height: 4px;
    width: 0;
    background: #e0462e;
    margin: 18px auto 0;
    animation: growLine 1.6s cubic-bezier(0.22,1,0.36,1) forwards;
    animation-delay: 1.2s;
}

@keyframes fadeText {
    to { opacity: 1; }
}

@keyframes growLine {
    from { width: 0; }
    to { width: 220px; }
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ================= NAVBAR ================= */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3000;
}

.logo img {
    width: 180px;
}

.hamburger {
    width: 28px;
}

.hamburger span {
    display: block;
    height: 2px;
    background: #fff;
    margin: 6px 0;
}

/* ================= SLIDE MENU ================= */

.menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    background: rgba(0,0,0,0.98);
    display: flex;
    align-items: center;
    justify-content: flex-start; /* changed */
    padding-left: 40px;          /* important */
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
    z-index: 2000;
}

.menu-overlay.active {
    transform: translateX(0);
}

.menu-links {
    width: auto;   /* remove 70% constraint */
}

.menu-links a {
    display: block;
    font-size: 2.6rem;
    margin: 30px 0;
    text-decoration: none;
    background: linear-gradient(to right, #e0462e 50%, #ffffff 50%);
    background-size: 200% 100%;
    background-position: right;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.4s cubic-bezier(0.22,1,0.36,1);
}

.menu-links a:hover {
    background-position: left;
}

/* ================= HOMEPAGE HERO ================= */

.hero {
    height: 100vh;
    background: url("../../Renders/The_Fiordland_Ascent/CAM1_The_Reflective_Approach.jpg") center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.8));
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.4;
}

/* ================= PROJECT HERO ================= */

.project-hero {
    height: 100vh;
    background: url("../../Renders/The_Fiordland_Ascent/CAM1_The_Reflective_Approach.jpg") center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.85));
}

.project-title {
    position: relative;
    text-align: center;
}

.project-title h1 {
    font-size: 2.6rem;
    margin-bottom: 10px;
}

.project-title p {
    opacity: 0.8;
}

/* ================= FEATURED ================= */

.featured {
    padding: 120px 40px;
    text-align: center;
    background: #000;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.project-card {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #111;
    text-decoration: none;
    color: inherit;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid #e0462e;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card .project-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 1.2rem;
}

/* ================= PROJECT INTRO ================= */

.project-intro {
    padding: 140px 20px;
    display: flex;
    justify-content: center;
    background: #000;
}

.intro-inner {
    max-width: 800px;
    text-align: center;
}

.intro-inner h2 {
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 40px;
    opacity: 0.6;
}

.intro-inner p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.85;
}

/* ================= PROJECT VIDEO ================= */

.project-film {
    padding: 160px 20px;
    display: flex;
    justify-content: center;
}

.video-wrapper {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ================= DESKTOP 35MM FILM STRIP ================= */

.project-gallery {
    position: relative;
    padding: 260px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 240px;
    z-index: 1;
}

/* Side rails (desktop only) */
.project-gallery::before,
.project-gallery::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100px;
    background: #0b0b0b;
    z-index: 5;
    box-shadow:
        inset -10px 0 20px rgba(0,0,0,0.9),
        inset 10px 0 20px rgba(0,0,0,0.9);
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 28px,
            #000 28px,
            #000 60px
        );
    background-size: 100% 60px;
    animation: filmMove 10s linear infinite;
}

.project-gallery::before { left: 0; }
.project-gallery::after { right: 0; }

@keyframes filmMove {
    from { background-position-y: 0; }
    to   { background-position-y: 60px; }
}

/* Film frames */

.film-frame {
    width: 70%;
    max-width: 1150px;
    position: relative;
    z-index: 2;
    transform: translateY(60px);
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.22,1,0.36,1);
}

.film-frame.in-view {
    transform: translateY(0);
    opacity: 1;
}

.film-frame img {
    width: 100%;
    display: block;
    box-shadow: 0 40px 80px rgba(0,0,0,0.7);
}

/* ================= FILM COUNTER ================= */

.film-counter {
    position: fixed;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 34px;
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 4px;
    pointer-events: none;
}

.film-counter span {
    color: rgba(255,255,255,0.2);
    transition: 
        color 0.4s ease,
        transform 0.4s ease,
        opacity 0.4s ease;
}

.film-counter span.active {
    color: #e0462e;
    transform: scale(1.2);
}

/* ================= FILM DUST ================= */

.film-dust {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.04) 1px, transparent 2px),
        radial-gradient(circle at 70% 80%, rgba(255,255,255,0.03) 1px, transparent 2px),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.02) 1px, transparent 2px);
    animation: dustFloat 18s linear infinite;
}

@keyframes dustFloat {
    from { transform: translateY(0); }
    to   { transform: translateY(-300px); }
}

/* ================= MOBILE CINEMATIC MODE ================= */

@media (max-width: 768px) {

    /* Remove film rails */
    .project-gallery::before,
    .project-gallery::after {
        display: none;
    }

    /* Expand frames */
    .film-frame {
        width: 92%;
        max-width: none;
    }

    .project-gallery {
        padding: 160px 0;
        gap: 140px;
    }

    /* Adjust hero typography */
    .project-title h1 {
        font-size: 1.8rem;
    }

    .project-title p {
        font-size: 0.9rem;
    }

    /* Reposition counter */
    .film-counter {
        left: 15px;
        font-size: 0.7rem;
        opacity: 0.3;
    }

}

/* ================= LIGHTBOX ================= */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 60px;
    font-size: 2rem;
    color: #fff;
}

/* ================= FOOTER ================= */

.footer {
    padding: 160px 20px 120px;
    text-align: center;
}

/* Logo — make this bulletproof */
.footer img {
    width: 160px;
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 80px auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 56px;
}

.footer-links .icon {
    width: 22px;
    height: 22px;
    display: block;
    filter: brightness(0) invert(1);
    transition: filter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-links .social:hover .icon {
    filter: brightness(0) saturate(100%) invert(34%) sepia(90%) saturate(1800%) hue-rotate(345deg) brightness(95%) contrast(90%);
}

/* ================= FIELD TONE SCROLLBAR ================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0b0b;
}

::-webkit-scrollbar-thumb {
    background: #e0462e;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(224, 70, 46, 0.4);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5a3c;
    box-shadow: 0 0 14px rgba(224, 70, 46, 0.7);
}

/* ================= DISABLE CUSTOM CURSOR ON TOUCH DEVICES ================= */

@media (hover: none) and (pointer: coarse) {

    html, body {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
}
