:root {
    /* Color Palette - Cyber/Tech Agency Theme */
    --primary-dark: #050A0A; /* Almost Black */
    --primary-green: #0F3D3E; /* Deep Green Support */
    --neon-green: #00FF9D; /* High Voltage Green */
    --neon-dim: #00cc7d; /* Slightly dimmer neon */
    --text-white: #F0F4F4;
    --text-gray: #8A9999;
    --surface-dark: #0A1212;
    --surface-light: #121F1F;
    
    --grid-line: rgba(0, 255, 157, 0.05);
    
    --transition-fast: 0.2s cubic-bezier(0.2, 0, 0.4, 1);
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-heading-mono: 'Courier New', monospace;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Courier New', monospace; /* For tech accents */
}

/* 1. RESET & BASE */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important; /* STRICT SHARP EDGES */
    /* Removed cursor: none to allow both system and canvas cursor */
}

html {
    scroll-behavior: smooth;
    background-color: var(--primary-dark);
}

body {
    font-family: var(--font-body);
    color: var(--text-white);
    background-color: var(--primary-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* 2. TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 5vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: 1.5rem; color: var(--neon-green); }

p { margin-bottom: 1.5rem; color: var(--text-gray); font-size: 1.1rem; }
a { text-decoration: none; color: inherit; }

/* 3. UTILITIES */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 8rem 0;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }

/* Responsive Toggles */
.mobile-only-btn { display: none; }
.desktop-only-btn { display: inline-flex; }

@media (max-width: 768px) {
    .mobile-only-btn { display: block !important; }
    .desktop-only-btn { display: none !important; }
}

/* Agency Grid Layout (About Page) */
.agency-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    grid-template-areas: 
        "text terminal"
        "metrics terminal";
}
.agency-text { grid-area: text; }
.agency-metrics { grid-area: metrics; }
.agency-terminal { grid-area: terminal; }

@media (max-width: 768px) {
    .agency-grid {
        grid-template-columns: 1fr;
        grid-template-areas: none;
        display: flex;
        flex-direction: column;
    }
    /* Order: Text -> Terminal -> Metrics */
    .agency-text { order: 1; }
    .agency-terminal { order: 2; margin-bottom: 3rem; }
    .agency-metrics { order: 3; }
    
    /* Force Metrics to Stack Vertically on Mobile */
    .agency-metrics .grid-3 {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
}

/* HERO OPTIMIZATIONS */
.hero-terminal-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%; /* Requested 75% */
    max-width: 1200px;
    height: 60vh;
    max-height: 600px;
    font-family: var(--font-mono);
    color: var(--neon-green);
    background: rgba(0, 10, 5, 0.4);
    padding: 2rem;
    border: 1px solid rgba(0, 255, 157, 0.15);
    z-index: 1; /* Behind text (z=2) */
    overflow: hidden;
    opacity: 0.4;
    pointer-events: none;
    text-align: left;
    filter: blur(1px); /* Background visual feel */
}

.hero-intro-text {
    font-family: var(--font-mono);
    color: var(--neon-green);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    min-height: 1.5rem;
    height: 1.5rem; /* prevent layout shift */
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 157, 0.5);
    display: block;
}

@media (max-width: 768px) {
    .hero-terminal-bg {
        display: none !important; /* Hide on small screens */
    }
    /* Hero Text Spacing on Mobile */
    .hero-content-wrapper {
        margin-top: 4rem;
    }
}

/* 4. CUSTOM CURSOR (Canvas Overlay logic handles drawing, we just need canvas style) */
#canvas {
    mix-blend-mode: screen; /* Makes the cursor glow */
}

/* 5. COMPONENTS */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    background: transparent;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    z-index: 1; /* Establishes stacking context so ::before (z-index -1) stays above parent background */
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--neon-green);
    transition: var(--transition-smooth);
    z-index: -1;
}

.btn:hover, .btn:focus {
    color: var(--primary-dark);
    outline: none;
}

.btn:hover::before, .btn:focus::before {
    left: 0;
}

.btn-primary {
    background: var(--neon-green);
    color: var(--primary-dark);
}
.btn-primary:hover {
    background: var(--text-white);
    border-color: var(--text-white);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0; width: 100%;
    padding: 1.5rem 0;
    background: rgba(5, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(5, 10, 10, 0.95);
}

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

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: var(--neon-green);
    transition: var(--transition-fast);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* MARQUEE BELOW NAVBAR */
.global-marquee {
    position: fixed;
    top: 80px; /* Adjust based on navbar height */
    left: 0;
    width: 100%;
    /* Updated background/text color to match Hero-bottom Section */
    background: var(--neon-green);
    color: var(--primary-dark);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
    padding: 8px 0;
    /* Z-index lowered to ensure it passes UNDER the mobile menu if needed, but above content. 
       Navbar is 1000. Mobile Menu is often 1001. */
    z-index: 900; 
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 2px solid var(--primary-dark);
    font-weight: 700;
}

.marquee-track {
    display: flex;
    width: fit-content;
    gap: 0; /* Continuous flow */
    /* Animation duration will be set inline or via specific classes for pacing */
    animation: marquee 60s linear infinite; 
}

.marquee-track:hover {
    animation-play-state: paused;
}

.navbar.scrolled ~ .global-marquee {
    top: 65px; /* Adjust as navbar shrinks */
    transition: top 0.3s;
}

/* Cards (Services/Portfolio) */
.card {
    background: var(--surface-light);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2rem;
    transition: var(--transition-fast);
    position: relative;
    z-index: 1; /* Added based on previous step context, ensuring it stays */
}
/* ... keeping context ... */

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move half way (one full set of content) */
}

.card:hover {
    border-color: var(--neon-green);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 255, 157, 0.05);
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* Form Elements */
.form-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    padding: 1rem 0;
    color: var(--text-white);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-green);
}

label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--neon-green);
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary-dark);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader-bar {
    width: 300px;
    height: 1px;
    background: #333;
    position: relative;
    overflow: hidden;
}

.loader-progress {
    position: absolute;
    top: 0; left: 0; height: 100%;
    background: var(--neon-green);
    width: 100%;
    animation: load-infinite 1.5s ease-in-out infinite;
}

/* CODE SNIPPETS DECORATION */
.bg-visuals {
    pointer-events: none;
    user-select: none;
}
.code-snippet {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-dim);
    transition: opacity 0.5s;
    white-space: nowrap;
}

/* ANIMATIONS */
@keyframes load-infinite {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* Marquee keyframes are defined above, removing duplicate here */

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Mobile Nav */
.mobile-menu-toggle { 
    display: none; 
    cursor: pointer;
    z-index: 1001; 
}
/* Ensure the hamburger icon has dimensions and color logic */
.mobile-menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--neon-green); /* Neon Green Bars */
    margin: 6px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .nav-links { 
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 10, 10, 0.98);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--neon-green);
        text-align: center;
        gap: 1.5rem;
    }
    
    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle { display: block; }
    
    .global-marquee {
        top: 70px; /* Adjust for mobile navbar height if needed */
        z-index: 950;
    }
    
    /* Ensure marquee isn't hidden by a tall navbar */
    .navbar {
        padding: 1rem 0;
    }
}
