/* --- GLOBAL BODY BACKGROUND --- */
body {
    background-color: #050505;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 200px 200px;
    background-attachment: fixed;
}

/* --- 1. HERO SECTION --- */
.home-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Balanced padding: enough to clear nav but close enough for impact */
    padding: 120px 8% 0 8%; 
    position: relative;
    overflow: hidden;
    background: transparent !important;
}

/* KINETIC TAGLINE (STANDARDIZED SIZE) */
.hero-tagline-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 18px; /* Balanced size */
    letter-spacing: 0.4em;
    font-weight: 900;
    margin-bottom: 2rem;
    height: 28px; 
    overflow: hidden;
    position: relative;
    z-index: 50;
}

.safe-abbreviation {
    display: flex;
    gap: 4px;
    color: rgba(255, 255, 255, 0.2);
}

/* Letter Glow Logic */
.letter-s { animation: smoothGlow 10s infinite; }
.letter-a { animation: smoothGlow 10s infinite 2.5s; }
.letter-f { animation: smoothGlow 10s infinite 5s; }
.letter-e { animation: smoothGlow 10s infinite 7.5s; }

@keyframes smoothGlow {
    0%, 20% { color: #0047AB; text-shadow: 0 0 10px rgba(0, 71, 171, 0.8); }
    25%, 100% { color: rgba(255, 255, 255, 0.2); text-shadow: none; }
}

.rotating-box { height: 28px; overflow: hidden; }
.rotating-items {
    display: flex;
    flex-direction: column;
    color: #0047AB;
    animation: rotateTagline 10s infinite cubic-bezier(0.85, 0, 0.15, 1);
}
.rotating-items span { height: 28px; display: flex; align-items: center; }

@keyframes rotateTagline {
    0%, 20% { transform: translateY(0); }
    25%, 45% { transform: translateY(-28px); }
    50%, 70% { transform: translateY(-56px); }
    75%, 95% { transform: translateY(-84px); }
    100% { transform: translateY(-112px); }
}

/* THE WATERMARK (VISIBLE REPAIR) */
.hero-watermark {
    position: absolute;
    right: -2%;
    top: 55%;
    transform: translateY(-50%);
    font-size: clamp(10rem, 28vw, 45rem); 
    font-weight: 900;
    line-height: 0.8;
    white-space: nowrap;
    pointer-events: none;
/* Brought forward slightly */
    z-index: 2 !important;
    opacity: 0.05 !important;
    transition: opacity 1s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 6.5vw, 7rem); 
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

/* BUTTON RESTORED */
.btn-expertise {
    display: inline-block;
    margin-top: 2rem;
    padding: 1.2rem 2.5rem;
    border: 1px solid #0047AB;
    color: white !important;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    transition: all 0.3s ease;
    background: transparent;
    text-decoration: none;
    position: relative;
    z-index: 99;
}

.btn-expertise:hover {
    background: #0047AB !important;
    box-shadow: 0 0 20px rgba(0, 71, 171, 0.4);
}

/* --- 2. EXPERTISE SECTION (BOXED STYLE) --- */
/* --- 2. SECTOR EXPERTISE (REFINED SCALE) --- */
/* --- 2. SECTOR EXPERTISE (SCALED & POSITIONED) --- */
#expertise {
    z-index: 10;
    position: relative;
    background: transparent !important;
    padding: 60px 8% 60px 8% !important;
    /* This ensures that when you click 'Explore Expertise', 
       the title doesn't hide behind the 80px-100px header */
    scroll-margin-top: 100px; 
    margin-top: -40px; 
}

/* Tagline: Size increased for both Mobile & Laptop */
.expertise-tagline {
    color: #0047AB !important;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 14px; /* Increased from 11px for better presence */
    letter-spacing: 0.5em;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 1 !important;
}

/* Section Title: Reduced size to prevent 'Gargantuan' look on laptop */
#expertise .hero-title {
    font-size: clamp(1.8rem, 3.8vw, 3.2rem) !important; /* Balanced scale */
    line-height: 1.1;
    margin-bottom: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: -0.02em;
}

.expertise-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    border: 1px solid rgba(0, 71, 171, 0.3) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px);
}

.expertise-card {
    position: relative;
    padding: 60px 40px !important;
    border-right: 1px solid rgba(0, 71, 171, 0.3) !important;
    transition: all 0.4s ease;
}

.expertise-card:last-child { border-right: none !important; }

/* CAD Bracket & Hover */
.expertise-card::after {
    content: ""; position: absolute; bottom: 0; right: 0;
    width: 12px; height: 12px; border-right: 2px solid #0047AB; border-bottom: 2px solid #0047AB; opacity: 0.6;
}
.expertise-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 0; height: 3px; background: #0047AB; transition: width 0.4s ease;
}
.expertise-card:hover::before { width: 100%; }
.expertise-card:hover { background: rgba(0, 71, 171, 0.1) !important; }


