/* ===== Дизайн-токены ===== */
:root {
    --accent: #15803d;
    --accent-dark: #116631;
    --accent-2: #0d9488;
    --grad: linear-gradient(135deg, #16a34a 0%, #0d9488 100%);

    --text: #0d1117;
    --text-soft: #56606e;

    --bg: #ffffff;
    --bg-soft: #f3f5f7;
    --border: #dfe3e8;

    --grid-line: rgba(13, 17, 23, 0.05);

    --header-bg: rgba(255, 255, 255, 0.86);
    --panel-bg: rgba(255, 255, 255, 0.97);
    --glass: rgba(255, 255, 255, 0.6);

    --maxw: 1080px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 8px rgba(13, 17, 23, 0.05);
    --shadow-md: 0 10px 26px rgba(13, 17, 23, 0.09);
    --shadow-lg: 0 22px 50px rgba(13, 17, 23, 0.13);
    --shadow-accent: 0 10px 26px rgba(21, 128, 61, 0.3);

    /* Шкала отступов (шаг 8px) */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-section: 96px;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* ===== Тёмная тема ===== */
html[data-theme="dark"] {
    --text: #e8ecf4;
    --text-soft: #8b95a8;
    --accent: #4ade80;
    --accent-dark: #22c55e;
    --accent-2: #22d3ee;
    --grad: linear-gradient(135deg, #4ade80 0%, #22d3ee 100%);

    --bg: #0a0c10;
    --bg-soft: #11141b;
    --border: #242a36;

    --grid-line: rgba(255, 255, 255, 0.045);

    --header-bg: rgba(10, 12, 16, 0.82);
    --panel-bg: rgba(17, 20, 27, 0.97);
    --glass: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 10px 26px rgba(74, 222, 128, 0.22);
}

/* В тёмной теме иконки навыков — на светлой плитке, чтобы не сливались */
html[data-theme="dark"] .skill-card img {
    background: #fff;
    border-radius: 12px;
    padding: 7px;
    box-sizing: border-box;
}

/* Тёмная тема: карточки кейсов/отзывов — приподнятые (светлее фона секции) */
html[data-theme="dark"] .case,
html[data-theme="dark"] .review {
    background: #131720;
}

html[data-theme="dark"] .case h3 {
    color: var(--accent);
}

/* ===== Моноширинные цифры — характер технического сайта ===== */
.hero-facts b,
.case-metrics .metric b,
.step-num,
.case-table td:not(:first-child),
.case-topbar .back {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum' 1;
}

.eyebrow,
.case-page .eyebrow {
    font-family: var(--font-mono);
    letter-spacing: 1.4px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* чтобы якоря не прятались под sticky-шапку */
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Техническая сетка на фоне + мягкое свечение акцента сверху */
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    pointer-events: none;
}

body::before {
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 35%, transparent 100%);
}

body::after {
    width: 760px;
    height: 520px;
    top: -220px;
    right: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 128, 61, 0.10), transparent 66%);
}

html[data-theme="dark"] body::after {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.12), transparent 66%);
}

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

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0 0 var(--space-2);
}

img {
    max-width: 100%;
}

/* ===== Шапка ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

/* Полоса прогресса прокрутки */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.08s linear;
    will-change: transform;
}

.bar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: var(--space-2) var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--grad);
    color: #fff;
    border-radius: 10px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--shadow-accent);
}

.logo:hover {
    text-decoration: none;
}

.logo:hover .logo-text {
    color: var(--accent);
}

.logo-text {
    transition: color 0.2s ease;
}

/* ===== Бургер ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ===== Правая часть шапки + переключатель темы ===== */
.bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--glass);
    color: var(--text-soft);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

.nav {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.nav a {
    position: relative;
    color: var(--text-soft);
    font-size: 16px;
    padding-bottom: 4px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.nav a:hover::after,
.nav a.active::after {
    transform: scaleX(1);
}

.nav a.active {
    color: var(--accent);
}

/* ===== Контейнер ===== */
.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 16px;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--grad);
    background-size: 150% 150%;
    color: #fff;
    box-shadow: var(--shadow-accent);
    transition: transform 0.15s ease, box-shadow 0.25s ease, background-position 0.4s ease;
}

