/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #050509;
    --surface-color: #0F1015;
    --text-color: #F5F5F7;
    --subtle-text: #a0a0a0;
    --accent-color: #4F8BFF;
    --border-color: rgba(245, 245, 247, 0.1);
    --card-radius: 16px;
    --nav-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    position: relative; /* Create a stacking context */
}

/* --- UTILITIES & LAYOUT --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section {
    padding: 6rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

/* --- PARTICLES BACKGROUND --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Behind content, but in front of body background */
    pointer-events: none; /* Allow clicks to pass through */
}

/* --- NAVIGATION BAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(5, 5, 9, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--subtle-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-color);
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: transparent; /* Allow particles to show through */
}

/* Add a pseudo-element for the gradient overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center left,
        rgba(15, 16, 21, 0.9) 0%, /* Darker near text for readability */
        rgba(5, 5, 9, 0.7) 70%   /* More transparent further away */
    );
    z-index: -1; /* Behind hero content, but above particles */
}

.hero-content {
    max-width: 650px;
}

.hero-content.fade-in {
    animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.hero p {
    font-size: 1.2rem;
    color: var(--subtle-text);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    background-color: #629dff;
}

/* --- CARD STYLES --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Ensures the link takes up the full grid cell */
}

.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    height: 100%; /* Ensure card fills the entire grid cell height */
    display: flex; /* Use flexbox for internal alignment */
    flex-direction: column; /* Stack card content vertically */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card p {
    color: var(--subtle-text);
    font-size: 0.9rem;
    flex-grow: 1; /* Allow the paragraph to grow and push tags to the bottom */
    margin-bottom: 1rem;
}

.img-placeholder {
    width: 100%;
    height: 180px;
    background-color: #1c1d24;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background-color: #000000; /* Fallback color if image fails to load */
}

/* Style for images that should contain within the frame, like logos */
.logo-fit {
    object-fit: contain;
    /* Add some padding so the logo doesn't touch the edges */
    padding: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    background-color: rgba(79, 139, 255, 0.1);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- ALL PROJECTS GRID --- */
.dense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.small-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.small-card:hover {
    transform: translateY(-5px);
}

.small-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.small-card p {
    font-size: 0.85rem;
    color: var(--subtle-text);
}

.small-card .small-img-placeholder {
    width: 100%;
    height: 120px;
    background-color: #1c1d24;
    border-bottom: 1px solid var(--border-color);
}

/* --- ML WORK SECTION --- */
.ml-work {
    /* background-color: var(--surface-color); <-- This was hiding the particles */
    background-image:
        linear-gradient(rgba(245, 245, 247, 0.03) 1px, transparent 1px),
        linear-gradient(to right, rgba(245, 245, 247, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

.small-card-content {
    padding: 1rem;
}

/* --- CONTENT STACKING --- */
/* Ensure main content sections sit above the particle canvas */
main,
.footer {
    position: relative;
    z-index: 1;
}
/* --- FOOTER --- */
.footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--subtle-text);
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--subtle-text);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .nav-links {
        display: none; /* Simple hide for mobile, can be replaced with a hamburger menu */
    }
    .section-title {
        font-size: 2rem;
    }
}