/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties */
:root {
    --primary-green: #006651;
    --secondary-green: #28a745;
    --accent-red: #dc2626;
    --dark-red: #b91c1c;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    min-height: 100vh;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    z-index: -1;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    background: var(--accent-red);
    color: white;
    padding: 16px 32px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
    border: 2px solid transparent;
}

.cta-button:hover {
    background: var(--dark-red);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(220, 38, 38, 0.4);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Projects Section */
.projects {
    padding: 6rem 0;
    background: var(--bg-white);
    position: relative;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: var(--primary-green);
    font-weight: 800;
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

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

.project-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 1px solid var(--bg-gray);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    transform: scaleX(0);
    transition: var(--transition);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.project-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-green);
    font-weight: 700;
}

.project-card p {
    margin-bottom: 2rem;
    color: var(--text-gray);
    line-height: 1.7;
    font-size: 1rem;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-light);
    color: var(--primary-green);
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: var(--transition);
}

.project-link:hover::before {
    left: 100%;
}

.project-link:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.project-link.demo {
    background: var(--accent-red);
    color: white;
    font-weight: 700;
}

.project-link.demo:hover {
    background: var(--dark-red);
    border-color: var(--dark-red);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.project-card {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .projects {
        padding: 4rem 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 2rem;
    }

    .project-links {
        gap: 0.5rem;
    }

    .project-link {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-icon {
        font-size: 3rem;
    }

    .project-card h3 {
        font-size: 1.3rem;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-gray: #d1d5db;
        --bg-white: #1f2937;
        --bg-light: #374151;
        --bg-gray: #4b5563;
    }
    
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    header {
        background: rgba(31, 41, 55, 0.95);
        border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    }
}

/* Loading state for images */
.project-icon {
    will-change: transform;
}

/* Focus styles for accessibility */
.project-link:focus,
.cta-button:focus,
.nav-links a:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    .hero {
        background: none !important;
        color: black !important;
    }
    
    .project-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