.btn-primary:hover {
    background-position: right center;
    box-shadow: var(--shadow-accent);
}

.btn-ghost {
    border: 1.5px solid var(--border);
    color: var(--text);
    background: var(--glass);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Герой ===== */
.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-5);
    padding: var(--space-5) 0 var(--space-5);
}

@media (min-width: 801px) {
    .hero-photo {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        margin-top: var(--space-2);
    }
}

.hero-text {
    flex: 1;
}

.eyebrow {
    color: var(--accent);
    font-weight: 500;
    margin: 0 0 var(--space-1);
}

.hero-name {
    font-size: 56px;
    margin: 0 0 var(--space-2);
    letter-spacing: -1.4px;
    font-weight: 800;
    color: var(--text);
}

/* Анимация появления героя */
.js .hero-text > *,
.js .hero-photo {
    opacity: 0;
    animation: fadeUp 0.7s ease forwards;
}

.js .eyebrow      { animation-delay: 0.05s; }
.js .hero-name    { animation-delay: 0.15s; }
.js .hero-lead    { animation-delay: 0.25s; }
.js .hero-actions { animation-delay: 0.45s; }
.js .hero-photo   { animation: floatIn 0.8s ease forwards; animation-delay: 0.2s; }

.hero-lead {
    font-size: 20px;
    color: var(--text-soft);
    margin: 0 0 var(--space-2);
    max-width: 30em;
}

.hero-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.hero-photo {
    position: relative;
}

.hero-photo::before {
    content: '';
    position: absolute;
    inset: -24px;
    background: radial-gradient(circle, rgba(21, 128, 61, 0.10), transparent 65%);
    z-index: -1;
}

html[data-theme="dark"] .hero-photo::before {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.07), transparent 65%);
}

.hero-photo img {
    width: 320px;
    height: auto;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    display: block;
    box-shadow: var(--shadow-lg);
}

/* ===== Секции ===== */
.section {
    padding: var(--space-5) var(--space-4);
    margin-top: var(--space-5);
    border-radius: var(--radius);
}

.section > h2 {
    font-size: 36px;
    text-align: center;
    margin-bottom: var(--space-4);
    position: relative;
    padding-bottom: var(--space-2);
}

.section > h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    border-radius: 4px;
    background: var(--grad);
}

.subhead {
    text-align: center;
    color: var(--text-soft);
    font-size: 20px;
    margin: var(--space-4) 0 var(--space-2);
}

/* Чередование фона секций */
.about,
.portfolio,
.contacts,
.reviews {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.about {
    text-align: center;
}

.about p {
    max-width: 46em;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* ===== Навыки ===== */
.skill-cards {
    display: grid;
    grid-template-columns: repeat(3, 150px);
    justify-content: center;
    gap: var(--space-3);
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(31, 36, 48, 0.08);
}

.skill-card img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.skill-card span {
    font-weight: 500;
}

.tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.tags li {
    padding: 6px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 16px;
    color: var(--text-soft);
}

/* ===== Услуги ===== */
.services {
    text-align: center;
}

.services-list {
    list-style: none;
    padding: 0;
    margin: var(--space-3) auto 0;
    display: inline-block;
    text-align: left;
}

.services-list li {
    margin: var(--space-1) 0;
}

/* ===== Контакты ===== */
.contacts {
    text-align: center;
}

.social {
    margin-top: var(--space-2);
}

.social img {
    width: 64px;
    transition: transform 0.2s ease;
}

.social a:hover img {
    transform: scale(1.1);
}

/* ===== Футер ===== */
.footer {
    text-align: center;
    color: var(--text-soft);
    font-size: 16px;
    padding: var(--space-4) var(--space-3);
}

/* ===== Кнопка "наверх" ===== */
.buttonup {
    width: 52px;
    height: 52px;
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    border-radius: 50%;
    box-shadow: var(--shadow-accent);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.buttonup img {
    display: none;
}

.buttonup::after {
    content: '';
    width: 11px;
    height: 11px;
    border-left: 2.5px solid #fff;
    border-top: 2.5px solid #fff;
    transform: rotate(45deg);
    margin-top: 3px;
}

.buttonup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.buttonup.show:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-accent);
}

/* ===== Появление при прокрутке ===== */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}

