/* ============================================
   LAYOUT OPTIMIZATION - COMPACT PROFESSIONAL
   ============================================ */

/* ============================================
   LOGO ENLARGEMENT (2x) & NAVBAR REFINEMENT
   ============================================ */
.logo {
    height: 110px !important; /* 2x from 55px */
    width: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(26, 43, 77, 0.1));
}

/* ============================================
   NAVBAR OPTIMIZATION & SPACING
   ============================================ */
.navbar {
    min-height: 90px !important;
    display: flex;
    align-items: center;
    padding: 1rem 0 !important;
    gap: 0;
}

.navbar.scrolled {
    min-height: 80px !important;
    padding: 0.75rem 0 !important;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px !important;
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
    opacity: 0;
    animation: logoEntrance 1s ease-out 0.3s forwards;
    flex-shrink: 0;
    margin-right: auto;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.site-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.logo-link:hover .site-title {
    color: var(--gold);
}

/* Optimize nav menu spacing */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem !important; /* Optimized spacing */
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
    min-width: 0; /* Allow flex shrinking */
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    padding: 0.75rem 0.75rem !important; /* Horizontal padding for better click area */
    white-space: nowrap;
    display: block;
    line-height: 1.2;
}

/* Optimize CTA button spacing */
.btn-nav-cta {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.85rem 2rem !important;
    font-size: 0.875rem;
    white-space: nowrap;
    min-width: fit-content;
}

/* Ensure proper spacing between elements */
.nav-container > * {
    margin: 0;
}

/* Tablet optimization */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-container {
        padding: 0 30px !important;
        gap: 1.5rem;
    }
    
    .nav-menu {
        gap: 1.75rem !important;
    }
    
    .btn-nav-cta {
        padding: 0.8rem 1.75rem !important;
    }
}

@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SECTION SPACING OPTIMIZATION
   ============================================ */
section {
    padding: 60px 0 !important; /* Reduced from larger values */
    margin: 0;
    position: relative;
    z-index: 2; /* Above floating elements */
    overflow: hidden; /* Contain floating icons */
}

/* Ensure section content is above floating icons */
section .container,
section > *:not(.section-floating-icons) {
    position: relative;
    z-index: 2;
}

/* Account for fixed navbar - hero content starts below navbar */
.hero-section {
    padding: 0 !important;
    margin-top: 90px !important;
    height: calc(100vh - 90px) !important;
    min-height: calc(600px - 90px) !important;
    z-index: 3; /* Above global floating layer */
}

body.navbar-scrolled .hero-section {
    margin-top: 80px !important;
    height: calc(100vh - 80px) !important;
    min-height: calc(600px - 80px) !important;
}

.about-section,
.services-section,
.gallery-section,
.showreel-section {
    padding: 80px 0 !important;
}

/* Remove excessive gaps between sections */
section + section {
    margin-top: 0;
    padding-top: 60px !important;
}

/* Container optimization */
.container {
    max-width: 1200px !important; /* More compact */
    padding: 0 30px !important;
}

/* Remove excessive gaps */
section + section {
    margin-top: 0;
}

/* ============================================
   GLOBAL FLOATING ANIMATIONS
   ============================================ */
@keyframes floatGlobal {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.2;
    }
    25% {
        transform: translate(40px, -50px) rotate(15deg) scale(1.1);
        opacity: 0.35;
    }
    50% {
        transform: translate(-30px, -90px) rotate(-15deg) scale(0.9);
        opacity: 0.25;
    }
    75% {
        transform: translate(-50px, -50px) rotate(10deg) scale(1.05);
        opacity: 0.3;
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.15;
    }
    50% {
        transform: translate(60px, -80px) rotate(20deg);
        opacity: 0.3;
    }
}

@keyframes opacityWave {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
}

/* Global floating icons layer */
.global-floating-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.global-floating-icon {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.2;
    animation: floatGlobal 30s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    will-change: transform, opacity;
}

/* Section-specific floating icons */
.section-floating-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}

.section-floating-icons .global-floating-icon {
    position: absolute;
}

/* Global floating layer icons (subtle background) */
.global-floating-layer .global-floating-icon {
    position: fixed;
}

/* ============================================
   GLOWING PARTICLE FIELD
   ============================================ */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(30px, -40px) scale(1.2);
        opacity: 0.6;
    }
}

@keyframes particleGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    }
}

.particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.8), transparent);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite, particleGlow 3s ease-in-out infinite;
    will-change: transform, opacity;
}

