/* ==========================================================================
   CITYTRADES CORE STYLESHEET
   File: css/core.css
   Updated: Restored Sticky Header & Fixed Layout Logic
   ========================================================================== */

/* ==========================================================================
   [SECTION 1] VARIABLES & CONFIGURATION
   ========================================================================== */
:root {
    /* Brand Palette */
    --bg-color: #000000;
    --bg-secondary: #111111;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #FF6600;

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout & Spacing */
    --header-height: 70px;
    --container-width: 1400px;
    --radius-card: 0px;
    --gutter-x: 40px;

    /* Effects */
    --glass-bg: rgba(0, 0, 0, 0.85);
    --transition-slow: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   [SECTION 2] RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    /* CRITICAL FIX: 'auto' allows Lenis to take control. 'smooth' breaks it. */
    scroll-behavior: auto !important; 
    width: 100%;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    position: relative;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.7;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter-x);
}

.section-padding {
    padding: 160px 0;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   [SECTION 3] TYPOGRAPHY UTILITIES
   ========================================================================== */
.text-hero {
    font-size: clamp(4rem, 9vw, 8rem);
    line-height: 0.9;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 30px;
    letter-spacing: -0.04em;
}

@media (max-width: 768px) {
    .text-hero {
        font-size: 3.5rem;
    }
}


.text-hero-small {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1;
}

@media (max-width: 768px) {
    .text-hero-small {
        font-size: 2.5rem;
    }
}

.text-sub {
    font-size: clamp(1.2rem, 1.5vw, 1.4rem);
    color: var(--text-muted);
    max-width: 600px;
    margin-top: 20px;
    border-left: 2px solid #333;
    padding-left: 20px;
}

.text-sub-light {
    font-size: clamp(1.8rem, 3vw, 3rem);
    color: #cccccc;
    font-weight: 400;
    line-height: 1.3;
    max-width: 1100px;
    margin: 0 auto;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   [SECTION 4] ANIMATION UTILITIES
   ========================================================================== */
.reveal-wrap {
    overflow: hidden;
    display: block;
    line-height: 1.1;
    padding-bottom: 5px;
}

.reveal-content {
    display: block;
    transform: translateY(110%);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.is-visible .reveal-content {
    transform: translateY(0);
}

.img-scale-wrap {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

.img-scale-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.3);
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.is-visible .img-scale-inner {
    transform: scale(1);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* ==========================================================================
   [SECTION 5] NAVIGATION (DESKTOP)
   ========================================================================== */
#header-placeholder {
    /* RESTORED: Sticky positioning for Desktop stability */
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: auto;
}

.navbar {
    height: var(--header-height);
    background-color: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    width: 100%;
    transition: var(--transition-slow);
}

.navbar.scrolled {
    background-color: #000000;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.navbar .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    padding-left: var(--gutter-x);
    padding-right: 0;
}

.logo img {
    height: 35px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* --- Desktop Navigation Defaults --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 100%;
    margin-left: auto;
    margin-right: 40px;
    list-style: none;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* --- Mobile-Specific Defaults (Hidden on Desktop) --- */
.mobile-only,
.mobile-menu-footer {
    display: none;
}

.nav-action {
    display: flex;
    align-items: center;
    height: 100%;
}

.cta-box {
    background: var(--accent);
    color: #000;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cta-box:hover {
    background: #fff;
    color: #000;
}

.hamburger {
    display: none;
    cursor: pointer;
    color: var(--text-main);
    z-index: 2000;
    transition: all 0.3s ease;
}

/* ==========================================================================
   NAVIGATION MOBILE LOGIC (Max-Width 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

    /* 1. Z-INDEX & STICKINESS [UPDATED] */
    /* UX FIX: Decoupling layout (placeholder) from visual (navbar) for rock-solid stability */

    #header-placeholder {
        position: relative !important;
        /* CRITICAL: Force the placeholder to occupy physical space so content doesn't jump up */
        height: var(--header-height);
        width: 100%;
        z-index: 4000 !important;
        background: transparent;
        display: block;
    }

    /* Target the injected navbar specifically */
    #header-placeholder .navbar {
        position: fixed;
        /* Anchors strictly to the glass, ignoring document height */
        top: 0;
        left: 0;
        width: 100%;
        transform: translateZ(0);
        /* Forces GPU promotion for butter-smooth scrolling */
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        /* Adds subtle depth to separate from content */
        will-change: transform;
    }

    #header-placeholder.layer-boost {
        z-index: 6000 !important;
    }

    .navbar .container-fluid {
        /* Reduce left padding from 40px to 20px */
        padding-left: 20px !important;

        /* Optional: Ensure right side doesn't get pushed if not desired, 
           though strictly only left was requested. */
        padding-right: 0;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        background: var(--bg-color);

        flex-direction: column;
        justify-content: flex-start;

        /* Reduced top padding to pull items up */
        padding: 60px 40px 40px 40px;
        gap: 10px;
        box-sizing: border-box;
        margin: 0;
        z-index: 4001;
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    /* 2. CINEMATIC TYPOGRAPHY (Tightened) */
    .nav-links .nav-item {
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        margin-bottom: 0px;
    }

    .nav-links a {
        font-family: var(--font-heading);
        font-size: clamp(2rem, 7vw, 3.5rem);
        font-weight: 800;
        color: transparent;
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.4);
        line-height: 1.1;
        display: block;
        transition: all 0.3s ease;
        padding: 5px 0;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #fff;
        -webkit-text-stroke: 0;
        transform: translateX(20px);
    }

    .nav-links a::after {
        display: none;
    }

    /* The "Contact" Highlight Link */
    .mobile-only {
        display: block;
    }

    .highlight-link {
        color: var(--accent) !important;
        -webkit-text-stroke: 0 !important;
        margin-top: 10px;
        font-size: clamp(2rem, 7vw, 3.5rem) !important;
    }

    .cta-box {
        display: none;
    }

    /* 3. HAMBURGER BUTTON */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--accent);
        color: #000;
        height: 100%;
        width: 90px;
        padding: 0;
        margin: 0;
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 4002 !important;
    }

    .hamburger i {
        font-size: 1.8rem;
    }

    .hamburger.is-active {
        background: #000;
        color: var(--accent);
    }

    /* 4. FOOTER: FLEX FLOW */
    .mobile-menu-footer {
        display: flex;
        flex-direction: column;
        justify-content: center;

        margin-top: auto;
        width: 100%;
        padding-top: 20px;

        border-top: 1px solid rgba(255, 255, 255, 0.1);

        opacity: 0;
        transform: translateY(20px);
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    }

    .nav-links.active .mobile-menu-footer {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.4s;
    }

    .menu-label {
        font-family: 'Courier New', monospace;
        color: var(--accent);
        font-size: 0.7rem;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        margin-bottom: 25px;
        opacity: 0.8;
    }

    .menu-socials {
        display: flex;
        gap: 5px;
        margin-bottom: 10px;
        align-items: center;
        flex-wrap: wrap;
    }

    .menu-socials a {
        font-size: 1.2rem !important;
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #fff !important;
        -webkit-text-stroke: 0 !important;
        background: rgba(255, 255, 255, 0.05);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        text-decoration: none;
    }

    .menu-socials a:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: #000 !important;
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 102, 0, 0.4);
    }

    /* 6. ANIMATION SEQUENCING */
    .nav-links.active .nav-item:nth-child(1) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
    }

    .nav-links.active .nav-item:nth-child(2) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.15s;
    }

    .nav-links.active .nav-item:nth-child(3) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
    }

    .nav-links.active .nav-item:nth-child(4) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.25s;
    }

    .nav-links.active .nav-item:nth-child(5) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s;
    }

    .nav-links.active .nav-item:nth-child(6) {
        animation: menuReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.35s;
    }
}