.js [data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Адаптив ===== */
@media screen and (max-width: 800px) {
    body {
        font-size: 16px;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: var(--space-5);
        gap: var(--space-4);
    }

    .hero-lead {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-name {
        font-size: 38px;
    }

    .section {
        padding: var(--space-4) var(--space-3);
    }

    .nav {
        gap: var(--space-2);
    }
}

/* ===== Уважаем "уменьшить движение" ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn:hover,
    .skill-card:hover,
    .service-card:hover,
    .case-gallery .shot:hover img,
    .social a:hover img,
    .buttonup {
        transform: none;
        transition: none;
    }
}

/* ===== Преимущества ===== */

/* ===== Услуги: карточки ===== */

/* ===== Оффер: Яндекс.Директ ===== */

/* ===== Портфолио: сетка кейсов ===== */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-3);
}

.case {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    margin: 0;
    text-align: left;
}

.case h3 {
    color: var(--accent-dark);
}

.case-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.case-gallery .shot {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 10;
    cursor: zoom-in;
}

.case-gallery .shot picture {
    display: block;
    width: 100%;
    height: 100%;
}

.case-gallery .shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
    transition: transform 0.4s ease;
}

.hero-photo picture {
    display: block;
}

.case-gallery .shot:hover img {
    transform: scale(1.12);
}

/* ===== Лайтбокс ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 18, 25, 0.92);
    display: flex;
    flex-direction: column;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-body {
    flex: 1;
    overflow: auto;
    padding: var(--space-5) var(--space-3);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.lightbox-body img {
    max-width: 1200px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.case-meta {
    font-size: 15px;
    color: var(--text-soft);
    font-style: italic;
    margin-top: var(--space-1);
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-2);
}

.case-tags span {
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.portfolio .note {
    text-align: center;
    color: var(--text-soft);
    margin-top: var(--space-3);
}

/* ===== Отзывы ===== */
.reviews {
    background: var(--bg-soft);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-3);
}

.review {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-3);
    margin: 0;
    text-align: left;
}

.review .stars {
    color: #f5b301;
    font-size: 18px;
    letter-spacing: 3px;
    margin-bottom: var(--space-2);
}

.review p {
    margin: 0 0 var(--space-2);
    font-style: italic;
}

.review footer {
    color: var(--text-soft);
    font-size: 15px;
}

/* ===== Контакты: handle ===== */
.contacts-handle {
    margin-top: var(--space-2);
    font-weight: 500;
}

/* ===== Этапы работы ===== */
.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4) var(--space-3);
}

.step {
    counter-increment: step;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-1);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-2) var(--space-3);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Номер шага */
.step::before {
    content: counter(step);
    position: absolute;
    top: 10px;
    left: 12px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 999px;
}

/* Стрелки между карточками */
.step::after {
    content: '';
    position: absolute;
    width: 11px;
    height: 11px;
    border-top: 2.5px solid var(--accent);
    border-right: 2.5px solid var(--accent);
    opacity: 0.85;
}

