
:root, html[data-theme="dark"] {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #a78bfa;
    --dark: #0b1120;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.5);

    /* semantic tokens */
    --bg: #0b1120;
    --bg-radial-1: #131c33;
    --bg-radial-2: #0b1120;
    --surface: rgba(15, 23, 42, 0.55);
    --surface-solid: rgba(15, 23, 42, 0.8);
    --surface-2: rgba(30, 41, 59, 0.8);
    --border: rgba(99, 102, 241, 0.22);
    --border-soft: rgba(99, 102, 241, 0.12);
    --navbar-bg: rgba(11, 17, 32, 0.72);
    --text-strong: #ffffff;
    --hero-lead: rgba(255, 255, 255, 0.65);
    --grid-line: rgba(99, 102, 241, 0.05);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #7c3aed;
    --dark: #eef1f8;
    --dark-light: #ffffff;
    --dark-lighter: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --white: #0f172a;
    --shadow: 0 20px 50px rgba(100, 116, 139, 0.18);
    --shadow-lg: 0 30px 60px rgba(100, 116, 139, 0.22);

    --bg: #eef1f8;
    --bg-radial-1: #ffffff;
    --bg-radial-2: #e6ebf5;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-solid: rgba(255, 255, 255, 0.92);
    --surface-2: rgba(255, 255, 255, 0.85);
    --border: rgba(99, 102, 241, 0.22);
    --border-soft: rgba(99, 102, 241, 0.14);
    --navbar-bg: rgba(255, 255, 255, 0.78);
    --text-strong: #0f172a;
    --hero-lead: rgba(30, 41, 59, 0.72);
    --grid-line: rgba(99, 102, 241, 0.06);
    --card-shadow: 0 20px 50px rgba(100, 116, 139, 0.18);
}

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

/* Защита от выделения включается скриптом только на хосте (не localhost) */
html.protected *:not(input):not(textarea) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Разрешаем выделение и копирование в полях ввода */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    max-width: 100%;
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

/* Дополнительная защита для изображений */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at top, var(--bg-radial-1) 0%, var(--bg-radial-2) 100%);
    overflow: hidden;
    transition: background 0.4s ease;
}

.particles-background::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(139, 92, 246, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(167, 139, 250, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(99, 102, 241, 0.2), transparent);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, -50px); }
}
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--navbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-menu {
    align-items: center;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.theme-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

html[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); color: #fbbf24; }
html[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
html[data-theme="light"] .theme-icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
html[data-theme="light"] .theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); color: #6366f1; }

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.nav-menu {
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-icon {
    position: relative;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
}

.logo-vion {
    font-family: 'Courier New', 'Courier', monospace;
    font-weight: 700;
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5), 0 0 15px rgba(0, 255, 65, 0.3);
    letter-spacing: 1px;
}
.ai-prompt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Courier New', 'Courier', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::before {
    content: '< ';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: #00ff41;
}

.nav-link::after {
    content: ' />';
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    color: #00ff41;
}

.nav-link:hover {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.nav-link:hover::before,
.nav-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
}

.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(var(--dot-color, rgba(99, 102, 241, 0.35)) 1.4px, transparent 1.6px);
    background-size: 34px 34px;
    animation: dotsDrift 24s linear infinite;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 100%);
    opacity: 0.6;
}

html[data-theme="light"] .hero-grid { --dot-color: rgba(99, 102, 241, 0.28); }

@keyframes dotsDrift {
    0% { background-position: 0 0; }
    100% { background-position: 34px 68px; }
}

/* Диагональные световые лучи */
.hero-beams {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.hero-beams::before,
.hero-beams::after {
    content: '';
    position: absolute;
    top: -30%;
    width: 45%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.12), transparent);
    filter: blur(28px);
    transform: rotate(18deg);
    animation: beamSweep 12s ease-in-out infinite;
}
.hero-beams::before { left: 5%; }
.hero-beams::after {
    right: 5%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.12), transparent);
    animation-delay: 6s;
}
@keyframes beamSweep {
    0%, 100% { opacity: 0.2; transform: translateX(-40px) rotate(18deg); }
    50% { opacity: 0.7; transform: translateX(40px) rotate(18deg); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-glow {
    position: absolute;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: glowPulse 8s ease-in-out infinite;
}

.hero-glow-1 {
    top: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.7), transparent 70%);
}

.hero-glow-2 {
    bottom: -220px;
    right: -160px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.7), transparent 70%);
    animation-delay: 4s;
}

html[data-theme="light"] .hero-glow { opacity: 0.5; }

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

.hero-content {
    max-width: 1400px;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-main {
    display: flex;
    flex-direction: column;
    gap: 1.9rem;
    min-width: 0;
    max-width: 100%;
}
.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 255, 65, 0.06);
    border: 1px solid rgba(0, 200, 65, 0.35);
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    width: fit-content;
    backdrop-filter: blur(8px);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: #00ff41;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px #00ff41;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.status-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #1db954;
    font-weight: 600;
    letter-spacing: 0.3px;
}

html[data-theme="dark"] .status-text { color: #4ade80; }
.hero-main > * {
    opacity: 0;
    animation: heroFadeUp 0.7s ease forwards;
}
.hero-main > *:nth-child(1) { animation-delay: 0.05s; }
.hero-main > *:nth-child(2) { animation-delay: 0.15s; }
.hero-main > *:nth-child(3) { animation-delay: 0.25s; }
.hero-main > *:nth-child(4) { animation-delay: 0.35s; }
.hero-main > *:nth-child(5) { animation-delay: 0.45s; }
.hero-main > *:nth-child(6) { animation-delay: 0.55s; }

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title-new {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.hero-title-new::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -40px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 65%);
    filter: blur(30px);
    z-index: -1;
    pointer-events: none;
}

.title-line {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.title-line-2 {
    margin-top: -0.4rem;
}

.title-bracket {
    font-family: 'Courier New', monospace;
    font-size: 3.2rem;
    font-weight: 900;
    color: rgba(99, 102, 241, 0.6);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    line-height: 1;
}

.title-gradient {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1.5px;
    line-height: 1.05;
}

html[data-theme="light"] .title-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

html[data-theme="light"] .title-gradient.title-gradient-accent {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.title-gradient-accent {
    background: linear-gradient(90deg, #8b5cf6, #6366f1, #00d4ff, #8b5cf6);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: accentShimmer 6s linear infinite;
}

@keyframes accentShimmer {
    to { background-position: 300% 0; }
}

.subtitle-line {
    margin-top: 1.1rem;
}

.title-arrow {
    font-family: 'Courier New', monospace;
    font-size: 1.35rem;
    font-weight: 900;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.title-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.5px;
}

.hero-lead {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--hero-lead);
    max-width: 480px;
    margin: 0;
}

.title-text { color: var(--text-strong); }

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}
.hero-chip:hover {
    color: var(--text-strong);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.hero-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.7);
}

