:root {
    --bg-base: #000000;
    --card-bg: #0A0A0A;
    --border-color: #1A1A1A;
    --border-hover: #333333;

    --text-main: #FFFFFF;
    --text-muted: #8A8A93;
    --text-dark: #000000;

    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

/* =========================================
   Уникальная Шапка
========================================= */
.header-wrapper {
    position: fixed; top: 1.5rem; left: 0; width: 100%;
    display: flex; justify-content: center; z-index: 100;
    padding: 0 1rem; pointer-events: none;
}
.navbar-pill {
    pointer-events: auto; display: flex; justify-content: space-between; align-items: center;
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 0.6rem 0.6rem 0.6rem 1.5rem; border-radius: 100px; width: 100%; max-width: 800px;
    transition: var(--transition);
}
.navbar-pill.scrolled { border-color: var(--border-hover); transform: scale(0.98); }
.logo { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.5px; color: var(--text-main); }
.logo .text-muted { font-weight: 400; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--text-main); }

/* =========================================
   Кнопки
========================================= */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.9rem 1.8rem; border-radius: 8px; font-size: 0.95rem; font-weight: 500;
    text-decoration: none; transition: var(--transition); cursor: pointer; border: none;
}
.navbar-pill .btn-small { padding: 0.6rem 1.2rem; font-size: 0.85rem; border-radius: 100px; }
.btn-primary { background: var(--text-main); color: var(--text-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #E0E0E0; }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--card-bg); border-color: var(--border-hover); }

.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-main); }

/* =========================================
   ГЛАВНЫЙ ЭКРАН (HERO)
========================================= */
.section { padding: 8rem 2rem 4rem; max-width: 1200px; margin: 0 auto; }
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 8rem; }
.hero-container { width: 100%; max-width: 1000px; display: flex; flex-direction: column; }

.hero-status-pill {
    display: inline-flex; align-items: center; gap: 10px; padding: 0.5rem 1.2rem;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 100px; margin-bottom: 3rem; width: max-content;
    font-size: 0.85rem; font-weight: 500; color: var(--text-main);
}
.status-dot { width: 8px; height: 8px; background-color: var(--text-main); border-radius: 50%; }