/* Ряд 1 (1→2→3): стрелка вправо */
.step:nth-child(1)::after,
.step:nth-child(2)::after,
.step:nth-child(3)::after {
    right: -16px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

/* Шаг 4 «Согласовываем детали» → стрелка вниз к шагу 5 */
.step:nth-child(4)::after {
    left: 50%;
    bottom: -26px;
    transform: translateX(-50%) rotate(135deg);
}

/* Ряд 2 (5→6→7, справа налево): стрелка влево */
.step:nth-child(5)::after,
.step:nth-child(6)::after,
.step:nth-child(7)::after {
    left: -16px;
    top: 50%;
    transform: translateY(-50%) rotate(225deg);
}

/* Второй ряд выкладываем справа налево */
.step:nth-child(5) { grid-column: 4; grid-row: 2; }
.step:nth-child(6) { grid-column: 3; grid-row: 2; }
.step:nth-child(7) { grid-column: 2; grid-row: 2; }
.step:nth-child(8) { grid-column: 1; grid-row: 2; }

/* У последнего шага стрелки нет */
.step:nth-child(8)::after {
    content: none;
}

/* Планшет: 2 в ряд, стрелки вправо в парах */
@media (max-width: 900px) {
    .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .step:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    .step:nth-child(n)::after {
        content: '';
        right: -16px;
        left: auto;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%) rotate(45deg);
    }

    .step:nth-child(2n)::after {
        content: none;
    }
}

/* Мобильный: 1 в ряд, стрелки вниз */
@media (max-width: 560px) {
    .steps {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .step:nth-child(n)::after {
        content: '';
        right: auto;
        left: 50%;
        top: auto;
        bottom: -27px;
        transform: translateX(-50%) rotate(135deg);
    }

    .step:last-child::after {
        content: none;
    }

    /* Карточки навыков — сетка 3 в ряд, компактнее */
    .skill-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2);
        max-width: 380px;
        margin-left: auto;
        margin-right: auto;
    }

    .skill-card {
        padding: var(--space-2) var(--space-1);
        gap: 4px;
    }

    .skill-card img {
        width: 42px;
        height: 42px;
    }

    .skill-card span {
        font-size: 13px;
    }
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-num {
    flex: none;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

/* та же техническая сетка, что на плашках героя, — единый стиль */
.step-num::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.5;
}

.step-num svg {
    width: 26px;
    height: 26px;
    display: block;
    position: relative;
    z-index: 1;
    stroke-width: 1.7;
}

.step-body h4 {
    margin: 0 0 4px;
    font-size: 17px;
}

.step-body p {
    margin: 0;
    font-size: 15px;
    color: var(--text-soft);
}

/* Ступенчатое появление шагов */
.js .process .step {
    opacity: 0;
}

.process.visible .step {
    animation: floatIn 0.5s ease forwards;
}

.process.visible .step:nth-child(1) { animation-delay: 0.05s; }
.process.visible .step:nth-child(2) { animation-delay: 0.10s; }
.process.visible .step:nth-child(3) { animation-delay: 0.15s; }
.process.visible .step:nth-child(4) { animation-delay: 0.20s; }
.process.visible .step:nth-child(5) { animation-delay: 0.25s; }
.process.visible .step:nth-child(6) { animation-delay: 0.30s; }
.process.visible .step:nth-child(7) { animation-delay: 0.35s; }
.process.visible .step:nth-child(8) { animation-delay: 0.40s; }

/* ===== Полировка карточек и теней ===== */

.skill-card {
    box-shadow: var(--shadow-sm);
}

.skill-card:hover {
    box-shadow: var(--shadow-md);
}

