:root {
    /* Чёрно-белая база с фиолетовыми акцентами */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f0f2f5;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --accent: #7e3af2;
    --accent-light: #a78bfa;
    --accent-hover: #6d28d9;
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #7e3af2, #6d28d9);
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 8px 25px rgba(126, 58, 242, 0.25);
    --transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #182131;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --accent-hover: #9370db;
    --accent-gradient: linear-gradient(135deg, #9370db, #a78bfa, #b7a3ff);
    --border: #334155;
    --border-light: #475569;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-accent: 0 8px 25px rgba(167, 139, 250, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(126, 58, 242, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(126, 58, 242, 0.03) 0%, transparent 20%);
    opacity: 0;
    animation: fadeInBody 0.9s ease-out forwards;
}

@keyframes fadeInBody {
    to { 
        opacity: 1; 
    }
}

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.75rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(1.875rem, 3vw, 2.75rem);
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
}

p {
    margin-bottom: 1.25rem;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* Header & Navigation */
header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
}

header.scrolled {
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
    background-color: var(--bg-primary);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Pirata One', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    background-clip: text;
    color: transparent;
    text-decoration: none;
    letter-spacing: -1px;
    display: inline-block;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.7;
    border-radius: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
    display: inline-block;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 100%;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: rotate(15deg);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.theme-toggle:active {
    transform: rotate(15deg) scale(0.95);
}

.theme-toggle svg {
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
}

.moon-icon {
    opacity: 1;
}

.sun-icon {
    opacity: 0;
    transform: scale(0.8);
}

.dark-theme .moon-icon {
    opacity: 0;
    transform: scale(0.8);
}

.dark-theme .sun-icon {
    opacity: 1;
    transform: scale(1);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(126, 58, 242, 0.08) 0%, transparent 70%);
    z-index: -1;
    animation: rotate 25s linear infinite;
    will-change: transform;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--text-primary), var(--accent), var(--text-primary));
    background-size: 200% 200%;
    background-clip: text;
    color: transparent;
    animation: gradientShift 12s ease infinite;
    line-height: 1.1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content h2 {
    font-size: 1.875rem;
    color: var(--accent);
    margin-bottom: 2rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.hero-content h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInText 0.8s ease-out 0.3s forwards;
}

@keyframes fadeInText {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-button {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 1.25rem 2.75rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition-slow);
    border: none;
    cursor: pointer;
    letter-spacing: -0.5px;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: gentlePulse 4s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 35px rgba(126, 58, 242, 0.4);
    background: linear-gradient(135deg, var(--accent-hover), #5b21b6);
    animation-play-state: paused; /* Остановка пульсации при наведении */
}

.cta-button:active {
    transform: translateY(-1px) scale(1.01);
}

.cta-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.cta-button:hover::after {
    opacity: 1;
}

/* Section Styling */
section {
    padding: 8rem 0;
}

.section-title {
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-size: 2.75rem;
    margin-bottom: 5rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-50%) translateY(25px);
    animation: slideUpTitle 0.8s ease-out 0.2s forwards;
}

@keyframes slideUpTitle {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: glowLine 3s ease-in-out infinite;
}

@keyframes glowLine {
    0%, 100% { 
        opacity: 0.7; 
        width: 70px; 
        box-shadow: 0 0 8px rgba(126, 58, 242, 0.3);
    }
    50% { 
        opacity: 1; 
        width: 90px; 
        box-shadow: 0 0 15px rgba(126, 58, 242, 0.5);
    }
}

/* About Section */
.about-content {
    display: flex;
    gap: 5rem;
    align-items: center;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 1.75rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.8;
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.17, 0.88, 0.32, 1.28);
}

.about-text p.appear {
    opacity: 1;
    transform: translateX(0);
}

