/* ═══════════════════════════════════════════════════════════════
   Кейс ККСК (cases/sites-kksk.html) — визуальная подача: обложка,
   видео сайта, экраны 2560×1440, мобильная версия.
   Голос агентства — система F-Brand; акцент проекта — Hero Green ККСК.
   Классы с префиксом kk-, чтобы не пересекаться с общими case-page правилами.
   ═══════════════════════════════════════════════════════════════ */

.kk {
  --kk-ink: #15130f;
  --kk-green: #2c673a;
}

body.case-page.kk main { padding-top: 0 !important; }
.kk main *, .kk main *::before, .kk main *::after { box-sizing: border-box; }
.kk main svg { flex: none; }
.kk-wrap { width: min(1600px, 100%); margin: 0 auto; padding: 0 var(--pad); }
.kk img, .kk video { display: block; max-width: 100%; }
.kk a { color: inherit; text-decoration: none; }
/* Ссылка внутри абзаца и в хлебных крошках — кеглем окружения, а не общими 18px для a из fonts.css */
.kk p a, .kk-crumbs a { font-size: inherit; }

/* ── Появление ─────────────────────────────────────────── */
html.js .kk-r { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1.2s var(--ease); }
html.js .kk-r.kk-in { opacity: 1; transform: none; }
html.js .kk-r[data-d="1"] { transition-delay: 0.12s; }
html.js .kk-r[data-d="2"] { transition-delay: 0.24s; }
html.js .kk-r[data-d="3"] { transition-delay: 0.36s; }

/* ── Общие элементы ────────────────────────────────────── */
.kk-label {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.kk-label::after { content: ""; flex: 1; height: 1px; background: rgba(13, 14, 18, 0.14); }

.kk-sec { padding: clamp(80px, 9vw, 160px) 0; }
.kk-sec--tight { padding-top: 0; }

.kk-btn {
  display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 30px;
  border-radius: 50px; background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font: 300 17px/1 var(--font-text); box-shadow: inset 0 0 0 1px var(--ink);
  transition: transform 0.4s var(--ease), box-shadow 0.3s, background 0.4s ease, color 0.4s ease;
}
.kk-btn:hover { transform: translateY(-2px); background: transparent; color: var(--ink); }
.kk-btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(13, 14, 18, 0.2); }
.kk-btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.kk-btn svg { width: 16px; height: 16px; }

/* ═══ Обложка ══════════════════════════════════════════════ */
.kk-cover {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; background: var(--kk-ink); color: #fff; isolation: isolate;
}
.kk-cover__bg { position: absolute; inset: -6% 0; z-index: -2; }
.kk-cover__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 2.4s var(--ease); }
html.js .kk-cover.kk-in .kk-cover__bg img { transform: scale(1); }
.kk-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(21, 19, 15, 0.55) 0%, rgba(21, 19, 15, 0.1) 35%, rgba(21, 19, 15, 0.85) 100%);
}
.kk-cover__mark { position: absolute; left: var(--pad); right: var(--pad); top: 42%; translate: 0 -50%; color: #fff; opacity: 0.16; pointer-events: none; }
.kk-cover__mark svg { width: 100%; height: auto; overflow: visible; }
.kk-cover__mark path { transform-box: fill-box; transform-origin: center; }
html.js .kk-cover__mark path { opacity: 0; transform: translateX(-60px); transition: opacity 0.9s ease, transform 1.3s var(--ease); }
html.js .kk-cover.kk-in .kk-cover__mark path { opacity: 1; transform: none; }
.kk-cover__mark path:nth-child(2) { transition-delay: 0.12s !important; }
.kk-cover__mark path:nth-child(3) { transition-delay: 0.24s !important; }
.kk-cover__mark path:nth-child(4) { transition-delay: 0.36s !important; }

.kk-cover__inner { position: relative; padding-top: 140px; padding-bottom: clamp(28px, 4vw, 56px); }
.kk-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, 0.5); margin-bottom: 24px; }
.kk-crumbs a:hover { color: #fff; }
body.case-page .kk-cover h1 { color: #fff; max-width: 18ch; font-size: clamp(34px, 4.4vw, 84px) !important; }
.kk-cover__row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; gap: var(--gap); }
.kk-cover__lead { max-width: 36ch; font-size: clamp(16px, 1.2vw, 21px); line-height: 1.5; color: rgba(255, 255, 255, 0.75); }

.kk-meta { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 0.6fr; gap: var(--gap); padding: 36px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.18); margin: clamp(32px, 4vw, 56px) 0 0; }
.kk-meta dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); margin-bottom: 10px; }
.kk-meta dd { margin: 0; font-size: 16px; line-height: 1.45; color: #fff; }
.kk-meta a { border-bottom: 1px solid rgba(255, 255, 255, 0.35); transition: border-color 0.3s; }
.kk-meta a:hover { border-color: #fff; }

/* ═══ О проекте ════════════════════════════════════════════ */
.kk-intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap); align-items: start; }
.kk-intro .kk-label::after { display: none; }
.kk-intro__text { font-weight: 300; font-size: clamp(22px, 2.2vw, 40px); line-height: 1.28; letter-spacing: -0.01em; color: var(--ink); }