.case {
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.review {
    box-shadow: var(--shadow-sm);
}

.tags li {
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tags li:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Адаптив для новых блоков ===== */

/* ===== Мобильная версия: полировка UX ===== */
@media screen and (max-width: 800px) {
    .bar {
        padding: var(--space-2) var(--space-3);
    }

    .logo {
        font-size: 16px;
    }

    .nav-toggle {
        display: flex;
    }

    /* Меню — выпадающая панель из-под шапки */
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        width: auto;
        padding: var(--space-1) var(--space-3) var(--space-2);
        background: var(--panel-bg);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .nav.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav a {
        font-size: 17px;
        padding: var(--space-2) 0;
        border-bottom: 1px solid var(--border);
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .nav a::after {
        display: none;
    }

    .section > h2 {
        font-size: 28px;
    }

    .hero-name {
        font-size: 40px;
    }

    .hero-photo {
        align-self: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-photo img {
        width: 260px;
    }

    .step {
        padding: var(--space-2) var(--space-3);
    }

    .buttonup {
        width: 46px;
        height: 46px;
        bottom: 20px;
        right: 20px;
    }

    /* Уменьшаем фоновые пятна, чтобы не перегружать мобильный фон */
    body::before {
        width: 320px;
        height: 320px;
    }

    body::after {
        width: 300px;
        height: 300px;
    }
}

@media screen and (max-width: 420px) {
    .section {
        padding: var(--space-4) var(--space-2);
    }

    .hero-name {
        font-size: 34px;
    }

    .hero-lead {
        font-size: 18px;
    }
}

/* Отключаем тяжёлые анимации при "уменьшить движение" */
@media (prefers-reduced-motion: reduce) {
    .js .hero-text > *,
    .js .hero-photo,
    .js .process .step {
        opacity: 1;
        animation: none;
    }

    .step:hover,
    .case:hover,
    .adv-card:hover,
    .buttonup.show:hover {
        transform: none;
    }
}

/* ===== Кейсы: построчная раскладка с чередованием сторон ===== */
.case-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.case {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-4);
    align-content: start;
    padding: var(--space-4);
}

/* текст — во второй колонке, картинки — в первой на всю высоту */
.case > * {
    grid-column: 2;
}

.case .case-gallery {
    grid-column: 1;
    grid-row: 1 / span 99;
    align-self: start;
    margin-bottom: 0;
}

/* чётные кейсы — картинки справа, текст слева */
.case:nth-child(even) > * {
    grid-column: 1;
}

.case:nth-child(even) .case-gallery {
    grid-column: 2;
}

/* кейсы без картинок — текст во всю ширину карточки */
.case:not(:has(.case-gallery)) > * {
    grid-column: 1 / -1;
}

.case:not(:has(.case-gallery)) p {
    max-width: 80ch;
}

.case p {
    max-width: 62ch;
}

.case h3 {
    margin-top: 0;
}

@media (max-width: 900px) {
    .case,
    .case:nth-child(even) {
        grid-template-columns: 1fr;
        padding: var(--space-3);
    }

    .case > *,
    .case:nth-child(even) > * {
        grid-column: 1;
    }

    .case .case-gallery,
    .case:nth-child(even) .case-gallery {
        grid-column: 1;
        grid-row: auto;
        margin-bottom: var(--space-2);
    }
}

/* ===== Метрики кейса (цифры результата) ===== */
.case-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0 20px;
    max-width: 62ch;
}

@media (max-width: 560px) {
    .case-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .case-metrics .metric:nth-child(3):last-child {
        grid-column: 1 / -1;
    }
}

.case-metrics .metric {
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.case-metrics .metric b {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: var(--accent);
}

.case-metrics .metric span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--text-soft);
}

/* ===== Ссылки на страницы кейсов ===== */
.case-title-link {
    color: inherit;
    text-decoration: none;
}

.case-title-link:hover {
    text-decoration: underline;
}

.case-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: var(--space-2);
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.case-link span {
    transition: transform 0.2s ease;
}

.case-link:hover {
    text-decoration: underline;
}

.case-link:hover span {
    transform: translateX(4px);
}

/* ===== Цифры в первом экране ===== */
.hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2) var(--space-4);
    list-style: none;
    margin: var(--space-3) 0;
    padding: 18px 22px;
    max-width: 680px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.hero-facts li {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hero-facts b {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: var(--accent);
    white-space: nowrap;
}

.hero-facts span {
    display: block;
    margin-top: 6px;
    font-size: 15.5px;
    line-height: 1.4;
    color: var(--text-soft);
}

/* ===== Кнопка «все работы» под портфолио ===== */
.portfolio-more {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
}

/* ===== Контакты: форма + прямые каналы ===== */
.contacts-lead {
    max-width: 62ch;
}

/* ===== Липкая кнопка на мобильных ===== */
.sticky-cta {
    display: none;
}

@media (max-width: 900px) {

    .sticky-cta {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        display: flex;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: var(--panel-bg);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border);
    }

    .sticky-cta[hidden] {
        display: none;
    }

    .sticky-cta .btn {
        flex: 1;
        text-align: center;
    }

    .sticky-tg {
        flex: none;
        width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--bg);
    }

    .sticky-tg img {
        width: 24px;
        height: 24px;
    }

    /* чтобы липкая панель не перекрывала подвал */
    .footer {
        padding-bottom: 84px;
    }
}

