/* Webdeveloper.ru — палитра 60-30-10: #151718 / #282A2C / #80F988 */

:root {
    /* 60% — доминирующий фон */
    --bg: #151718;
    /* 30% — карточки, шапка, вторичные плоскости */
    --surface: #282a2c;
    --text: #e8eae9;
    --text-muted: #9ca39f;
    /* 10% — акценты, активные состояния */
    --accent: #80f988;
    --accent-soft: rgba(128, 249, 136, 0.14);
    --accent-glow: rgba(128, 249, 136, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --radius: 10px;
    --header-h: 64px;
    /* только H1 — как герой «Веб-разработка» */
    --heading-size: clamp(3.5rem, 8vw, 4.5rem);
    --heading-line-height: 1.15;
    --heading-letter-spacing: -0.03em;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 85% 55% at 50% -25%, var(--accent-glow), transparent 55%),
        radial-gradient(ellipse 50% 35% at 100% 0%, rgba(40, 42, 44, 0.5), transparent);
    line-height: 1.5;
    overflow-x: hidden;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    height: var(--header-h);
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
    background: rgba(40, 42, 44, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    will-change: transform;
}

.site-header.site-header--hidden {
    transform: translateY(-110%);
}

.site-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.site-logo span {
    color: var(--accent);
    font-weight: 600;
}

.site-logo__img {
    display: block;
    width: 120px;
    height: 60px;
    object-fit: contain;
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: color 0.15s ease, background 0.15s ease;
}

.site-nav__link:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.site-nav__link.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 500;
}

@media (max-width: 640px) {
    /* Логотип по центру, меню второй строкой — компактные отступы сверху/снизу */
    :root {
        --header-h: 112px;
    }

    .site-header {
        height: auto;
        min-height: var(--header-h);
        padding: 0.32rem 0.75rem 0.38rem;
        justify-content: center;
        flex-direction: column;
        gap: 0.2rem;
    }

    .site-logo {
        position: static;
        transform: none;
        order: 0;
    }

    .site-logo__img {
        width: 88px;
        height: 44px;
    }

    .site-nav {
        width: 100%;
    }

    .site-nav__list {
        justify-content: center;
        gap: 0.15rem 0.4rem;
        flex-wrap: wrap;
    }

    .site-nav__link {
        font-size: 0.84rem;
        padding: 0.32rem 0.52rem;
    }
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--header-h) + clamp(2rem, 5vw, 3.5rem)) clamp(1.25rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3.5rem);
    overflow-x: clip;
}

.landing__section {
    scroll-margin-top: calc(var(--header-h) + 1rem);
    padding-bottom: clamp(2.5rem, 6vw, 4rem);
    overflow-x: clip;
}

.landing__section:last-child {
    padding-bottom: clamp(3rem, 8vw, 5rem);
}

.section__head {
    margin-bottom: 1.5rem;
}