/* ═══ Подсказка у курсора на обложке (cases/sites-kksk.html) ═══
   Тот же круг, что «смотреть» у кейсов на главной (.home-cursor), — инверсия под тёмную обложку */
.kk-cue { position: fixed; top: 0; left: 0; z-index: 250; pointer-events: none; }
.kk-cue span {
  position: absolute; left: -56px; top: -56px; display: grid; place-items: center; width: 112px; height: 112px;
  border-radius: 50%; background: #fff; color: var(--ink); font-size: 15px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.45);
  transform: scale(0); transition: transform 0.5s var(--ease);
}
.kk-cue.is-on span { transform: scale(1); }

/* ═══ Обзор: что сделали и главное ═════════════════════════ */
.kb-hero .kk-meta.kk-meta--3 { grid-template-columns: 1.6fr 1fr 0.5fr; }
.kk-over { margin-top: clamp(56px, 6vw, 112px); padding: clamp(56px, 6vw, 112px) 0; background: #dfe1e6; }
.kk-over__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: start; }
.kk-over .kk-label { margin-bottom: 28px; }
.kk-over .kk-label::after { background: rgba(13, 14, 18, 0.18); }
.kk-tags { display: flex; flex-wrap: wrap; gap: 8px; max-width: 520px; margin: 0; padding: 0; list-style: none; }
.kk-tags li { padding: 11px 20px; border-radius: 50px; box-shadow: inset 0 0 0 1px rgba(13, 14, 18, 0.22); font-size: 15px; line-height: 1.2; color: var(--ink); }
.kk-keys { margin: 0; padding: 0; list-style: none; }
.kk-keys li { padding: 20px 0; border-top: 1px solid rgba(13, 14, 18, 0.14); font-size: clamp(18px, 1.5vw, 26px); line-height: 1.35; color: var(--ink); }
.kk-keys li:first-child { padding-top: 0; border-top: 0; }

/* ═══ Рассказ: задача и подход ═════════════════════════════ */
.kk-sec--flush { padding: 0; }
.kk-story { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap); align-items: start; }
.kk-story .kk-label::after { display: none; }
.kk-story__body { display: grid; gap: 20px; }
.kk-story__body h2 { max-width: 22ch; margin: 0 0 12px; }
.kk-story__body p { max-width: 52ch; margin: 0; font-weight: 300; font-size: clamp(18px, 1.4vw, 24px); line-height: 1.5; color: var(--text); }

/* ═══ Главы: заголовок и строка → экран на всю ширину ════════ */
.kk-ch .kb-flow { margin-top: 0; }
.kk-ch + .kk-mob { margin-top: clamp(80px, 9vw, 160px); }
.kk-mobile__text p { max-width: 36ch; margin: 24px 0 0; font-size: clamp(16px, 1.1vw, 19px); line-height: 1.55; color: var(--text); }