@media (max-width: 600px) {
    .hero-facts {
        gap: var(--space-1) var(--space-2);
    }

    .hero-facts b {
        font-size: 21px;
    }

    .hero-facts span {
        font-size: 13.5px;
    }
}

/* ===== Призыв к действию между секциями ===== */
.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin: var(--space-5) 0;
    padding: var(--space-4);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.cta-band h2 {
    font-size: 26px;
    margin-bottom: 8px;
}

.cta-band p {
    margin: 0;
    max-width: 54ch;
    color: var(--text-soft);
    font-size: 16px;
}

.cta-band-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .cta-band {
        padding: var(--space-3);
    }

    .cta-band h2 {
        font-size: 22px;
    }

    .cta-band-actions .btn {
        flex: 1;
        text-align: center;
    }
}

/* ===== Кнопка в контактах ===== */
.contacts-actions {
    display: flex;
    justify-content: center;
    margin: var(--space-3) 0 var(--space-2);
}

/* ===== Два направления в герое ===== */
.hero-lead {
    color: var(--text-soft);
    margin-bottom: var(--space-2);
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.hero-col {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    display: flex;
    flex-direction: column;
}

.hero-col h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin: 0 0 6px;
    color: var(--accent);
}

.hero-col p {
    margin: 0;
    font-size: 16.5px;
    line-height: 1.5;
    color: var(--text-soft);
}

@media (max-width: 620px) {
    .hero-split {
        grid-template-columns: 1fr;
    }
}

/* ===== Иллюстрация в блоке направления ===== */
.hero-col-art {
    height: 74px;
    margin: -2px 0 14px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero-col-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.55;
}

.hero-col-art svg {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1;
}

.art-dev {
    background: linear-gradient(135deg, #15803d, #0f766e);
}

.art-ads {
    background: linear-gradient(135deg, #0f766e, #115e8b);
}

html[data-theme="dark"] .art-dev {
    background: linear-gradient(135deg, #166534, #0f5f57);
}

html[data-theme="dark"] .art-ads {
    background: linear-gradient(135deg, #0f5f57, #10496b);
}

/* теги внутри блока */
.hero-col-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.hero-col-tags span {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--bg);
}

/* строка со сроком */
.hero-col-meta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 15.5px;
    color: var(--text-soft);
}

.hero-col-meta b {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 15.5px;
}

/* три факта в ряд */
.hero-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 640px;
}

@media (max-width: 700px) {
    .hero-facts {
        grid-template-columns: 1fr 1fr;
    }

    .hero-facts li:nth-child(3):last-child {
        grid-column: 1 / -1;
    }
}

/* Подпись под фото в герое */
.hero-photo-caption {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-soft);
    text-align: center;
}

.hero-photo-caption b {
    display: block;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 2px;
}

/* Заголовок героя — теперь это оффер, а не имя */
.hero-name {
    font-size: clamp(32px, 4.4vw, 46px);
    max-width: 16ch;
}

/* ===== Логотипы рекламных сервисов в навыках ===== */
.skill-logo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 800;
    font-size: 24px;
    color: #fff;
}

.skill-logo svg {
    width: 28px;
    height: 28px;
}

.logo-direct {
    background: #fc0;
    color: #d31e25;
}

.logo-metrika {
    background: #d31e25;
}

.logo-vk {
    background: #07f;
    font-size: 19px;
    letter-spacing: -0.5px;
}

