/* ============================================================
   globall.dev — CASES STYLESHEET  (/assets/cases.css)
   Layered on styles.css tokens (?v=8.4). Styles the cases index
   (/cases/) and individual case-study pages (/cases/<slug>/).
   LIGHT design system (white bg, Telegram-blue #0098EA accent),
   modeled on buytgbot.ru. Self-sufficient: re-defines
   .breadcrumbs so cases pages don't depend on blog.css.
   Owner: Cases-CSS agent. Do not duplicate styles.css component
   rules here — only what's specific to cases.
   ============================================================ */

/* ============================================================
   WIDE-CANVAS LAYOUT (consistent with styles.css v9.0 .section)
   .page--bots is full-width (padding:0); these cases blocks own
   their own centering + capping via the padding-inline trick,
   matching the home/bots full-bleed rhythm. No inner wrapper div.
   --cap / --gutter come from styles.css :root (≈1240px content).
   ------------------------------------------------------------ */

/* Index-level blocks: full content width (~1240px), centered, capped. */
.breadcrumbs,
.bots-stats,
.cases-filter,
.cases-grid {
    width: 100%;
    padding-inline: max(var(--gutter, 20px), calc(50% - var(--cap, 620px)));
}

/* Vertical rhythm between top-level page blocks (matches marketing pages).
   Margins on these blocks are zeroed so the padding-block owns the rhythm. */
.page--bots > .cases-intro { margin: 0 auto; padding-block: clamp(40px, 5vw, 72px) 0; }
.page--bots > .bots-stats  { margin: 0 auto; padding-block: clamp(24px, 3vw, 40px); }
.page--bots > .cases-filter { margin: 0 auto; padding-block: clamp(20px, 2.5vw, 32px) clamp(8px, 1.5vw, 20px); }
.page--bots > .cases-grid  { padding-block: clamp(24px, 3vw, 40px) clamp(48px, 6vw, 80px); }

/* Case DETAIL reading column: comfortable measure (~960px), centered.
   Wider than a blog article (it carries stat tiles, cards, grids) but
   intentionally NOT the full ~1240px marketing width. */
.case {
    max-width: 960px;
    margin-inline: auto;
    padding-inline: var(--gutter, 20px);
    padding-block: clamp(28px, 3.5vw, 48px) clamp(48px, 6vw, 80px);
}

/* On the cases INDEX, the CTA + Related are top-level blocks on the wide
   canvas: center them and cap to a readable width so the form/links don't
   stretch edge-to-edge. (On detail pages they sit inside .case already.) */
.page--bots > .case-cta,
.page--bots > .related {
    max-width: 960px;
    margin-inline: auto;
    width: calc(100% - 2 * var(--gutter, 20px));
}
.page--bots > .case-cta { margin-block: clamp(24px, 3vw, 40px); }
.page--bots > .related  { margin-block: 0 clamp(48px, 6vw, 80px); }

/* ------------------------------------------------------------
   0. BREADCRUMBS  (self-sufficient — identical to blog.css)
   Главная › Кейсы › <case>
   ------------------------------------------------------------ */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    padding-top: 22px;
    font-size: .82rem;
    color: var(--text-sec);
    line-height: 1.4;
}
.breadcrumbs a {
    color: var(--text-sec);
    transition: color .25s var(--ease);
}
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs__sep {
    color: var(--text-dim);
    font-size: .72rem;
    opacity: .8;
    margin: 0 1px;
}
.breadcrumbs__current {
    color: var(--text);
    font-weight: 600;
    /* keep long case titles from blowing out the row on mobile */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   PART A — CASES INDEX  (/cases/)
   ============================================================ */

/* ------------------------------------------------------------
   A1. Index intro head — reuses .bots-section__* spacing feel
   ------------------------------------------------------------ */
.cases-intro {
    text-align: center;
    margin: 0 auto;
    max-width: 720px;
    padding-inline: var(--gutter, 20px);
}

/* ------------------------------------------------------------
   A2. Filter bar — category chips (JS optional; default = CSS only).
   Chips are <button> or <a>; one carries .is-active.
   ------------------------------------------------------------ */
.cases-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-bottom: 36px;
}
.cases-filter__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: .82rem;
    font-weight: 650;
    letter-spacing: .01em;
    color: var(--text-sec);
    background: #fff;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: color .25s var(--ease), background .25s var(--ease),
                border-color .25s var(--ease), transform .25s var(--ease),
                box-shadow .25s var(--ease);
    white-space: nowrap;
}
.cases-filter__chip:hover {
    color: var(--blue);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.cases-filter__chip.is-active {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: var(--shadow-blue);
}
.cases-filter__count {
    font-size: .72rem;
    font-weight: 700;
    opacity: .65;
}

/* JS-driven filter hide (optional behavior). Without JS everything shows. */
.case-card.is-hidden { display: none; }

/* ------------------------------------------------------------
   A3. Cases grid
   ------------------------------------------------------------ */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 26px;
    align-items: stretch;
    margin-bottom: 0; /* rhythm handled by .page--bots > .cases-grid padding */
}

