/* Переменные */
:root {
    --bg-dark-1: #0E0E10;
    --bg-dark-2: #141418;
    --bg-darker: #0a0a0b;
    --text-primary: #ffffff;
    --text-secondary: #8a8a93;
    --text-muted: #55555e;
    --accent: #f18e3a;
    --accent-hover: #e67e22;
    --accent-glow: rgba(241, 142, 58, 0.15);
    --card-bg: rgba(255,255,255,0.03);
    --card-border: rgba(255,255,255,0.06);
    --card-border-hover: rgba(241, 142, 58, 0.5);
    --font-main: 'Inter', sans-serif;
    --section-px: 6%;
    --radius: 12px;
}

/* Сброс */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-darker);
    color: var(--text-primary);
    overflow: hidden;
    height: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

.scroll-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.section {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px var(--section-px) 60px;
}

.section--dark-1 { background-color: var(--bg-dark-1); }
.section--dark-2 { background-color: var(--bg-dark-2); }

/* Шапка */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    z-index: 100;
    padding: 0 var(--section-px);
}

.top-bar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2a2a2e, #1a1a1c);
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #4ade80;
    border-radius: 50%;
    border: 2px solid var(--bg-dark-1);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.profile-info { display: flex; flex-direction: column; }

.profile-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.profile-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 2px;
}

.social-links { display: flex; gap: 18px; }

.social-link {
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
}

.social-link svg { width: 18px; height: 18px; }
.social-link:hover { color: var(--text-primary); transform: translateY(-2px); }

/* Вкладки навигации */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 16px;
    background-color: rgba(26,26,28,0.6);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
}

.tab:hover {
    background-color: #232326;
    color: var(--text-primary);
}

.tab.active {
    background-color: #232326;
    color: var(--text-primary);
    border: 1px solid var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.tab-indicator {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.tab.active .tab-indicator {
    background: linear-gradient(135deg, #f18e3a, #e65c00);
    box-shadow: 0 0 8px rgba(241, 142, 58, 0.6);
}

.tab .tab-indicator.default {
    background-color: #4a4a4f;
}

/* Заголовки секций */
.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 50px;
    color: var(--text-primary);
}

/* Первый экран */
.section--hero {
    background-color: var(--bg-darker);
    overflow: hidden;
    justify-content: flex-start;
}

.hero-photo {
    position: absolute;
    top: 0;
    right: 0;
    width: 65%;
    height: 100%;
    z-index: 1;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 20%;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            rgba(10,10,11, 0.92) 0%,
            rgba(10,10,11, 0.80) 20%,
            rgba(10,10,11, 0.40) 45%,
            rgba(10,10,11, 0.10) 65%,
            transparent          80%
        ),
        linear-gradient(180deg,
            rgba(10,10,11, 0.4) 0%,
            transparent 12%
        );
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 850px;
    padding-top: 60px;
    padding-left: 10%;
}

.hero-title {
    font-size: 4.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
    color: var(--text-primary);
    white-space: nowrap;
    min-height: 1.2em;
}

.hero-title .highlight {
    color: var(--accent);
}

.hero-title .cursor {
    font-weight: 800;
    color: var(--accent);
    animation: blink 1s step-start infinite;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: #b3b3b3;
    line-height: 1.7;
    max-width: 520px;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.8s ease 2.5s forwards;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-top: 36px;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.8s ease 2.8s forwards;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f18e3a, #e65c00);
    color: #fff;
    box-shadow: 0 4px 20px rgba(241, 142, 58, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(241, 142, 58, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.18);
}

.btn-secondary:hover {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

/* Индикатор прокрутки */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 10%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 3.2s forwards;
}

.scroll-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

/* Работы */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.case-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
}

.case-card:hover {
    border-color: var(--card-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px var(--accent-glow);
}

.case-cover {
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.case-cover picture,
.case-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-card:hover .case-cover img {
    transform: scale(1.05);
}

.case-info {
    padding: 24px;
}

.case-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.case-result {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

/* Услуги */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 36px 32px;
    transition: all 0.4s ease;
}

.service-card:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 0 30px var(--accent-glow);
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent);
}

.service-icon svg {
    width: 32px;
    height: 32px;
}

.service-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.service-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Стек */
.stack-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.stack-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stack-tag {
    padding: 8px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.stack-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Контакты */
.cta-block {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 60px;
    backdrop-filter: blur(10px);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cta-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.cta-copy {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--accent);
    color: #000;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 18px 40px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-btn svg {
    width: 24px;
    height: 24px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.cta-secondary-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-decoration: none;
}

.contact-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-link:hover {
    color: var(--accent);
}

/* Появление при прокрутке */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

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

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

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleX(0.8); }
    50%      { opacity: 1;   transform: scaleX(1.2); }
}

