/* --- General Setup & Variables --- */
:root {
    --bg-dark: #1A1D24; /* Charcoal grey */
    --bg-light: #252934; /* Slightly lighter grey for cards */
    --text-primary: #F5F5F5; /* Near white */
    --text-secondary: #A9B1D6; /* Muted text */
    --accent-primary: #00BFFF; /* Electric blue */
    --accent-hover: #0099cc;
    --font-family: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Utility & Reusable Components --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background-color: var(--accent-primary);
    color: var(--bg-dark);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

section {
    padding: 80px 0;
}

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    width: 100%;
    z-index: 100;
    background: rgba(26, 29, 36, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--accent-primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* FIX: Added position:relative and z-index to ensure it's above the background */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.hero-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background-image: radial-gradient(circle, var(--accent-primary) 0%, transparent 40%);
    opacity: 0.1;
    transform: translate(-50%, -50%);
    animation: pulse 10s infinite ease-in-out;
    z-index: 1; /* Ensure background is behind content */
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* --- Content Sections --- */
.section-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.section-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.service-card i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 20px 20px;
    color: white;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
    opacity: 1;
}

.portfolio-overlay h3 {
    margin-bottom: 5px;
}

/* --- Contact Section --- */
.contact-section {
    background-color: var(--bg-light);
}

/* --- Footer --- */
.main-footer {
    padding: 30px 0;
    text-align: center;
    background-color: #111318;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-primary);
}

/* --- Scroll Animations --- */
.section-content, .services-grid, .portfolio-grid {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-content.visible, .services-grid.visible, .portfolio-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        height: 100vh;
        background: var(--bg-light);
        
        /* FIX: Added display:flex and z-index */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 100;

        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .main-nav a {
        margin: 20px 0;
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: block;
        z-index: 101; /* Ensure toggle is above the nav menu */
    }
    
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .section-title { font-size: 2rem; }

    .footer-content {
        flex-direction: column;
    }
}