@keyframes menuReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
   [SECTION 6] FOOTER: THE HYBRID MASTER
   ========================================================================== */
.footer-hybrid {
    background-color: #050505;
    color: #fff;
    position: relative;
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* --- PART A: THE SMART-PANEL CTA --- */
.cta-container {
    padding: 100px var(--gutter-x);
    display: flex;
    justify-content: center;
    background-color: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-page="contact"] .cta-container {
    display: none !important;
}

.smart-panel-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    padding: 60px 80px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-text {
    display: flex;
    flex-direction: column;
}

.panel-sub {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.panel-heading-mask {
    height: 3.5rem;
    overflow: hidden;
    position: relative;
}

.panel-heading {
    display: block;
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-heading.hover-state {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--accent);
    transform: translateY(100%);
}

.panel-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    transition: all 0.4s ease;
}

/* Hover Physics */
.smart-panel-cta:hover {
    background: #111;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
}

.smart-panel-cta:hover .panel-heading.original {
    transform: translateY(-100%);
}

.smart-panel-cta:hover .panel-heading.hover-state {
    transform: translateY(0);
}

.smart-panel-cta:hover .panel-icon {
    background: var(--accent);
    color: #000;
    transform: rotate(-45deg);
}


/* --- PART B: THE SCHEMATIC GRID --- */
.footer-schematic {
    background-color: #080808;
}

.schematic-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    /* Rigid columns */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schematic-box {
    padding: 60px 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.schematic-box:last-child {
    border-right: none;
}

body[data-page="contact"] .contact-box {
    opacity: 0.3;
    pointer-events: none;
}

.box-label {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 0.05em;
    display: block;
}

/* Box A: Brand */
.schematic-logo {
    width: 160px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.schematic-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    max-width: 280px;
}

/* Box B: Coordinates */
.contact-box address {
    font-style: normal;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.contact-links a {
    display: block;
    color: #888;
    text-decoration: none;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.contact-links a:hover {
    color: var(--accent);
}

/* Box C: Social Matrix */
.social-matrix {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.social-node i {
    font-size: 1rem;
    color: var(--accent);
    transition: all 0.3s ease;
}

.social-node:hover {
    padding-left: 10px;
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* Box D: Navigation */
.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav a {
    text-decoration: none;
    color: #999;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: #fff;
}


/* --- PART C: BASEMENT --- */
.footer-base {
    padding: 20px 40px;
    background: #000;
}

.base-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mono-text {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #444;
    text-transform: uppercase;
}

.base-links a {
    color: #444;
    text-decoration: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-left: 20px;
    transition: color 0.3s;
}

.base-links a:hover {
    color: #fff;
}


/* --- RESPONSIVE LOGIC --- */
@media (max-width: 1024px) {

    /* Tablet Grid */
    .schematic-grid {
        grid-template-columns: 1fr 1fr;
        /* 2x2 Grid */
    }

    .schematic-box {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .schematic-box:nth-child(2) {
        border-right: none;
    }

    .panel-heading {
        font-size: 2.5rem;
    }

    .panel-heading-mask {
        height: 2.5rem;
    }

    .smart-panel-cta {
        padding: 40px;
    }
}

@media (max-width: 768px) {

    /* 1. Mobile CTA: Centered Stack */
    .cta-container {
        padding: 60px 20px;
    }

    .smart-panel-cta {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 40px 20px;
    }

    .panel-text {
        align-items: center;
    }

    /* 2. Schematic Grid: Single Column Totem */
    .schematic-grid {
        display: flex;
        flex-direction: column;
    }

    .schematic-box {
        border-right: none;
        padding: 60px 20px;
        align-items: center;
        text-align: center;
    }

    .schematic-desc {
        max-width: 100%;
    }

    /* Socials: Center aligned nodes */
    .social-matrix {
        width: 100%;
        align-items: center;
    }

    .social-node {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }

    /* Nav: Center aligned */
    .footer-nav {
        align-items: center;
    }

    /* 3. Basement: Stacked & Centered */
    .base-flex {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }

    .base-links a {
        margin: 0 10px;
    }

    /* 1. The Container: Adapts to content height */
    .panel-heading-mask {
        height: auto !important;
        /* CRITICAL: Let the box grow with the text */
        overflow: visible !important;
        /* Stop clipping the descenders (g, j, y) */
        display: block;
        margin: 0 auto;
        padding: 5px 0;
        /* Add slight breathing room */
    }

    /* 2. The Text: Wraps naturally */
    .panel-heading {
        white-space: normal !important;
        /* Allow text to wrap to new lines */
        font-size: clamp(2rem, 9vw, 3rem) !important;
        /* Large, readable, fluid */
        line-height: 1.1 !important;
        /* Tight leading for 2-line display */

        display: block;
        width: 100%;
        text-align: center;
        position: relative;
    }

    /* 3. UX STABILITY: Disable the "Slot Machine" on Mobile 
       (prevents text from flying away when tapped) */
    .panel-heading.hover-state {
        display: none !important;
        /* Remove the "Let's Build" layer on mobile */
    }

    .panel-heading.original {
        transform: none !important;
        /* Lock the text in place */
    }

    .smart-panel-cta:hover .panel-heading.original {
        transform: none !important;
        /* Ensure tap states don't hide the text */
    }

}

/* ==========================================================================
   KINETIC DOCKING SYSTEM (Homepage Hero)
   ========================================================================== */

/* 1. Base State: Invisible & Waiting */
/* We override the default glass/scrolled states so the JS has full control */
.navbar.kinetic-header,
.navbar.kinetic-header.scrolled {
    background-color: transparent !important;
    /* JS controls opacity during scroll */
    backdrop-filter: none !important;
    /* JS controls blur during scroll */
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: none !important;
    transition: border-color 0.3s ease;
}

/* 2. Hidden Navigation Elements */
/* They are pushed up and invisible until the "Docking" event */
.navbar.kinetic-header .nav-links .nav-item,
.navbar.kinetic-header .nav-action {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. The "Docked" State (Triggered by JS) */
.navbar.kinetic-header.is-docked {
    background-color: #000000 !important;
    /* Force Solid Black */
    backdrop-filter: none !important;
    /* Remove blur for solid look */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Reveal the items */
.navbar.kinetic-header.is-docked .nav-links .nav-item,
.navbar.kinetic-header.is-docked .nav-action {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 4. Mechanical Stagger (The "Domino" Effect) */
.navbar.kinetic-header.is-docked .nav-item:nth-child(1) {
    transition-delay: 0.05s;
}

.navbar.kinetic-header.is-docked .nav-item:nth-child(2) {
    transition-delay: 0.1s;
}

.navbar.kinetic-header.is-docked .nav-item:nth-child(3) {
    transition-delay: 0.15s;
}

.navbar.kinetic-header.is-docked .nav-item:nth-child(4) {
    transition-delay: 0.2s;
}

.navbar.kinetic-header.is-docked .nav-item:nth-child(5) {
    transition-delay: 0.25s;
}

.navbar.kinetic-header.is-docked .nav-action {
    transition-delay: 0.3s;
}

/* 5. MOBILE CRITICAL OVERRIDE */
/* Ensures the Hamburger (inside nav-action) is always visible and on top */
@media (max-width: 1024px) {

    /* 1. Unlock the Hamburger & CTA (Existing) */
    .navbar.kinetic-header .nav-action {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        z-index: 5000 !important;
    }

    /* 2. Unlock the Nav Items (CRITICAL FIX) */
    /* This overrides the pointer-events: none inherited from the desktop kinetic logic */
    .navbar.kinetic-header .nav-links .nav-item {
        pointer-events: auto !important;
        /* Note: We do NOT force opacity: 1 here, because we want 
           the 'menuReveal' keyframe animation to still handle the fade-in. */
    }
}

/* ==========================================================================
   GLOBAL LIGHTBOX SYSTEM
   ========================================================================== */

/* 1. Trigger Button (The Expand Icon on Images) */
.lb-trigger-btn {
    position: absolute; top: 20px; right: 20px;
    width: 40px; height: 40px;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
    color: #fff; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    z-index: 20; cursor: pointer;
    opacity: 0; transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Show on hover of parent container */
.img-scale-wrap:hover .lb-trigger-btn { opacity: 1; transform: scale(1); }
.lb-trigger-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* 2. Modal Overlay */
.lightbox-modal {
    position: fixed; top: 0; left: 0; width: 100%; 
    height: 100dvh; /* Dynamic Height for Mobile */
    background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
.lightbox-modal.is-active { opacity: 1; pointer-events: auto; }

/* 3. View Container & Image */
.lightbox-view {
    position: relative; width: 100%; height: 100%;
    overflow: hidden; 
    display: flex; align-items: center; justify-content: center;
    cursor: grab; touch-action: none;
}
.lightbox-view:active { cursor: grabbing; }

.lightbox-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    will-change: transform; transform-origin: 0 0; 
    user-select: none; -webkit-user-drag: none;
}

/* 4. Controls (Close Button) */
.lb-controls {
    position: absolute; top: 30px; right: 30px; z-index: 100;
}
.lb-btn {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%; color: #fff; font-size: 1.2rem;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: #fff; color: #000; }
.lb-btn.close-btn:hover { background: #ff0000; color: #fff; }

/* 5. Precision Scope */
.lb-scope {
    position: fixed; top: 0; left: 0;
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.8);
    background-repeat: no-repeat; background-color: #000;
    pointer-events: none; z-index: 200;
    opacity: 0; transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: top, left; 
}
.lb-scope.is-visible { opacity: 1; transform: scale(1); }
.lb-scope::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px;
    border-left: 1px solid rgba(255,255,255,0.8); border-top: 1px solid rgba(255,255,255,0.8);
    transform: translate(-10px, -10px);
}

/* 6. Technical Grid */
.lb-grid-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; opacity: 0; transition: opacity 0.3s ease; z-index: 50;
    background-image: linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 100px 100px;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
}
.lb-grid-overlay.is-visible { opacity: 1; }

/* 7. HUD Toolbar */
.lb-toolbar {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 8px;
    background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px);
    padding: 8px 12px; border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 150;
    opacity: 0; animation: fadeUp 0.4s 0.2s forwards ease-out;
}
@keyframes fadeUp { to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.lb-tool-btn {
    width: 40px; height: 40px; background: transparent; border: none;
    color: rgba(255,255,255,0.7); font-size: 1rem; cursor: pointer;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; position: relative;
}
.lb-tool-btn:hover { background: rgba(255,255,255,0.15); color: #fff; transform: translateY(-2px); }
.lb-tool-btn.is-active { background: #fff; color: #000; box-shadow: 0 0 10px rgba(255,255,255,0.3); }

.lb-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.1); margin: 0 4px; }

/* Tooltip */
.lb-tool-btn::after {
    content: attr(data-label); position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%) translateY(0px);
    background: #000; color: #fff; padding: 4px 8px; font-size: 0.75rem;
    border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none;
    transition: all 0.2s ease; margin-bottom: 10px; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
}
.lb-tool-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .lb-trigger-btn { opacity: 1; transform: scale(1); top: 15px; right: 15px; }
    .lb-controls { top: 15px; right: 15px; }
    .lb-btn { width: 40px; height: 40px; font-size: 1rem; }
    
    .lb-toolbar { 
        bottom: calc(20px + env(safe-area-inset-bottom)); 
        padding: 6px 10px; gap: 4px; 
        width: auto; max-width: 95%; justify-content: center;
    }
    .lb-tool-btn { width: 38px; height: 38px; font-size: 0.9rem; }
    .lb-tool-btn::after { display: none; }
    .lb-scope { width: 140px; height: 140px; }
}