:root {
    /* Enhanced modern color palette */
    --primary-color: #1a1a1a;
    --secondary-color: #3498db;
    --accent-color: #2ecc71;
    --grid-panel-color: #ffffff;
    --text-color: #ffffff;
    --light-bg: #121212;
    --nav-bg: rgba(26, 26, 26, 0.95);
    --nav-text: #ffffff;
    --nav-shadow: 0 2px 5px rgba(0,0,0,0.2);
    
    /* Enhanced Fluid Typography */
    --h1-size: clamp(2rem, 5vw, 3.052rem);
    --h2-size: clamp(1.8rem, 4vw, 2.441rem);
    --h3-size: clamp(1.5rem, 3vw, 1.953rem);
    --h4-size: clamp(1.2rem, 2vw, 1.563rem);
    --body-size: clamp(1rem, 1.2vw, 1.2rem);
    
    /* Enhanced Spacing Scale */
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);
    --space-sm: clamp(1rem, 2vw, 1.5rem);
    --space-md: clamp(1.5rem, 3vw, 2.5rem);
    --space-lg: clamp(2.5rem, 5vw, 4rem);
    --space-xl: clamp(4rem, 8vw, 8rem);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Optimized Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-bg);
    /* Enhanced Subtle pattern overlay */
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,.02) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.02) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.02) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.02) 75%);
    background-size: 20px 20px;
    overflow-x: hidden;
}

.container {
    width: min(1200px, 95%);
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

h1, h2, h3, h4 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

/* Enhanced Mobile-First Navbar */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--nav-shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    position: relative;
}

.logo {
    font-size: var(--h4-size);
    font-weight: bold;
    color: var(--nav-text);
    transition: transform 0.3s ease;
    z-index: 2;
}

/* Enhanced Mobile Navigation */
.nav-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2;
    padding: 0.8rem;
    margin: -0.8rem;
    touch-action: manipulation;
}

.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    max-width: 300px;
    background: var(--nav-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease-in-out;
    padding: var(--space-xl) var(--space-md);
}

.nav-links.active {
    right: 0;
    animation: slideInFromRight 0.3s ease-in-out;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding: var(--space-sm);
    font-size: 1.2rem;
    width: 100%;
    text-align: center;
}

.nav-links a i {
    margin-right: 0.5rem;
}

/* Enhanced Hero Section */
#top {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5)),
                url('./images/hero.webp') center/cover fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: var(--nav-text);
    text-align: center;
    position: relative;
    padding-top: 60px;
}

.hero-content {
    max-width: min(800px, 95%);
    margin: 0 auto;
    padding: var(--space-md);
}

.hero-text {
    font-size: var(--h3-size);
    margin-bottom: var(--space-md);
    animation: fadeIn 1s ease-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Enhanced App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--space-md);
    padding: var(--space-md);
}

.app-card {
    background: var(--grid-panel-color);
    color: var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    touch-action: manipulation;
}

.app-card:hover, .app-card:active {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.app-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.app-card:hover img {
    transform: scale(1.05);
}

.app-card-content {
    padding: var(--space-md);
}

.category-tag {
    display: inline-block;
    padding: 0.5em 1em;
    background: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    margin-bottom: var(--space-sm);
}

/* Enhanced Mobile-First Footer */
footer {
    background: var(--primary-color);
    color: var(--nav-text);
    padding: var(--space-lg) 0;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--space-lg);
    padding: var(--space-md);
}

.footer-col {
    animation: slideInFromLeft 0.8s ease-out;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.newsletter-form input {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--nav-text);
    transition: all 0.3s ease;
    font-size: 1rem;
    min-height: 44px;
}

.newsletter-form input:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-color: var(--secondary-color);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: var(--space-sm) var(--space-md);
    background: var(--secondary-color);
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 44px;
    width: 100%;
    touch-action: manipulation;
}

.cta-button:hover, .cta-button:active {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.social-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
    justify-content: center;
}

.social-links a {
    color: var(--nav-text);
    font-size: 1.8rem;
    transition: all 0.3s ease;
    padding: var(--space-xs);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover, .social-links a:active {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Enhanced Tablet & Desktop Styles */
@media (min-width: 901px) {
    .nav-toggle {
        display: none;
    }
    
    .nav-links {
        position: static;
        height: auto;
        width: auto;
        max-width: none;
        padding: 0;
        flex-direction: row;
        background: none;
        display: flex;
        gap: var(--space-md);
    }

    .nav-links a {
        width: auto;
        font-size: 1rem;
    }

    .form-group {
        flex-direction: row;
    }

    .newsletter-form .cta-button {
        width: auto;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* Enhanced Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(90deg, 
        var(--grid-panel-color) 0%, 
        rgba(255,255,255,0.1) 50%, 
        var(--grid-panel-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Mobile-specific optimizations */
@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    .hero-content {
        padding: var(--space-sm);
    }

    .app-grid {
        gap: var(--space-sm);
        padding: var(--space-sm);
    }

    .footer-grid {
        gap: var(--space-md);
    }

    .contact-info p {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        margin-bottom: var(--space-sm);
    }
}