/* Индикаторы под цвета технологий */
.chip-flutter { background: #54c5f8; box-shadow: 0 0 8px rgba(84, 197, 248, 0.8); }
.chip-python { background: linear-gradient(135deg, #3776ab 50%, #ffd43b 50%); box-shadow: 0 0 8px rgba(255, 212, 59, 0.6); }
.chip-react { background: #61dafb; box-shadow: 0 0 8px rgba(97, 218, 251, 0.8); }
.chip-fastapi { background: #05998b; box-shadow: 0 0 8px rgba(5, 153, 139, 0.8); }

.hero-chip-more {
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    padding: 0.4rem 0.7rem;
    line-height: 1;
}
.hero-chip-more:hover {
    background: rgba(99, 102, 241, 0.12);
}

.hero-metrics {
    position: relative;
    display: flex;
    gap: 0;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 0.4rem;
    width: 100%;
    max-width: 560px;
    box-sizing: border-box;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    margin-top: 0.2rem;
    overflow: hidden;
}

.hero-metrics::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), rgba(0, 212, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: metricsSweep 4s linear infinite;
}
@keyframes metricsSweep {
    to { background-position: 200% 0; }
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1.1rem;
    flex: 1;
    border-radius: 12px;
    transition: background 0.25s ease, transform 0.25s ease;
}
.metric-item:hover {
    background: rgba(99, 102, 241, 0.07);
    transform: translateY(-2px);
}
.metric-item:hover .metric-icon {
    transform: scale(1.08) rotate(-4deg);
}
.metric-icon {
    transition: transform 0.25s ease;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.18));
    border: 1px solid rgba(139, 92, 246, 0.25);
    font-size: 1.3rem;
    color: #a78bfa;
    font-family: 'JetBrains Mono', monospace;
}

.metric-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
}

.metric-number {
    font-size: 1.7rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00ff41 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-plus {
    font-size: 1.3rem;
    font-weight: 800;
    color: rgba(0, 255, 65, 0.8);
}

.metric-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}
.hero-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.3rem;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.hero-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.6);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

.hero-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    animation: btnShine 3.5s ease-in-out infinite;
}
@keyframes btnShine {
    0% { left: -60%; }
    45%, 100% { left: 140%; }
}

.hero-btn-primary:hover {
    background: linear-gradient(135deg, #6d70f5, #9670f8);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.55);
}

.hero-btn-secondary {
    background: var(--surface);
    color: var(--text-strong);
    border: 1px solid var(--border);
}

.hero-btn-secondary:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.hero-btn-tz {
    background: rgba(255, 165, 0, 0.1);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.hero-btn-tz:hover {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.6);
    box-shadow: 0 0 25px rgba(255, 165, 0, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

.btn-arrow {
    font-size: 1.15rem;
    transition: transform 0.3s ease;
}

.hero-btn:hover .btn-arrow {
    transform: translateX(4px);
}
.hero-visual {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    animation: float 3s ease-in-out infinite;
}

.card-icon {
    font-size: 2.5rem;
}

.card-text {
    font-weight: 600;
    color: var(--text);
}

.card-1 {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.card-2 {
    top: 0;
    right: 0;
    animation-delay: 0.5s;
}

.card-3 {
    bottom: 0;
    left: 0;
    animation-delay: 1s;
}

.card-4 {
    bottom: 0;
    right: 0;
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 10px); }
}

@keyframes scrollWheel {
    0% { opacity: 1; top: 10px; }
    100% { opacity: 0; top: 30px; }
}
section {
    padding: 4.5rem 0;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
}
.about {
    background: rgba(30, 41, 59, 0.3);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.about-intro {
    margin-bottom: 0;
}

.intro-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.8rem 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), rgba(0, 212, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: metricsSweep 4s linear infinite;
}

.intro-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: var(--card-shadow);
}

.intro-text {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.intro-header {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.2rem;
}

.intro-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.4;
}

.highlight-role {
    color: #a78bfa;
    font-weight: 700;
}

.highlight-senior {
    color: #7c3aed;
    font-weight: 800;
}

.highlight-years {
    color: #8b5cf6;
    font-weight: 700;
    font-size: 1.35rem;
}

.intro-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-icon {
    font-size: 0.85rem;
}

.intro-description {
    font-size: 0.96rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.intro-highlight {
    background: rgba(99, 102, 241, 0.05);
    border-left: 2px solid rgba(99, 102, 241, 0.3);
    padding: 0.85rem 1.1rem;
    border-radius: 0 10px 10px 0;
    margin: 0.3rem 0;
}

.tag-corp {
    color: rgba(0, 212, 255, 0.85);
    font-weight: 500;
}

.tag-product {
    color: rgba(255, 165, 0, 0.85);
    font-weight: 500;
}

.tag-startup {
    color: rgba(0, 255, 65, 0.8);
    font-weight: 500;
}

.tag-lang {
    color: #a78bfa;
    font-weight: 500;
}

.quote {
    color: rgba(167, 139, 250, 0.8);
    font-style: italic;
}

.roles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.2rem 0;
}

.role-badge {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 500;
    color: rgba(167, 139, 250, 0.9);
    transition: all 0.2s ease;
    cursor: default;
}

.role-badge:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.intro-cta {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-top: 0.5rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .intro-card {
        padding: 2rem 1.5rem;
    }
    
    .intro-title {
        font-size: 1.25rem;
    }
    
    .highlight-years {
        font-size: 1.35rem;
    }
    
    .intro-meta {
        justify-content: flex-start;
    }
    
    .meta-item {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }
    
    .intro-description {
        font-size: 0.95rem;
    }
    
    .role-badge {
        padding: 0.4rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .intro-cta {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .intro-card {
        padding: 1.5rem 1.2rem;
    }
    
    .intro-title {
        font-size: 1.1rem;
    }
    
    .highlight-years {
        font-size: 1.2rem;
    }
    
    .intro-meta {
        gap: 0.6rem;
    }
    
    .meta-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .intro-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .intro-highlight {
        padding: 0.8rem 1rem;
    }
    
    .role-badge {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .intro-cta {
        font-size: 0.85rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.skills-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.skills-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), rgba(0, 212, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: metricsSweep 4s linear infinite;
}

.tech-stack-header {
    text-align: center;
    margin-bottom: 1.8rem;
    position: relative;
}

.tech-stack-icon {
    display: inline-block;
    margin-bottom: 0.6rem;
    animation: techIconPulse 3s ease-in-out infinite;
}
.tech-stack-icon svg { width: 44px; height: 44px; }

@keyframes techIconPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(180deg);
    }
}

.tech-stack-icon svg circle:nth-child(1),
.tech-stack-icon svg circle:nth-child(2) {
    animation: techRipple 2s ease-in-out infinite;
}

@keyframes techRipple {
    0%, 100% {
        r: 28;
        opacity: 0.3;
    }
    50% {
        r: 32;
        opacity: 0.1;
    }
}

.skills-title {
    font-size: 1.9rem;
    margin-bottom: 0.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.tech-stack-subtitle {
    font-size: 0.98rem;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* ==== Технологический стек — интерфейс в стиле Windows ==== */
.tech-os {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    margin-top: 1.3rem;
}

.tech-os-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.tech-tab::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 3px; height: 0;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    transform: translateY(-50%);
    transition: height 0.3s ease;
}
.tech-tab:hover {
    border-color: var(--border);
    transform: translateX(3px);
}
.tech-tab.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.18));
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}
.tech-tab.active::before { height: 60%; }

.tab-ico {
    font-size: 1.4rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}
.tab-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.tab-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.tech-tab.active .tab-count { color: var(--accent); }

/* «Экран» с технологиями */
.tech-os-stage {
    position: relative;
    display: grid;
    background: rgba(10, 15, 30, 0.35);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 1.4rem;
    min-height: 240px;
    overflow: hidden;
}
html[data-theme="light"] .tech-os-stage { background: rgba(99, 102, 241, 0.05); }

.tech-panel {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateX(24px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.tech-panel.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}
.panel-ico {
    font-size: 1.7rem;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
    animation: iconFloat 3s ease-in-out infinite;
}
.panel-head h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.panel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Пилюли выезжают каскадом при активации панели */
.tech-panel .tech-pill {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.tech-panel.active .tech-pill { opacity: 1; transform: translateY(0); }
.tech-panel.active .tech-pill:nth-child(1)  { transition-delay: 0.06s; }
.tech-panel.active .tech-pill:nth-child(2)  { transition-delay: 0.10s; }
.tech-panel.active .tech-pill:nth-child(3)  { transition-delay: 0.14s; }
.tech-panel.active .tech-pill:nth-child(4)  { transition-delay: 0.18s; }
.tech-panel.active .tech-pill:nth-child(5)  { transition-delay: 0.22s; }
.tech-panel.active .tech-pill:nth-child(6)  { transition-delay: 0.26s; }
.tech-panel.active .tech-pill:nth-child(7)  { transition-delay: 0.30s; }
.tech-panel.active .tech-pill:nth-child(8)  { transition-delay: 0.34s; }
.tech-panel.active .tech-pill:nth-child(9)  { transition-delay: 0.38s; }
.tech-panel.active .tech-pill:nth-child(10) { transition-delay: 0.42s; }
.tech-panel.active .tech-pill:nth-child(n+11) { transition-delay: 0.46s; }

@media (prefers-reduced-motion: reduce) {
    .tech-panel, .tech-panel .tech-pill { transition: none; }
}

@media (max-width: 768px) {
    .tech-os { grid-template-columns: 1fr; }
    .tech-os-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.4rem;
        gap: 0.4rem;
    }
    .tech-tab { flex: 0 0 auto; }
    .tech-tab::before { display: none; }
    .tech-tab:hover { transform: none; }
}

.tech-pill {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.35);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #a855f7;
    text-shadow: 0 0 4px rgba(147, 51, 234, 0.25);
    transition: all 0.3s ease;
    cursor: default;
    white-space: nowrap;
}

.tech-pill:hover {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.5);
    color: #c084fc;
    text-shadow: 0 0 8px rgba(147, 51, 234, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: clamp(1.3rem, 3vw, 2.5rem);
    margin-bottom: clamp(1.2rem, 3vw, 2.2rem);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), rgba(0, 212, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: metricsSweep 4s linear infinite;
    z-index: 1;
}

.project-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.2);
    transform: translateY(-5px);
}

