/* Общие правки секций для EN, UK и RU. Подключается после файла темы,
   цвета берутся из её переменных (--accent-1, --line, --graphite…). */

/* ---------- «Почему со мной удобно работать»: таймлайн без карточек ----------
   Пять пунктов: номера стоят на одной линии, под ними — заголовок и текст
   прямо на фоне, колонки разделены тонкими вертикальными линиями. Иконки скрыты. */
.why-layout { grid-template-columns: minmax(0, 1fr); }

/* линия уходит за края контента — обрезаем её по краю экрана */
#why { overflow-x: clip; }

.why-main h2 {
    margin-bottom: 56px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.12;
    text-align: center;
}

.why-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    --why-gap: 0px;
    --why-dot: 60px;
    --why-dot-left: 20px;
    position: relative;
    gap: 0;
}

/* общая линия через все номера — от края до края экрана */
.why-steps::before {
    content: "";
    position: absolute;
    top: calc(var(--why-dot) / 2 - 1px);
    left: calc(50% - 50vw);
    right: calc(50% - 50vw);
    height: 2px;
    background: var(--why-badge-line, var(--accent-1));
}

.why-steps .why-step:not(:last-child) .why-badge::after { display: none; }

.why-steps .why-badge {
    justify-content: flex-start;
    margin-bottom: 32px;
    padding-left: var(--why-dot-left);
}

.why-steps .why-badge span {
    width: var(--why-dot);
    height: var(--why-dot);
}

.why-steps .why-card,
.why-steps .why-card:hover {
    padding: 4px 22px 6px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
}

.why-steps .why-step:first-child .why-card { border-left-color: transparent; }

.why-steps .why-card svg { display: none; }

.why-steps .why-card h3 {
    margin-bottom: 14px;
    font-size: 17px;
}

.why-steps .why-card p {
    font-size: 14.5px;
    line-height: 1.6;
}

@media (max-width: 1040px) {
    .why-steps {
        --why-dot: 52px;
        --why-dot-left: 14px;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .why-steps .why-card,
    .why-steps .why-card:hover { padding: 4px 14px 6px; }

    .why-steps .why-card h3 { font-size: 15px; }

    .why-steps .why-card p { font-size: 13px; }
}

/* телефон: пункты идут сверху вниз змейкой — стартовый кружок, заголовки
   в рамках, линии со стрелками попеременно справа и слева */
@media (max-width: 720px) {
    .why-steps {
        --why-box-h: 56px;
        --why-box-half-w: min(32%, 115px);
        --why-line: 1.5px solid var(--accent-1);
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
        padding-top: 72px;
    }

    /* стартовый кружок */
    .why-steps::before {
        top: 0;
        left: 8px;
        right: auto;
        width: 56px;
        height: 56px;
        border: 2px solid var(--accent-1);
        border-radius: 50%;
        background: radial-gradient(circle, var(--accent-1) 0 17px, transparent 18px);
    }

    /* от кружка вниз и вправо — в первый заголовок */
    .why-steps::after {
        content: "";
        position: absolute;
        top: 56px;
        left: 36px;
        width: calc(50% - var(--why-box-half-w) - 36px);
        height: calc(16px + var(--why-box-h) / 2);
        border-left: var(--why-line);
        border-bottom: var(--why-line);
        border-bottom-left-radius: 10px;
    }

    .why-steps .why-badge { display: none; }

    .why-steps .why-step {
        position: relative;
        padding: 0 0 30px;
    }

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

    .why-steps .why-card,
    .why-steps .why-card:hover,
    .why-steps .why-step:nth-child(odd) .why-card {
        padding: 0;
        border: 0;
    }

    .why-steps .why-card h3 {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: calc(var(--why-box-half-w) * 2);
        height: var(--why-box-h);
        margin: 0 auto 16px;
        padding: 0 12px;
        border: var(--why-line);
        border-radius: 8px;
        font-size: 14px;
        line-height: 1.2;
        text-align: center;
    }

    /* стрелка на входе в заголовок: у 1, 3, 5 — слева, у 2, 4 — справа */
    .why-steps .why-card h3::before {
        content: "";
        position: absolute;
        top: 50%;
        width: 0;
        height: 0;
        margin-top: -5px;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
    }

    .why-steps .why-step:nth-child(odd) .why-card h3::before {
        left: -8px;
        border-left: 7px solid var(--accent-1);
    }

    .why-steps .why-step:nth-child(even) .why-card h3::before {
        right: -8px;
        border-right: 7px solid var(--accent-1);
    }

    /* точка на выходе из заголовка */
    .why-steps .why-step:not(:last-child) .why-card h3::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 7px;
        height: 7px;
        margin-top: -3.5px;
        border-radius: 50%;
        background: var(--accent-1);
    }

    .why-steps .why-step:nth-child(odd) .why-card h3::after { right: -4px; }

    .why-steps .why-step:nth-child(even) .why-card h3::after { left: -4px; }

    /* линия к следующему заголовку: от центра этой рамки до центра следующей */
    .why-steps .why-step:not(:last-child)::after {
        content: "";
        position: absolute;
        top: calc(var(--why-box-h) / 2);
        bottom: calc(var(--why-box-h) / -2);
        width: calc(50% - var(--why-box-half-w) - 8px);
        border: var(--why-line);
    }

    .why-steps .why-step:nth-child(odd):not(:last-child)::after {
        right: 8px;
        border-left: 0;
        border-radius: 0 12px 12px 0;
    }

    .why-steps .why-step:nth-child(even):not(:last-child)::after {
        left: 8px;
        border-right: 0;
        border-radius: 12px 0 0 12px;
    }

    .why-steps .why-card p {
        max-width: calc(100% - 44px);
        margin: 0 auto;
        font-size: 14px;
        line-height: 1.6;
        text-align: center;
    }

    .why-main h2 { margin-bottom: 36px; }
}

