/* ============================================================
   Techy Site-Wide Background & Global Styles
   Grid pattern applied site-wide — faded, adaptive to dark/light
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- CSS Custom Properties --- */
:root {
    /* Background */
    --tech-bg: #FFFFFF;

    /* Grid line colour: very subtle in light mode */
    --tech-grid-color: rgba(0, 0, 0, 0.026);

    /* Soft ambient gradients that sit behind the grid */
    --tech-gradient-1: rgba(21, 76, 121, 0.04);
    --tech-gradient-2: rgba(37, 150, 190, 0.03);

    /* --- Theme tokens (Light default) --- */
    --primary: #164c78;
    --primary-hover: #0f3a5f;
    --secondary: #8B5CF6;
    --accent: #10B981;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --card-bg: #FFFFFF;
    --overlay-light: rgba(255, 255, 255, 0.5);
    --overlay-dark: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Background */
        --tech-bg: #0A0E21;

        /* Grid lines slightly brighter to stay visible on dark canvas */
        --tech-grid-color: rgba(255, 255, 255, 0.021);

        /* Cool blue ambient gradients for dark mode */
        --tech-gradient-1: rgba(37, 99, 235, 0.06);
        --tech-gradient-2: rgba(139, 92, 246, 0.04);

        /* --- Theme tokens (Dark) --- */
        --bg-primary: #0A0E21;
        --bg-secondary: #161B22;
        --text-color: #F8FAFC;
        --text-muted: rgba(248, 250, 252, 0.65);
        --border-color: rgba(255, 255, 255, 0.1);
        --shadow-color: rgba(0, 0, 0, 0.4);
        --card-bg: #1A202C;
        --overlay-light: rgba(255, 255, 255, 0.07);
        --overlay-dark: rgba(0, 0, 0, 0.25);
    }
}

/* Manual dark-mode class for JS-toggled themes */
.dark-mode {
    --tech-bg: #0A0E21;
    --tech-grid-color: rgba(255, 255, 255, 0.021);
    --tech-gradient-1: rgba(37, 99, 235, 0.06);
    --tech-gradient-2: rgba(139, 92, 246, 0.04);
    --bg-primary: #0A0E21;
    --bg-secondary: #161B22;
    --text-color: #F8FAFC;
    --text-muted: rgba(248, 250, 252, 0.65);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --card-bg: #1A202C;
    --overlay-light: rgba(255, 255, 255, 0.07);
    --overlay-dark: rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Global body — base background + ambient gradient
   ============================================================ */
body {
    background-color: var(--tech-bg);
    background-image:
        /* Interactive Mouse Spotlight */
        radial-gradient(circle 500px at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--tech-gradient-1), transparent),
        /* Drifting Ambient Glows */
        radial-gradient(ellipse 80% 60% at 10% 20%,  var(--tech-gradient-1), transparent),
        radial-gradient(ellipse 60% 50% at 90% 80%,  var(--tech-gradient-2), transparent);
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    position: relative;
    /* Smooth theme transitions */
    transition: background-color 0.3s ease, color 0.3s ease;
    animation: drift 20s infinite alternate ease-in-out, fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
body.page-exiting {
    animation: fadeOut 0.3s ease-out forwards !important;
}

@keyframes drift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 0% 0%, 5% 5%, -5% -5%; }
}

/* ============================================================
   Grid overlay via ::before — fixed, covers full viewport,
   always behind page content via z-index: 0 / pointer-events: none
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;                    /* equivalent to top/right/bottom/left: 0 */
    z-index: 0;
    pointer-events: none;

    /* Two perpendicular sets of lines form the grid */
    background-image:
        linear-gradient(var(--tech-grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--tech-grid-color) 1px, transparent 1px);
    background-size: 50px 50px;

    /* Fade the very edges so it blends naturally */
    -webkit-mask-image:
        radial-gradient(ellipse 120% 120% at 50% 50%, black 55%, transparent 100%);
    mask-image:
        radial-gradient(ellipse 120% 120% at 50% 50%, black 55%, transparent 100%);
}

/* ============================================================
   Ensure key containers don't block the grid
   ============================================================ */
section,
.container,
.main-content,
.page-wrapper,
main {
    background-color: transparent;
    position: relative;
    z-index: 1;       /* sit above body::before */
}

/* ============================================================
   Base typography — respect theme variables
   ============================================================ */
h1, h2, h3, h4, h5, h6, li, span {
    color: var(--text-color);
}

.highlight {
    color: var(--primary) !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
}

.hero-title .highlight {
    display: block;
}

a:not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-primary-small):not(.read-more-btn):not(.nav-signup-btn) {
    color: inherit;
}

.text-muted {
    color: var(--text-muted) !important;
}


/* ============================================================
   Global Footer Styles
   ============================================================ */
.footer {
    padding: 6rem 4rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 4rem 2rem 2rem;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Global Mobile Optimization (Overrides)
   Ensures proportional sizing and eliminates empty spaces
   ============================================================ */
@media (max-width: 768px) {
    /* Compress excessive padding on Heroes */
    .hero, .subpage-hero {
        padding: 8rem 1.5rem 3rem !important;
    }
    
    /* Standardize Container & Content Paddings */
    .container, 
    .legal-content, 
    .compliance-section, 
    .form-section, 
    .contact-container,
    .blog-grid,
    .post-content,
    .main-content {
        padding: 1.5rem !important;
        margin-top: 2rem !important;
    }
    
    /* Standardize Section Paddings */
    .features, 
    .pricing, 
    .hero-features {
        padding: 2rem 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Compress Footer Space */
    .footer {
        padding: 3rem 1.5rem 2rem !important;
    }
    .footer-container {
        gap: 2rem !important;
        margin-bottom: 2rem !important;
    }

    /* Proportional Typography for Mobile */
    h1, .hero-title {
        font-size: clamp(2.2rem, 8vw, 3rem) !important;
        line-height: 1.2 !important;
    }
    h2, .section-header h2 {
        font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
        margin-bottom: 1rem !important;
    }
    .hero-subtitle, .section-subtitle {
        font-size: 1rem !important;
        padding: 0 1rem !important;
    }
}