/* --- THE BLUEPRINT RIPPLE (REACTIVE GEOMETRY) --- */
/* --- THE NEURAL BLUEPRINT (THE LIFE) --- */
.system-life {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* --- THE ADAPTIVE ATMOSPHERIC RIPPLE --- */
.blueprint-ripple {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* 1. We now use a variable for opacity (defaults to 0.1) */
    background: 
        radial-gradient(at var(--ripple-x1) var(--ripple-y1), rgba(0, 110, 255, var(--ripple-opacity, 0.12)) 0%, transparent 85%),
        radial-gradient(at var(--ripple-x2) var(--ripple-y2), rgba(0, 45, 120, var(--ripple-opacity, 0.1)) 0%, transparent 85%);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
    /* 2. The blur also reacts: Higher intensity = Sharper focus */
    filter: blur(var(--ripple-blur, 140px));
    /* 3. Smooth transition for the 'Intensity' shift */
    transition: filter 0.5s ease-out, background 0.5s ease-out;
}
@keyframes organicFlicker {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    33% { opacity: 1; transform: scale(1.05); }
    66% { opacity: 0.8; transform: scale(0.95); }
}

/* THE DATA SPARKS: Tiny white/blue pings that travel the grid */
.data-spark {
    position: absolute;
    width: 2px; height: 2px;
    background: #fff;
    box-shadow: 0 0 10px #0047AB, 0 0 20px #0047AB;
    border-radius: 50%;
    opacity: 0;
}

@keyframes sparkTravel {
    0% { opacity: 0; transform: scale(0); }
    10% { opacity: 1; transform: scale(1); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)); }
}

/*

/* --- THE TOUCH IMPACT (BLUE LEAK) --- */
.touch-impact-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100; /* Above everything for maximum 'pop' */
}

/* --- THE RESONANCE SPLASH (STOMACH-DROP JOY) --- */
.impact-splash {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

/* The Core: A soft, expanding bloom (no hard point) */
.impact-splash::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    border-radius: 50%;
    animation: bloomFade 1.5s cubic-bezier(0.1, 0.5, 0.2, 1) forwards;
}

/* THE AXIAL RESONANCE: Lines that shoot along the grid */
.resonance-line {
    position: absolute;
    background: linear-gradient(var(--dir), transparent, rgba(0, 212, 255, 0.4), transparent);
    filter: blur(1px);
    animation: lineShoot 1.2s cubic-bezier(0.1, 0.5, 0.2, 1) forwards;
}

/* Horizontal lines */
.line-h { width: 100vw; height: 1px; --dir: to right; top: 0; left: -50vw; }
/* Vertical lines */
.line-v { width: 1px; height: 100vh; --dir: to bottom; left: 0; top: -50vh; }

@keyframes bloomFade {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

@keyframes lineShoot {
    0% { transform: scale(0); opacity: 0; }
    15% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; filter: blur(10px); }
}
/* --- 3. MOBILE REPAIR (SCROLL EFFECTS RESTORED) --- */
@media (max-width: 768px) {
    .home-hero {
        padding: 110px 6% 40px 6% !important;
        display: block !important;
    }

    .hero-tagline-wrapper {
        justify-content: flex-start !important;
        font-size: 14px !important; /* Standardized Mobile Size */
        height: 22px;
        margin-bottom: 1.5rem !important;
    }
    .rotating-box, .rotating-items span { height: 22px; }

    @keyframes rotateTagline {
        0%, 20% { transform: translateY(0); }
        25%, 45% { transform: translateY(-22px); }
        50%, 70% { transform: translateY(-44px); }
        75%, 95% { transform: translateY(-66px); }
        100% { transform: translateY(-88px); }
    }

    .hero-watermark {
    position: absolute;
    /* Aligned to the right edge */
    right: -7% !important; 
    /* Centered vertically relative to the hero */
    top: 28% !important;
    transform: translateY(-50%);
    
    /* Massive architectural scale */
    font-size: 55vw !important
    font-weight: 900;
    line-height: 0.8;
    white-space: nowrap;
    display: block !important;
    
    /* Functional behavior */
    pointer-events: none; /* User can click through it to the button */
    z-index: 1; /* Above the grid, but below the content (z-index 10) */
    
    /* Visual styling */
    color: rgba(255, 255, 255, 0.05) !important;
    text-transform: uppercase;
    user-select: none;
    }
    #expertise {
        /* Pulls the section up significantly to eliminate the black void */
        margin-top: -180px !important; 
        padding: 40px 6% 40px 6% !important;
        /* Setting a smaller scroll margin for mobile header height */
        scroll-margin-top: 80px; 
    }

    .expertise-tagline {
        font-size: 11px !important; /* Scaled up for mobile visibility */
        letter-spacing: 0.3em !important;
        margin-bottom: 1rem !important;
        text-align: left;
    }
    #expertise .hero-title {
        font-size: 8.5vw !important; /* Mobile optimized size */
        line-height: 1.2 !important;
        margin-bottom: 2.5rem !important;
        text-align: left;
    }

    .expertise-grid { grid-template-columns: 1fr !important; }

    /* Restoration of the Scroll Active State */
    .expertise-card.mobile-active {
        background: rgba(0, 71, 171, 0.15) !important;
        box-shadow: inset 0 0 20px rgba(0, 71, 171, 0.2);
    }
    .expertise-card.mobile-active::before { width: 100% !important; }
    .blueprint-ripple {
        background: 
            radial-gradient(at var(--ripple-x1) var(--ripple-y1), rgba(0, 71, 171, 0.20) 0%, transparent 90%),
            radial-gradient(at var(--ripple-x2) var(--ripple-y2), rgba(0, 45, 120, 0.17) 0%, transparent 90%);
        filter: blur(100px);
    }
}


body {
    /* Prevents the 'jump' when the scrollbar disappears */
    padding-right: var(--scrollbar-width, 0px);
}

.modal-overlay {
    /* Ensure the overlay covers the full viewport regardless of scroll status */
    overflow-y: auto; 
}