:root {
    --primary: #D93644;
    --accent: #F2A2A2;
    --dark: #111111;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark);
    background-image: radial-gradient(circle at 50% 50%, #2a0505 0%, #000000 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.6;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    perspective: 1000px;
    align-items: stretch;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
    pointer-events: none;
}

.card:hover::before {
    left: 100%;
}

.profile-img-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px var(--primary);
    flex-shrink: 0;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    text-align: center;
    font-size: 2rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #ccc;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 1px;
    height: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Убрали долгий transition, будем управлять им из JS */
}

.sparkle {
    position: absolute;
    pointer-events: none;
    background: white;
    border-radius: 50%;
    z-index: 10;
}

/* Анимация появления стала быстрее (0.4s вместо 0.6s) */
.text-appear {
    animation: blurIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: auto;
}

.social-btn {
    color: white;
    font-size: 1.5rem;
    transition: 0.3s;
}

.social-btn:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    transform: translateY(-3px);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
    justify-content: center;
}

.tags span {
    background: rgba(217, 54, 68, 0.2);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    border: 1px solid var(--primary);
    transition: 0.3s;
    cursor: default;
    white-space: nowrap;
}

.tags span:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary);
}

.projects-card {
    flex-grow: 1;
}

.projects-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    flex-grow: 1;
}

.projects-list::-webkit-scrollbar {
    width: 6px;
}

.projects-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.projects-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.projects-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.project-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.project-item:last-child {
    border-bottom: none;
}

.project-item h3 {
    color: var(--accent);
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
}

.project-item p {
    font-size: 0.95rem;
    color: #ddd;
}

.project-item a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
    display: inline-block;
    margin-top: 0.5rem;
}

.project-item a:hover {
    color: white;
    padding-left: 5px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
    }
    .card:hover {
        transform: none !important; 
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
}