.project-number {
    position: absolute;
    top: 0.6rem;
    right: 1.3rem;
    font-size: clamp(3.5rem, 10vw, 6.5rem);
    font-weight: 900;
    color: rgba(99, 102, 241, 0.07);
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    line-height: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.project-title {
    font-size: clamp(1.3rem, 3vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--white);
    line-height: 1.25;
}

.project-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-flutter {
    background: rgba(109, 40, 217, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.5);
}

.badge-mobile {
    background: rgba(91, 33, 182, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(109, 40, 217, 0.5);
}

.badge-ai {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.badge-python {
    background: rgba(109, 40, 217, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(124, 58, 237, 0.5);
}

.badge-bot {
    background: rgba(91, 33, 182, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(109, 40, 217, 0.5);
}

.badge-web {
    background: rgba(124, 58, 237, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(124, 58, 237, 0.5);
}

.badge-security {
    background: rgba(109, 40, 217, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.5);
}

.badge-game {
    background: rgba(91, 33, 182, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(109, 40, 217, 0.5);
}

.project-period {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    height: fit-content;
}

.project-description {
    font-size: clamp(0.9rem, 1.5vw, 0.98rem);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.feature-item {
    background: rgba(99, 102, 241, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 9px;
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    transition: background 0.25s ease, transform 0.25s ease;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.feature-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(3px);
}
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    margin: 1.1rem 0;
}

/* Горизонтальные фото делаем крупнее */
.gallery-horizontal {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.project-gallery-placeholder {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin: 1.1rem 0;
    text-align: left;
    transition: all 0.3s ease;
}

.project-gallery-placeholder:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(15, 23, 42, 0.7);
}

.placeholder-icon {
    font-size: 1.8rem;
    margin-bottom: 0;
    opacity: 0.7;
    flex-shrink: 0;
}

.project-gallery-placeholder h3 {
    font-size: 0.95rem;
    color: var(--white);
    margin-bottom: 0.1rem;
}

.project-gallery-placeholder p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.6);
}

/* Горизонтальная ориентация галереи (по умолчанию) */
.gallery-horizontal .gallery-item {
    aspect-ratio: 4/3;
}

/* Вертикальная ориентация галереи — компактнее, чтобы не растягивать карточку */
.gallery-vertical .gallery-item {
    aspect-ratio: 3/4;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}
.tech-stack-title {
    margin-top: 1.1rem;
    margin-bottom: 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.12));
    border: 1px solid var(--border);
    border-radius: 999px;
}

.tech-stack-title::before {
    content: '⚙️';
    font-size: 0.9rem;
}

.tech-stack-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 999px;
    padding: 0.02rem 0.45rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.9rem;
    border-radius: 12px;
    background: rgba(10, 15, 30, 0.28);
    border: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
}
.project-tech::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, #6366f1, #8b5cf6, #00d4ff);
}
html[data-theme="light"] .project-tech { background: rgba(99, 102, 241, 0.05); }

.tech-tag {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.35);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #a855f7;
    text-shadow: 0 0 4px rgba(147, 51, 234, 0.25);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.5);
    color: #c084fc;
    text-shadow: 0 0 8px rgba(147, 51, 234, 0.4);
    transform: translateY(-1px);
}
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 70%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    user-select: none;
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    padding: 1rem 1.5rem;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 2001;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(99, 102, 241, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 2rem;
}

.modal-next {
    right: 2rem;
}

.modal-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    background: rgba(15, 23, 42, 0.8);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
}
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
}

.gallery-modal.active {
    display: block;
}

.gallery-modal-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    position: relative;
}

.gallery-modal-title {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.gallery-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-modal-grid .gallery-item {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-modal-grid .gallery-item:hover {
    transform: scale(1.05);
}

.gallery-more-btn {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-more-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.more-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    gap: 1rem;
}

.more-btn-icon svg {
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

.rotating-circle {
    animation: rotate 8s linear infinite;
    transform-origin: center;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.more-btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.more-btn-count {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
}

.more-btn-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.contact {
    background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(99, 102, 241, 0.1), transparent 70%);
}

.contact-content {
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: clamp(1.4rem, 3vw, 2.2rem);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
}

.contact-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.9), rgba(0, 212, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: metricsSweep 4s linear infinite;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.contact-item {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 1.1rem 1.3rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.contact-item:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px);
    background: rgba(99, 102, 241, 0.09);
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.18);
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.contact-icon svg { width: 42px; height: 42px; }

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border-soft);
}

.telegram-icon svg {
    transition: all 0.3s ease;
}

.contact-item:hover .telegram-icon svg {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 10px rgba(42, 171, 238, 0.5));
}

.contact-text h4 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
    color: var(--text-strong);
}

.contact-text p {
    color: var(--text-muted);
}

.contact-hidden {
    font-style: italic;
    color: rgba(167, 139, 250, 0.8);
    font-size: 0.95rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #2aabee;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    transition: all 0.25s ease;
}
.contact-link:hover {
    color: #229ed9;
    text-shadow: 0 0 10px rgba(42, 171, 238, 0.5);
    transform: translateX(2px);
}
.footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.95) 20%, rgba(10, 15, 30, 1) 100%);
    padding: 3rem 0 2rem;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), transparent) 1;
    position: relative;
    margin-top: 2rem;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), transparent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.footer-brand {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    animation: footerGlow 3s ease-in-out infinite;
}

