body {
    background-color: #050507;
    color: #e2e8f0;
    overflow-x: clip;
}

/* Отложенный рендеринг секций ниже экрана */
#services, #experience, #portfolio, #code, #certificates, #contacts {
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

/* Lenis Smooth Scroll */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

/* Glassmorphism Карточки */
.glass-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease;
    will-change: backdrop-filter;
}
.glass-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Текстовые градиенты */
.text-glow {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Стилизация Фотографий (Premium Cinematic) */
.cinematic-photo {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 50px -10px rgba(59, 130, 246, 0.2);
}
.cinematic-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}
.cinematic-img {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.02);
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cinematic-photo:hover .cinematic-img {
    transform: scale(1.05);
}
.cinematic-photo:hover::after {
    opacity: 0.3;
}

/* Таймлайн опыта */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, #3b82f6, #8b5cf6, transparent);
    transform: translateX(-50%);
}
.timeline-dot {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1rem;
    height: 1rem;
    background: #050507;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(59,130,246, 0.5);
    z-index: 10;
}

/* Скроллбар */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #050507; }
::-webkit-scrollbar-thumb { background: #3b82f6; border-radius: 4px; }

/* === Проекты — Cinematic Slider === */
.projects-swiper {
    overflow: hidden;
    padding: 40px 0;
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}
.projects-swiper .swiper-slide {
    width: 55%;
    max-width: 700px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.4) saturate(0.3);
    transform: scale(0.82);
    opacity: 0.5;
}
.projects-swiper .swiper-slide-active {
    filter: brightness(1) saturate(1);
    transform: scale(1);
    opacity: 1;
    z-index: 2;
}
.projects-swiper .swiper-slide-prev,
.projects-swiper .swiper-slide-next {
    filter: brightness(0.55) saturate(0.5);
    transform: scale(0.88);
    opacity: 0.7;
}
.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: border-color 0.4s, box-shadow 0.4s;
}
.swiper-slide-active .project-card {
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow:
        0 20px 60px rgba(59, 130, 246, 0.12),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}
.project-img {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover .project-img img {
    transform: scale(1.06);
}
.project-info {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.project-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}
.project-title:hover {
    color: #60a5fa;
}
.project-tech {
    display: inline-block;
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.projects-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
}
.projects-nav-btn:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}
.projects-counter {
    font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
    .projects-swiper .swiper-slide {
        width: 90%;
        transform: none;
        filter: brightness(0.35) saturate(0.2);
        opacity: 0.4;
    }
    .projects-swiper .swiper-slide-active {
        transform: none;
        filter: brightness(1) saturate(1);
        opacity: 1;
    }
    .projects-swiper .swiper-slide-prev,
    .projects-swiper .swiper-slide-next {
        transform: none;
        filter: brightness(0.35) saturate(0.2);
        opacity: 0.4;
    }
    .projects-swiper { padding: 20px 0; }
    .projects-nav-btn { width: 40px; height: 40px; }
}
.swiper-pagination-bullet {
    background: #ffffff;
    opacity: 0.2;
    transition: all 0.3s;
}
.swiper-pagination-bullet-active {
    background: #3b82f6;
    opacity: 1;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(59,130,246,0.8);
}