/* ------------------------------------------------------------
   A4. Case card — white card, mirrors .proj visual language
   Markup order: .case-card__cat → h3.case-card__title →
   .case-card__problem → .case-card__result →
   .case-card__tech (chips) → .case-card__more
   ------------------------------------------------------------ */
.case-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: border-color .35s var(--ease), transform .35s var(--ease),
                box-shadow .35s var(--ease);
}
/* Top accent line (revealed on hover) */
.case-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--blue);
    opacity: 0;
    transition: opacity .4s var(--ease);
}
.case-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 1px 2px rgba(13, 18, 30, .05), 0 16px 40px rgba(13, 18, 30, .10);
}
.case-card:hover::after { opacity: 1; }

/* Whole-card link: make the card clickable while keeping inner links live */
.case-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.case-card > *:not(.case-card__link) { position: relative; z-index: 2; }

/* Category chip — same dialect as styles.css .proj__cat */
.case-card__cat,
.proj__cat-like {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 3px 11px;
    margin-bottom: 12px;
    border-radius: 50px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid transparent;
}
.case-card__cat i,
.proj__cat-like i { font-size: .64rem; opacity: .85; }

.case-card__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 10px;
}

/* Muted problem one-liner */
.case-card__problem {
    font-size: .84rem;
    color: var(--text-sec);
    line-height: 1.55;
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
    flex: 1; /* pushes result + footer to bottom for even card heights */
}
.case-card__problem::before {
    content: '\f071'; /* exclamation-triangle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--text-dim);
    font-size: .72rem;
    flex-shrink: 0;
    line-height: 1.85;
    opacity: .7;
}

/* Highlighted result line — green accent, mirrors .proj__result */
.case-card__result {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 14px;
    padding: 12px 14px 12px 16px;
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--green);
    background: rgba(22, 163, 74, .07);
    display: flex;
    gap: 9px;
    align-items: flex-start;
}
.case-card__result::before {
    content: '\f0a9'; /* arrow-circle-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--green);
    font-size: .85rem;
    flex-shrink: 0;
    line-height: 1.7;
}

/* Tech chips row */
.case-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.case-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .68rem;
    font-weight: 650;
    letter-spacing: .2px;
    color: var(--text-sec);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.case-chip i { font-size: .66rem; opacity: .8; }

/* "Смотреть кейс →" footer link */
.case-card__more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    font-size: .85rem;
    font-weight: 700;
    color: var(--blue);
    transition: gap .25s var(--ease), color .25s var(--ease);
}
.case-card__more-arrow,
.case-card__more i { transition: transform .25s var(--ease); }
.case-card:hover .case-card__more { color: var(--blue-dark); gap: 11px; }
.case-card:hover .case-card__more-arrow,
.case-card:hover .case-card__more i { transform: translateX(3px); }

/* ============================================================
   PART B — INDIVIDUAL CASE PAGE  (/cases/<slug>/)
   Wrapper: <article class="case"> inside .page--bots
   ============================================================ */
.case {
    position: relative;
    z-index: 1;
}

/* ------------------------------------------------------------
   B1. Case hero — h1 niche+outcome, subtitle, meta chips
   ------------------------------------------------------------ */
.case-hero {
    padding: 48px 48px 44px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-soft), #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
/* soft top accent line */
.case-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--blue);
}
.case-hero__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    margin-bottom: 18px;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid transparent;
}
.case-hero__cat i { font-size: .68rem; opacity: .85; }

.case-hero__title {
    font-family: 'Inter', sans-serif;
    font-size: 2.7rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--text);
    max-width: 880px;
    margin: 0 auto;
}
.case-hero__title .grad {
    background: linear-gradient(90deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.case-hero__sub {
    margin: 18px auto 0;
    max-width: 660px;
    color: var(--text-sec);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Meta chips: ниша · стек · тип */
.case-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 26px;
}
.case-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-sec);
    background: #fff;
    border: 1px solid var(--border);
}
.case-meta-chip i { color: var(--blue); font-size: .8rem; }
.case-meta-chip b {
    color: var(--text);
    font-weight: 700;
}