@keyframes footerGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8));
    }
}

.footer-tagline {
    font-size: 1rem;
    color: rgba(167, 139, 250, 0.8);
    font-style: italic;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.footer-copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    width: 100%;
}

.footer-copyright p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-copyright {
        text-align: center;
    }
}


@media (max-width: 968px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }
    
    
    .hero {
        padding: 6rem 1.5rem 3rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-main {
        gap: 1.5rem;
    }
    
    .hero-visual-new {
        display: none;
    }
    
    .hero-visual {
        display: none;
    }
    
    .title-bracket {
        font-size: 2.5rem;
    }
    
    .title-gradient {
        font-size: 2.5rem;
    }
    
    .title-text {
        font-size: 1.5rem;
    }
    
    .hero-metrics {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.2rem;
    }
    
    .metric-item {
        padding: 0;
    }
    
    .metric-divider {
        height: 1px;
        width: 100%;
        background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
    }
    
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    
    section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
    }
    
    
    .project-card {
        padding: 2rem;
    }
    
    .project-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    
    
    .modal-content {
        max-width: 85%;
        max-height: 70vh;
    }
    
    .modal-prev,
    .modal-next {
        font-size: 2rem;
        padding: 0.8rem 1rem;
    }
    
    .modal-prev {
        left: 1rem;
    }
    
    .modal-next {
        right: 1rem;
    }
}


@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    
    .logo {
        font-size: 1.3rem;
    }
    
    
    .nav-menu {
        gap: 0.8rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0;
    }
    
    .nav-link::before,
    .nav-link::after {
        display: none;
    }
    
    
    .hero {
        padding: 6rem 1rem 2rem;
        min-height: auto;
    }
    
    .hero-status {
        width: 100%;
        justify-content: center;
    }
    
    .title-line {
        justify-content: center;
    }
    
    .title-bracket {
        font-size: 2rem;
    }
    
    .title-gradient {
        font-size: 2rem;
    }
    
    .subtitle-line {
        margin-left: 0;
    }
    
    .title-text {
        font-size: 1.3rem;
    }
    
    .title-arrow {
        font-size: 1.3rem;
    }
    
    .desc-line {
        font-size: 0.95rem;
    }
    
    .hero-metrics {
        width: 100%;
        padding: 1rem;
    }
    
    .metric-item {
        padding: 0 0.8rem;
    }
    
    .metric-number {
        font-size: 2rem;
    }
    
    .metric-label {
        font-size: 0.7rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-btn {
        width: 100%;
        justify-content: center;
    }
    
    
    section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    
    .skills-section {
        padding: 2rem 1.5rem;
    }
    
    .skills-title {
        font-size: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tech-card {
        padding: 1.2rem;
    }
    
    
    .project-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .project-number {
        font-size: 5rem;
        top: -10px;
        right: 1rem;
    }
    
    .project-title {
        font-size: 1.6rem;
    }
    
    .project-description {
        font-size: 1rem;
    }
    
    .project-features {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .project-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .gallery-more-btn {
        aspect-ratio: 1/1;
    }
    
    .more-btn-count {
        font-size: 1.5rem;
    }
    
    .more-btn-label {
        font-size: 0.75rem;
    }
    
    
    .gallery-modal-content {
        padding: 1rem;
    }
    
    .gallery-modal-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .gallery-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-item {
        padding: 1.5rem;
    }
    
    
    .modal-content {
        max-width: 90%;
        max-height: 65vh;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
    }
    
    .modal-prev,
    .modal-next {
        font-size: 1.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    .modal-counter {
        bottom: 1rem;
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
    
    
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-brand {
        font-size: 2rem;
    }
    
    .footer-tagline {
        font-size: 0.85rem;
    }
    
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}


@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
    
    .nav-container {
        padding: 0 0.8rem;
    }
    
    
    .logo {
        font-size: 1.1rem;
        gap: 0.3rem;
    }
    
    
    .hero {
        padding: 5.5rem 0.8rem 2rem;
    }
    
    .hero-status {
        padding: 0.5rem 1rem;
        gap: 0.6rem;
    }
    
    .status-indicator {
        width: 8px;
        height: 8px;
    }
    
    .status-text {
        font-size: 0.75rem;
    }
    
    .title-bracket {
        font-size: 1.5rem;
    }
    
    .title-gradient {
        font-size: 1.5rem;
    }
    
    .title-text {
        font-size: 1.1rem;
    }
    
    .title-arrow {
        font-size: 1.1rem;
    }
    
    .desc-line {
        font-size: 0.85rem;
        gap: 0.6rem;
    }
    
    .hero-metrics {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0.8rem;
    }
    
    .metric-item {
        padding: 0;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .metric-divider {
        width: 80%;
        height: 1px;
        margin: 0 auto;
    }
    
    .metric-number {
        font-size: 1.8rem;
    }
    
    .metric-label {
        font-size: 0.65rem;
    }
    
    .hero-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    
    section {
        padding: 2.5rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.95rem;
    }
    
    
    .skills-section {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .tech-stack-icon svg {
        width: 48px;
        height: 48px;
    }
    
    .skills-title {
        font-size: 1.6rem;
    }
    
    .tech-stack-subtitle {
        font-size: 0.95rem;
    }
    
    .tech-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .tech-card-icon {
        font-size: 1.6rem;
    }
    
    .tech-card-title {
        font-size: 0.85rem;
    }
    
    .tech-pill {
        padding: 0.3rem 0.7rem;
        font-size: 0.7rem;
        border-radius: 16px;
    }
    
    
    .project-card {
        padding: 1.2rem;
        border-radius: 16px;
    }
    
    .project-number {
        font-size: 4rem;
        top: -5px;
        right: 0.5rem;
    }
    
    .project-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .project-badges {
        gap: 0.4rem;
    }
    
    .badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
        border-radius: 16px;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .feature-item {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .tech-stack-title {
        font-size: 0.9rem;
        margin-top: 1.2rem;
        margin-bottom: 0.6rem;
    }
    
    .tech-tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 5px;
    }
    
    
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .gallery-item {
        border-radius: 8px;
    }
    
    .more-btn-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .more-btn-count {
        font-size: 1.2rem;
    }
    
    .more-btn-label {
        font-size: 0.65rem;
    }
    
    
    .gallery-modal-content {
        margin: 1rem auto;
        padding: 0.8rem;
    }
    
    .gallery-modal-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .gallery-modal-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    
    .contact-item {
        padding: 1.2rem;
        gap: 1rem;
        border-radius: 16px;
    }
    
    .contact-icon {
        font-size: 2rem;
    }
    
    .telegram-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .contact-text h4 {
        font-size: 1rem;
    }
    
    .contact-text p {
        font-size: 0.85rem;
    }
    
    .contact-hidden {
        font-size: 0.85rem;
    }
    
    
    .modal-content {
        max-width: 92%;
        max-height: 60vh;
        border-radius: 8px;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 2rem;
    }
    
    .modal-prev,
    .modal-next {
        font-size: 1.5rem;
        padding: 0.5rem 0.6rem;
        border-radius: 6px;
    }
    
    .modal-prev {
        left: 0.5rem;
    }
    
    .modal-next {
        right: 0.5rem;
    }
    
    .modal-counter {
        bottom: 0.5rem;
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        border-radius: 16px;
    }
    
    
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-brand {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .footer-tagline {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }
    
    .footer-copyright p {
        font-size: 0.75rem;
    }
    
    
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    
    .hero-glow,
    .hero-grid,
    .floating-badges,
    .scroll-indicator {
        display: none;
    }
}


@media (max-width: 360px) {
    .title-gradient {
        font-size: 1.3rem;
    }
    
    .title-text {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
    }
    
    .hero-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .footer-brand {
        font-size: 1.4rem;
    }
}


@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 3rem 1rem 2rem;
    }
    
    .hero-metrics {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .metric-divider {
        width: 1px;
        height: 60px;
    }
    
    section {
        padding: 3rem 0;
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-aos="fade-up"] {
    animation: fadeInUp 0.8s ease forwards;
}
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid rgba(0, 255, 65, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.2);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: rgba(0, 255, 65, 0.2);
    border-color: rgba(0, 255, 65, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.4);
}

.scroll-to-top svg {
    color: #00ff41;
    filter: drop-shadow(0 0 5px rgba(0, 255, 65, 0.5));
}

.scroll-to-top:hover svg {
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}
.hero-visual-new {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 60px 24px 60px;
    box-sizing: border-box;
    perspective: 1400px;
}

.visual-stage {
    position: relative;
    width: 100%;
    max-width: min(520px, 100%);
    transform-style: preserve-3d;
    transform: rotateY(-9deg) rotateX(4deg);
    transition: transform 0.5s ease;
    animation: stageFloat 7s ease-in-out infinite;
}

.hero-visual-new:hover .visual-stage {
    animation-play-state: paused;
    transform: rotateY(-3deg) rotateX(1deg);
}

@keyframes stageFloat {
    0%, 100% { transform: rotateY(-9deg) rotateX(4deg) translateY(0); }
    50% { transform: rotateY(-9deg) rotateX(4deg) translateY(-14px); }
}

/* Орбитальные кольца */
.visual-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px dashed rgba(99, 102, 241, 0.25);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.visual-orbit-1 {
    width: 130%;
    height: 130%;
    animation: orbitSpin 26s linear infinite;
}
.visual-orbit-2 {
    width: 108%;
    height: 108%;
    border-color: rgba(139, 92, 246, 0.2);
    animation: orbitSpin 18s linear infinite reverse;
}
@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.visual-glow-blob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 90%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.5), transparent 60%),
                radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.45), transparent 60%);
    filter: blur(60px);
    opacity: 0.7;
    pointer-events: none;
    animation: blobPulse 6s ease-in-out infinite;
}
@keyframes blobPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.85; }
}

