/* Стили для секции философии с красивым кодом */
.typing-demo {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-top: 3rem;
    border: 1px solid var(--accent-frontend);
    position: relative;
    overflow: hidden;
}

.typing-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-frontend), var(--accent-backend));
}

.typing-demo h3 {
    color: var(--accent-frontend);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.philosophy-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.philosophy-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.philosophy-line {
    color: var(--text-primary);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

/* Анимация появления текста философии при скролле */
.typing-demo.in-view .philosophy-line {
    opacity: 1;
    transform: translateY(0);
}

/* Задержки для последовательного появления */
.typing-demo.in-view .philosophy-line:nth-child(1) { transition-delay: 0.1s; }
.typing-demo.in-view .philosophy-line:nth-child(2) { transition-delay: 0.3s; }
.typing-demo.in-view .philosophy-line:nth-child(3) { transition-delay: 0.5s; }
.typing-demo.in-view .philosophy-line:nth-child(4) { transition-delay: 0.7s; }

/* СТИЛИ ДЛЯ КРАСИВОГО КОДА - ВОЗВРАЩАЕМ */
.philosophy-visual {
    background: #1a1f2e;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #2d3748;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.8s ease 0.9s;
}

.typing-demo.in-view .philosophy-visual {
    opacity: 1;
    transform: translateX(0);
}

/* Заголовок окна кода */
.philosophy-visual::before {
    content: 'code.js';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #2d3748;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
    border-bottom: 1px solid #4a5568;
}

.code-animation {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 2.5rem;
    background: transparent;
}

.code-line {
    color: #cbd5e0;
    margin-bottom: 0.3rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.5s ease;
    padding-left: 0.5rem;
    position: relative;
}

/* Подсветка синтаксиса для кода */
.code-line:nth-child(1) { color: #63b3ed; } /* Комментарий - синий */
.code-line:nth-child(2) { color: #fbb6ce; } /* function - розовый */
.code-line:nth-child(3) { color: #90cdf4; } /* return - голубой */
.code-line:nth-child(4) { color: #fbb6ce; } /* } - розовый */
.code-line:nth-child(5) { color: #63b3ed; } /* Комментарий - синий */
.code-line:nth-child(6) { color: #fbb6ce; } /* async function - розовый */
.code-line:nth-child(7) { color: #90cdf4; } /* return - голубой */
.code-line:nth-child(8) { color: #fbb6ce; } /* } - розовый */

/* Выделение ключевых слов */
.code-line:nth-child(2)::before {
    content: 'function';
    color: #fbb6ce;
}

.code-line:nth-child(6)::before {
    content: 'async function';
    color: #fbb6ce;
}

.code-line:nth-child(3)::before,
.code-line:nth-child(7)::before {
    content: 'return';
    color: #90cdf4;
}

/* Анимация появления строк кода */
.typing-demo.in-view .code-line {
    opacity: 1;
    transform: translateX(0);
}

/* Задержки для строк кода с эффектом печати */
.typing-demo.in-view .code-line:nth-child(1) { 
    transition-delay: 1.0s; 
    border-left: 2px solid #63b3ed;
}
.typing-demo.in-view .code-line:nth-child(2) { 
    transition-delay: 1.3s; 
    border-left: 2px solid #fbb6ce;
    padding-left: 1rem;
}
.typing-demo.in-view .code-line:nth-child(3) { 
    transition-delay: 1.6s; 
    border-left: 2px solid #90cdf4;
    padding-left: 2rem;
}
.typing-demo.in-view .code-line:nth-child(4) { 
    transition-delay: 1.9s; 
    border-left: 2px solid #fbb6ce;
    padding-left: 1rem;
}
.typing-demo.in-view .code-line:nth-child(5) { 
    transition-delay: 2.2s; 
    border-left: 2px solid #63b3ed;
}
.typing-demo.in-view .code-line:nth-child(6) { 
    transition-delay: 2.5s; 
    border-left: 2px solid #fbb6ce;
    padding-left: 1rem;
}
.typing-demo.in-view .code-line:nth-child(7) { 
    transition-delay: 2.8s; 
    border-left: 2px solid #90cdf4;
    padding-left: 2rem;
}
.typing-demo.in-view .code-line:nth-child(8) { 
    transition-delay: 3.1s; 
    border-left: 2px solid #fbb6ce;
    padding-left: 1rem;
}

/* Эффект мигающего курсора для кода (опционально) */
.code-line.typing::after {
    content: '|';
    color: var(--accent-frontend);
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Blink animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Адаптивность для философии */
@media (max-width: 968px) {
    .philosophy-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .typing-demo {
        padding: 2rem;
    }
    
    .philosophy-visual {
        order: -1; /* Код первым на мобильных */
    }
}

@media (max-width: 768px) {
    .typing-demo {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .typing-demo h3 {
        font-size: 1.5rem;
    }
    
    .philosophy-visual {
        padding: 1.5rem;
    }
    
    .code-animation {
        font-size: 0.8rem;
        margin-top: 2rem;
    }
    
    .code-line {
        padding-left: 0.25rem;
    }
    
    .typing-demo.in-view .code-line:nth-child(3),
    .typing-demo.in-view .code-line:nth-child(7) {
        padding-left: 1rem;
    }
}

/* Preloader Styles (остается без изменений) */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-content {
    text-align: center;
    transform: translateY(-50px);
}

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

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

.n-letter {
    color: var(--accent-frontend);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 0.5s forwards;
}

.dash {
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 0.7s forwards;
}

.code-text {
    color: var(--accent-backend);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 0.9s forwards;
}

.loading-container {
    width: 300px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1.1s forwards;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-frontend), var(--accent-backend));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: shimmer 2s infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 1px;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Team Name Typing Animation */
.team-name-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.team-name {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-frontend), var(--accent-backend));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

/* Мигающий курсор для названия команды */
.team-name.typing::after {
    content: '|';
    position: absolute;
    right: -15px;
    top: 0;
    background: linear-gradient(135deg, var(--accent-frontend), var(--accent-backend));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: blink 1s infinite;
    font-weight: 300;
}

.team-name.typing-complete::after {
    animation: blink 1s infinite;
}

/* Hero Section Animations */
.hero .team-name {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.team-tagline {
    animation: fadeInUp 1s ease 1.5s both;
}

.dev-card.frontend-dev {
    animation: fadeInLeft 1s ease 2s both;
}

.dev-card.backend-dev {
    animation: fadeInRight 1s ease 2s both;
}

.synergy .pulse-circle {
    animation: pulse 2s ease-in-out 2.5s infinite;
}

.cta-button {
    animation: fadeInUp 1s ease 2.5s both;
}

.scroll-arrow {
    animation: scrollBounce 2s 3s infinite;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Binary Background */
.binary-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: -1;
}

.binary-char {
    position: absolute;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    opacity: 0;
    animation: binaryFall linear infinite;
}

@keyframes binaryFall {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(100vh);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .n-code-logo {
        font-size: 3rem;
    }
    
    .team-name {
        font-size: 2.5rem;
    }
    
    .loading-container {
        width: 250px;
    }
    
    .team-name.typing::after {
        right: -10px;
    }
}

@media (max-width: 480px) {
    .n-code-logo {
        font-size: 2.5rem;
    }
    
    .team-name {
        font-size: 2rem;
    }
    
    .loading-container {
        width: 200px;
    }
}