:root {
    --primary-bg: #121614;
    --secondary-bg: #2F3E2D;
    --accent-color: #4E6B3C;
    --text-primary: #F4F4F4;
    --text-secondary: #F3F5F4;
    --border-color: rgba(255, 255, 255, 0.06);
    --shadow-color: rgba(78, 107, 60, 0.3);

    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;

    --font-xs: 14px;   
    --font-sm: 16px;   
    --font-md: 18px;   
    --font-lg: 24px;  
    --font-xl: 32px;   
    --font-2xl: 48px;  
    --font-3xl: 64px;  

    --border-radius: 30px;
    --border-radius-sm: 15px;
}

* {
    box-sizing: border-box;
    margin:0;
    padding:0;
}

body {
    font-family: 'Manrope', sans-serif;
    color:var(--text-primary);
    background-color:var(--primary-bg);
    line-height: 1.6;
}

h1 {
    font-size: var(--font-3xl);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

h2 {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

h3 {
    font-size: var(--font-lg);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

h4, p {
    font-size: var(--font-sm);
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

.mainTitleProj {
    display:flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--accent-color);
    font-size: var(--font-2xl); 
    font-weight: 700;
    margin: var(--spacing-xl) 0 var(--spacing-lg);
}

.projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.projects > div {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    overflow: hidden;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-md);
}

.projects > div:hover {
    transform: translateY(-5px);
    background-color: var(--accent-color);
}

.projects > div:hover h2 {
    color: var(--text-primary);
}

.projects > div:hover a {
    background-color: var(--primary-bg);
    color: var(--text-secondary);
}

.projects img {
    width: 100%;
    height: 200px;
    object-fit: cover; 
    margin-bottom: var(--spacing-sm);
    background-color: var(--primary-bg);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.projects h3 {
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.projects h2 {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--font-color); 
    margin-bottom: var(--spacing-xs);
}

.projects a {
    text-decoration:none;
    font-weight:600;
    font-size: var(--font-sm);
    border:2px solid var(--accent-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--accent-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.projects a:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

.image-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.image-popup img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px var(--shadow-color);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-popup.show {
    display: flex;
}

@media screen and (max-width: 480px) {
    :root {
        --font-2xl: 36px;
        --font-xl: 24px;
    }
    .mainTitleProj { font-size: var(--font-2xl); margin: var(--spacing-lg) 0; }
    .projects { grid-template-columns: 1fr; gap: var(--spacing-md); padding: var(--spacing-md); }
    .projects img { height: 180px; max-width: 100%; }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    .projects { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .projects { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (min-width: 2560px) {
    .projects {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
        max-width: 2400px;
        margin: 0 auto;
    }
    .projects img {
        height: 300px;
        max-width: 400px;
    }
}

.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 var(--spacing-lg); }

html { scroll-behavior: smooth; }