/* --- ИСПРАВЛЕННЫЙ ЗАГОЛОВОК --- */
.hero-massive-title {
    /* Слегка уменьшили адаптивный размер шрифта (с 9vw на 7.5vw), чтобы длинные фразы влезали */
    font-size: clamp(3.5rem, 7.5vw, 7.2rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 6rem;

    /* Жестко фиксируем блок от "прыжков" по высоте */
    white-space: nowrap;
    min-height: 2.2em;
}

#typewriter { position: relative; display: inline; }
#typewriter::after { content: '|'; font-weight: 300; color: var(--text-main); animation: blink 1s step-end infinite; margin-left: 4px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-divider { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 2.5rem; border-top: 1px solid var(--border-color); gap: 2rem; }
.hero-desc { font-size: 1.15rem; color: var(--text-muted); line-height: 1.6; max-width: 450px; }
.hero-buttons { display: flex; gap: 1rem; flex-shrink: 0; }

/* =========================================
   ПРЕМИАЛЬНЫЕ КАРТОЧКИ УСЛУГ (BENTO)
========================================= */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.bento-item.span-2 { grid-column: span 2; }
.bento-item.span-3 { grid-column: span 3; }

.solid-card {
    background: var(--card-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color);
    position: relative; overflow: hidden; display: flex; flex-direction: column; transition: all 0.4s ease;
}
.solid-card:hover { border-color: #333; }
.card-content { padding: 3rem; flex-grow: 1; display: flex; flex-direction: column; }

.bento-bg-outline {
    position: absolute; right: -2rem; bottom: -4rem;
    font-size: 18rem; font-weight: 700; line-height: 1;
    -webkit-text-stroke: 2px rgba(255,255,255,0.03);
    color: transparent; pointer-events: none; z-index: 0; user-select: none; letter-spacing: -5px;
}

.bento-micro-header, .bento-micro-tag {
    font-family: monospace; font-size: 0.8rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2rem;
}
.bento-micro-tag { padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 100px; margin-bottom: 0; }
.bento-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3rem; }

.bento-title-large { font-size: 3rem; font-weight: 600; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 2rem; }
.bento-divider { width: 50px; height: 2px; background: var(--border-hover); margin-bottom: 2rem; }
.bento-text { color: #A0A0A5; font-size: 1.15rem; line-height: 1.7; font-weight: 400; max-width: 90%; }
.bento-title { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.5px; margin: 0; }
.mb-3 { margin-bottom: 2.5rem; }

/* Инструменты */
.tech-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.tech-item {
    padding: 1.2rem 1.5rem; background: #111111; border: 1px solid var(--border-color); border-radius: 8px;
    display: flex; justify-content: space-between; align-items: center;
    font-family: monospace; font-size: 0.95rem; color: var(--text-muted); transition: var(--transition); cursor: default;
}
.tech-item .t-arrow { font-size: 1.1rem; opacity: 0; transform: translate(-10px, 10px); transition: var(--transition); }
.tech-item:hover { background: #1A1A1A; border-color: #333333; }
.tech-item:hover .t-name { color: var(--text-main); }
.tech-item:hover .t-arrow { color: var(--text-main); opacity: 1; transform: translate(0, 0); }

/* Прайс-лист */
.premium-price-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 4rem; }
.price-row { display: flex; justify-content: space-between; align-items: flex-end; padding: 1rem 0; cursor: default; }
.p-name { font-size: 1.05rem; font-weight: 500; color: var(--text-muted); transition: color 0.3s; z-index: 2; background: var(--card-bg); padding-right: 10px;}
.p-price { font-family: monospace; font-size: 1.05rem; color: var(--text-main); font-weight: 600; z-index: 2; background: var(--card-bg); padding-left: 10px;}
.p-line { flex-grow: 1; border-bottom: 1px solid var(--border-color); margin-bottom: 0.4rem; transition: border-color 0.3s; }
.price-row:hover .p-name { color: var(--text-main); }
.price-row:hover .p-line { border-bottom-color: #444; }

.flex-col { display: flex; flex-direction: column; }
.h-100 { height: 100%; }
.mt-auto { margin-top: auto; }
.w-max { width: max-content; }

/* =========================================
   Портфолио
========================================= */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.section-title { font-size: 2rem; font-weight: 500; letter-spacing: -1px; }
.link-arrow { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.link-arrow:hover { color: var(--text-main); }

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: stretch; }
.case-card { cursor: pointer; text-decoration: none; transition: transform 0.3s, border-color 0.3s; display: flex; flex-direction: column; height: 100%; }
.case-card:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.case-card .card-content { padding: 1.8rem; }
.case-img-container { width: 100%; height: 240px; background: #050505; border-bottom: 1px solid var(--border-color); position: relative; overflow: hidden; flex-shrink: 0; }
.skeleton-loader { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, #050505 25%, #0f0f0f 50%, #050505 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.case-img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease-in-out; position: relative; z-index: 2; }
.case-img.loaded { opacity: 1; }

.case-text { color: var(--text-main); font-size: 1rem; font-weight: 500; line-height: 1.5; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.case-card.no-image .case-text { -webkit-line-clamp: 10; }
.case-date { color: var(--text-muted); font-size: 0.85rem; margin-top: auto; padding-top: 1.5rem; }

.case-tags { display: flex; gap: 0.5rem; margin-top: 1.2rem; }
.case-card .case-tags {
    flex-wrap: nowrap; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 85%, transparent 100%);
}
.case-card .case-tag { flex-shrink: 0; }

.case-tag { background: transparent; color: var(--text-muted); border: 1px solid var(--border-hover); padding: 0.35rem 0.8rem; border-radius: 100px; font-size: 0.75rem; font-weight: 500; transition: var(--transition); }
.case-card:hover .case-tag { border-color: #555555; color: var(--text-main); }

/* =========================================
   Премиальный Подвал (Footer)
========================================= */
.footer {
    border-top: 1px solid var(--border-color); border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color); border-bottom: none;
    border-radius: 32px 32px 0 0; background-color: transparent;
    padding: 5rem 4rem; margin: 0 auto; width: calc(100% - 2rem); max-width: 1200px;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-bottom: 0; }
.footer-brand { display: flex; flex-direction: column; gap: 1.5rem; }
.footer-massive-title { font-size: clamp(3rem, 5vw, 4.5rem); font-weight: 600; letter-spacing: -2px; line-height: 1.05; }
.footer-brand-desc { color: var(--text-muted); font-size: 1.1rem; max-width: 400px; line-height: 1.6; }
.footer-nav { display: flex; gap: 4rem; justify-content: flex-end; }
.footer-col { display: flex; flex-direction: column; gap: 1rem; }
.footer-col-title { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.footer-link { color: var(--text-main); text-decoration: none; font-size: 1.1rem; font-weight: 500; transition: var(--transition); }
.footer-link:hover { color: var(--text-muted); transform: translateX(4px); }

/* =========================================
   SPLIT-SCREEN Модальное окно (Pop-up)
========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease; padding: 2rem;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.premium-split-modal {
    width: 100%; max-width: 1200px; height: 85vh;
    display: flex; flex-direction: row;
    background: var(--bg-base); border: 1px solid var(--border-hover);
    border-radius: 20px; position: relative;
    transform: translateY(30px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.modal-overlay.active .premium-split-modal { transform: translateY(0) scale(1); }

/* ДИНАМИКА ПРИ ОТСУТСТВИИ КАРТИНКИ */
.premium-split-modal.no-media .modal-left-pane {
    display: none;
}
.premium-split-modal.no-media .modal-right-pane {
    width: 100%;
}

/* Кнопка закрытия */
.modal-close {
    position: absolute; top: 1.5rem; right: 1.5rem; z-index: 30;
    background: #111; color: var(--text-muted); border: 1px solid var(--border-hover);
    width: 44px; height: 44px; border-radius: 8px; font-size: 1.2rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--text-main); color: var(--bg-base); transform: rotate(90deg); }

/* Левая колонка */
.modal-left-pane {
    width: 55%; height: 100%; position: relative;
    border-right: 1px solid var(--border-color);
    background-color: #050505;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.modal-slider { width: 100%; height: 100%; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.slider-track { display: flex; width: 100%; height: 100%; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.slider-track img { width: 100%; height: 100%; object-fit: contain; flex-shrink: 0; padding: 2rem; }

.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    background: #111; color: var(--text-main); border: 1px solid var(--border-hover);
    width: 44px; height: 44px; border-radius: 8px; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.slider-btn:hover { background: var(--text-main); color: var(--bg-base); }
.slider-btn.prev { left: 1.5rem; }
.slider-btn.next { right: 1.5rem; }
.slider-btn.hidden { display: none; }
.slider-dots { position: absolute; bottom: 1.5rem; left: 0; width: 100%; display: flex; justify-content: center; gap: 8px; z-index: 5; }
.slider-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); cursor: pointer; transition: 0.3s; }
.slider-dots .dot.active { background: white; transform: scale(1.3); }

/* Правая колонка */
.modal-right-pane {
    width: 45%; height: 100%;
    display: flex; flex-direction: column;
    background: var(--card-bg);
}

.modal-scrollable {
    overflow-y: auto; flex: 1 1 auto;
    padding: 4rem 3rem 2rem 3rem;
}
.modal-scrollable::-webkit-scrollbar { width: 4px; }
.modal-scrollable::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

/* Дата */
.modal-date-badge {
    display: inline-block;
    font-family: monospace; font-size: 0.85rem; color: var(--text-main);
    margin-bottom: 2.5rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-hover);
    border-radius: 100px;
}

/* Текст кейса (полный) */
.modal-body .case-text {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: 1.1rem;
    color: #E0E0E0;
    line-height: 1.8;
    font-weight: 400;
    white-space: pre-line;
}

/* Теги */
#modal-tags.case-tags {
    flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; overflow: visible;
    margin-top: 3rem; gap: 0.6rem;
}
#modal-tags .case-tag { font-size: 0.8rem; padding: 0.4rem 0.9rem; background: var(--bg-base); }

/* Подвал правой колонки */
.modal-actions {
    display: flex; gap: 1rem; padding: 2rem 3rem;
    background: var(--card-bg);
    border-top: 1px dashed var(--border-hover);
    flex: 0 0 auto;
}
.modal-actions a { flex: 1; text-align: center; }

.reveal { opacity: 0; transform: translateY(15px); transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* =========================================
   Адаптивность (Mobile)
========================================= */
@media (max-width: 900px) {
    .navbar-pill { padding: 0.5rem 0.5rem 0.5rem 1.2rem; }

    /* --- ВОЗВРАЩАЕМ ПЕРЕНОС СТРОК ДЛЯ МОБИЛОК --- */
    .hero-massive-title {
        font-size: 3.5rem;
        margin-bottom: 3rem;
        white-space: normal;
        min-height: auto;
    }

    .hero { padding-top: 8rem; }
    .hero-divider { flex-direction: column; align-items: flex-start; gap: 2rem; }
    .bento-grid { grid-template-columns: 1fr; }
    .bento-item.span-2, .bento-item.span-3 { grid-column: span 1; }

    .bento-item .card-content { padding: 2rem; }
    .premium-price-list { grid-template-columns: 1fr; gap: 1rem; }
    .bento-bg-outline { font-size: 12rem; right: -1rem; bottom: -2rem; }
    .bento-title-large { font-size: 2.5rem; }

    .hidden-mobile { display: none; }

    .footer { padding: 3rem 2rem; margin: 0 1rem 0 1rem; width: auto; border-radius: 24px 24px 0 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 3rem; margin-bottom: 0; }
    .footer-nav { justify-content: flex-start; flex-wrap: wrap; gap: 3rem; }

    .modal-overlay { padding: 1rem; }
    .premium-split-modal { flex-direction: column; height: 90vh; border-radius: 16px; }

    .modal-left-pane { width: 100%; height: 40vh; border-right: none; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
    .slider-track img { padding: 1rem; }

    .modal-right-pane { width: 100%; height: auto; flex: 1; min-height: 0; }
    .modal-scrollable { padding: 2rem 1.5rem 1.5rem 1.5rem; }

    .modal-close { top: 1rem; right: 1rem; width: 40px; height: 40px; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); }

    .modal-actions { padding: 1.5rem; flex-direction: column; gap: 0.8rem; }
    .modal-actions a { width: 100%; }
}