.visual-terminal {
    position: relative;
    background: rgba(10, 15, 30, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.03) inset;
    width: 100%;
    transition: box-shadow 0.3s ease;
    z-index: 2;
    cursor: pointer;
}

/* Анимированная градиентная рамка */
.terminal-glow-border {
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: conic-gradient(from var(--angle, 0deg),
        rgba(99, 102, 241, 0), rgba(99, 102, 241, 0.9),
        rgba(139, 92, 246, 0.9), rgba(0, 255, 65, 0.7),
        rgba(99, 102, 241, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderSpin 5s linear infinite;
    pointer-events: none;
    opacity: 0.9;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderSpin {
    to { --angle: 360deg; }
}

.visual-terminal:hover {
    box-shadow: 0 30px 80px rgba(99, 102, 241, 0.35);
}
.visual-terminal::after {
    content: '🎮 Click to play';
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: rgba(0, 255, 65, 0.75);
    font-family: 'Courier New', monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}
.visual-terminal:hover::after {
    opacity: 1;
}

.terminal-header {
    position: relative;
    background: rgba(15, 23, 42, 0.85);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 2;
}

.terminal-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #4ade80;
    letter-spacing: 0.5px;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: statusPulse 1.6s ease-in-out infinite;
}

.terminal-build {
    position: relative;
    z-index: 2;
    padding: 0.7rem 1rem 0.9rem;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.5);
}
.build-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(167, 139, 250, 0.9);
    margin-bottom: 0.5rem;
}
.build-spinner {
    width: 11px;
    height: 11px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: borderSpin2 0.8s linear infinite;
}
@keyframes borderSpin2 { to { transform: rotate(360deg); } }
.build-bar {
    height: 5px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    overflow: hidden;
}
.build-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #00ff41);
    animation: buildProgress 4s ease-in-out infinite;
}
@keyframes buildProgress {
    0% { width: 8%; }
    60% { width: 92%; }
    100% { width: 8%; }
}