/* ------------------------------------------------------------
   B2. Case stat row — big highlighted result/scope facts
   (like styles.css .stat). Grid of .case-stat tiles.
   ------------------------------------------------------------ */
.case-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.case-stat {
    padding: 28px 22px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color .35s var(--ease), transform .35s var(--ease),
                box-shadow .35s var(--ease);
}
.case-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--blue);
    opacity: 0;
    transition: opacity .35s var(--ease);
}
.case-stat:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 1px 2px rgba(13, 18, 30, .05), 0 16px 40px rgba(13, 18, 30, .10);
}
.case-stat:hover::before { opacity: 1; }
.case-stat__num {
    font-family: 'Inter', sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--blue);
    margin-bottom: 10px;
}
.case-stat__label {
    font-size: .85rem;
    color: var(--text-sec);
    line-height: 1.4;
}

/* ------------------------------------------------------------
   B3. Case sections — Проблема / Подход / Решение /
   Технически / Результат. Each = .case-section card.
   ------------------------------------------------------------ */
.case-section {
    padding: 40px 48px;
    margin-bottom: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.case-section__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.case-section__icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    font-size: 1.15rem;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid transparent;
}
.case-section__kicker {
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.case-section__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* Prose inside a case section */
.case-section__body { color: var(--text-sec); font-size: 1.02rem; line-height: 1.75; }
.case-section__body > * + * { margin-top: 16px; }
.case-section__body p { color: var(--text-sec); }
.case-section__body strong,
.case-section__body b { color: var(--text); font-weight: 650; }
.case-section__body a {
    color: var(--blue);
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--ease), color .25s var(--ease);
}
.case-section__body a:hover { color: var(--blue-dark); border-color: var(--blue); }
.case-section__body h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-top: 26px;
}
.case-section__body ul,
.case-section__body ol { padding-left: 4px; list-style: none; }
.case-section__body ul li,
.case-section__body ol li {
    position: relative;
    padding-left: 28px;
    margin-top: 11px;
    line-height: 1.6;
}
.case-section__body ul li::before {
    content: '\f058'; /* check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0; top: 1px;
    color: var(--green);
    font-size: .92rem;
}
.case-section__body ol { counter-reset: case-li; }
.case-section__body ol li::before {
    counter-increment: case-li;
    content: counter(case-li);
    position: absolute;
    left: 0; top: 2px;
    width: 19px; height: 19px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
    font-size: .68rem;
    font-weight: 800;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid transparent;
}
.case-section__body blockquote {
    margin: 6px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--blue);
    border-radius: var(--radius-xs);
    background: var(--bg-soft);
    color: var(--text);
    font-style: italic;
}
.case-section__body code {
    font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Menlo, monospace;
    font-size: .86em;
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--blue-dark);
    background: var(--blue-soft);
    border: 1px solid var(--border);
}
.case-section__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    margin: 6px 0;
}
.case-section__body th,
.case-section__body td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
}
.case-section__body th {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-soft);
}
.case-section__body td { color: var(--text-sec); }

/* Result section accent — distinguish the outcome block */
.case-section--result .case-section__icon {
    color: var(--green);
    background: rgba(22, 163, 74, .1);
    border-color: transparent;
}

/* ------------------------------------------------------------
   B4. Capability bullets grid (Технически) — .case-tech
   ------------------------------------------------------------ */
.case-tech {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.case-tech__item {
    display: flex;
    gap: 13px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: border-color .3s var(--ease), background .3s var(--ease),
                transform .3s var(--ease), box-shadow .3s var(--ease);
}
.case-tech__item:hover {
    border-color: var(--border-hover);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.case-tech__icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 1rem;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid transparent;
}
.case-tech__title {
    font-family: 'Inter', sans-serif;
    font-size: .98rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}
.case-tech__desc {
    font-size: .85rem;
    color: var(--text-sec);
    line-height: 1.5;
}

/* Tech-stack chip row (devicon badges) inside a case section */
.case-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 4px;
}
.case-stack__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    transition: border-color .25s var(--ease), background .25s var(--ease);
}
.case-stack__chip:hover {
    border-color: var(--border-hover);
    background: var(--bg-soft);
}
.case-stack__chip i,
.case-stack__chip [class*="devicon"] { font-size: 1.05rem; }

/* ------------------------------------------------------------
   B5. Gallery / Mini App preview frame — .case-gallery (optional)
   ------------------------------------------------------------ */
.case-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.case-shot {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.case-shot:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(13, 18, 30, .05), 0 14px 36px rgba(13, 18, 30, .12);
}
.case-shot img { width: 100%; height: auto; display: block; }
.case-shot__cap {
    padding: 11px 15px;
    font-size: .8rem;
    color: var(--text-sec);
    border-top: 1px solid var(--border);
}

