@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Montserrat:wght@100..900&display=swap');

:root {
    /* Color Palette: Onyx Shadow & Electric Mercury */
    --bg: #000000;
    --fg: #ffffff;
    --accent: #e0e0e0;
    --accent-gold: #c5a059;
    --mercury: #8e8e8e;
    --muted: rgba(255, 255, 255, 0.3);
    --border: rgba(255, 255, 255, 0.05);
    
    /* Typography: Kinetic Scaling */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    --fs-hero: clamp(3.6rem, 9.6vw, 12.8rem);
    --fs-h1: clamp(3.5rem, 10vw, 12rem);
    --fs-h2: clamp(2rem, 6vw, 8rem);
    --fs-body: clamp(1rem, 1.1vw, 1.2rem);
    
    /* Motion */
    --easing: cubic-bezier(0.9, 0, 0.1, 1);
    --transition: 1s var(--easing);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.3;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Page Transition Layer */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 20000;
    transform: translateY(100%);
    pointer-events: none;
}

/* Film Grain V4 */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.07;
    mix-blend-mode: color-burn;
}

/* Liquid Aura Cursor */
.cursor-main {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}

/* Character Split Support */
.split-wrap {
    overflow: hidden;
    display: block;
}

.word {
    display: inline-block;
    margin-right: 0.1em; /* Subtle word spacing */
}

.char {
    display: inline-block;
    will-change: transform;
    letter-spacing: -0.02em; /* Tighter for premium feel */
}

/* Layout: Fragmented Grid */
.container {
    padding: 0 4vw;
}

.section-margin {
    margin-top: 30vh; /* Reduced slightly for better vertical rhythm */
}


/* Navigation: Minimal Ghost */
.nav-master {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4vw;
    z-index: 1000;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    text-decoration: none;
    color: #fff;
    letter-spacing: -1px;
}

.nav-links {
    display: flex; gap: 3vw;
}

.nav-item {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 700;
    transition: color 0.4s;
}

.nav-item:hover {
    color: #fff;
}

/* Mobile Menu Button - 3 dots */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    height: 24px;
    width: 24px;
    z-index: 1001; /* Above nav links */
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn .dot {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.4s var(--easing), opacity 0.4s var(--easing), width 0.4s var(--easing), height 0.4s var(--easing), border-radius 0.4s var(--easing);
    align-self: center;
}

/* Hero V4: Multi-Layer Parallax */
.hero-v4 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

.hero-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.layer-bg { z-index: 1; }
.layer-mid { z-index: 2; }
.layer-fg { z-index: 3; pointer-events: none; }

.hero-bg-asset {
    width: 110%; height: 110%;
    object-fit: cover;
    filter: brightness(0.3) grayscale(1);
    opacity: 0.5;
}

.hero-title-v4 {
    font-family: var(--font-heading);
    font-size: var(--fs-hero);
    line-height: 0.8;
    text-align: center;
    letter-spacing: -0.06em;
    mix-blend-mode: overlay;
    color: #fff;
}

.floating-shard {
    position: absolute;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.shard-1 {
    width: 20vw; height: 30vh;
    top: 10%; right: 10%;
    transform: rotate(15deg);
}

.shard-2 {
    width: 15vw; height: 40vh;
    bottom: 5%; left: 5%;
    transform: rotate(-10deg);
}

/* Avant-Garde Elements */
.nexus-vertical-text {
    position: absolute;
    right: 2vw;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1em;
    color: var(--muted);
    z-index: 10;
}

/* Image Shard (Services) */
.image-shard {
    width: 100%;
    height: 70vh;
    overflow: hidden;
    position: relative;
    border-radius: 0;
}

.image-shard img {
    width: 100%;
    height: 140%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1);
    transform: translateY(0);
}