/* ═══ Проект в цифрах ══════════════════════════════════════ */
.kk-nums { padding-bottom: 0; }
.kk-nums h2 { margin: 0 0 clamp(32px, 4vw, 64px); }
.kk-nums__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.kk-nums__list li { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: clamp(240px, 24vw, 440px); padding: 28px clamp(16px, 2vw, 36px) 0 0; }
.kk-nums__list li + li { padding-left: clamp(16px, 2vw, 36px); border-left: 1px solid var(--line); }
.kk-nums__list b { font-family: var(--font-display); font-weight: 500; font-size: clamp(80px, 10vw, 200px); line-height: 0.85; color: var(--ink); }
.kk-nums__list span { max-width: 32ch; font-size: 16px; line-height: 1.55; color: var(--text); }

/* ═══ Видео ════════════════════════════════════════════════ */
.kk-browser {
  border-radius: 14px; overflow: hidden; background: #1c1b18; box-shadow: 0 40px 120px -40px rgba(13, 14, 18, 0.55);
  transform-origin: 50% 0; will-change: transform;
}
.kk-browser__bar { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #26241f; }
.kk-browser__bar i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.kk-browser__url { margin: 0 auto; padding: 4px 18px; border-radius: 50px; background: rgba(255, 255, 255, 0.07); font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.kk-browser video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; cursor: pointer; }
.kk-ctrl { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.kk-play {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(13, 14, 18, 0.2); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: background 0.3s, color 0.3s;
}
.kk-play:hover { background: var(--ink); color: #fff; }
.kk-play svg { width: 16px; height: 16px; }
.kk-chapters { flex: 1; display: flex; gap: 4px; min-width: 0; }
.kk-chap { position: relative; flex: var(--len) 1 0; min-width: 0; background: none; border: 0; padding: 14px 0 0; text-align: left; cursor: pointer; color: var(--muted); font: 300 12px/1.2 var(--font-text); }
.kk-chap::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 3px; background: rgba(13, 14, 18, 0.12); }
.kk-chap s { position: absolute; top: 0; left: 0; height: 3px; border-radius: 3px; background: var(--ink); width: 0; text-decoration: none; }
.kk-chap span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.3s; }
.kk-chap:hover span, .kk-chap.is-cur span { color: var(--ink); }

/* ═══ Экраны ═══════════════════════════════════════════════ */
.kk-gallery { display: grid; gap: clamp(16px, 2.4vw, 48px); }
.kk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 48px); }
.kk-shot { margin: 0; }
.kk-shot img {
  width: 100%; height: auto; border-radius: 12px; background: #d9dbe0;
  box-shadow: 0 0 0 1px rgba(13, 14, 18, 0.06), 0 30px 80px -50px rgba(13, 14, 18, 0.6);
}
html.js .kk-shot.kk-r img { clip-path: inset(6% 6% 6% 6% round 12px); transition: clip-path 1.4s var(--ease-io); }
html.js .kk-shot.kk-r.kk-in img { clip-path: inset(0 0 0 0 round 12px); }
.kk-shot figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ═══ Мобильная версия ═════════════════════════════════════ */
.kk-mob { background: #dfe1e6; }
.kk-mobile { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 80px); align-items: center; }
.kk-mobile__text h2 { margin-top: 24px; max-width: 12ch; }
.kk-mobile__text .kk-label::after { background: rgba(13, 14, 18, 0.18); }
.kk-phone { position: relative; width: min(100%, 360px); margin: 0 auto; padding: 12px; border-radius: 52px; background: #0b0b0c; box-shadow: 0 0 0 2px #2b2b2e, 0 50px 100px -30px rgba(13, 14, 18, 0.6); }
.kk-phone::before { content: ""; position: absolute; top: 22px; left: 50%; width: 92px; height: 26px; translate: -50% 0; border-radius: 20px; background: #000; z-index: 2; }
.kk-phone video { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; border-radius: 40px; background: #111; }
.kk-strip { margin-top: clamp(48px, 6vw, 96px); overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: none; padding: 0 var(--pad) 8px; }
.kk-strip::-webkit-scrollbar { display: none; }
.kk-strip.is-drag { cursor: grabbing; }
.kk-strip__row { display: flex; gap: 18px; width: max-content; }
.kk-strip figure { margin: 0; width: clamp(200px, 19vw, 300px); flex: none; }
.kk-strip figure div { height: clamp(420px, 40vw, 620px); border-radius: 26px; overflow: hidden; background: #ccc; box-shadow: inset 0 0 0 1px rgba(13, 14, 18, 0.08); }
.kk-strip img { width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; transition: object-position 3.5s ease-in-out; }
.kk-strip figure:hover img { object-position: bottom; }

/* ═══ ИИ-помощник: текст + вертикальный ролик (cases/sites-sobor.html) ═══ */
.kk-ai { padding-bottom: 0; }
.kk-ai__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 80px); align-items: center; }
.kk-ai__text h2 { margin-top: 24px; max-width: 16ch; }
.kk-ai__text p { max-width: 44ch; margin: 24px 0 0; font-size: clamp(16px, 1.1vw, 19px); line-height: 1.55; color: var(--text); }
.kk-ai .kk-keys { max-width: 560px; margin-top: clamp(32px, 3vw, 48px); }
/* Ролик — на всю высоту экрана; если колонка у́же 9:16, обрезаются тёмные поля по бокам */
.kk-ai__video { height: 100svh; aspect-ratio: 9 / 16; max-width: 100%; margin: 0 auto; border-radius: 28px; overflow: hidden; background: #14120e; box-shadow: 0 50px 100px -40px rgba(13, 14, 18, 0.6); }
.kk-ai__video video { width: 100%; height: 100%; object-fit: cover; }

/* ═══ Финал ════════════════════════════════════════════════ */
.kk-final { padding: clamp(80px, 9vw, 160px) 0 clamp(60px, 6vw, 100px); overflow: hidden; }
.kk-final__row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: clamp(40px, 5vw, 80px); }
.kk-final__ask { font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 2.4vw, 44px); line-height: 1.05; text-transform: uppercase; max-width: 20ch; }
.kk-final__btns { display: flex; gap: 12px; flex-wrap: wrap; }
.kk-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gap); align-items: center; margin-top: clamp(60px, 7vw, 120px); padding-top: 28px; border-top: 1px solid rgba(13, 14, 18, 0.14); }
.kk-next__img { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: #ddd; }
.kk-next__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.kk-next:hover .kk-next__img img { transform: scale(1.05); }
.kk-next small { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kk-next b { display: block; margin-top: 10px; font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 2.6vw, 46px); line-height: 1.05; text-transform: uppercase; }
.kk-next span { display: block; margin-top: 12px; color: var(--muted); }

/* ═══ Адаптив страницы ═════════════════════════════════════ */
@media (max-width: 900px) {
  .kk-cover__row, .kk-intro, .kk-mobile, .kk-next, .kk-over__grid, .kk-story, .kk-ai__grid { grid-template-columns: 1fr; }
  .kk-meta { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .kb-hero .kk-meta.kk-meta--3 { grid-template-columns: 1fr 1fr; }
  .kk-meta--3 > div:first-child { grid-column: 1 / -1; }
  .kk-over__grid { row-gap: 48px; }
  .kk-nums__list { grid-template-columns: 1fr; }
  .kk-nums__list li { min-height: 0; padding: 28px 0 32px; }
  .kk-nums__list li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .kk-chap span { display: none; }
  .kk-mobile__text { order: -1; }
  /* на телефоне ролик Справщика — во весь экран, от края до края */
  .kk-ai__video { aspect-ratio: auto; max-width: none; margin: 0 calc(-1 * var(--pad)); border-radius: 0; }
}
@media (max-width: 600px) {
  .kk-pair { grid-template-columns: 1fr; }
  .kk-cover__mark { top: 34%; }
}
@media (prefers-reduced-motion: reduce) {
  html.js .kk-r { opacity: 1; transform: none; }
  html.js .kk-shot.kk-r img { clip-path: none; }
  .kk-cue { display: none; }
}
