/* ============================================
   Страница кейса (с 10.2026): та же система, что на главной (home.css),
   плюс рассказ о проекте, блок с двумя путями (бриф / заявка)
   и плавающая панель «Рассчитать стоимость · Оставить заявку».
   ============================================ */

/* === Первый экран кейса === */
.case-hero { padding-top: calc(var(--bar) + clamp(28px, 5vw, 64px)); }
.case-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: clamp(28px, 4vw, 48px);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-2);
    transition: color .2s;
}
.case-back svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.case-back:hover { color: var(--cloud); }
.case-back:hover svg { transform: translateX(-4px); }

.case-title {
    max-width: 18ch;
    font-size: clamp(36px, 5.4vw, 78px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}
.case-lead {
    max-width: 52ch;
    margin-top: clamp(18px, 2vw, 26px);
    font-size: clamp(18px, 1.55vw, 23px);
    line-height: 1.5;
    color: var(--muted);
}
.case-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: clamp(24px, 3vw, 36px); }
.case-site { margin-right: 6px; }
.case-site svg { width: 16px; height: 16px; }
.case-tag {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.case-cover {
    margin: clamp(36px, 5vw, 64px) 0 0;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 50px 120px -50px color-mix(in srgb, var(--blue) 55%, transparent);
}
.case-cover img { display: block; width: 100%; height: auto; }

/* === Рассказ === */
.case-story__in { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.case-aside { position: sticky; top: calc(var(--bar) + 24px); }
.case-dl { display: grid; gap: 22px; margin: 0; }
.case-dl dt { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.case-dl dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); word-break: break-word; }
.case-dl a { color: var(--cloud); border-bottom: 1px solid var(--line-2); transition: border-color .2s; }
.case-dl a:hover { border-color: var(--cloud); }
.case-text { max-width: 68ch; }
.case-text p { margin: 0 0 1.15em; font-size: 18px; line-height: 1.75; color: color-mix(in srgb, var(--cloud) 80%, transparent); }
.case-text .case-text__first { font-size: clamp(20px, 1.7vw, 24px); line-height: 1.6; color: var(--cloud); }

/* === Скриншоты: разметка и рамки из style.css, здесь — только место на странице === */
.case-shots .ss-bento { margin: 0; padding: 0; max-width: none; }
.case-gallery .gallery-grid { margin: 0; }

/* === Два пути: бриф и заявка === */
.case-cta { min-height: 0; }
.case-cta .cta__title { max-width: 15ch; }
.case-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 760px; }
.case-way {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 24px 26px;
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    background: color-mix(in srgb, var(--black) 55%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--cloud);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .25s, background .25s, transform .4s var(--ease-out);
}
.case-way b { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.case-way span:last-child { font-size: 15px; line-height: 1.5; color: var(--muted); }
.case-way__n { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.case-way::after {
    content: "";
    position: absolute;
    top: 22px;
    right: 22px;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: .5;
    transition: opacity .25s, transform .4s var(--ease-out);
}
.case-way:hover { border-color: color-mix(in srgb, var(--violet) 60%, var(--cloud)); background: color-mix(in srgb, var(--violet) 10%, transparent); }
.case-way:hover::after { opacity: 1; transform: translate(2px, -2px); }
.case-way:first-child { background: var(--cloud); color: var(--black); border-color: var(--cloud); }
.case-way:first-child span:last-child, .case-way:first-child .case-way__n { color: color-mix(in srgb, var(--black) 62%, transparent); }
.case-way:first-child:hover { background: #fff; }
.case-promise { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 30px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.case-promise li { display: flex; align-items: center; gap: 10px; }
.case-promise li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #FF4031; flex: none; }

/* === Плавающая панель === */
.cbar {
    position: fixed;
    left: 50%;
    bottom: calc(18px + var(--ck-h, 0px));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 22px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: color-mix(in srgb, var(--black) 74%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
    transform: translate3d(-50%, calc(100% + 40px), 0);
    visibility: hidden;
    transition: transform .55s var(--ease-out), visibility 0s .55s, bottom .3s;
}
.cbar.is-on { transform: translate3d(-50%, 0, 0); visibility: visible; transition: transform .55s var(--ease-out), visibility 0s, bottom .3s; }
.cbar__q { margin: 0 10px 0 0; font-size: 15px; font-weight: 500; white-space: nowrap; }
.cbar__short { display: none; }

/* === Планшет === */
@media (max-width: 1100px) {
    .case-story__in { grid-template-columns: 1fr; }
    .case-aside { position: static; }
    .case-dl { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 860px) {
    .case-ways { grid-template-columns: 1fr; }
}

/* === Телефон: панель во всю ширину, две кнопки поровну === */
@media (max-width: 640px) {
    .case-title { font-size: clamp(32px, 9vw, 44px); }
    .case-text p { font-size: 17px; }
    .case-text .case-text__first { font-size: 19px; }
    .cbar {
        left: 10px;
        right: 10px;
        bottom: calc(10px + var(--ck-h, 0px));
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 8px;
        border-radius: 22px;
        transform: translate3d(0, calc(100% + 30px), 0);
    }
    .cbar.is-on { transform: none; }
    .cbar__q { display: none; }
    .cbar .btn { width: 100%; padding: 0 12px; min-height: 46px; }
    .cbar__long { display: none; }
    .cbar__short { display: inline; }
    .foot2 { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
    .cbar, .cbar.is-on { transition: none; }
}