/* Стили для фотографии в секции "Обо мне" */
.about-image {
    flex: 1;
    min-width: 300px;
    height: 580px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border);
    transform: translateY(0);
    transition: transform 0.6s cubic-bezier(0.17, 0.88, 0.32, 1.28), box-shadow 0.4s ease;
}

.about-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(126, 58, 242, 0.08) 0%, 
        transparent 50%, 
        rgba(126, 58, 242, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.about-image:hover {
    transform: translateY(-10px) scale(1.015);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    border-color: var(--accent);
}

.about-image:hover::before {
    opacity: 1;
}

/* Обёртка для изображения */
.profile-photo-wrapper {
    width: 90%;
    height: 90%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
    transition: all 0.6s cubic-bezier(0.17, 0.88, 0.32, 1.28);
    background: var(--bg-tertiary);
}

.about-image:hover .profile-photo-wrapper {
    transform: scale(1.03);
    border-color: var(--accent);
    box-shadow: 0 12px 35px rgba(126, 58, 242, 0.25);
}

/* Стили для изображения */
.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.17, 0.88, 0.32, 1.28);
    position: relative;
    z-index: 2;
}

.about-image:hover .profile-photo {
    transform: scale(1.08);
}

/* Эффект свечения */
.profile-photo-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.15), 
        rgba(126, 58, 242, 0.25), 
        rgba(255, 255, 255, 0.15), 
        transparent);
    transform: rotate(45deg) translateX(-100%);
    animation: photoShine 4s infinite ease-in-out;
    opacity: 0.7;
    z-index: 3;
    pointer-events: none;
}

@keyframes photoShine {
    0% { transform: rotate(45deg) translateX(-100%); }
    50% { transform: rotate(45deg) translateX(100%); opacity: 0.9; }
    100% { transform: rotate(45deg) translateX(300%); opacity: 0.7; }
}

/* Для тёмной темы */
.dark-theme .profile-photo-wrapper {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.dark-theme .about-image:hover .profile-photo-wrapper {
    box-shadow: 0 12px 35px rgba(167, 139, 250, 0.3);
}

/* Unified Skills Block */
.skills-unified {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
    margin-top: 3.5rem;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}
/* Unified Education Block — в стиле Skills и Projects */

.education-unified::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(126, 58, 242, 0.08) 0%, transparent 70%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.education-unified:hover::before {
  opacity: 1;
}

.education-unified:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.skills-unified::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(126, 58, 242, 0.08) 0%, transparent 70%);
    z-index: 0;
    transition: opacity 0.5s ease;
    opacity: 0;
}

.skills-unified:hover::before {
    opacity: 1;
}

.skills-unified:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.skills-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
}

.skills-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    display: block;
    animation: float 3s ease-in-out infinite;
    color: var(--accent);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.skills-header h3 {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
    position: relative;
    z-index: 2;
}

.skill-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.skill-tag::before,
.skill-tag::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s ease;
}

.skill-tag::before {
    left: 0;
}

.skill-tag::after {
    right: 0;
}

.skill-tag:hover::before,
.skill-tag:hover::after {
    transform: scaleY(1);
}

.skill-tag:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
    background: rgba(126, 58, 242, 0.08);
}

.tag-text {
    font-weight: 500;
    font-size: 1.125rem;
    color: var(--text-primary);
    white-space: nowrap;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.skill-tag:hover .tag-text {
    color: var(--accent);
    font-weight: 600;
}

.skills-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px dashed var(--border);
    position: relative;
    z-index: 2;
}