/* Buttons: Minimalist Shimmer */
.btn-master {
    display: inline-block;
    padding: 1.2vw 3.5vw;
    border: 1px solid var(--border);
    text-decoration: none;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.btn-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-master:hover .btn-shimmer {
    left: 100%;
    transition: 0.8s var(--easing);
}

.btn-master:hover {
    border-color: #fff;
}

/* Grid Reveal */
.grid-reveal {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2vw;
}

/* Horizontal Scroll V4 */
.horizontal-container {
    display: flex;
    flex-wrap: nowrap;
    width: 400vw;
    height: 100vh;
    will-change: transform;
}

.service-panel {
    width: 100vw;
    height: 100vh;
    padding: 10vh 4vw;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: end;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}

.service-graphic {
    grid-column: 7 / 13;
    grid-row: 1;
    height: 80vh;
    align-self: center;
}

.service-text {
    grid-column: 1 / 6;
    margin-bottom: 5vh;
}

/* Utils */
.accent { color: var(--accent-gold); }
.italic { font-style: italic; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mt-80 { margin-top: 80px; }

/* ==========================================================================
   MOBILE & TABLET OPTIMIZATION (STRICT BREAKPOINTS)
   ========================================================================== */

/* Dual Architecture Visibility Controls */
.mobile-only { display: none !important; }

/* GLOBAL MOBILE/TABLET FIXES (< 1024px) */
@media (max-width: 1023px) {
    /* Navigation - Hamburger Menu Global For Tablet And Mobile */
    .mobile-menu-btn { display: flex !important; }
    
    .nav-links { 
        display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important;
        position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important;
        background: rgba(0, 0, 0, 0.98) !important; backdrop-filter: blur(15px) !important;
        transform: translateY(-100%) !important; transition: transform 0.6s var(--easing) !important; gap: 40px !important; z-index: 999 !important;
    }
    .nav-master.menu-open .nav-links { transform: translateY(0) !important; }
    .nav-links .nav-item { font-size: 24px !important; opacity: 0; transform: translateY(20px); transition: opacity 0.4s, transform 0.4s; }
    .nav-master.menu-open .nav-item { opacity: 1; transform: translateY(0); }
    
    /* Nav Animations */
    .nav-master.menu-open .nav-item:nth-child(1) { transition-delay: 0.3s; }
    .nav-master.menu-open .nav-item:nth-child(2) { transition-delay: 0.4s; }
    .nav-master.menu-open .nav-item:nth-child(3) { transition-delay: 0.5s; }
    .nav-master.menu-open .nav-item:nth-child(4) { transition-delay: 0.6s; }
    .nav-master.menu-open .nav-item:nth-child(5) { transition-delay: 0.7s; }
    .nav-master.menu-open .mobile-menu-btn .dot:nth-child(1) { transform: translateY(8px) rotate(45deg); height: 2px !important; width: 24px !important; border-radius: 0; }
    .nav-master.menu-open .mobile-menu-btn .dot:nth-child(2) { opacity: 0; }
    .nav-master.menu-open .mobile-menu-btn .dot:nth-child(3) { transform: translateY(-8px) rotate(-45deg); height: 2px !important; width: 24px !important; border-radius: 0; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    html, body, main, section, div {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    h1, h2, h3, h4, h5, h6, p, a, span {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }

    /* Prevent any inline styling from forcing column grid on tablet/mobile */
    [style*="grid-template-columns"], 
    .grid-reveal {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .grid-reveal > div, [style*="grid-column"] {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        text-align: left !important;
    }

    /* Horizontal Scroll Decoupling & Stack Conversion */
    .horizontal-scroll-section { overflow-x: hidden !important; width: 100% !important; display: block !important; }
    .horizontal-container { width: 100% !important; height: auto !important; display: flex !important; flex-direction: column !important; }
    
    .service-panel { 
        width: 100% !important; height: auto !important; 
        padding: 40px 4vw !important; 
        display: flex !important; flex-direction: column-reverse !important; 
        border-right: none !important; border-bottom: 1px solid var(--border) !important; 
    }
    .service-graphic { width: 100% !important; height: auto !important; margin-bottom: 24px !important; }
    .image-shard { height: auto !important; max-height: 40vh !important; }
    .service-text { width: 100% !important; margin-bottom: 0 !important; }
    
    /* Pages Specifics */
    .narrative-step { height: auto !important; min-height: unset !important; padding: 40px 0 !important; position: relative !important; }
    .service-card-v4 { padding: 40px 5vw !important; margin-bottom: 24px !important; width: 100% !important; }
    
    /* Footer */
    footer > div { flex-direction: column !important; align-items: flex-start !important; gap: 24px !important; width: 100% !important; }
    footer > div > div { text-align: left !important; width: 100% !important; }
}

/* TABLET ONLY (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .section-margin { margin-top: 60px !important; }
    .mt-80 { margin-top: 40px !important; }
    .mt-40 { margin-top: 24px !important; }
    
    /* Typography */
    .hero-title-v4 { font-size: clamp(40px, 8vw, 80px) !important; line-height: 1 !important; }
    h2, .grid-reveal h2, section.container h2 { font-size: clamp(32px, 6vw, 64px) !important; }
}

/* MOBILE (<= 767px) */
@media (max-width: 767px) {
    /* Layout & Hero */
    .hero-v4 { height: 70vh !important; min-height: 500px !important; }
    .hero-title-v4 { font-size: clamp(32px, 10vw, 56px) !important; line-height: 1.1 !important; text-align: center !important; }
    .nexus-vertical-text { display: none !important; }
    
    /* General Typography */
    h2, .grid-reveal h2, section.container h2 { font-size: clamp(28px, 8vw, 42px) !important; line-height: 1.1 !important; letter-spacing: -0.02em !important; margin: 16px 0 !important; }
    h3 { font-size: clamp(24px, 6vw, 32px) !important; line-height: 1.2 !important; margin: 12px 0 !important; }
    p, .grid-reveal p, .service-card-v4 p { font-size: 16px !important; line-height: 1.5 !important; }
    
    /* Spacing fixes */
    .section-margin { margin-top: 40px !important; margin-bottom: 40px !important; }
    .mt-80 { margin-top: 32px !important; }
    .mt-40 { margin-top: 24px !important; }
    .container { padding: 0 20px !important; }
    
    /* Cards and Images */
    .service-card-v4 { padding: 24px !important; }
    .image-shard { height: auto !important; max-height: 30vh !important; }
    .service-graphic { margin-bottom: 24px !important; }
    
    /* Forms - Full Width & Touch heights */
    form, input, textarea { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
    input { height: 50px !important; min-height: 50px !important; font-size: 16px !important; padding: 12px !important; margin-bottom: 16px !important; }
    textarea { min-height: 120px !important; font-size: 16px !important; padding: 12px !important; margin-bottom: 16px !important; }
    .btn-master { width: 100% !important; text-align: center !important; padding: 16px !important; min-height: 50px !important; display: flex !important; align-items: center !important; justify-content: center !important; margin-top: 16px !important; }
    .btn-text { font-size: 14px !important; font-weight: bold !important; letter-spacing: 0.2em !important; }
    
    /* Specific overrides */
    .nexus-formula-container { padding-left: 0 !important; margin-top: 24px !important; }
    .formula-step { padding-left: 20px !important; margin-bottom: 32px !important; border-left: 2px solid var(--accent-gold); opacity: 1 !important; }
    .formula-progress-line { display: none !important; }
}

/* SMALL MOBILE (<= 480px) */
@media (max-width: 480px) {
    .hero-title-v4 { font-size: clamp(28px, 10vw, 36px) !important; }
    h2, .grid-reveal h2, section.container h2 { font-size: clamp(24px, 8vw, 32px) !important; }
    h3 { font-size: clamp(20px, 6vw, 24px) !important; }
    .container { padding: 0 16px !important; }
    .section-margin { margin-top: 32px !important; margin-bottom: 32px !important; }
    .hero-v4 { height: 60vh !important; }
}

/* ==========================================================================
   ADVANCED NARRATIVE & SERVICES MODULES
   ========================================================================== */

/* Sticky Narrative */
.narrative-scroll { position: relative; width: 100%; }
.narrative-step {
    height: 100vh;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    overflow: hidden;
    background: var(--bg);
}
.step-content { opacity: 0; transform: translateY(50px); }

/* Nexus Formula */
.nexus-formula-container { position: relative; padding-left: 5vw; }
.formula-progress-line {
    position: absolute; left: 0; top: 0; width: 2px; height: 100%;
    background: rgba(255,255,255,0.05);
}
.formula-progress-fill {
    position: absolute; left: 0; top: 0; width: 100%; height: 0%;
    background: var(--accent-gold);
    box-shadow: 0 0 20px var(--accent-gold);
}
.formula-step { margin-bottom: 20vh; padding-left: 2vw; opacity: 0.3; transition: 0.5s; }
.formula-step.active { opacity: 1; }
.formula-step h3 { font-size: 4rem; line-height: 0.8; margin: 2vh 0; }

/* Services: Architectural Mastery */
.service-card-v4 {
    position: relative;
    padding: 8vh 4vw;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: 0.5s var(--easing);
}
.service-card-v4:hover {
    border-color: var(--accent-gold);
    background: rgba(255,255,255,0.05);
}
.service-card-v4::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.1), transparent);
    transition: 0.8s;
}
.service-card-v4:hover::after { left: 100%; }
.service-glow-line {
    position: absolute;
    left: 0; top: 0;
    width: 2px; height: 0;
    background: var(--accent-gold);
    transition: 0.8s var(--easing);
}
.service-card-v4:hover .service-glow-line { height: 100%; }