/* === Code Showcase — IDE === */
.code-showcase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .code-showcase {
        grid-template-columns: 3fr 2fr;
    }
}
.ide-window {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: #0d1117;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ide-titlebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ide-dots { display: flex; gap: 6px; }
.ide-dot { width: 12px; height: 12px; border-radius: 50%; }
.ide-filename { color: #8b949e; font-size: 0.8rem; font-family: 'JetBrains Mono', monospace, 'Courier New'; }
.ide-tabs {
    display: flex;
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
}
.ide-tabs::-webkit-scrollbar { display: none; }
.ide-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #8b949e;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}
.ide-tab:hover { color: #c9d1d9; }
.ide-tab.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background: rgba(88,166,255,0.05);
}
.ide-code {
    padding: 0.75rem;
    overflow-x: auto;
    min-height: 280px;
    display: flex;
    align-items: flex-start;
}
@media (min-width: 640px) {
    .ide-code { padding: 1.25rem; min-height: 380px; }
}
.ide-pre {
    display: none;
    margin: 0;
    font-family: 'JetBrains Mono', monospace, 'Courier New';
    font-size: 0.68rem;
    line-height: 1.7;
    animation: fadeCode 0.4s ease;
}
.ide-pre.active { display: block; }
@media (min-width: 640px) { .ide-pre { font-size: 0.82rem; } }
@keyframes fadeCode { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.ide-lines { white-space: pre; }
.ide-lines .ln { color: #484f58; user-select: none; display: inline-block; width: 2.5em; text-align: right; margin-right: 1.5em; }
.ide-lines .kw { color: #ff7b72; }
.ide-lines .fn { color: #d2a8ff; }
.ide-lines .tp { color: #79c0ff; }
.ide-lines .st { color: #a5d6ff; }
.ide-lines .vr { color: #ffa657; }
.ide-lines .cm { color: #8b949e; font-style: italic; }
.ide-lines .nm { color: #79c0ff; }

/* Info panel */
.ide-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ide-info-panel { display: none; animation: fadeCode 0.4s ease; }
.ide-info-panel.active { display: block; }
.ide-info-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ide-metrics {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ide-metric { display: flex; flex-direction: column; }
.ide-metric-val { font-size: 1.5rem; font-weight: 800; color: #fff; }
.ide-metric-label { font-size: 0.7rem; color: #8b949e; margin-top: 0.2rem; }

/* === Сертификаты === */
.cert-card {
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.cert-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1);
    transform: translateY(-4px);
}

/* === Таймлайн — мобилка === */
@media (max-width: 768px) {
    .timeline-line { left: 24px; transform: none; }
    .timeline-dot { left: 24px; transform: translateX(-50%); }
    .timeline-content-left, .timeline-content-right {
        width: calc(100% - 60px);
        margin-left: 60px;
        padding-right: 0 !important;
        padding-left: 0 !important;
        text-align: left !important;
    }
}

/* === Hero фоновое изображение === */
.hero-section {
    isolation: isolate;
}
.hero-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-section .text-gray-400 {
    color: #fff;
}
.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.75;
    will-change: transform;
}
.hero-bg-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 25%, #050507 70%),
        linear-gradient(to bottom, #050507 0%, transparent 20%),
        linear-gradient(to top, #050507 0%, transparent 25%);
}
@media (max-width: 1024px) {
    .hero-bg-image img {
        object-position: 60% center;
        opacity: 0.15;
    }
}

/* === Бегущая строка (Marquee) === */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
}
.marquee-content {
    display: flex;
    gap: 1rem;
    padding-right: 1rem;
    flex-shrink: 0;
}
.marquee-item {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    white-space: nowrap;
    transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.marquee-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #e2e8f0;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}
.marquee-item.accent-blue {
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.marquee-item.accent-purple {
    border-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

@media (min-width: 640px) {
    .marquee-item { padding: 0.65rem 1.5rem; font-size: 0.95rem; }
}

/* Анимации маркиза */
.marquee-left {
    animation: marquee-scroll-left 30s linear infinite;
    will-change: transform;
}
.marquee-right {
    animation: marquee-scroll-right 28s linear infinite;
    will-change: transform;
}
.marquee-left-slow {
    animation: marquee-scroll-left 40s linear infinite;
    will-change: transform;
}
@keyframes marquee-scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes marquee-scroll-right {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Пауза при наведении */
.marquee-wrapper:hover .marquee-track {
    animation-play-state: paused;
}

/* === Кнопка «Наверх» === */
#scroll-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#scroll-top:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.35);
}