/* Плавающие чипы-метрики */
.visual-chip {
    position: absolute;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    font-family: 'JetBrains Mono', monospace;
    animation: floatBadge 5s ease-in-out infinite;
}
.visual-chip .chip-value {
    font-weight: 800;
    font-size: 1rem;
    background: linear-gradient(135deg, #00ff41, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.visual-chip .chip-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}
.visual-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}
.visual-chip-uptime {
    top: -14px;
    right: -10px;
    animation-delay: 0.5s;
}
.visual-chip-deploy {
    bottom: 30px;
    left: -22px;
    animation-delay: 2s;
}
html[data-theme="light"] .visual-chip .chip-label { color: rgba(255,255,255,0.7); }

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.terminal-line {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.terminal-prompt {
    color: #00ff41;
    font-weight: 700;
}

.terminal-text {
    color: rgba(255, 255, 255, 0.9);
}

.terminal-output {
    color: rgba(167, 139, 250, 0.9);
}

.indent {
    padding-left: 2rem;
}

.json-key {
    color: #00d4ff;
}

.json-string {
    color: #ffa500;
}

.terminal-cursor {
    color: #00ff41;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.floating-badges {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.tech-badge {
    position: absolute;
    background: rgba(20, 27, 45, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
    backdrop-filter: blur(10px);
    animation: floatBadge 4.5s ease-in-out infinite;
}

.badge-emoji {
    font-size: 1.4rem;
}

.badge-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #c4b5fd;
    font-size: 0.85rem;
}

.badge-1 {
    top: -26px;
    left: 6%;
    animation-delay: 0s;
}

.badge-2 {
    top: 34%;
    right: -34px;
    animation-delay: 1.2s;
}

.badge-3 {
    bottom: -22px;
    left: 24%;
    animation-delay: 2.4s;
}

.badge-4 {
    top: 6%;
    right: -26px;
    animation-delay: 3.2s;
}

@keyframes floatBadge {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    75% {
        transform: translateY(10px) rotate(-2deg);
    }
}

/* ============================================
   СВЕТЛАЯ ТЕМА — переопределения поверхностей
   ============================================ */
html[data-theme="light"] .about {
    background-color: rgba(99, 102, 241, 0.04);
}

html[data-theme="light"] .intro-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .tech-card,
html[data-theme="light"] .contact-item,
html[data-theme="light"] .skills-section {
    background: var(--surface-solid);
    border-color: var(--border-soft);
    box-shadow: var(--card-shadow);
}

html[data-theme="light"] .project-card {
    background: var(--surface-solid);
    border-color: var(--border-soft);
    box-shadow: var(--card-shadow);
}

html[data-theme="light"] .meta-item {
    background: rgba(99, 102, 241, 0.06);
    color: var(--text-muted);
}

html[data-theme="light"] .intro-highlight {
    background: rgba(99, 102, 241, 0.06);
}

html[data-theme="light"] .intro-description,
html[data-theme="light"] .project-description,
html[data-theme="light"] .feature-item {
    color: var(--text-muted);
}

html[data-theme="light"] .intro-title,
html[data-theme="light"] .project-title,
html[data-theme="light"] .stat-number,
html[data-theme="light"] .skills-title,
html[data-theme="light"] .tech-card-title,
html[data-theme="light"] .contact-text h4 {
    color: var(--text-strong);
}

html[data-theme="light"] .section-subtitle,
html[data-theme="light"] .tech-stack-subtitle {
    color: var(--text-muted);
}

html[data-theme="light"] .role-badge {
    color: #4f46e5;
}

html[data-theme="light"] .footer {
    background: linear-gradient(180deg, rgba(238, 241, 248, 0) 0%, rgba(230, 235, 245, 0.9) 30%, #e6ebf5 100%);
}

html[data-theme="light"] .footer-copyright p {
    color: var(--text-muted);
}

html[data-theme="light"] .scroll-to-top {
    background: var(--surface-solid);
    color: var(--primary);
}

html[data-theme="light"] .metric-icon {
    color: #6366f1;
}

html[data-theme="light"] .hero-btn-secondary {
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-strong);
    border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .hero-btn-secondary:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

html[data-theme="light"] .tech-pill {
    color: #6d28d9;
}

html[data-theme="light"] .project-gallery-placeholder {
    background: var(--surface-solid);
    border-color: rgba(99, 102, 241, 0.3);
}
html[data-theme="light"] .project-gallery-placeholder h3 { color: var(--text-strong); }
html[data-theme="light"] .gallery-item { background: rgba(99, 102, 241, 0.06); }
html[data-theme="light"] .project-period { color: #4f46e5; }

html[data-theme="light"] .intro-cta,
html[data-theme="light"] .intro-description {
    color: var(--text-muted);
}

/* Терминал и плавающие бейджи остаются тёмными в обеих темах —
   это стилизованный «редактор кода», так и задумано */
html[data-theme="light"] .visual-terminal {
    box-shadow: 0 30px 60px rgba(100, 116, 139, 0.25);
}

/* ============================================================
   Мобильное меню (бургер) + фиксы адаптива
   ============================================================ */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Анимированная кнопка-бургер */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-burger:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}
.nav-burger span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, background 0.3s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 600px) {
    .nav-burger { display: flex; }

    /* Меню превращается в выпадающую панель */
    .nav-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.6rem;
        background: var(--navbar-bg);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
        backdrop-filter: blur(18px) saturate(160%);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.98);
        transform-origin: top center;
        transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
        pointer-events: none;
    }
    .nav-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .nav-menu li {
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .nav-menu.open li { opacity: 1; transform: translateY(0); }
    .nav-menu.open li:nth-child(1) { transition-delay: 0.05s; }
    .nav-menu.open li:nth-child(2) { transition-delay: 0.10s; }
    .nav-menu.open li:nth-child(3) { transition-delay: 0.15s; }
    .nav-menu.open li:nth-child(4) { transition-delay: 0.20s; }
    .nav-menu.open li:nth-child(5) { transition-delay: 0.25s; }

    .nav-menu .nav-link {
        display: block;
        padding: 0.7rem 0.9rem;
        border-radius: 10px;
        font-size: 0.95rem;
        transition: background 0.25s ease, color 0.25s ease;
    }
    .nav-menu .nav-link:hover,
    .nav-menu .nav-link:active {
        background: rgba(99, 102, 241, 0.12);
        color: var(--text-strong);
    }
    .nav-menu .nav-link::before,
    .nav-menu .nav-link::after { display: none; }
}

/* Терминал-визуал скрываем на планшете/телефоне (перекрываем базовое display:flex) */
@media (max-width: 968px) {
    .hero-visual-new,
    .hero-visual { display: none !important; }
}

/* Вкладки tech-os: авто-ширина, чтобы помещались несколько и скроллились */
@media (max-width: 768px) {
    .tech-tab { width: auto; }
    .tab-name { white-space: nowrap; }
}

/* Картинки галереи/лайтбокса открываются почти на весь экран */
@media (max-width: 768px) {
    .modal-content {
        max-width: 96vw !important;
        max-height: 82vh !important;
        width: auto;
        height: auto;
    }
}
@media (max-width: 480px) {
    .modal-content {
        max-width: 100vw !important;
        max-height: 85vh !important;
        border-radius: 6px;
    }
}

/* ============================================================
   Производительность: снижаем нагрузку на GPU на мобильных
   (перегрев из-за множества blur-слоёв и бесконечных анимаций)
   ============================================================ */
@media (max-width: 768px) {
    /* Дорогой backdrop-filter на десятках карточек — главный источник нагрева */
    .navbar,
    .intro-card,
    .project-card,
    .contact-item,
    .contact-glass,
    .tech-os-stage,
    .tech-tab,
    .hero-chip,
    .stat-card,
    .skills-section,
    .nav-menu {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* Останавливаем фоновые бесконечные анимации */
    .particles-background::before,
    .hero-glow,
    .hero-beams,
    .hero-grid {
        animation: none !important;
    }
}

/* ============================================================
   Светлая тема: живой переливающийся фон карточек
   Мягкие цветные пятна медленно дрейфуют по поверхности,
   поверх — почти незаметный диагональный блик
   ============================================================ */
@keyframes cardAuroraDrift {
    0% {
        background-position: 0% 30%, 100% 20%, 50% 100%, 0% 50%, 0 0;
    }
    50% {
        background-position: 30% 70%, 70% 60%, 20% 40%, 100% 50%, 0 0;
    }
    100% {
        background-position: 0% 30%, 100% 20%, 50% 100%, 0% 50%, 0 0;
    }
}

html[data-theme="light"] .intro-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .contact-item,
html[data-theme="light"] .skills-section,
html[data-theme="light"] .project-card {
    background-image:
        radial-gradient(120% 90% at 0% 0%, rgba(99, 102, 241, 0.10) 0%, rgba(99, 102, 241, 0) 55%),
        radial-gradient(110% 85% at 100% 0%, rgba(139, 92, 246, 0.09) 0%, rgba(139, 92, 246, 0) 55%),
        radial-gradient(130% 100% at 50% 100%, rgba(0, 212, 255, 0.07) 0%, rgba(0, 212, 255, 0) 60%),
        linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    background-size: 180% 180%, 180% 180%, 200% 200%, 300% 100%, 100% 100%;
    background-repeat: no-repeat;
    animation: cardAuroraDrift 22s ease-in-out infinite;
}

/* У карточек с внутренними псевдоэлементами фон не должен их перекрывать */
html[data-theme="light"] .intro-card,
html[data-theme="light"] .project-card {
    background-color: #ffffff;
}

html[data-theme="light"] .stat-card {
    animation-duration: 26s;
}

html[data-theme="light"] .project-card:nth-of-type(even) {
    animation-direction: reverse;
}

html[data-theme="light"] .intro-card:hover,
html[data-theme="light"] .project-card:hover,
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .contact-item:hover {
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 22px 55px rgba(99, 102, 241, 0.16);
}

/* На мобильных десятки анимированных градиентов греют GPU — оставляем статику */
@media (max-width: 768px) {
    html[data-theme="light"] .intro-card,
    html[data-theme="light"] .stat-card,
    html[data-theme="light"] .contact-item,
    html[data-theme="light"] .skills-section,
    html[data-theme="light"] .project-card {
        animation: none !important;
        background-size: 140% 140%, 140% 140%, 160% 160%, 200% 100%, 100% 100%;
    }
}

/* ============================================================
   Фон ПОЗАДИ карточек: переливающийся слой на уровне секции
   Дрейфующие цветные пятна + точечная сетка «артефактов»,
   сами карточки не трогаем — они рисуются поверх
   ============================================================ */
:root, html[data-theme="dark"] {
    --sfx-1: rgba(99, 102, 241, 0.16);
    --sfx-2: rgba(139, 92, 246, 0.13);
    --sfx-3: rgba(0, 212, 255, 0.10);
    --sfx-beam: rgba(167, 139, 250, 0.07);
}

html[data-theme="light"] {
    --sfx-1: rgba(99, 102, 241, 0.11);
    --sfx-2: rgba(139, 92, 246, 0.09);
    --sfx-3: rgba(0, 212, 255, 0.07);
    --sfx-beam: rgba(99, 102, 241, 0.05);
}

@keyframes sectionAuroraDrift {
    0% {
        background-position: 8% 18%, 92% 12%, 50% 96%, 0% 50%;
    }
    33% {
        background-position: 38% 62%, 62% 44%, 18% 28%, 50% 50%;
    }
    66% {
        background-position: 22% 40%, 74% 78%, 68% 60%, 100% 50%;
    }
    100% {
        background-position: 8% 18%, 92% 12%, 50% 96%, 0% 50%;
    }
}

.about,
.projects,
.contact {
    position: relative;
    background-image:
        radial-gradient(60% 45% at 12% 8%, var(--sfx-1) 0%, transparent 65%),
        radial-gradient(55% 40% at 88% 18%, var(--sfx-2) 0%, transparent 65%),
        radial-gradient(70% 55% at 50% 95%, var(--sfx-3) 0%, transparent 68%),
        linear-gradient(110deg, transparent 40%, var(--sfx-beam) 50%, transparent 60%);
    background-size: 180% 180%, 180% 180%, 200% 200%, 300% 100%;
    background-repeat: no-repeat;
    animation: sectionAuroraDrift 40s ease-in-out infinite;
}

.about { background-color: rgba(30, 41, 59, 0.3); }

.contact { animation-direction: reverse; }
.projects { animation-duration: 48s; }

@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .about,
    .projects,
    .contact {
        animation: none !important;
    }
}

/* Уважаем системную настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .particles-background::before { animation: none !important; }
}



/* === Сворачиваемый список функций проекта === */
.project-features .feature-extra {
    display: none;
}

.project-features.is-open .feature-extra {
    display: block;
    animation: featureReveal 0.35s ease both;
}

@keyframes featureReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.features-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 1px dashed rgba(139, 92, 246, 0.55);
    border-left: 3px solid #8b5cf6;
    border-radius: 9px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.features-toggle > * {
    pointer-events: none;
}

.features-toggle:hover {
    background: rgba(139, 92, 246, 0.16);
    border-style: solid;
    border-color: rgba(139, 92, 246, 0.6);
    border-left-color: #8b5cf6;
    transform: translateX(3px);
}

.features-toggle:active {
    transform: translateX(3px) scale(0.98);
}

.features-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.features-toggle-label::before {
    content: '+ ';
}

.project-features.is-open .features-toggle-label::before {
    content: '− ';
}

.features-toggle-arrow {
    flex-shrink: 0;
    width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4);
    transition: transform 0.35s cubic-bezier(.4, 1.6, .5, 1);
}

