h1, h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    text-align: center;
    margin: 0 auto;
    max-width: 1200px;
    padding: 2rem 0;
    /* Градиентный текст */
    background: linear-gradient(to right, #ff3366, #33ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Тень текста */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    /* Дополнительные эффекты */
    font-size: 2.5rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.project-card h2 {
    text-align: center;
    margin-bottom: 1rem;
}

p, .project-description {
    font-family: 'Lora', serif;
    font-size: 16px;
    line-height: 1.6;
}

.heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
}

main {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

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

.project-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
    margin-bottom: 1rem;
}

.project-card:focus-within {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.project-card:hover {
    transform: translateY(-2px);
}

.project-card a {
    text-decoration: none;
    color: inherit;
}

.project-description {
    padding: 1rem;
    background: #fff;
    text-align: center; /* Добавлено для центрирования текста */
    margin: 0 auto; /* Добавлено для центрирования блока */
    max-width: 512px; /* Ограничение максимальной ширины */
}

.project-card img {
    max-width: 512px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    border: 1px solid #ddd;
    padding: 4px;
    object-fit: contain;
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .project-description {
        font-size: 0.9rem;
    }

    .project-card img {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
}