/* ---------- Телефон: блоки в сетке, как на компьютере ---------- */

/* «Что вы получите»: две колонки, последняя карточка на всю ширину */
@media (max-width: 640px) {
    .benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .benefit-card { padding: 18px 16px; }

    .benefit-card .title {
        align-items: flex-start;
        gap: 8px;
        font-size: 15px;
        line-height: 1.25;
    }

    .benefit-card .title .emoji {
        font-size: 18px;
        line-height: 1.1;
    }

    .benefit-card p {
        font-size: 13px;
        line-height: 1.5;
    }
}

/* «Что будем создавать?»: цена справа от названия, как на компьютере */
@media (max-width: 720px) {
    .service-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 22px 4px;
    }

    .service-num { font-size: 18px; }

    .service-price {
        grid-column: auto;
        margin-top: 0;
        font-size: 15px;
        text-align: right;
    }

    .service-price.is-custom {
        max-width: 84px;
        font-size: 12px;
    }
}

/* «Как со мной связаться»: четыре кнопки в один ряд */
@media (max-width: 560px) {
    .contacts-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .contact-link {
        padding-left: 4px;
        padding-right: 4px;
        font-size: 12px;
    }
}

/* ---------- «Нашли подходящую услугу?» + контакты одним блоком ---------- */
.cta-block { padding: 84px 24px; }

.cta-block > h2 {
    margin-bottom: 18px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.12;
}

.cta-block > p {
    max-width: 520px;
    margin-top: 0;
    font-size: clamp(17px, 1.8vw, 21px);
    line-height: 1.5;
}

.cta-divider {
    display: block;
    width: 96px;
    height: 1px;
    margin: 40px auto;
    background: var(--line-2, var(--line));
}

.cta-contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    scroll-margin-top: 24px;
}

.cta-contacts__title {
    margin-bottom: 30px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.2;
}

.cta-contacts__title .accent {
    background: none;
    color: inherit;
    font-weight: inherit;
    -webkit-text-stroke: 0;
}

.cta-contacts .contact-link {
    gap: 14px;
    padding: 30px 12px;
    border-radius: 16px;
    font-size: 15px;
}

@media (max-width: 560px) {
    .cta-block { padding: 64px 16px; }

    .cta-divider { margin: 32px auto; }

    .cta-contacts__title { margin-bottom: 22px; }

    .cta-contacts .contact-link {
        gap: 10px;
        padding: 20px 4px;
        border-radius: 14px;
        font-size: 12px;
    }
}

/* ---------- «Мои работы»: скриншот на всю карточку, текст поверх ----------
   Метка типа сверху, снизу описание, название и «Открыть сайт» с круглой
   стрелкой. Сначала видны три работы, остальные открываются кнопкой. */
.works-grid.is-collapsed .work-card--more { display: none; }

.work-card {
    aspect-ratio: 5 / 4;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: #0b0b0e;
}

.work-card:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 1px var(--accent-1), 0 18px 40px rgba(0, 0, 0, 0.55);
}

.work-shot {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    border-bottom: 0;
}

/* затемнение снизу, чтобы текст читался на любом скриншоте */
.work-shot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(8, 8, 10, 0) 22%,
        rgba(8, 8, 10, 0.78) 52%,
        rgba(8, 8, 10, 0.96) 100%);
    pointer-events: none;
}