.features-toggle-arrow::after {
    content: '';
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.8px solid #fff;
    border-bottom: 1.8px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.project-features.is-open .features-toggle-arrow {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .project-features.is-open .feature-extra { animation: none; }
    .features-toggle, .features-toggle-arrow { transition: none; }
}

/* === Раскрытие описания проекта === */
.project-description.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.desc-more {
    display: inline-flex;
    align-items: center;
    margin: -0.7rem 0 1.1rem;
    padding: 0.2rem 0;
    border: 0;
    background: none;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.desc-more[hidden] {
    display: none;
}

.desc-more:hover {
    text-decoration: underline;
}

.desc-more:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Компактные вертикальные отступы на телефоне === */
@media (max-width: 768px) {
    section {
        padding: 2.75rem 0;
    }

    .hero {
        padding-bottom: 1rem;
    }

    .section-header {
        margin-bottom: 1.75rem;
    }

    .footer {
        margin-top: 0;
        padding: 2rem 0 1.25rem;
    }
}

/* =====================================================================
   Мобильная версия 2.0 — компактная и современная (до 768px)
   ===================================================================== */
@media (max-width: 768px) {
    /* --- Первый экран --- */
    .hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .hero-actions .hero-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 0.6rem;
        font-size: 0.86rem;
        border-radius: 14px;
    }

    .hero-actions .hero-btn-tz {
        grid-column: 1 / -1;
    }

    .hero-metrics {
        flex-direction: row !important;
        padding: 0.85rem 0.3rem;
        border-radius: 18px;
    }

    .hero-metrics .metric-item {
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.35rem;
        padding: 0 0.25rem;
        min-width: 0;
    }

    .hero-metrics .metric-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .hero-metrics .metric-body {
        align-items: center;
    }

    .hero-metrics .metric-number {
        font-size: 1.35rem;
    }

    .hero-metrics .metric-plus {
        font-size: 1rem;
    }

    .hero-metrics .metric-label {
        font-size: 0.66rem;
        line-height: 1.25;
    }

    .hero-metrics .metric-divider {
        display: block !important;
        width: 1px;
        height: auto;
        align-self: stretch;
        margin: 0;
    }

    /* --- Обо мне --- */
    .intro-card {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .intro-description,
    .intro-cta {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.85rem 0.4rem;
        border-radius: 16px;
    }

    .stat-number {
        font-size: 1.45rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Вкладки стека — горизонтальная лента со свайпом */
    .tech-os {
        grid-template-columns: 1fr !important;
        gap: 0.7rem;
    }

    .tech-os-tabs {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        gap: 0.45rem;
        margin: 0 -1rem;
        padding: 0.1rem 1rem 0.3rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .tech-os-tabs::-webkit-scrollbar {
        display: none;
    }

    .tech-tab {
        flex: 0 0 auto;
        width: auto !important;
        padding: 0.5rem 0.8rem;
        gap: 0.45rem;
        border-radius: 999px;
        scroll-snap-align: start;
    }

    .tech-tab:hover {
        transform: none;
    }

    .tech-tab::before {
        display: none;
    }

    .tech-tab .tab-ico {
        font-size: 1rem;
    }

    .tech-tab .tab-info {
        flex-direction: row;
        align-items: baseline;
        gap: 0.35rem;
    }

    .tech-tab .tab-name {
        font-size: 0.82rem;
    }

    .tech-os-stage {
        padding: 1rem;
        min-height: 0;
        border-radius: 16px;
    }

    /* --- Карточки проектов --- */
    .project-card {
        padding: 1.1rem 1rem 1rem;
        margin-bottom: 0.9rem;
        border-radius: 20px;
    }

    .project-card:hover {
        transform: none;
    }

    .project-number {
        font-size: 2.6rem;
        top: 0.7rem;
        right: 0.9rem;
    }

    .project-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
        margin-bottom: 0.7rem;
    }

    .project-title-block {
        display: contents;
    }

    .project-title {
        flex: 1 1 100%;
        font-size: 1.18rem;
        line-height: 1.3;
        margin-bottom: 0.15rem;
        padding-right: 2.6rem;
    }

    .project-badges {
        gap: 0.35rem;
    }

    .project-badges .badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }

    .project-period {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }

    .project-description {
        font-size: 0.9rem;
        line-height: 1.55;
        margin-bottom: 0.8rem;
    }

    .desc-more {
        margin: -0.5rem 0 0.8rem;
        font-size: 0.8rem;
    }

    .project-features {
        gap: 0.4rem;
        margin-bottom: 0.4rem;
    }

    .feature-item,
    .features-toggle {
        padding: 0.5rem 0.7rem;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .feature-item:hover {
        transform: none;
    }

    /* Галерея — лента скриншотов со свайпом */
    .project-gallery {
        display: flex !important;
        gap: 0.55rem;
        margin: 0.9rem -1rem;
        padding: 0 1rem 0.2rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .project-gallery::-webkit-scrollbar {
        display: none;
    }

    .project-gallery .gallery-item {
        display: block !important;
        flex: 0 0 auto;
        scroll-snap-align: start;
        border-radius: 14px;
        border: 1px solid var(--border-soft);
    }

    .project-gallery.gallery-vertical .gallery-item {
        width: 31%;
        aspect-ratio: 9 / 17;
    }

    .project-gallery.gallery-horizontal .gallery-item {
        width: 72%;
        aspect-ratio: 16 / 10;
    }

    .project-gallery .gallery-more-btn {
        display: none !important;
    }

    .gallery-item:hover img {
        transform: none;
    }

    /* Стек технологий — одна строка со свайпом */
    .tech-stack-title {
        margin: 0.9rem 0 0.5rem;
        font-size: 0.7rem;
    }

    .project-tech {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.35rem;
        padding: 0.6rem 0.75rem 0.6rem 0.9rem;
        border-radius: 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
        mask-image: linear-gradient(90deg, #000 85%, transparent);
    }

    .project-tech::-webkit-scrollbar {
        display: none;
    }

    .project-tech .tech-tag {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.72rem;
        padding: 0.24rem 0.6rem;
    }

    .tech-stack-title {
        padding: 0.25rem 0.7rem;
        gap: 0.4rem;
    }

    /* Блок «Технологический стек» в «Обо мне» */
    .skills-section {
        padding: 1.1rem;
        border-radius: 18px;
    }

    .tech-stack-icon {
        display: none;
    }

    .tech-stack-header {
        margin-bottom: 0.4rem;
    }

    .skills-title {
        font-size: 1.4rem;
    }

    .tech-stack-subtitle {
        font-size: 0.82rem;
    }

    .panel-head {
        margin-bottom: 0.7rem;
        padding-bottom: 0.6rem;
    }

    .panel-head h4 {
        font-size: 0.95rem;
    }

    .tech-pill {
        font-size: 0.74rem;
        padding: 0.28rem 0.65rem;
    }

    /* --- Свяжитесь со мной --- */
    .contact-content {
        padding: 0.9rem;
        border-radius: 20px;
    }

    .contact-info {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        padding: 0.75rem;
        margin: 0;
        border-radius: 14px;
        min-width: 0;
    }

    .contact-item:hover {
        transform: none;
    }

    .contact-icon {
        display: flex;
        align-items: center;
        height: 28px;
        font-size: 1.4rem;
        line-height: 1;
    }

    .contact-icon svg {
        width: 26px;
        height: 26px;
    }

    .contact-text {
        min-width: 0;
    }

    .contact-text h4 {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }

    .contact-text p,
    .contact-link {
        font-size: 0.76rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .contact-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding-top: 0;
        border-top: 0;
    }

    .contact-actions .hero-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 0.6rem;
        font-size: 0.86rem;
        border-radius: 14px;
    }

    .contact-actions .hero-btn-primary {
        grid-column: 1 / -1;
    }

    /* --- Подвал --- */
    .footer {
        padding: 1.4rem 0 1rem;
    }

    .footer-content {
        gap: 0.4rem;
    }

    .footer-logo {
        font-size: 1.4rem;
    }

    .footer-tagline {
        font-size: 0.7rem;
        margin: 0;
    }

    .footer-copyright {
        margin-top: 0.4rem;
        padding-top: 0.6rem;
        padding-bottom: 4.5rem;
    }

    .footer-copyright p {
        font-size: 0.7rem;
    }

    /* --- Заголовки секций --- */
    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }
}


/* =====================================================================
   Производительность: меньше перерисовок, меньше нагрев
   ===================================================================== */

/* Огромные секции больше не перерисовывают фон каждый кадр — фон статичный */
.about,
.projects,
.contact {
    animation: none !important;
}

/* Бегущая полоска на карточках проекта — только при наведении */
.project-card::after {
    animation-play-state: paused;
}

.project-card:hover::after {
    animation-play-state: running;
}

/* Размытие под 24 большими карточками дорого при прокрутке */
.project-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Анимации вне экрана и в скрытой вкладке стоят на паузе */
.anim-offscreen,
.anim-offscreen::before,
.anim-offscreen::after,
.anim-offscreen *,
.anim-offscreen *::before,
.anim-offscreen *::after,
.anim-paused-all *,
.anim-paused-all *::before,
.anim-paused-all *::after {
    animation-play-state: paused !important;
}

/* Анимации только на transform/opacity — без пересчёта раскладки */
.build-bar span {
    width: 100%;
    transform-origin: left center;
    animation-name: buildProgressX;
}

@keyframes buildProgressX {
    0% { transform: scaleX(0.08); }
    60% { transform: scaleX(0.92); }
    100% { transform: scaleX(0.08); }
}

.hero-btn-primary::after {
    left: 0;
    animation-name: btnShineX;
}

@keyframes btnShineX {
    0% { transform: translateX(-150%) skewX(-20deg); }
    45%, 100% { transform: translateX(350%) skewX(-20deg); }
}

.wheel {
    animation-name: scrollWheelY;
}

@keyframes scrollWheelY {
    0% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 20px); }
}

.tech-stack-icon svg circle:nth-child(1),
.tech-stack-icon svg circle:nth-child(2) {
    transform-box: fill-box;
    transform-origin: center;
    animation-name: techRippleScale;
}

@keyframes techRippleScale {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.14); opacity: 0.1; }
}