.particle:nth-child(1) { top: 15%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 25%; left: 60%; animation-delay: 1s; }
.particle:nth-child(3) { top: 45%; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { top: 65%; left: 70%; animation-delay: 3s; }
.particle:nth-child(5) { top: 35%; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { top: 55%; left: 10%; animation-delay: 5s; }
.particle:nth-child(7) { top: 75%; left: 40%; animation-delay: 6s; }
.particle:nth-child(8) { top: 85%; left: 80%; animation-delay: 7s; }
.particle:nth-child(9) { top: 20%; left: 90%; animation-delay: 8s; }
.particle:nth-child(10) { top: 50%; left: 5%; animation-delay: 9s; }

/* ============================================
   SECTION FADE & SLIDE ANIMATIONS
   ============================================ */
@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.section-scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */
.parallax-bg {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ============================================
   HERO TEXT WORD-BY-WORD ANIMATION
   ============================================ */
@keyframes wordFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-word {
    display: inline-block;
    opacity: 0;
    animation: wordFadeIn 0.6s ease-out forwards;
}

/* ============================================
   BUTTON & ICON HOVER EFFECTS
   ============================================ */
.btn, .service-link, .nav-link, .icon-hover {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    transform: translateZ(0);
    will-change: transform;
}

.btn:hover, .service-link:hover, .icon-hover:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BACKGROUND GRADIENT ANIMATION
   ============================================ */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

body {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* ============================================
   PAGE FADE-OUT ON NAVIGATION
   ============================================ */
@keyframes pageFadeOut {
    from {
        opacity: 1;
        filter: blur(0);
    }
    to {
        opacity: 0;
        filter: blur(10px);
    }
}

.page-exiting {
    animation: pageFadeOut 0.5s ease-out forwards;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.animated-element {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* GPU acceleration for animations */
@media (prefers-reduced-motion: no-preference) {
    .global-floating-icon,
    .particle,
    .section-scroll-reveal {
        transform: translateZ(0);
        will-change: transform, opacity;
    }
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 768px) {
    .logo {
        height: 80px !important; /* Proportional scaling */
    }
    
    .logo-link {
        gap: 0.75rem !important;
    }
    
    .site-title {
        font-size: 1.1rem !important;
        letter-spacing: 1.5px !important;
    }
    
    .navbar {
        min-height: 75px !important;
        padding: 0.75rem 0 !important;
    }
    
    .nav-container {
        padding: 0 20px !important;
        gap: 1rem;
    }
    
    .logo-container {
        margin-right: 0;
    }
    
    .nav-menu {
        gap: 1.5rem !important;
    }
    
    .btn-nav-cta {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.8rem;
    }
    
    .hero-section {
        margin-top: 75px !important;
        height: calc(100vh - 75px) !important;
        min-height: calc(500px - 75px) !important;
    }
    
    body.navbar-scrolled .hero-section {
        margin-top: 70px !important;
        height: calc(100vh - 70px) !important;
    }
    
    section {
        padding: 40px 0 !important;
    }
    
    .about-section,
    .services-section,
    .gallery-section,
    .showreel-section {
        padding: 50px 0 !important;
    }
    
    .container {
        padding: 0 20px !important;
    }
    
    .global-floating-icon {
        font-size: 1.5rem;
        opacity: 0.1;
    }
    
    .particle {
        width: 3px;
        height: 3px;
    }
    
    /* Reduce animation complexity on mobile */
    body {
        animation: none !important;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 60px !important;
    }
    
    .logo-link {
        gap: 0.5rem !important;
    }
    
    .site-title {
        font-size: 0.85rem !important;
        letter-spacing: 1px !important;
    }
    
    .navbar {
        min-height: 65px !important;
        padding: 0.6rem 0 !important;
    }
    
    .nav-container {
        padding: 0 15px !important;
        gap: 0.75rem;
    }
    
    .nav-menu {
        gap: 1rem !important;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.85rem;
    }
    
    .btn-nav-cta {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.75rem;
    }
    
    .hero-section {
        margin-top: 65px !important;
        height: calc(100vh - 65px) !important;
        min-height: calc(400px - 65px) !important;
    }
    
    body.navbar-scrolled .hero-section {
        margin-top: 60px !important;
        height: calc(100vh - 60px) !important;
    }
    
    section {
        padding: 30px 0 !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body {
        animation: none;
    }
}