#cases .section__head {
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section__head h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(2.7rem, 6vw, 3.3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.section__lead {
    margin: 0;
    max-width: 42ch;
    font-size: 1rem;
    color: var(--text-muted);
}

.cases-preview {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cases-preview__item {
    margin: 0;
}

/* Блок кейса на лендинге и на case.php */

.case-showcase__more-wrap {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.case-showcase__more {
    display: inline-block;
    padding: 0.6rem 1.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    transition: background 0.15s ease, color 0.15s ease;
}

.case-showcase__more:hover {
    background: var(--accent-soft);
}

.case-showcase__head {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.7rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.case-showcase__title {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.case-showcase .case-showcase__subtitle {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-style: italic;
    white-space: nowrap;
}

.case-showcase__section {
    margin-bottom: 1.25rem;
}

.case-showcase__content-split {
    display: block;
}

.case-showcase__content-split--with-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}

.case-showcase__content-main,
.case-showcase__content-media {
    min-width: 0;
}

/* Hero: первый скрин на всю ширину + телефон с наслоением */
.case-showcase__hero-media {
    position: relative;
    margin: 0 0 clamp(1.25rem, 3vw, 2rem);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.case-showcase__shot--hero {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
}

.case-showcase__caption--hero {
    margin-top: 0.85rem;
}

.case-showcase__hero-device {
    position: absolute;
    right: clamp(0.75rem, 2vw, 1.35rem);
    top: clamp(0.75rem, 2vw, 1.35rem);
    width: clamp(150px, 24%, 240px);
    bottom: auto;
    z-index: 3;
    pointer-events: none;
    transform-origin: top right;
    transform: translateY(270px);
}

.case-showcase__hero-device .case-showcase__device-figure {
    pointer-events: none;
    filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.45));
}

.case-showcase__hero-device .case-showcase__device-caption {
    display: none;
}

.case-showcase__hero-device .device-mockup {
    width: 100%;
}

.case-showcase__content-main--below-hero {
    max-width: 920px;
    margin: 100px auto 0;
}

@media (max-width: 860px) {
    .case-showcase__hero-device {
        position: static;
        margin-top: 1rem;
        display: flex;
        justify-content: center;
        width: 100%;
        pointer-events: auto;
        transform: none;
    }
    .case-showcase__hero-device .case-showcase__device-figure {
        transform: none;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .case-showcase__hero-device .device-mockup {
        width: 100%;
        max-width: none;
    }
    .case-showcase__hero-device .case-showcase__device-caption {
        display: block;
    }
    .case-showcase__shot--hero {
        aspect-ratio: 3 / 2;
    }
}

/* Мокап телефона: iphone17.png с прозрачным «экраном», подложка — скриншот (см. device_demo в данных кейса) */
.case-showcase__device-wrap {
    display: flex;
    justify-content: center;
    margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
    padding: 0;
}

.case-showcase__device-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
}

.case-showcase__device-caption {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
    max-width: 22rem;
}

.device-mockup {
    --dm-screen-left: 5.71%;
    --dm-screen-top: 8.2%;
    --dm-screen-w: 88.57%;
    --dm-screen-h: 88.6%;
    position: relative;
    width: min(260px, 72vw);
    aspect-ratio: 245 / 500;
    flex-shrink: 0;
}

.device-mockup__screen {
    position: absolute;
    left: var(--dm-screen-left);
    top: var(--dm-screen-top);
    width: var(--dm-screen-w);
    height: var(--dm-screen-h);
    border-radius: 0 0 11% 11% / 0 0 5.5% 5.5%;
    overflow: hidden;
    background: #0a0a0c;
}

.device-mockup__screen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.device-mockup__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: fill;
}

.case-showcase__h {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8125rem;
}

.case-showcase__text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.case-showcase__list {
    margin: 0.65rem 0 0;
    padding: 0 0 0 1.2rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.case-showcase__list li {
    margin-bottom: 0.35rem;
}

.case-showcase__gallery {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2.75rem;
    margin: 0;
    padding: 0;
}

.case-showcase__gallery-more {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    margin: 1.5rem 0 0;
}

.case-showcase__gallery-more.is-collapsed {
    position: relative;
}

.case-showcase__gallery-more.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(21, 23, 24, 0), rgba(21, 23, 24, 0.95) 65%, rgba(21, 23, 24, 1));
}

.case-showcase__gallery-more-actions {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.case-showcase__gallery-more-item {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.case-showcase__gallery-more-item .case-showcase__shot--a,
.case-showcase__gallery-more-item .case-showcase__shot--b,
.case-showcase__gallery-more-item .case-showcase__shot--c {
    width: 100%;
    max-width: none;
    aspect-ratio: 2 / 3;
}

.case-showcase__gallery-more-item .case-showcase__shot img {
    object-position: center top;
}

.case-showcase__gallery-more-badge {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.35rem;
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: rgba(21, 23, 24, 0.62);
    backdrop-filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

.case-showcase__gallery-more.is-collapsed .case-showcase__gallery-more-badge,
.case-showcase__gallery-more-item--more-hint .case-showcase__gallery-more-badge {
    display: flex;
}

.case-showcase__gallery-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.85rem;
    width: 100%;
}

.case-showcase__gallery-row .case-showcase__shot--a,
.case-showcase__gallery-row .case-showcase__shot--b,
.case-showcase__gallery-row .case-showcase__shot--c {
    margin-top: 0;
    flex-shrink: 0;
    width: 100%;
    max-width: none;
}

.case-showcase__caption {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-muted);
    text-align: center;
}

.case-showcase__shot {
    margin: 0;
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    box-shadow:
        0 28px 55px -15px rgba(0, 0, 0, 0.55),
        0 14px 28px -18px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.2s ease;
}

.case-showcase__shot:hover {
    box-shadow:
        0 36px 60px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(128, 249, 136, 0.12);
}

.case-showcase__shot:focus {
    outline: none;
}

.case-showcase__shot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.case-showcase__shot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.case-showcase__shot--a {
    width: 90%;
    max-width: 560px;
}

.case-showcase__shot--b {
    width: 82%;
    max-width: 500px;
}

.case-showcase__shot--c {
    width: 86%;
    max-width: 530px;
}

/* Hero override: не ограничиваем вариантами a/b/c */
.case-showcase__shot.case-showcase__shot--hero {
    width: 100%;
    max-width: none;
}

.case-showcase__project-block {
    margin: 70px 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    justify-content: center;
    text-align: center;
    flex-wrap: nowrap;
}

.case-showcase__project-title,
.case-showcase__project-cta {
    margin: 0;
}

.case-showcase__project-title {
    white-space: nowrap;
}

.case-showcase__project-link {
    white-space: nowrap;
}

.case-showcase__project-cta {
    margin: 0;
}

.case-showcase__project-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--accent);
    text-decoration: none;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
}

.case-showcase__project-link:hover {
    filter: brightness(1.08);
}

.case-showcase__outro-block {
    margin-top: 50px;
}

.case-showcase__outro-title {
    margin-bottom: 0.55rem;
}

.case-showcase__outro {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.55;
}