.logo-call {
    background: var(--grad);
}

/* ===== Мини-диалог в герое: типичный проект ===== */
.hero-chat {
    width: 320px;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

html[data-theme="dark"] .hero-chat {
    background: var(--bg-soft);
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-soft);
}

.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
    animation: chatPulse 1.8s infinite;
}

@keyframes chatPulse {
    50% { box-shadow: 0 0 0 6px rgba(21, 128, 61, 0.05); }
}

.chat-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 13px 15px;
    height: 448px;
    overflow: hidden;
}

.chat-msg {
    max-width: 86%;
    padding: 8px 12px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(10px);
    animation: msgIn 0.4s ease forwards;
}

@keyframes msgIn {
    to { opacity: 1; transform: none; }
}

.chat-msg.cl {
    align-self: flex-start;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

html[data-theme="dark"] .chat-msg.cl {
    background: var(--bg);
}

.chat-msg.me {
    align-self: flex-end;
    background: var(--grad);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* в тёмной теме градиент светлый — текст делаем тёмным для контраста */
html[data-theme="dark"] .chat-msg.me {
    color: #06210f;
}

html[data-theme="dark"] .chat-msg.me b {
    color: #06210f;
}

.chat-msg b {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* индикатор «печатает…» */
.chat-typing {
    align-self: flex-end;
    display: inline-flex;
    gap: 4px;
    padding: 10px 13px;
    border-radius: 13px;
    border-bottom-right-radius: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

.chat-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-soft);
    animation: typDot 1s infinite;
}

.chat-typing i:nth-child(2) { animation-delay: 0.16s; }
.chat-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes typDot {
    30% { transform: translateY(-4px); opacity: 0.55; }
}

@media (max-width: 800px) {
    .hero-chat { display: none; }
}

/* цифры в плитках не переносятся на новую строку */
.case-metrics .metric b,
.hero-facts b {
    white-space: nowrap;
}

/* ===== Услуги: ситуации клиентов ===== */
.svc-sub {
    color: var(--text-soft);
    margin: -6px 0 var(--space-3);
    font-size: 18px;
}

.task-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-4);
    text-align: left;
}

.task {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.task .task-ico {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-accent);
}

.task .task-ico svg {
    width: 23px;
    height: 23px;
}

.task-body {
    min-width: 0;
}

.task-body b {
    display: block;
    font-size: 19px;
    margin-bottom: 4px;
}

.task-body span {
    display: block;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-soft);
}

.svc-cta {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
}

@media (max-width: 800px) {
    .task-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== Как я работаю: вертикальный таймлайн ===== */
.timeline {
    list-style: none;
    margin: var(--space-4) auto 0;
    padding: 0;
    max-width: 820px;
    text-align: left;
    position: relative;
}

.tl-step {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
}

/* линия между маркерами */
.tl-step::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.tl-step:last-child::before {
    display: none;
}

.tl-step:last-child {
    padding-bottom: 0;
}

.tl-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-accent);
    position: relative;
    z-index: 1;
}

.tl-num {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 17px;
}

.tl-card {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.tl-ico {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-ico svg {
    width: 23px;
    height: 23px;
}

.tl-body {
    min-width: 0;
}

.tl-body h4 {
    margin: 0 0 6px;
    font-size: 19px;
    letter-spacing: -0.2px;
}

.tl-body p {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-soft);
}

.tl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 15px;
}

.tl-meta em {
    font-style: normal;
    font-weight: 700;
    color: var(--accent);
    margin-right: 6px;
}

@media (max-width: 600px) {
    .tl-step {
        grid-template-columns: 36px 1fr;
        gap: var(--space-2);
    }

    .tl-step::before {
        left: 17px;
        top: 36px;
    }

    .tl-marker {
        width: 36px;
        height: 36px;
    }

    .tl-num {
        font-size: 15px;
    }

    .tl-card {
        padding: var(--space-2);
    }

    .tl-ico {
        display: none;
    }
}