.skills-footer p {
    color: var(--text-tertiary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    font-style: italic;
}

/* Responsive Skills Block */
@media (max-width: 768px) {
    .skills-unified {
        padding: 2.25rem 1.75rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.25rem;
    }
    
    .skill-tag {
        padding: 1rem 1.25rem;
        min-width: 160px;
    }
    
    .tag-text {
        font-size: 1rem;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .skills-unified {
        padding: 2rem;
        border-radius: var(--radius-lg);
    }
    
    .skills-header h3 {
        font-size: 1.75rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-tag {
        padding: 1.25rem;
        justify-content: center;
        text-align: center;
    }
    
    .skills-footer p {
        font-size: 1rem;
        padding: 0 10px;
    }
}

/* Timeline Sections */
.timeline {
  position: relative;
  padding-left: 0;
  /* Убрали max-width и margin — теперь он растягивается на 100% родителя */
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 20px;
    height: calc(100% - 20px);
    width: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(126, 58, 242, 0.4);
}

.timeline-item {
  position: relative;
  margin-bottom: 4.5rem;
  padding-left: 64px; /* 24px (ось) + 40px (отступ текста) */
}

.timeline-item.appear {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 4px solid var(--accent);
    box-shadow:
        0 0 0 4px var(--bg-primary),
        0 0 0 8px var(--accent),
        0 0 15px rgba(126, 58, 242, 0.45);
    z-index: 1;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.timeline-item:hover::before {
    transform: scale(1.2) rotate(5deg);
    box-shadow:
        0 0 0 4px var(--bg-primary),
        0 0 0 8px var(--accent),
        0 0 20px rgba(126, 58, 242, 0.65);
}

.timeline-item h3 {
    font-family: 'Space Mono', monospace;
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.timeline-item:hover h3 {
    color: var(--accent);
}

.timeline-item h4 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.375rem;
    letter-spacing: -0.5px;
}

.timeline-item .date {
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
    display: block;
    font-weight: 500;
    letter-spacing: -0.5px;
    font-size: 1.05rem;
}

.timeline-item p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

.timeline-item:hover p {
    color: var(--text-primary);
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3.5rem;
    margin-top: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.contact-item {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
    transition: transform 0.35s cubic-bezier(0.17, 0.88, 0.32, 1.28);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(8px);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.contact-icon {
    min-width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.contact-item:hover .contact-icon {
    background: var(--accent-gradient);
    transform: rotate(10deg) scale(1.1);
    box-shadow: var(--shadow-accent);
    border-color: transparent;
}

.contact-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-primary);
    stroke-width: 1.75;
    transition: var(--transition-fast);
    fill: none;
}

.contact-item:hover .contact-icon svg {
    stroke: white;
    transform: scale(1.15);
}

.contact-text h3 {
    margin-bottom: 0.4rem;
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    font-size: 1.375rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.contact-item:hover .contact-text h3 {
    color: var(--accent);
}

.contact-text p, 
.contact-text a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 1.125rem;
    line-height: 1.7;
    display: block;
}

.contact-text a:hover {
    color: var(--accent);
    padding-left: 4px;
    transform: translateX(2px);
}

.contact-social {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.contact-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.contact-social a:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.contact-message {
    text-align: center;
    font-size: 1.375rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 550px;
    margin: 1.5rem auto 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInMessage 0.9s ease-out 0.4s forwards;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
		transition: var(--transition); 
}

.contact-message:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

@keyframes fadeInMessage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 3.5rem 0 2.5rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    transition: background-color 0.4s ease;
}

.footer-content {
    max-width: 650px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2.25rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    transform: scale(1);
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: white;
    transform: translateY(-5px) scale(1.1);
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.copyright {
    margin-top: 2.25rem;
    color: var(--text-tertiary);
    font-size: 1.05rem;
    letter-spacing: -0.5px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.copyright:hover {
    opacity: 1;
}

/* Кнопка "Вверх" */
.scroll-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-accent);
    font-weight: 600;
    font-size: 1.4rem;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 8px 30px rgba(126, 58, 242, 0.45);
    background: linear-gradient(135deg, var(--accent-hover), #5b21b6);
}

.scroll-to-top:active {
    transform: translateY(-3px) scale(1.05);
}

.scroll-to-top svg {
    stroke-width: 2;
    transition: transform 0.3s ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

/* Анимации для основных секций */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Поддержка prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .fade-in,
    .timeline-item,
    .about-text p,
    .section-title,
    .hero-content p,
    .contact-message {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .scroll-to-top {
        transition: none !important;
    }
}

/* Mobile Menu Placeholder (для будущей реализации в HTML) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 1002;
}

/* Responsive Design */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 4rem;
    }
    
    .about-text p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-content h1 {
        font-size: 3.75rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .timeline {
        padding-left: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
    
    .controls {
        gap: 12px;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
    
    .hero-content h1 {
        font-size: 3.25rem;
    }
    
    .hero-content h2 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 1.1875rem;
        margin-bottom: 2.75rem;
    }
    
    section {
        padding: 6rem 0;
    }
    
    .section-title {
        font-size: 2.25rem;
        margin-bottom: 4rem;
    }
    
    .timeline {
        padding-left: 35px;
    }
    
    .timeline::before {
        left: 8px;
        width: 2px;
    }
    
    .timeline-item::before {
        left: -12px;
        width: 24px;
        height: 24px;
    }
    
    .timeline-item .date {
        font-size: 1rem;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .scroll-to-top {
        bottom: 30px;
        right: 30px;
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    
    header.scrolled {
        padding: 0.7rem 0;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .hero-content h1 {
        font-size: 2.75rem;
        letter-spacing: -1px;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-button {
        padding: 1.1rem 2.25rem;
        font-size: 1.05rem;
        width: 90%;
        margin: 0 auto;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-image {
        height: 380px;
        border-radius: var(--radius-lg);
    }
    
    .profile-photo-wrapper {
        width: 95%;
        height: 95%;
        border-radius: var(--radius-md);
    }
    
    .timeline-item h3 {
        font-size: 1.625rem;
    }
    
    .timeline-item h4 {
        font-size: 1.25rem;
    }
    
    footer {
        padding: 2.5rem 0 2rem;
    }
    
    .social-links a {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }
    
    .scroll-to-top {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        bottom: 25px;
        right: 25px;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }
    
    .contact-icon {
        min-width: 56px;
        height: 56px;
    }
}

/* === Resume Dropdown — идеально выровненный с .nav-links a === */
.resume-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

.resume-toggle {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem 0;
    transition: var(--transition-fast);
    position: relative;
    display: inline-block;
    outline: none;
    line-height: 1.5;
    margin: 0;
    text-align: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.resume-toggle:hover,
.resume-toggle:focus {
    color: var(--accent);
}

/* Подчёркивание — точно как у .nav-links a */
.resume-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.resume-toggle:hover::after,
.resume-dropdown.open .resume-toggle::after {
    width: 100%;
}

/* Меню */
.resume-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin: 0;
    padding: 0.75rem 0;
    list-style: none;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
}

.resume-dropdown:hover .resume-menu,
.resume-dropdown:focus-within .resume-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.resume-menu li {
    margin: 0;
}

.resume-menu a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
    border-radius: var(--radius-md);
    margin: 0 0.5rem;
}

.resume-menu a:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    padding-left: 1.5rem;
}

/* Dark theme support */
.dark-theme .resume-menu {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}
/* === Дополнительная оптимизация для малых экранов (< 320px) === */
@media (max-width: 320px) {
  :root {
    --radius-lg: 16px;
    --radius-xl: 20px;
  }

  .container {
    width: 95%;
    padding: 0 8px;
  }

  /* Hero section */
  #hero {
    padding: 4rem 0 3rem;
  }
  .hero-content h1 {
    font-size: 2.375rem !important;
    line-height: 1.15;
  }
  .hero-content h2 {
    font-size: 1.375rem !important;
    margin-bottom: 1.5rem;
  }
  .hero-content p {
    font-size: 1.05rem !important;
    margin-bottom: 2rem;
    padding: 0 5px;
  }
  .cta-button {
    padding: 1rem 1.75rem !important;
    font-size: 1rem !important;
    width: 92%;
    margin: 0 auto;
  }

  /* Sections */
  section {
    padding: 4.5rem 0 !important;
  }
  .section-title {
    font-size: 1.875rem !important;
    margin-bottom: 3rem !important;
  }

  /* About section */
  .about-image {
    height: 300px !important;
    border-radius: var(--radius-lg) !important;
  }
  .profile-photo-wrapper {
    width: 96% !important;
    height: 96% !important;
    border-radius: var(--radius-md) !important;
  }
  .about-text p {
    font-size: 1rem !important;
    margin-bottom: 1.25rem !important;
  }

  /* Timeline */
  .timeline {
    padding-left: 28px !important;
  }
  .timeline::before {
    left: 6px !important;
    width: 2px !important;
  }
  .timeline-item::before {
    left: -10px !important;
    width: 20px !important;
    height: 20px !important;
  }
  .timeline-item h3 {
    font-size: 1.45rem !important;
  }
  .timeline-item h4 {
    font-size: 1.15rem !important;
  }
  .timeline-item .date {
    font-size: 0.925rem !important;
  }

  /* Skills */
  .skills-unified {
    padding: 1.75rem !important;
    border-radius: var(--radius-lg) !important;
  }
  .skills-header h3 {
    font-size: 1.625rem !important;
  }
  .skill-tag {
    padding: 0.875rem !important;
    font-size: 0.95rem !important;
  }

  /* Contacts */
  .contact-item {
    padding: 1rem !important;
    gap: 1rem !important;
  }
  .contact-icon {
    min-width: 48px !important;
    height: 48px !important;
  }
  .contact-icon svg {
    width: 22px !important;
    height: 22px !important;
  }
  .contact-text h3 {
    font-size: 1.2rem !important;
  }
  .contact-text p,
  .contact-text a {
    font-size: 0.975rem !important;
  }
  .contact-social a {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.85rem !important;
  }
  .contact-message {
    font-size: 1.15rem !important;
    padding: 1.5rem !important;
    margin-top: 1rem !important;
  }

  /* Footer & UI */
  footer {
    padding: 2rem 0 1.5rem !important;
  }
  .social-links a {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.2rem !important;
  }
  .copyright {
    font-size: 0.925rem !important;
    padding: 0 8px;
  }
  .scroll-to-top {
    width: 44px !important;
    height: 44px !important;
    bottom: 18px !important;
    right: 18px !important;
    font-size: 1.15rem !important;
  }

  /* Улучшение тактильных целей */
  .nav-links a,
  .resume-toggle,
  .theme-toggle,
  .cta-button,
  .contact-social a,
  .social-links a {
    min-height: 44px;
    min-width: 44px;
  }
  .contact-item:hover {
    transform: none !important;
  }
}

/* === Критически важные улучшения для всех мобильных устройств === */
@media (hover: none) and (pointer: coarse) {
  /* Убираем анимации наведения на тач-устройствах */
  .nav-links a:hover::after,
  .skill-tag:hover::before,
  .skill-tag:hover::after,
  .timeline-item:hover::before,
  .contact-item:hover,
  .contact-item:hover .contact-icon {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border) !important;
  }
  
  /* Увеличиваем зоны касания */
  .theme-toggle,
  .scroll-to-top,
  .resume-toggle {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Отключаем пульсацию кнопки на мобильных */
  .cta-button {
    animation: none !important;
  }
}

/* === Исправление потенциальных проблем === */
@media (max-width: 480px) {
  /* Гарантируем, что контент не выходит за границы */
  body, html {
    overflow-x: hidden !important;
  }
  
  /* Защита от случайного увеличения текста в полях ввода */
  input, textarea, select, button {
    font-size: 16px !important;
  }
  
  /* Улучшение читаемости на ярком солнце */
  .dark-theme .hero-content h1,
  .dark-theme .section-title {
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

/* Анимированный фон с плавающими частицами */
.particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-gradient);
  opacity: 0.18;
  animation: float 25s infinite linear;
  box-shadow: 0 0 25px var(--accent);
  will-change: transform;
}

/* Разные размеры и позиции для частиц */
.p1 { width: 180px; height: 180px; top: 15%; left: 10%; animation-delay: 0s; animation-duration: 35s; }
.p2 { width: 120px; height: 120px; top: 65%; left: 85%; animation-delay: -7s; animation-duration: 40s; }
.p3 { width: 90px; height: 90px; top: 35%; left: 75%; animation-delay: -15s; animation-duration: 30s; opacity: 0.25; }
.p4 { width: 150px; height: 150px; top: 80%; left: 25%; animation-delay: -2s; animation-duration: 45s; }
.p5 { width: 70px; height: 70px; top: 45%; left: 40%; animation-delay: -12s; animation-duration: 28s; opacity: 0.3; }
.p6 { width: 110px; height: 110px; top: 10%; left: 80%; animation-delay: -5s; animation-duration: 38s; }
.p7 { width: 85px; height: 85px; top: 55%; left: 15%; animation-delay: -18s; animation-duration: 32s; opacity: 0.22; }
.p8 { width: 130px; height: 130px; top: 75%; left: 50%; animation-delay: -9s; animation-duration: 42s; }
.p9 { width: 100px; height: 100px; top: 25%; left: 60%; animation-delay: -3s; animation-duration: 36s; opacity: 0.28; }
.p10 { width: 75px; height: 75px; top: 90%; left: 35%; animation-delay: -14s; animation-duration: 33s; }

/* Анимация плавающего движения */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(12vw, -15vh) scale(1.1) rotate(90deg);
  }
  50% {
    transform: translate(8vw, 10vh) scale(0.95) rotate(180deg);
  }
  75% {
    transform: translate(-10vw, 5vh) scale(1.05) rotate(270deg);
  }
}

/* Эффект свечения для частиц */
.particle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  border-radius: 50%;
  opacity: 0.6;
  filter: blur(20px);
  z-index: -1;
}

/* Адаптация для темной темы */
.dark-theme .particle {
  opacity: 0.22;
  box-shadow: 0 0 35px var(--accent);
}

.dark-theme .particle::after {
  opacity: 0.75;
}

/* Оптимизация для мобильных устройств */
@media (max-width: 768px) {
  .particles-background {
    display: none;
  }
}

/* Дополнительная оптимизация производительности */
@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none !important;
    transform: scale(0.7);
    opacity: 0.08;
  }
}

@keyframes float-icon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.skills-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
  display: block;
  animation: float-icon 3s ease-in-out infinite;
  color: var(--accent);
}

/* Unified Projects Block — в стиле Skills */
.projects-unified,
.education-unified {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: var(--transition-slow);
  margin-top: 3.5rem;
  max-width: 950px;      /* ← УБЕРИТЕ ЭТО */
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
}

.projects-unified::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(126, 58, 242, 0.08) 0%, transparent 70%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.projects-unified:hover::before {
  opacity: 1;
}

.projects-unified:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* Timeline внутри unified блока */
.projects-unified .timeline {
  padding-left: 0;
  max-width: none;
  margin: 0;
  position: relative;
}


.projects-unified .timeline-item {
  padding-left: 64px;
  margin-bottom: 3.5rem;
}

.projects-unified .timeline-item:last-child {
  margin-bottom: 0;
}



/* Стили ссылок проектов */
.project-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.project-link:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

.project-link svg {
  flex-shrink: 0;
}

/* === Unified Timeline — линия строго по центру маркеров === */
.timeline {
  max-width: 900px;
  margin: 4rem auto 0;
  position: relative;
  padding-left: 0;
}

/* Вертикальная линия — ось таймлайна */
.timeline::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 24px; /* ← основная ось */
  width: 3px;
  background: var(--accent-gradient);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(126, 58, 242, 0.4);
  z-index: 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 4.5rem;
  padding-left: 64px; /* 24px (ось) + 40px (отступ текста) */
  opacity: 0;
  transform: translateX(-25px);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.17, 0.88, 0.32, 1.28);
}

.timeline-item.appear {
  opacity: 1;
  transform: translateX(0);
}

/* Маркер — круг, центрированный по оси */
.timeline-item::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 24px; /* ← центр маркера на оси */
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 4px solid var(--accent);
  box-shadow:
    0 0 0 4px var(--bg-primary),
    0 0 0 8px var(--accent),
    0 0 15px rgba(126, 58, 242, 0.45);
  z-index: 1;
  transform: translateX(-50%); /* ← ключевой момент: центрирует по left */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.timeline-item:hover::before {
  transform: translateX(-50%) scale(1.2) rotate(5deg);
  box-shadow:
    0 0 0 4px var(--bg-primary),
    0 0 0 8px var(--accent),
    0 0 20px rgba(126, 58, 242, 0.65);
}

/* Сдвиг содержимого влево на мобильных */
@media (max-width: 768px) {
  .projects-unified .timeline,
  .education-unified .timeline {
    padding-left: 20px; /* вместо 0 или 35–40px по умолчанию */
  }

  .projects-unified .timeline-item,
  .education-unified .timeline-item {
    padding-left: 52px; /* 20px (ось) + 32px (текст) — чуть уже, чем раньше */
  }

  /* Центрируем маркер относительно новой оси */
  .projects-unified .timeline::before,
  .education-unified .timeline::before {
    left: 16px;
  }

  .projects-unified .timeline-item::before,
  .education-unified .timeline-item::before {
    left: 16px;
  }
}

@media (max-width: 480px) {
  .projects-unified .timeline,
  .education-unified .timeline {
    padding-left: 16px;
  }

  .projects-unified .timeline-item,
  .education-unified .timeline-item {
    padding-left: 44px;
  }

  .projects-unified .timeline::before,
  .education-unified .timeline::before {
    left: 12px;
  }

  .projects-unified .timeline-item::before,
  .education-unified .timeline-item::before {
    left: 12px;
  }
}

/* Стили формы контактов */
.contact-message h2 {
  font-family: 'Space Mono', monospace;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -1px;
  text-align: left;
}

.contact-message p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  text-align: left;
  font-size: 1.125rem;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#contact-form input,
#contact-form textarea {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 58, 242, 0.2);
}

#contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

#contact-form button {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

#contact-form button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(126, 58, 242, 0.4);
  background: linear-gradient(135deg, var(--accent-hover), #5b21b6);
}

#contact-form button:active {
  transform: translateY(-1px);
}

#contact-form button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}

#contact-form button:hover::after {
  opacity: 1;
}

.form-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(126, 58, 242, 0.12);
  border: 1px solid var(--accent, #7e3af2);
  color: var(--accent, #7e3af2);
  padding: 1rem;
  border-radius: var(--radius-md, 8px);
  margin-top: 1.25rem;
  width: 100%;
  font-weight: 500;

  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-success.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.form-success svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2.5;
}

.form-success span {
  line-height: 1.4;
}


@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(-8px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

/* Стиль кнопки с иконкой */
#contact-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  width: 100%;
}

#contact-form button svg {
  transition: transform 0.3s ease;
}

#contact-form button:hover svg {
  transform: translateX(3px);
}

/* Обёртка под сообщение — фиксированная зона под формой */
.form-success-wrapper {
  margin-top: 1.25rem;
}

.form-success-container {
  margin-top: 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.form-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-secondary) 90%);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  width: 100%;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-sm);

  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s,  /* лёгкая задержка */
    transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s;
}

.form-success-container.open .form-success {
  opacity: 1;
  transform: translateY(0);
}

.form-success svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2.5;
}

.form-success span {
  line-height: 1.4;
}