/* Phone-framed Mini App preview (single, centered) */
.case-preview {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}
.case-phone {
    position: relative;
    width: 300px;
    max-width: 100%;
    padding: 12px;
    border-radius: 38px;
    background: linear-gradient(160deg, #f1f5f9, #e6edf3);
    border: 1px solid var(--border-hover);
    box-shadow: 0 30px 70px rgba(13, 18, 30, .18), inset 0 1px 1px rgba(255, 255, 255, .6);
}
.case-phone::before {
    /* notch */
    content: '';
    position: absolute;
    top: 22px; left: 50%;
    transform: translateX(-50%);
    width: 90px; height: 6px;
    border-radius: 6px;
    background: rgba(13, 18, 30, .12);
    z-index: 3;
}
.case-phone__screen {
    border-radius: 28px;
    overflow: hidden;
    background: #ffffff;
    aspect-ratio: 9 / 19.5;
}
.case-phone__screen img,
.case-phone__screen iframe {
    width: 100%; height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

/* ------------------------------------------------------------
   B6. CTA card — reuses .btn / .btn--primary from styles.css
   ------------------------------------------------------------ */
.case-cta {
    padding: 44px 48px;
    margin-bottom: 22px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--blue-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.case-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(0, 152, 234, .08), transparent 70%);
    pointer-events: none;
}
.case-cta > * { position: relative; z-index: 1; }
.case-cta__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
}
.case-cta__sub {
    color: var(--text-sec);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 24px;
}
.case-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
/* Scarcity / capacity line under the CTA */
.case-cta__capacity {
    margin-top: 18px;
    font-size: .85rem;
    color: var(--text-dim);
}

/* ------------------------------------------------------------
   B7. Related — related cases (+ 1 article) grid
   ------------------------------------------------------------ */
.related {
    padding: 40px 48px;
    margin-bottom: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.related__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 22px;
}
.related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: border-color .3s var(--ease), background .3s var(--ease),
                transform .3s var(--ease), box-shadow .3s var(--ease);
}
.related__item:hover {
    border-color: var(--border-hover);
    background: #fff;
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}
.related__kicker {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue);
}
/* article tag uses a distinct accent so it reads as "статья", not case */
.related__item--article .related__kicker { color: var(--purple); }
.related__name {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.related__desc {
    font-size: .82rem;
    color: var(--text-sec);
    line-height: 1.5;
    flex: 1;
}
.related__go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--blue);
    margin-top: 4px;
    transition: gap .25s var(--ease);
}
.related__item:hover .related__go { gap: 9px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* .cases-grid uses auto-fit minmax(320px) — it reflows on its own. */
@media (max-width: 1100px) {
    .case-stats { grid-template-columns: repeat(2, 1fr); }
    .related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .case-hero { padding: 40px 32px 36px; }
    .case-hero__title { font-size: 2.2rem; }
    .case-hero__sub { font-size: 1rem; }
    .case-section,
    .case-cta,
    .related { padding: 32px 28px; }
    .case-section__title { font-size: 1.45rem; }
    .case-tech { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .case-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .related__grid { grid-template-columns: 1fr; }
    .case-hero { padding: 32px 22px 30px; }
    .case-hero__title { font-size: 1.85rem; }
    .case-stat { padding: 22px 16px; }
    .case-stat__num { font-size: 2rem; }
    .case-section,
    .case-cta,
    .related { padding: 26px 20px; }
    .case-section__head { gap: 11px; }
    .case-section__icon { width: 38px; height: 38px; font-size: 1rem; }
    .case-section__title { font-size: 1.3rem; }
    .case-cta__title { font-size: 1.5rem; }
    .case-cta__actions { flex-direction: column; }
    .case-cta__actions .btn { width: 100%; }
    /* keep breadcrumbs from forcing horizontal scroll on tiny screens */
    .breadcrumbs { font-size: .76rem; }
    .breadcrumbs__current { max-width: 160px; }
}

/* ============================================================
   MOTION / A11Y
   ============================================================ */
.case-card,
.case-stat,
.case-tech__item,
.case-shot,
.related__item {
    will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
    .case-card,
    .case-stat,
    .case-tech__item,
    .case-shot,
    .related__item,
    .cases-filter__chip,
    .case-card__more,
    .related__go { transition: none !important; }
    .case-card:hover,
    .case-stat:hover,
    .case-tech__item:hover,
    .case-shot:hover,
    .related__item:hover { transform: none; }
}