@media (max-width: 640px) {
    .case-showcase__head {
        flex-wrap: wrap;
        white-space: normal;
        row-gap: 0.35rem;
    }

    .case-showcase .case-showcase__subtitle {
        white-space: normal;
    }

    .case-showcase__project-block {
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }

    .case-showcase__project-title,
    .case-showcase__project-link {
        white-space: normal;
    }

    .case-showcase__content-split--with-gallery {
        grid-template-columns: 1fr;
    }

    .case-showcase__gallery-row {
        align-items: stretch;
        text-align: left;
    }

    .case-showcase__caption {
        max-width: 100%;
    }

    .case-showcase__gallery-row .case-showcase__shot--a,
    .case-showcase__gallery-row .case-showcase__shot--b,
    .case-showcase__gallery-row .case-showcase__shot--c {
        width: 100%;
        max-width: none;
    }

    .case-showcase__gallery-more {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .case-showcase__gallery-more.is-collapsed::after {
        height: 72px;
    }

    .case-showcase__gallery-more-actions {
        margin-top: 20px;
    }

    .case-showcase__gallery-more-badge {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

}

.estimate-builder {
    display: grid;
    gap: 1.5rem;
}

.estimate-wizard {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    background: rgba(21, 23, 24, 0.45);
}

.estimate-wizard__head {
    display: grid;
    gap: 0.25rem;
}

.estimate-wizard__kicker {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.estimate-wizard__title {
    margin: 0;
    font-size: 1.06rem;
}

.estimate-wizard__meta {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.estimate-wizard__progress {
    margin-top: 0.65rem;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.estimate-wizard__progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), rgba(128, 249, 136, 0.72));
    transition: width 0.2s ease;
}

.estimate-builder__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.estimate-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(21, 23, 24, 0.4);
}

.estimate-group__title {
    margin: 0 0 0.8rem;
    font-size: 1.05rem;
    color: var(--accent);
}

.estimate-group__title-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.estimate-option {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.estimate-option:last-child {
    margin-bottom: 0;
}

.estimate-option input {
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

.estimate-option__main {
    display: grid;
    gap: 0.2rem;
}

.estimate-option__name {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    color: var(--text);
}

.estimate-option__info {
    position: relative;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(21, 23, 24, 0.7);
    color: var(--accent);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.estimate-option__info:hover {
    border-color: rgba(128, 249, 136, 0.45);
}

.estimate-option__info::after {
    content: attr(data-info-text);
    display: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    width: min(320px, calc(100vw - 2rem));
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(21, 23, 24, 0.92);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-line;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.estimate-option__info:hover::after,
.estimate-option__info:focus-visible::after,
.estimate-option__info.is-open::after {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Мобильные подсказки: не привязываем к «?», иначе центрирование уводит блок за край экрана */
@media (max-width: 640px) {
    .estimate-option__info::after {
        position: fixed;
        left: max(0.75rem, env(safe-area-inset-left, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        top: 50%;
        bottom: auto;
        width: auto;
        max-width: none;
        max-height: min(65vh, 22rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        transform: translateY(calc(-50% + 8px));
        z-index: 200;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }

    .estimate-option__info:hover::after,
    .estimate-option__info:focus-visible::after,
    .estimate-option__info.is-open::after {
        transform: translateY(-50%);
    }
}

.estimate-option__meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.estimate-builder__grid .estimate-option__meta {
    display: none;
}

.estimate-order {
    display: none;
    border-top: 0;
    padding-top: 0;
}

.estimate-order.is-visible {
    display: block;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.estimate-order__title {
    margin: 0 0 0.7rem;
    font-size: 1.1rem;
}

.estimate-order__empty {
    margin: 0;
    color: var(--text-muted);
}

.estimate-order__list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.4rem;
}

.estimate-order__list li {
    color: var(--text);
    font-size: 0.93rem;
}

.estimate-order__totals {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}

.estimate-order__totals p {
    margin: 0;
    color: var(--text-muted);
}

.estimate-order__totals strong {
    color: var(--text);
}

.estimate-order__totals .estimate-order__disclaimer {
    margin: 0.55rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.estimate-order__disclaimer-accent {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 0.12em;
    text-decoration-thickness: max(1px, 0.07em);
}

.estimate-wireframe {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* Как у заголовка секции «Расчёт заказа» (.section__head h2) */
.estimate-wireframe__title {
    margin: 0 0 0.5rem;
    font-size: clamp(2.7rem, 6vw, 3.3rem);
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
}

/* Внутри .card h2 по умолчанию — Playfair + italic */
.card .estimate-wireframe__title {
    font-family: var(--font);
    font-style: normal;
    font-weight: 700;
    font-size: clamp(2.7rem, 6vw, 3.3rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

/* Снизу столько же «воздуха», сколько сверху блока до текста: padding-top + отступ под заголовком */
.estimate-wireframe__lead {
    margin: 0 0 calc(1.1rem + 0.5rem);
    max-width: 42ch;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.estimate-wireframe__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.estimate-wireframe__after-note {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.55;
    color: #fff;
    max-width: 52ch;
}

.estimate-wireframe__item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.estimate-wireframe__thumb {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 4 / 3;
    font: inherit;
    color: inherit;
    cursor: zoom-in;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.estimate-wireframe__thumb:hover {
    border-color: rgba(128, 249, 136, 0.35);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.estimate-wireframe__thumb:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.estimate-wireframe__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    pointer-events: none;
}

.estimate-wireframe__caption {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
}

.estimate-order__actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: flex-end;
}

.estimate-order__cta-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.15rem 0.35rem;
    flex-wrap: nowrap;
}

.estimate-order__cta-pointer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    margin-bottom: 0;
    margin-right: -0.15rem;
    color: var(--accent);
    pointer-events: none;
    user-select: none;
}

/* Lottie-стрелка к кнопке «Оформить заказ» (dotlottie-player) */
.estimate-order__cta-arrow-osc {
    display: block;
    line-height: 0;
}

.estimate-order__cta-lottie {
    display: block;
    width: 120px;
    height: 72px;
    max-width: min(120px, 32vw);
}

.estimate-order__cta-arrow--fallback {
    display: block;
    flex-shrink: 0;
    color: var(--accent);
    overflow: visible;
}

@media (max-width: 520px) {
    /* Стрелка и кнопка в одну строку (как на десктопе): стрелка слева указывает на «Оформить заказ» */
    .estimate-order__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .estimate-order__cta-wrap {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
        justify-content: flex-start;
        width: 100%;
        gap: 0.35rem;
    }

    .estimate-order__cta-pointer {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: flex-end;
        align-self: flex-end;
        margin-bottom: 0;
        margin-right: 0;
    }

    .estimate-order__cta-wrap > .admin-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .estimate-order__cta-lottie {
        width: 88px;
        height: 54px;
        max-width: min(88px, 34vw);
    }

    .estimate-order__cta-arrow--fallback {
        width: 88px;
        height: auto;
        max-height: 54px;
    }
}

.estimate-wizard__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: space-between;
}

.estimate-wizard__actions .admin-btn {
    min-width: 130px;
}

.estimate-share-hint {
    flex: 1 1 200px;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .estimate-wizard__actions .admin-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 0.3rem);
    }

    .estimate-wizard__actions .admin-btn[data-estimate-step-next] {
        flex-basis: 100%;
    }

    .estimate-share-hint {
        flex-basis: 100%;
    }
}

.estimate-request {
    margin-top: 1rem;
    display: grid;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* CTA "Хочу похожий проект" на странице кейса */
.case-similar {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.case-similar__title {
    margin: 0;
    font-size: 1.15rem;
}

.case-similar__bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-align: center;
}

.case-similar__bar .admin-btn {
    margin-top: 0.65rem;
}

.case-similar__case-title {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
    white-space: nowrap;
}

.case-similar__note {
    margin: 0.65rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Другие кейсы внизу case.php */
.case-others {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.case-others__title {
    margin: 0 0 1.15rem;
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}

.case-others__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.case-others__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(21, 23, 24, 0.55);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-others__card:hover {
    border-color: rgba(128, 249, 136, 0.45);
    box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.65);
}

.case-others__card:focus {
    outline: none;
}

.case-others__card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.case-others__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.case-others__media--empty {
    min-height: 120px;
}

.case-others__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.case-others__body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 0.95rem 1rem;
}

.case-others__name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

.case-others__tagline {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-muted);
    font-family: "Playfair Display", serif;
    font-style: italic;
}

@media (max-width: 900px) {
    .case-others__grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

[hidden] {
    display: none !important;
}

.estimate-accent-word {
    color: var(--accent);
    font-weight: 700;
}

.estimate-success-animate {
    animation: estimateSuccessFadeIn 360ms ease-out both;
}

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

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 17, 18, 0.96);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.28);
}

.cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    column-gap: 1.25rem;
    row-gap: 0.5rem;
}

.cookie-banner__text {
    margin: 0;
    flex: 0 1 auto;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.cookie-banner__text a {
    color: var(--accent);
    white-space: nowrap;
}

.cookie-banner__btn {
    flex: 0 0 auto;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
}

.cookie-banner__btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body:has(#cookie-banner:not([hidden])) .estimate-cart {
    bottom: 3.75rem;
}

.estimate-cart {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 120;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: rgba(21, 23, 24, 0.95);
    color: var(--accent);
    font-weight: 600;
    padding: 0.7rem 1rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .estimate-builder__grid {
        grid-template-columns: 1fr;
    }
}

/* Админка */

.admin-shell .card h1,
.admin-shell .card h2,
.admin-shell .card h3 {
    font-family: var(--font);
    font-style: normal;
    letter-spacing: -0.01em;
}

.admin-heading {
    margin: 0 0 0.9rem;
}

.admin-accordion {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(21, 23, 24, 0.35);
    overflow: hidden;
}

.admin-accordion__summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    user-select: none;
}

.admin-accordion__summary::-webkit-details-marker {
    display: none;
}

.admin-accordion__summary::after {
    content: "▾";
    float: right;
    opacity: 0.8;
    transition: transform 0.16s ease;
}

.admin-accordion[open] .admin-accordion__summary::after {
    transform: rotate(180deg);
}

.admin-accordion__body {
    padding: 0.4rem 1rem 1rem;
    border-top: 1px solid var(--border);
}

.admin-case-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-case-accordion__meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-accordion--nested {
    background: rgba(21, 23, 24, 0.28);
}

.admin-case-image-accordion__summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.admin-case-image-accordion__summary .admin-drag-handle {
    flex: 0 0 auto;
}

.admin-case-image-accordion__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-msg {
    margin: 0.4rem 0 0;
}

.admin-msg--error {
    color: #ff8b8b;
}

.admin-msg--ok {
    color: #80f988;
}

.admin-form-grid {
    display: grid;
    gap: 0.8rem;
}

.admin-fields-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.admin-fields-row--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-field {
    display: grid;
    gap: 0.25rem;
}

.admin-field span {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.admin-field input,
.admin-field select {
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(21, 23, 24, 0.7);
    color: var(--text);
    padding: 0 0.75rem;
    outline: none;
}

.admin-field input[type="file"] {
    height: auto;
    padding: 0.45rem;
    border-style: dashed;
    cursor: pointer;
}

.admin-field input[type="file"]::file-selector-button {
    border: 1px solid var(--accent);
    border-radius: 7px;
    background: rgba(128, 249, 136, 0.16);
    color: var(--accent);
    font-weight: 600;
    padding: 0.45rem 0.7rem;
    margin-right: 0.65rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-field input[type="file"]:hover::file-selector-button {
    background: var(--accent);
    color: var(--bg);
}

.admin-field textarea {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(21, 23, 24, 0.7);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    resize: vertical;
    min-height: 90px;
    outline: none;
    font: inherit;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(128, 249, 136, 0.2);
}

.admin-btn {
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

.admin-btn--ghost {
    background: transparent;
    color: var(--accent);
}

.admin-btn--archive {
    background: rgba(255, 193, 94, 0.16);
    border-color: rgba(255, 193, 94, 0.6);
    color: #ffd898;
}

.admin-btn--restore {
    background: rgba(110, 186, 255, 0.15);
    border-color: rgba(110, 186, 255, 0.6);
    color: #b7dcff;
}

.admin-services-list {
    display: grid;
    gap: 0.8rem;
}

.admin-service-card {
    display: grid;
    gap: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem;
    background: rgba(21, 23, 24, 0.45);
}

.admin-orders-toolbar {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 0.8rem;
}

.admin-orders-toolbar__search {
    flex: 1 1 360px;
    min-width: 260px;
    margin: 0;
}

.admin-orders-toolbar__sort {
    min-width: 220px;
    margin: 0;
}

.admin-orders-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-order-card--new {
    background: rgba(34, 44, 40, 0.6);
    border-color: rgba(128, 249, 136, 0.28);
}

.admin-order-card--archived {
    background: rgba(21, 23, 24, 0.34);
    border-color: rgba(255, 255, 255, 0.12);
}

.admin-order-card--progress {
    background: rgba(42, 40, 52, 0.65);
    border-color: rgba(180, 160, 255, 0.28);
}

.admin-order-card--waiting {
    background: rgba(42, 48, 58, 0.65);
    border-color: rgba(110, 186, 255, 0.35);
}

.admin-order-badge {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(128, 249, 136, 0.15);
    color: var(--accent);
}

.admin-order-card--progress .admin-order-badge {
    background: rgba(200, 180, 255, 0.2);
    color: #dcd0ff;
}

.admin-order-card--waiting .admin-order-badge {
    background: rgba(110, 186, 255, 0.18);
    color: #b7dcff;
}

.admin-order-status-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: flex-end;
    margin-top: 0.35rem;
}

.admin-order-status-form .admin-field {
    min-width: 200px;
    margin: 0;
}

.admin-orders-push {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(21, 23, 24, 0.38);
}

.admin-push-preview {
    margin-top: 0.2rem;
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: rgba(30, 33, 34, 0.95);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.admin-push-preview__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.admin-push-preview__head span {
    margin-left: auto;
}

.admin-push-preview__icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    flex: 0 0 auto;
}

.admin-push-preview__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.admin-push-preview__text {
    margin: 0.28rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.admin-check a {
    color: var(--accent);
}

.admin-service-card.is-dragging {
    opacity: 0.55;
    border-color: var(--accent);
}

.admin-dnd-status {
    margin: 0 0 0.55rem;
    color: var(--accent);
    font-size: 0.85rem;
}

.admin-dnd-status.is-error {
    color: #ff8b8b;
}

.admin-category-chips {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.admin-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    background: rgba(21, 23, 24, 0.5);
    color: var(--text);
}

.admin-chip-delete {
    border: 0;
    background: transparent;
    color: #ff8b8b;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.admin-hero-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.admin-hero-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-hero-preview-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.admin-hero-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: rgba(21, 23, 24, 0.7);
    background-size: cover;
    background-repeat: no-repeat;
    outline: none;
    cursor: crosshair;
}

.admin-hero-preview:focus {
    box-shadow: inset 0 0 0 2px rgba(128, 249, 136, 0.45);
}

.admin-hero-preview__marker {
    position: absolute;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(21, 23, 24, 0.7);
    pointer-events: none;
}

.admin-hero-help,
.admin-hero-coords {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.admin-media-preview {
    display: grid;
    gap: 0.45rem;
}

.admin-media-preview__frame {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(21, 23, 24, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.admin-media-preview__frame--logo {
    min-height: 84px;
    padding: 0.9rem 1rem;
}

.admin-media-preview__frame--favicon {
    width: 84px;
    height: 84px;
    padding: 0.8rem;
}

.admin-media-preview__frame img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.admin-case-images {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.8rem;
}

.admin-case-image-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    background: rgba(21, 23, 24, 0.45);
}

.admin-case-image-card.is-dragging {
    opacity: 0.6;
    border-color: var(--accent);
}

.admin-case-image-card .admin-form-grid + form {
    margin-top: 0.8rem;
}

.admin-case-image-preview {
    position: relative;
    width: min(480px, 100%);
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21, 23, 24, 0.45);
}

/* Область ровно под отмасштабированное фото — подсказки в % от картинки */
.admin-case-image-preview__frame {
    position: relative;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.admin-case-image-preview__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.admin-hint-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(21, 23, 24, 0.8);
}

.admin-hints-editor {
    display: grid;
    gap: 0.5rem;
}

.admin-hint-row-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: stretch;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(21, 23, 24, 0.35);
}

.admin-hint-row-wrap.is-dragging-hint {
    opacity: 0.65;
    border-color: var(--accent);
}

.admin-hint-row__handle {
    align-self: center;
    cursor: grab;
}

.admin-hint-row__handle:active {
    cursor: grabbing;
}

.admin-hint-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 110px 160px;
    gap: 0.5rem;
    align-items: end;
}

.admin-drag-handle {
    width: 14px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    cursor: grab;
    user-select: none;
}

.admin-drag-handle span {
    width: 4px;
    height: 4px;
    border-radius: 1px;
    background: var(--accent);
    opacity: 0.95;
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

@media (max-width: 900px) {
    .admin-hero-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-hero-tools {
        grid-template-columns: 1fr;
    }

    .admin-fields-row,
    .admin-fields-row--4 {
        grid-template-columns: 1fr;
    }

    .admin-hint-row-wrap {
        grid-template-columns: 1fr;
    }

    .admin-hint-row__handle {
        justify-self: start;
    }

    .admin-hint-row {
        grid-template-columns: 1fr;
    }
}

/* Страница отдельного кейса */

.case-page__back {
    margin: 0 0 1rem;
}

.case-back {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

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

.case-page__title {
    margin: 0 0 0.5rem;
    font-size: var(--heading-size);
    font-weight: 700;
    line-height: var(--heading-line-height);
    letter-spacing: var(--heading-letter-spacing);
}

.case-page__muted {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.hero {
    margin-bottom: 1.25rem;
}

.hero-visual {
    height: 45vh;
    min-height: 140px;
    max-height: 520px;
    overflow: hidden;
    overflow-x: clip;
    position: relative;
    margin-top: 0.25rem;
    margin-bottom: 2rem;
}

.hero-visual__inner {
    position: absolute;
    left: 0;
    right: 0;
    top: -12%;
    height: 124%;
    transform-origin: center center;
    will-change: transform;
}

.hero-visual__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.hero-visual__inner--fallback {
    background-image:
        linear-gradient(145deg, rgba(128, 249, 136, 0.12) 0%, transparent 45%),
        linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero__title {
    margin: 0 0 clamp(1.5rem, 4vw, 2.75rem);
    font-size: var(--heading-size);
    font-weight: 700;
    font-style: normal;
    letter-spacing: var(--heading-letter-spacing);
    line-height: var(--heading-line-height);
}

.hero__title-line {
    display: block;
}

.hero__title-line--sub {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

.hero p {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--text-muted);
    max-width: 36ch;
}

.hero-audience {
    margin-top: clamp(4rem, 10vw, 7rem);
    margin-bottom: clamp(4rem, 10vw, 7rem);
    padding: clamp(0.75rem, 2vw, 1.5rem) 0;
    text-align: center;
}

.hero-audience__intro {
    margin: 0 0 clamp(1.5rem, 4vw, 2.4rem);
    font-size: 4.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

.hero-audience__types {
    position: relative;
    margin: 0 auto 1rem;
    width: min(760px, 100%);
    height: clamp(13.5rem, 30vw, 19rem);
}

.hero-audience__types::before {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 420' preserveAspectRatio='none'%3E%3Cpath d='M874 78 C756 18, 676 164, 764 230 C840 286, 926 190, 848 138 C740 70, 620 178, 520 224 C434 264, 410 138, 500 104 C584 74, 654 168, 578 226 C470 308, 296 230, 170 272 C118 290, 86 314, 34 346' fill='none' stroke='%2380f988' stroke-width='3' stroke-linecap='round' stroke-dasharray='8 9'/%3E%3C/svg%3E");
    opacity: 0.9;
}

.hero-audience__types span {
    position: absolute;
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: clamp(2.7rem, 6vw, 3.3rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
}

.hero-audience__outro {
    margin: 0 0 0 auto;
    max-width: 44ch;
    width: min(44ch, 100%);
    font-size: 1rem;
    color: var(--text-muted);
    text-align: right;
}

.hero-audience__types span:nth-child(1) {
    left: -6%;
    bottom: 2%;
}

.hero-audience__types span:nth-child(2) {
    top: 44%;
    left: 39%;
    transform: translateX(-50%);
}

.hero-audience__types span:nth-child(3) {
    right: 3%;
    top: 1%;
}

.landing__section#workflow {
    padding-top: clamp(3.5rem, 9vw, 6rem);
    padding-bottom: clamp(3.5rem, 9vw, 6rem);
}

.workflow-steps {
    --workflow-pad-x: clamp(0.95rem, 2.3vw, 1.4rem);
    position: relative;
    margin: 0;
    padding: clamp(1rem, 2.5vw, 1.35rem) var(--workflow-pad-x);
    list-style: none;
    counter-reset: workflow-step;
    display: grid;
    gap: clamp(2rem, 4.8vw, 3.8rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(21, 23, 24, 0.45);
}

.workflow-steps::before {
    display: none;
}

.workflow-steps__item {
    position: relative;
    padding: 0 0 0.1rem clamp(2.1rem, 3.2vw, 2.5rem);
}

.workflow-steps__item::before {
    counter-increment: workflow-step;
    content: counter(workflow-step);
    position: absolute;
    left: 0;
    top: 0.28rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(128, 249, 136, 0.65);
    background: rgba(128, 249, 136, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.78rem;
    line-height: 1;
    pointer-events: none;
}

.workflow-steps__item::after {
    content: none;
}

.workflow-steps__title {
    margin: 0;
    font-size: clamp(1.03rem, 1.8vw, 1.2rem);
    color: var(--text);
}

.workflow-steps__text {
    margin: 0.4rem 0 0;
    font-size: 0.93rem;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .landing__section#workflow {
        padding-top: clamp(2.4rem, 8vw, 3.4rem);
        padding-bottom: clamp(2.4rem, 8vw, 3.4rem);
    }

    .case-lightbox__frame {
        max-width: calc(100vw - 1rem);
        max-height: calc(100dvh - 3.25rem);
        overflow-x: hidden;
    }

    .case-lightbox__scene {
        width: 100%;
    }

    .case-lightbox__img {
        width: 100%;
        max-width: 100% !important;
        height: auto;
    }

    .hero-audience__types {
        height: 10.5rem;
    }

    .hero-audience__types span {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .hero-audience__types span:nth-child(1) {
        left: 2%;
    }

    .hero-audience__types span:nth-child(2) {
        left: 50%;
    }

    .hero-audience__types span:nth-child(3) {
        right: 4%;
    }

    .workflow-steps {
        gap: 1.45rem;
        --workflow-pad-x: 0.85rem;
        padding: 0.9rem var(--workflow-pad-x);
    }

    .workflow-steps::before {
        display: none;
    }

    .workflow-steps__item {
        padding-left: 2rem;
    }

    .workflow-steps__item::before {
        width: 1.25rem;
        height: 1.25rem;
        top: 0.22rem;
        font-size: 0.74rem;
    }

}

.card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card h2 {
    margin: 0 0 1rem;
    font-family: "Playfair Display", serif;
    font-size: 2.25rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: var(--heading-letter-spacing);
    line-height: var(--heading-line-height);
}

.card p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* Сильнее .card p (margin: 0), иначе отступ снизу не применяется */
.card .estimate-wireframe__lead {
    margin: 0 0 calc(1.1rem + 0.5rem);
    font-size: 1rem;
}

.card .estimate-wireframe__after-note {
    margin: 1rem 0 0;
    padding-top: 1rem;
    font-size: 0.95rem;
    color: #fff;
}

/* Лайтбокс: увеличение скриншота кейса */

.case-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(3rem, 8vw, 4.25rem) clamp(0.75rem, 3vw, 2rem) clamp(0.75rem, 3vw, 2rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.case-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.case-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 20, 0.9);
    cursor: zoom-out;
}

.case-lightbox__frame {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: min(96vw, 100%);
    max-height: calc(100vh - clamp(4rem, 10vw, 5.5rem));
    max-height: calc(100dvh - clamp(4rem, 10vw, 5.5rem));
    overflow-x: hidden;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.case-lightbox.is-open .case-lightbox__frame {
    overflow-y: auto;
}

.case-lightbox__scene {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.case-lightbox__hints {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.case-lightbox.has-hints.hints-ready .case-lightbox__hints {
    opacity: 1;
    transform: translateY(0);
}

.case-lightbox__hints-stack {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.case-lightbox__hint-card {
    position: absolute;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: min(22rem, calc(100% - 2rem));
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: calc(var(--radius) - 2px);
    background: rgba(21, 23, 24, 0.9);
    backdrop-filter: blur(6px);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.case-lightbox__hint-card--1 {
    top: 6%;
    left: 4%;
}

.case-lightbox__hint-card--2 {
    top: 24%;
    right: 5%;
}

.case-lightbox__hint-card--3 {
    top: 44%;
    left: 8%;
}

.case-lightbox__hint-card--4 {
    top: 68%;
    right: 8%;
}

.case-lightbox__hint-card--5 {
    top: 92%;
    left: 12%;
}

.case-lightbox__hint-num {
    flex: 0 0 auto;
    min-width: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.case-lightbox__hint-text {
    min-width: 0;
}

.case-lightbox__hint-card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: caseHintPop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.case-lightbox__hint-card.is-hidden {
    display: none;
}

@keyframes caseHintPop {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
    }
    65% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.case-lightbox__img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    transform: scale(0.88);
    opacity: 0.7;
    transform-origin: top center;
    transition:
        transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.38s ease;
}

.case-lightbox.is-open .case-lightbox__img {
    transform: scale(1);
    opacity: 1;
}

.case-lightbox__close {
    position: absolute;
    top: clamp(0.5rem, 2vw, 1.25rem);
    right: clamp(0.5rem, 2vw, 1.25rem);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(40, 42, 44, 0.95);
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.case-lightbox__close:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

@media (max-width: 640px) {
    .case-lightbox__hints {
        overflow: hidden;
    }

    .case-lightbox__hint-card {
        left: 0.7rem !important;
        right: 0.7rem !important;
        max-width: none;
    }

    .case-lightbox__hint-card--1 {
        top: 6%;
    }

    .case-lightbox__hint-card--2 {
        top: 24%;
    }

    .case-lightbox__hint-card--3 {
        top: 42%;
    }

    .case-lightbox__hint-card--4 {
        top: 60%;
    }

    .case-lightbox__hint-card--5 {
        top: 78%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-lightbox,
    .case-lightbox__img,
    .case-lightbox__hints,
    .case-lightbox__hint-card {
        transition: none !important;
    }
}

/* Техническое обслуживание */
.maintenance {
    min-height: calc(100vh - var(--header-h));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.5rem) 1.25rem;
}

.maintenance__wrap {
    width: 100%;
    max-width: 820px;
    position: relative;
    z-index: 1;
}

.maintenance__card {
    position: relative;
    z-index: 2;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: clamp(1.25rem, 3.8vw, 2.25rem);
    background: rgba(21, 23, 24, 0.55);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.maintenance__code {
    position: fixed;
    inset: 0;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    opacity: 0.78;
    filter: none;
    mask-image: radial-gradient(ellipse 150% 120% at 50% 50%, #000 72%, transparent 100%);
}

.maintenance__code-track {
    width: min(1600px, 96vw);
    display: flex;
    flex-direction: column;
    will-change: transform;
    animation: maintenanceCodeScroll 100s linear infinite;
}

.maintenance__code pre {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.38;
    letter-spacing: 0.01em;
    color: rgba(228, 255, 236, 0.95);
    text-shadow:
        0 0 8px rgba(128, 249, 136, 0.2),
        0 0 14px rgba(128, 249, 136, 0.1);
    text-align: left;
    white-space: pre;
}

.maintenance__code code {
    display: block;
    padding: 22px 28px;
}

.maintenance__code .code-token {
    font-weight: 500;
}

.maintenance__code .code-token--php {
    color: rgba(22, 150, 60, 0.95);
}

.maintenance__code .code-token--string {
    color: rgba(22, 150, 60, 0.95);
}

.maintenance__code .code-token--comment {
    color: rgba(22, 150, 60, 0.95);
    font-style: normal;
}

.maintenance__code .code-token--kw {
    color: rgba(22, 150, 60, 0.95);
}

@keyframes maintenanceCodeScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.maintenance__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.maintenance__logo {
    display: block;
    width: 120px;
    height: 60px;
    object-fit: contain;
}

.maintenance__logo-text {
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
}

.maintenance__logo-text span {
    color: var(--accent);
}

.maintenance__title {
    margin: 0 0 0.55rem;
    font-size: clamp(1.6rem, 4vw, 2.15rem);
    line-height: 1.15;
}

.maintenance__lead {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
}

.maintenance__status {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.15rem;
    color: var(--text);
    font-weight: 600;
}

.maintenance__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(128, 249, 136, 0.12);
    animation: maintenancePulse 1.2s ease-in-out infinite;
}

@keyframes maintenancePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(128, 249, 136, 0.12);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(128, 249, 136, 0.07);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(128, 249, 136, 0.12);
    }
}

.maintenance__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 1.25rem;
}

.maintenance__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0.75rem 1.05rem;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.maintenance__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(128, 249, 136, 0.45);
}

.maintenance__btn--ghost {
    background: rgba(21, 23, 24, 0.25);
    color: var(--accent);
}

.maintenance__back {
    margin: 0;
}

.maintenance__back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
}

.maintenance__back-link:hover {
    color: var(--text);
    border-bottom-color: rgba(128, 249, 136, 0.35);
}

@media (max-width: 640px) {
    .maintenance__card {
        border-radius: 18px;
    }

    .maintenance__logo {
        width: 88px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .maintenance__code-track {
        animation: none !important;
    }
}
