/* ======= Base Styles ======= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* disable text selection */
}

:root {
    --primary-red: #e60000;
    --secondary-red: #b10000;
    --pure-white: #ffffff;
    --off-white: #f2f2f2;
    --pure-black: #000000;
    --dark-gray: #1a1a1a;
    --accent-color: #e74c3c;
}

body {
    font-family: 'Monocraft', sans-serif;
    background-color: transparent;
    color: var(--pure-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ======= Particles ======= */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* изменено с -1 */
    background-color: #000000;
    pointer-events: auto; /* добавлено для интерактивности */
}

/* ======= Layout ======= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1; /* добавлено, чтобы содержимое было выше фона */
    pointer-events: none; /* оставляем для пропуска событий через прозрачные области */
}

/* Добавляем правило для интерактивного блока внутри main.content */
.profile-container {
    pointer-events: none;  /* now transparent for interactions */
}

/* Add rules to enable pointer events on interactive elements */
.profile-container .avatar,
.profile-container .title,
.profile-container .subtitle,
.profile-container .buttons {
    pointer-events: auto;
}

.container header,
.container .main-nav,
.container footer {
    pointer-events: auto; /* элементы остаются интерактивными */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-red);
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
}

/* ======= Navigation ======= */
.nav-toggle {
    display: none;
    cursor: pointer;
     width: 40px; /* increased for a square clickable area */
    height: 40px; /* increased for a square clickable area */
    position: relative;
    z-index: 200;
    background: transparent;
    /* removed previous background styling */
}

.nav-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--pure-white);
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.nav-toggle:active::before {
    opacity: 1;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--pure-white);
    position: absolute;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle span:first-child {
    top: 8px;
}

.nav-toggle span:last-child {
    bottom: 8px;
}

.nav-toggle.active span:first-child {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.nav-toggle.active span:last-child {
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    color: var(--pure-white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* ======= Main Content ======= */
.content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 0;
    z-index: 10;
}

.profile-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 30px;
    position: relative;
    border: 2px solid var(--primary-red);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
}

.avatar:hover img {
    filter: grayscale(0%);
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230,0,0,0.5) 0%, rgba(0,0,0,0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.avatar:hover .avatar-glow {
    opacity: 1;
    animation: pulse 2s infinite;
}

/* Add custom font for specific text */
.title,
.subtitle {
    font-family: 'Monocraft', sans-serif;
}

.title {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--pure-white);
    position: relative;
    text-shadow: 3px 3px 0 var(--primary-red);
}

.subtitle {
    font-size: 20px;
    color: var(--off-white);
    margin-bottom: 40px;
}

/* ======= Buttons ======= */
.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-red); /* плоский цвет */
    color: var(--pure-white);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px; /* небольшое скругление */
    transition: all 0.3s ease; /* анимация возвращена */
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 2px solid var(--primary-red);
}
.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--pure-white);
    transition: all 0.3s ease;
    z-index: -1;
}
.button:hover {
    color: var(--primary-red);
}
.button:hover::before {
    left: 0;
}
.button:active {
    color: var(--primary-red);
}
.button:active::before {
    left: 0;
}

/* ======= Footer ======= */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--off-white);
    font-size: 14px;
}

/* ======= Glitch Effect ======= */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--primary-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--pure-white);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim2 2.5s infinite linear alternate-reverse;
}

/* ======= Animations ======= */
@keyframes glitch-anim {
    0% {
        clip: rect(52px, 9999px, 61px, 0);
    }
    10% {
        clip: rect(78px, 9999px, 94px, 0);
    }
    20% {
        clip: rect(41px, 9999px, 49px, 0);
    }
    30% {
        clip: rect(37px, 9999px, 56px, 0);
    }
    40% {
        clip: rect(71px, 9999px, 89px, 0);
    }
    50% {
        clip: rect(16px, 9999px, 79px, 0);
    }
    60% {
        clip: rect(46px, 9999px, 78px, 0);
    }
    70% {
        clip: rect(23px, 9999px, 42px, 0);
    }
    80% {
        clip: rect(67px, 9999px, 70px, 0);
    }
    90% {
        clip: rect(33px, 9999px, 71px, 0);
    }
    100% {
        clip: rect(19px, 9999px, 26px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(67px, 9999px, 17px, 0);
    }
    10% {
        clip: rect(32px, 9999px, 54px, 0);
    }
    20% {
        clip: rect(12px, 9999px, 24px, 0);
    }
    30% {
        clip: rect(86px, 9999px, 91px, 0);
    }
    40% {
        clip: rect(43px, 9999px, 75px, 0);
    }
    50% {
        clip: rect(26px, 9999px, 49px, 0);
    }
    60% {
        clip: rect(76px, 9999px, 82px, 0);
    }
    70% {
        clip: rect(31px, 9999px, 66px, 0);
    }
    80% {
        clip: rect(89px, 9999px, 99px, 0);
    }
    90% {
        clip: rect(14px, 9999px, 26px, 0);
    }
    100% {
        clip: rect(54px, 9999px, 98px, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* ======= Responsive Styles ======= */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.8);
        transition: all 0.5s ease;
        padding: 80px 20px;
        z-index: 99;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 30px;
    }
    
    .main-nav a {
        font-size: 18px;
        display: block;
        padding: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .title {
        font-size: 48px;
    }
    
    .subtitle {
        font-size: 18px;
    }

    /* Added rules to apply desktop hover animations on mobile */
    .button:active,
    .button:focus {
        color: var(--primary-red);
    }
    .button:active::before,
    .button:focus::before {
        left: 0;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .button {
        width: 100%;
    }
}