/* Галерея на страницах кейсов */
.case-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
}
.gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
}
.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    cursor: zoom-in;
}
.gallery-slide.active {
    opacity: 1;
    z-index: 2;
}
.gallery-slide picture,
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.gallery-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.gallery-btn svg {
    width: 20px;
    height: 20px;
}
.prev-btn {
    left: 10px;
}
.next-btn {
    right: 10px;
}
.gallery-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 10;
}
.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s;
}
.gallery-dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* Полноэкранный просмотр */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(10px);
}
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Средние экраны: горизонтальная навигация сохраняется */
@media (max-width: 1150px) and (min-width: 901px) {
    .hero-title { font-size: 3.4rem; }
    .hero-content { padding-left: var(--section-px); }
    .scroll-indicator { left: var(--section-px); }
    .section-inner { padding: 90px 4% 50px; }
    .cases-grid { gap: 20px; }
    .case-info { padding: 18px; }
    .services-grid { gap: 18px; }
    .service-card { padding: 28px 24px; }
    .section-title { font-size: 2.4rem; margin-bottom: 36px; }
}

/* Мобильные и планшеты: вертикальная прокрутка, отдельная компоновка */
@media (max-width: 900px) {

    /* Шапка: строка профиля + лента вкладок */
    .top-bar {
        height: auto;
        flex-wrap: wrap;
        padding: 0 16px;
        background: rgba(10,10,11,0.9);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .top-bar-left { order: 1; padding: 10px 0; }
    .top-bar-right { order: 2; margin-left: auto; padding: 10px 0; }
    .profile { gap: 10px; }
    .profile-avatar { width: 32px; height: 32px; font-size: 15px; border-radius: 7px; }
    .profile-name { font-size: 13px; }
    .profile-role { font-size: 9px; letter-spacing: 0.8px; }
    .social-link svg { width: 20px; height: 20px; }

    .tabs-container {
        order: 3;
        width: calc(100% + 32px);
        margin: 0 -16px;
        padding: 2px 16px 10px;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs-container::-webkit-scrollbar { display: none; }
    .tab {
        flex-shrink: 0;
        height: 34px;
        padding: 0 16px;
        font-size: 12.5px;
        border-radius: 17px;
        background-color: rgba(255,255,255,0.05);
    }
    .tab-indicator { display: none; }
    .tab.active { box-shadow: none; }

    /* Вертикальная прокрутка вместо слайдера */
    .scroll-wrapper {
        display: block;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: none;
        scroll-padding-top: 100px;
        height: 100vh;
        height: 100dvh;
    }
    .section {
        min-width: 0;
        width: 100%;
        height: auto;
        display: block;
    }
    .section + .section {
        border-top: 1px solid rgba(255,255,255,0.06);
    }
    .section-inner {
        padding: 52px 20px 64px;
    }
    .section-title {
        font-size: 1.9rem;
        margin-bottom: 26px;
    }

    /* Первый экран: без фото, ровный тёмный фон, текст по центру */
    .section--hero {
        min-height: 100vh;
        min-height: 100svh;
        display: flex;
        align-items: center;
        background-color: var(--bg-dark-1);
    }
    .hero-photo { display: none; }
    .hero-overlay { display: none; }
    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 110px 24px 70px;
        text-align: center;
    }
    .hero-title {
        font-size: clamp(2.1rem, 8.8vw, 2.8rem);
        white-space: normal;
        letter-spacing: -0.5px;
        margin-bottom: 14px;
    }
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.65;
        color: #c6c6cc;
        margin-left: auto;
        margin-right: auto;
        max-width: 420px;
    }
    .hero-buttons {
        margin-top: 30px;
        flex-direction: column;
        gap: 12px;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 15px 24px;
        font-size: 15px;
    }
    .scroll-indicator { display: none; }

    /* Работы */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .case-info { padding: 18px 20px; }
    .case-name { font-size: 1.05rem; margin-bottom: 6px; }
    .case-result { font-size: 0.85rem; }

    /* Услуги: иконка слева от текста */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .service-card {
        display: grid;
        grid-template-columns: 44px 1fr;
        column-gap: 16px;
        align-items: center;
        padding: 18px 16px;
    }
    .service-icon {
        grid-row: 1 / 3;
        width: 44px;
        height: 44px;
        margin-bottom: 0;
        background: rgba(241,142,58,0.08);
        border-radius: 11px;
    }
    .service-icon svg { width: 24px; height: 24px; }
    .service-name {
        grid-column: 2;
        font-size: 1.02rem;
        margin-bottom: 4px;
    }
    .service-desc {
        grid-column: 2;
        font-size: 0.88rem;
        line-height: 1.5;
    }

    /* Стек */
    .stack-groups {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .stack-group-title { margin-bottom: 12px; }
    .stack-tag {
        padding: 7px 14px;
        font-size: 0.85rem;
    }

    /* Контакты */
    .cta-block {
        padding: 36px 20px;
        border-radius: 18px;
    }
    .cta-title {
        font-size: 1.7rem;
        margin-bottom: 14px;
    }
    .cta-copy {
        font-size: 0.98rem;
        margin-bottom: 28px;
    }
    .cta-actions { gap: 18px; }
    .cta-btn {
        width: 100%;
        font-size: 1rem;
        padding: 15px 22px;
    }
    .cta-secondary-links { gap: 16px; }
    .contact-link { font-size: 0.88rem; }
    .contact-link svg { width: 18px; height: 18px; }
}

@media (max-width: 380px) {
    .profile-role { display: none; }
    .hero-title { font-size: 1.95rem; }
    .cta-title { font-size: 1.55rem; }
}