/* Сетка фона героя статична — перерисовка всей области каждый кадр не нужна */
.hero-grid {
    animation: none;
}

/* Вращение рамки терминала (анимация CSS-переменной) — только при наведении */
.terminal-glow-border {
    animation-play-state: paused;
}

.visual-terminal:hover .terminal-glow-border {
    animation-play-state: running;
}

/* Бегущая полоска сверху карточек: сдвиг через transform вместо background-position */
@keyframes metricsSweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* === ПК: компактный низ страницы и кнопки контактов по центру === */
@media (min-width: 769px) {
    .projects {
        padding-bottom: 1.5rem;
    }

    .projects .project-card:last-child {
        margin-bottom: 0;
    }

    .contact {
        padding-top: 3.5rem;
        padding-bottom: 2.5rem;
    }

    .contact .section-header {
        margin-bottom: 1.75rem;
    }

    .contact-actions {
        justify-content: center;
    }

    .footer {
        margin-top: 0;
        padding: 1.75rem 0 1.25rem;
    }

    .footer-content {
        gap: 0.9rem;
    }

    .footer-logo {
        gap: 0.4rem;
    }

    .footer-brand {
        font-size: 2rem;
    }

    .footer-tagline {
        font-size: 0.85rem;
    }

    .footer-copyright {
        padding-top: 0.9rem;
    }

    .footer-copyright p {
        font-size: 0.82rem;
    }
}