.work-meta {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 14px;
    padding: 20px 20px 18px;
    color: #f4f4f2;
}

.work-meta p {
    grid-column: 1 / -1;
    order: 1;
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(244, 244, 242, 0.86);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.work-meta h3 {
    order: 2;
    margin: 0;
    font-size: clamp(18px, 1.35vw, 21px);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    color: #fff;
}

.work-open-hint {
    order: 3;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 13px;
    white-space: nowrap;
}

.work-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--accent-1);
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.work-card:hover .work-arrow {
    background: var(--accent-1);
    color: #0b0b0e;
}

.work-open:focus-visible { border-radius: 14px; }

.works-more-btn {
    display: block;
    width: min(100%, 360px);
    margin: 36px auto 0;
    padding: 16px 24px;
    border: 0;
    border-radius: 4px;
    background: var(--accent-1);
    color: #0b0b0e;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.25s ease;
}

.works-more-btn[hidden] { display: none; }

.works-more-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.works-more-btn:focus-visible {
    outline: 3px solid var(--accent-1);
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .works-grid { gap: 16px; }

    .work-card {
        flex-basis: 100%;
        aspect-ratio: 5 / 4;
        border-radius: 12px;
    }

    .work-meta { padding: 16px 16px 14px; }

    .work-meta h3 { font-size: 18px; }

    .works-more-btn { width: 100%; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .work-arrow, .works-more-btn { transition: none; }
    .works-more-btn:hover { transform: none; }
}

/* ---------- «Как проходит работа» на компьютере: дорожка змейкой ----------
   Старт, заголовки шагов в рамках, линии со стрелками: первый ряд слева
   направо (1 → 2 → 3), справа поворот вниз, второй ряд справа налево
   (4 → 5 → 6). На телефоне остаётся прежний вертикальный список. */
@media (min-width: 721px) {
    #process h2 {
        margin-bottom: 64px;
        font-size: clamp(32px, 5vw, 56px);
        line-height: 1.12;
    }

    .process-list {
        --box-h: 68px;
        --box-in: 18px;
        --pad-l: 110px;
        --pad-r: 64px;
        --gap-y: 64px;
        --dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4'/%3E%3C/svg%3E");
        --arrow-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12'%3E%3Cpath d='M0 0L10 6L0 12z'/%3E%3C/svg%3E");
        --arrow-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12'%3E%3Cpath d='M10 0L0 6L10 12z'/%3E%3C/svg%3E");
        --line: linear-gradient(#000, #000);
        position: relative;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: var(--gap-y);
        max-width: 1180px;
        padding: 0 var(--pad-r) 0 var(--pad-l);
    }

    /* стартовый кружок */
    .process-list::before {
        content: "";
        position: absolute;
        top: calc(var(--box-h) / 2 - 28px);
        left: 0;
        width: 56px;
        height: 56px;
        border: 2px solid var(--accent-1);
        border-radius: 50%;
        background: radial-gradient(circle, var(--accent-1) 0 17px, transparent 18px);
    }

    /* общий вид линии со стрелкой */
    .process-list::after,
    .process-step::after {
        content: "";
        position: absolute;
        top: calc(var(--box-h) / 2 - 6px);
        height: 12px;
        background: var(--accent-1);
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
    }

    /* линии слева направо: точка на выходе, стрелка на входе */
    .process-list::after,
    .process-step:nth-child(1)::after,
    .process-step:nth-child(2)::after {
        -webkit-mask-image: var(--dot), var(--arrow-r), var(--line);
        mask-image: var(--dot), var(--arrow-r), var(--line);
        -webkit-mask-position: left center, right center, center;
        mask-position: left center, right center, center;
        -webkit-mask-size: 8px 8px, 10px 12px, calc(100% - 12px) 2px;
        mask-size: 8px 8px, 10px 12px, calc(100% - 12px) 2px;
    }

    /* линии справа налево */
    .process-step:nth-child(4)::after,
    .process-step:nth-child(5)::after,
    .process-step:nth-child(6)::after {
        -webkit-mask-image: var(--arrow-l), var(--dot), var(--line);
        mask-image: var(--arrow-l), var(--dot), var(--line);
        -webkit-mask-position: left center, right center, center;
        mask-position: left center, right center, center;
        -webkit-mask-size: 10px 12px, 8px 8px, calc(100% - 12px) 2px;
        mask-size: 10px 12px, 8px 8px, calc(100% - 12px) 2px;
    }

    /* от старта к первому шагу */
    .process-list::after {
        left: 60px;
        width: calc(var(--pad-l) + var(--box-in) - 62px);
    }

    .process-step,
    .process-step:last-child {
        position: relative;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: var(--box-h) auto;
        align-items: center;
        column-gap: 12px;
        padding: 0 var(--box-in);
        border: 0;
        background: none;
    }

    .process-step > div:not(.process-num) { display: contents; }

    /* рамка вокруг номера и заголовка */
    .process-step::before,
    .process-step:last-child::before {
        content: "";
        display: block;
        position: absolute;
        top: 0;
        right: var(--box-in);
        bottom: auto;
        left: var(--box-in);
        width: auto;
        height: var(--box-h);
        border: 1.5px solid var(--accent-1);
        border-radius: 10px;
        background: none;
        pointer-events: none;
    }

    .process-num {
        grid-column: 1;
        grid-row: 1;
        width: 38px;
        height: 38px;
        margin-left: 16px;
        border: 1.5px solid var(--accent-1);
        background: none;
        color: var(--accent-1);
        font-size: 17px;
    }

    .process-step h3 {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        padding: 0 16px 0 0;
        font-size: clamp(16px, 1.5vw, 20px);
        line-height: 1.2;
    }

    .process-step p {
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: start;
        padding: 18px 8px 0;
        font-size: clamp(15px, 1.3vw, 17px);
        line-height: 1.55;
    }

    /* порядок в сетке: второй ряд идёт справа налево */
    .process-step:nth-child(1) { grid-area: 1 / 1; }
    .process-step:nth-child(2) { grid-area: 1 / 2; }
    .process-step:nth-child(3) { grid-area: 1 / 3; }
    .process-step:nth-child(4) { grid-area: 2 / 3; }
    .process-step:nth-child(5) { grid-area: 2 / 2; }
    .process-step:nth-child(6) { grid-area: 2 / 1; }

    /* 1 → 2 и 2 → 3 */
    .process-step:nth-child(1)::after,
    .process-step:nth-child(2)::after {
        left: calc(100% - var(--box-in));
        width: calc(var(--box-in) * 2);
    }

    /* 3 → 4: поворот справа вниз */
    .process-step:nth-child(3)::after {
        top: calc(var(--box-h) / 2 - 1px);
        left: calc(100% - var(--box-in));
        width: calc(var(--box-in) + var(--pad-r) - 14px);
        height: calc(100% + var(--gap-y));
        border: 2px solid var(--accent-1);
        border-left: 0;
        border-radius: 0 18px 18px 0;
        background: none;
    }

    /* стрелка на входе в шаг 4 (справа) */
    .process-step:nth-child(4) .process-num::before {
        content: "";
        position: absolute;
        top: calc(var(--box-h) / 2 - 6px);
        left: calc(100% - var(--box-in) + 1px);
        width: 10px;
        height: 12px;
        background: var(--accent-1);
        -webkit-mask: var(--arrow-l) center / 10px 12px no-repeat;
        mask: var(--arrow-l) center / 10px 12px no-repeat;
    }

    /* точка на выходе из шага 3 */
    .process-step:nth-child(3) .process-num::before {
        content: "";
        position: absolute;
        top: calc(var(--box-h) / 2 - 4px);
        left: calc(100% - var(--box-in) - 4px);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent-1);
    }

    /* 4 → 5 и 5 → 6: линия слева от шага */
    .process-step:nth-child(4)::after,
    .process-step:nth-child(5)::after {
        right: calc(100% - var(--box-in));
        width: calc(var(--box-in) * 2);
    }

    /* после шага 6 — стрелка к краю */
    .process-step:nth-child(6)::after {
        right: calc(100% - var(--box-in));
        width: calc(var(--box-in) + var(--pad-l) - 30px);
    }
}

/* планшет: те же три колонки, только компактнее */
@media (min-width: 721px) and (max-width: 1023px) {
    .process-list {
        --box-h: 64px;
        --box-in: 17px;
        --pad-l: 70px;
        --pad-r: 40px;
        --gap-y: 48px;
    }

    .process-list::before {
        top: calc(var(--box-h) / 2 - 20px);
        width: 40px;
        height: 40px;
        background: radial-gradient(circle, var(--accent-1) 0 11px, transparent 12px);
    }

    .process-list::after { left: 44px; width: calc(var(--pad-l) + var(--box-in) - 46px); }

    .process-num { width: 30px; height: 30px; margin-left: 10px; font-size: 14px; }

    .process-step h3 { padding-right: 10px; font-size: 14px; }

    .process-step p { padding: 14px 4px 0; font-size: 14px; }
}
