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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
    font-family: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.page-wrapper {
    display: contents;
}

/* Статичный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
}

/* Современная типографика */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    color: white;
    text-align: center;
    padding: 3rem 0 6rem 0;
    position: relative;
    overflow: hidden;
    height: 720px;
}

/* Статичные частицы в заголовке */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

header nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
    gap: 2rem;
    position: relative;
    z-index: 10;
}

header nav ul li {
    position: relative;
}

header nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

header nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    /*background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);*/
    transition: left 0.5s;
}

header nav ul li a:hover::before {
    left: 100%;
    /*background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);*/
}

header nav ul li a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    z-index: 10;
    margin-top: 2rem;
}

.profile-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.profile-img::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    z-index: -1;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.4;
    }
    25% { 
        transform: translateY(-30px) translateX(15px) rotate(90deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-60px) translateX(-10px) rotate(180deg);
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-30px) translateX(-15px) rotate(270deg);
        opacity: 0.7;
    }
}


.profile-img:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.2);
}

.hero-content {
    text-align: left;
    /*max-width: 500px;*/
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

main {
    padding: 0 1rem;
}

section {
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    margin: 3rem auto;
    max-width: 1200px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    /*background: var(--accent-gradient);*/
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

#skills .skill-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

#skills .skill {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.skill-icon {
    width: 40px;
    height: 40px;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    object-fit: contain;
    filter: brightness(0.9);
}

.skill-text {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

#skills .skill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#skills .skill:hover::before {
    left: 100%;
}

#skills .skill:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#skills .skill:hover .skill-icon {
    transform: scale(1.2) rotate(5deg);
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

#skills .skill img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.certificates-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem;
    margin-top: 2rem;
}

.certificates-gallery img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem;
}

.certificates-gallery img:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.contact-form {
    max-width: 600px;
    margin: 3rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow-soft);
}

.contact-form label {
    text-align: start;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-form input, .contact-form textarea {
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.contact-form input::placeholder, .contact-form textarea::placeholder {
    color: rgba(44, 62, 80, 0.6);
}

.contact-form button {
    padding: 1.2rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.contact-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.contact-form button:hover::before {
    left: 100%;
}

.contact-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

#contact .socials {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

#contact .socials a {
    display: inline-block;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#contact .socials a:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#contact .socials img {
    width: 35px;
    height: 35px;
    filter: brightness(0.8);
    transition: filter 0.3s;
}

#contact .socials a:hover img {
    filter: brightness(1);
}

footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem;
    font-weight: 500;
    width: 100%;
}

/* Модальное окно сертификатов */
.popup {
    display: none;
    position: fixed;
    z-index: 999;
    padding: 2rem;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    margin: auto;
    display: block;
    width: 90%;
    max-height: 90%; 
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-popup {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    color: #ff6b6b;
    transform: scale(1.1);
    background: rgba(255, 107, 107, 0.2);
}

.filter-buttons {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-btn {
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    opacity: 1;
}

.filter-btn:hover,
.filter-btn.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}


#hobby p {
    padding-bottom: 10px;
}

.typing-container {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    text-align: left;
    min-height: 150px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90%;
    position: relative;
    overflow: hidden;
}

.typing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
}

#code-block {
    margin: 0;
    white-space: pre-wrap;
    position: relative;
    color: #d4d4d4;
}

.typing-cursor {
    display: inline-block;
    background-color: #00ff00;
    margin-left: 2px;
    width: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Бургер-меню */
.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 1001;
}
.burger span {
    height: 4px;
    width: 30px;
    background: #fff;
    margin: 2px 0;
    border-radius: 2px;
    transition: 0.4s;
}

.burger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.burger.active span:nth-child(2) {
    opacity: 0;
}
.burger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
    #about {
        max-width: 98vw;
        padding: 1.5rem 0.5rem;
    }
    #skills {
        max-width: 98vw;
        padding: 1.5rem 0.5rem;
    }
    #hobby {
        max-width: 98vw;
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .typing-container {
        width: 90vw;
        margin: 0 auto;
    }
    
    .profile-img {
        width: 200px;
        height: 200px;
    }
    
    section {
        padding: 3rem 1rem;
        margin: 2rem auto;
        max-width: calc(100vw - 2rem);
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
        margin: 2rem auto;
        max-width: calc(100vw - 2rem);
    }
    
    .certificates-gallery {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    #skills .skill-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    #skills .skill {
        min-height: 100px;
        padding: 1rem;
    }
    
    .skill-icon {
        width: 30px;
        height: 30px;
    }
    
    .skill-text {
        font-size: 0.8rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 700px) {
    header nav ul {
        display: none;
        flex-direction: column;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        position: absolute;
        top: 80px;
        right: 2rem;
        width: 250px;
        box-shadow: var(--shadow-soft);
        z-index: 1000;
        padding: 1rem;
        border-radius: 15px;
    }
    
    header nav ul.open {
        display: flex;
    }
    
    header nav ul li a {
        color: var(--text-primary) !important;
        margin-bottom: 0.5rem;
    }
    
    header nav ul li a:hover {
        color: white !important;
    }
    
    .burger {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
}

/*.line-1{
    position: relative;
    top: 50%;
    width: 24em;
    margin: 0 auto;
    border-right: 2px solid rgba(255,255,255,.75);
    font-size: 180%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    transform: translateY(-50%);
}

.anim-typewriter{
    animation: typewriter 4s steps(44) 1s 1 normal both,
    blinkTextCursor 500ms steps(44) infinite normal;
}*/
@keyframes typewriter{
    from{width: 0;}
    to{width: 24em;}
}
@keyframes blinkTextCursor{
    from{border-right-color: rgba(255,255,255,.75);}
    to{border-right-color: transparent;}
}
