@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Радиусы: контейнеры 14px, всё интерактивное (кнопки, чипы, поиск) — pill. */
:root {
  --bg: #eaecf0;
  --surface: #ffffff;
  --surface-2: #e5e8ed;
  --text: #15171c;
  --muted: #5d6370;
  --line: #dadee5;
  --accent: #2f55d4;
  --accent-hover: #2446b8;
  --accent-soft: #e8edfb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(40 48 66 / .08), 0 10px 28px -14px rgb(40 48 66 / .30);
  --shadow-hover: 0 2px 4px rgb(40 48 66 / .08), 0 22px 44px -16px rgb(40 48 66 / .38);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -.02em; text-decoration: none; }
.wordmark span { color: var(--accent); }
.topbar__total { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  padding-block: clamp(28px, 5vw, 64px) clamp(32px, 5vw, 56px);
}
.intro__photo {
  width: clamp(128px, 15vw, 200px);
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}
.intro__photo img { width: 100%; height: 100%; object-fit: cover; }
.intro__monogram { font-weight: 700; font-size: clamp(40px, 5vw, 64px); letter-spacing: -.03em; color: var(--accent); }
.intro__text { max-width: 640px; }
.intro h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; }
.intro p { margin-top: 12px; color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); max-width: 58ch; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn i { font-size: 19px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); border-color: var(--line); }
.btn--ghost:hover { border-color: #c8ccd4; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 18px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.icon-btn:hover { border-color: #c8ccd4; background: var(--surface-2); }
.icon-btn:disabled { opacity: .4; cursor: default; }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: rgb(234 236 240 / .9);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.toolbar.is-stuck { border-bottom-color: var(--line); }
.toolbar__inner { display: flex; flex-direction: column; gap: 8px; padding-block: 10px; }
.chips { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip i { font-size: 17px; color: var(--muted); transition: color .2s var(--ease); }
.chip__count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; transition: color .2s var(--ease); }
.chip:hover { border-color: #c8ccd4; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.chip[aria-pressed="true"] i, .chip[aria-pressed="true"] .chip__count { color: rgb(255 255 255 / .7); }
.chip:disabled { opacity: .45; cursor: default; }

.toolbar__side { display: flex; gap: 10px; flex: none; }
.search { position: relative; flex: 0 1 240px; }
.select { position: relative; flex: none; }
.reset-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.reset-btn i { font-size: 16px; color: var(--muted); }
.reset-btn:hover { border-color: #c8ccd4; background: var(--surface-2); }
.select > i { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.select > i:first-of-type { left: 14px; font-size: 18px; }
.select__caret { right: 14px; font-size: 14px; }
.select select {
  appearance: none; -webkit-appearance: none;
  height: 40px; max-width: 230px; padding: 0 34px 0 38px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; outline: none;
  text-overflow: ellipsis;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.select select:hover { border-color: #c8ccd4; }
.select select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select.is-active select { background: var(--text); border-color: var(--text); color: #fff; }
.select.is-active > i { color: rgb(255 255 255 / .75); }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.search { width: 190px; }
.search input {
  width: 100%; height: 40px; padding: 0 16px 0 40px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: #7a808c; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Grid ---------- */
.work__status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 14px; padding-block: 14px 14px; min-height: 64px; font-variant-numeric: tabular-nums; }
.grid {
  list-style: none; margin: 0; padding: 0 0 72px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 32px 24px;
}
.case[hidden] { display: none; }
.case__link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .35s var(--ease);
}
.case__link:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #c9ced8; }
.case__link:active { transform: translateY(-1px); }

.case__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.case__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.case__link:hover .case__media img { transform: scale(1.025); }
.case__badge {
  position: absolute; left: 12px; bottom: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgb(21 23 28 / .78); color: #fff;
  font-size: 12px; font-weight: 500;
}

/* Обложка для проектов без интерфейса: схема «откуда → что делает → куда» */
.case__media--flow {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 1px 1px, rgb(47 85 212 / .13) 1px, transparent 0) 0 0 / 18px 18px,
    linear-gradient(160deg, #eef2fb, #e6e9ef);
}
.flow__icon { position: absolute; top: 14px; left: 14px; font-size: 20px; color: var(--accent); opacity: .8; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.flow li {
  position: relative;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(40 48 66 / .06);
}
.flow li:nth-child(2) { background: var(--accent); border-color: var(--accent); color: #fff; }
.flow li + li::before {
  content: ""; position: absolute; left: 50%; top: -15px;
  width: 1px; height: 12px; background: #9aa3b5;
}
.flow li + li::after {
  content: ""; position: absolute; left: calc(50% - 3px); top: -6px;
  border: 3.5px solid transparent; border-top: 4px solid #9aa3b5; border-bottom: 0;
}

.case__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.case__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.case__meta span:first-child { color: var(--accent); font-weight: 600; }
.case__title { font-size: 19px; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; }
.case__summary { color: var(--muted); font-size: 15px; line-height: 1.5; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 56px 0 96px; color: var(--muted); }
.empty > i { font-size: 32px; }
.empty__title { color: var(--text); font-weight: 600; font-size: 18px; margin-top: 8px; }
.empty .btn { margin-top: 20px; }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-weight: 500; }
.footer a:hover { color: var(--accent); }
.footer i { font-size: 18px; }
.footer__links { display: flex; gap: 20px; }

/* ---------- Viewer ---------- */
.viewer {
  width: min(1560px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgb(20 24 36 / .45);
  overflow: hidden;
}
.viewer::backdrop { background: rgb(20 23 30 / .5); backdrop-filter: blur(3px); }
.viewer__panel { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100dvh - 48px); }
.viewer__media { background: var(--surface-2); overflow: auto; position: relative; display: flex; flex-direction: column; }
.viewer__media > img { margin-block: auto; flex: none; }
.viewer__media img { width: 100%; height: auto; }
.viewer__media .case__media--flow { height: 100%; min-height: 320px; border: 0; }
.viewer__media .flow li { font-size: 18px; padding: 11px 24px; }
.viewer__media .flow { gap: 30px; }
.viewer__media .flow li + li::before { top: -25px; height: 20px; }
.viewer__media .flow li + li::after { top: -8px; }

.viewer__enlarge { display: none; }
.viewer__media > img.viewer__more { margin-block: 0; margin-top: 10px; }
.pswp__zoom-hint {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; background: rgb(255 255 255 / .92); color: var(--text);
  font: 500 14px/1.3 "Onest", system-ui, sans-serif; pointer-events: none;
  transition: opacity .4s ease;
}
.pswp__zoom-hint i { font-size: 20px; flex: none; }
.pswp__zoom-hint.is-hidden { opacity: 0; }
.tabs { position: absolute; top: 14px; left: 14px; z-index: 1; display: inline-flex; padding: 3px; border-radius: 999px; background: rgb(21 23 28 / .78); }
.tabs button { border: 0; background: transparent; color: rgb(255 255 255 / .75); height: 32px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--text); }

.viewer__info { padding: 64px 28px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.viewer__title { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
.viewer__desc { color: var(--muted); font-size: 15px; line-height: 1.55; }
.viewer__block { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.viewer__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.features li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.features li::before {
  content: ""; position: absolute; left: 2px; top: .42em;
  width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.status { padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stack:empty { display: none; }
.stack li { padding: 4px 11px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.viewer__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.viewer__links .btn { height: 42px; padding: 0 18px; font-size: 14px; }
.viewer__links .btn i { font-size: 16px; }
.viewer__cta { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.viewer__cta-title { font-weight: 650; font-size: 17px; }
.viewer__cta > p:not(.viewer__cta-title) { color: var(--muted); font-size: 14px; }
.viewer__cta-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.viewer__cta .btn { height: 42px; padding: 0 16px; font-size: 14px; }
.viewer__counter {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.viewer__nav { align-items: center; }
.viewer__nav { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: viewer-in .35s var(--ease); }
  .viewer[open]::backdrop { animation: fade-in .25s ease; }
  .case.is-entering { animation: card-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
}
@keyframes viewer-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ---------- Mobile ---------- */
@media (min-width: 861px) {
  .viewer__info { padding-bottom: 0; }
  .viewer__cta { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 22px; box-shadow: 0 -12px 16px -12px rgb(40 48 66 / .12); }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .viewer__panel { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  .viewer { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
    .viewer__panel { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; align-content: start; max-height: 100dvh; height: 100%; overflow-y: auto; }
  .viewer__media { overflow: visible; }
  .viewer__media .case__media--flow { min-height: 240px; }
  .viewer__info { padding: 22px 20px 32px; overflow: visible; }
  /* отдельная панель над картинкой: кнопки не перекрывают скриншот */
  .viewer__nav {
    grid-row: 1; position: sticky; top: 0; z-index: 3;
    padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .viewer__media { grid-row: 2; }
  .viewer__info { grid-row: 3; }
  .viewer__nav [data-close] { margin-left: auto; }
  .viewer__nav .icon-btn { width: 40px; height: 40px; }
  .viewer__nav .icon-btn:disabled { opacity: 1; color: #b3b8c2; }
  .viewer__media img { cursor: zoom-in; }
  .viewer__media > img.viewer__more { display: none; }
  /* на телефоне ничего не лежит поверх скриншота: переключатель над ним, «Увеличить» полосой под ним */
  .tabs { position: static; align-self: flex-start; margin: 10px 12px; }
  .viewer__enlarge {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 44px; border: 0; border-top: 1px solid var(--line);
    background: var(--surface-2); color: var(--accent); font-size: 15px; font-weight: 500; cursor: pointer;
  }
  .viewer__enlarge i { font-size: 19px; }
  .viewer__cta { padding-bottom: 8px; }
}
@media (max-width: 560px) {
  .intro { grid-template-columns: 1fr; }
  .topbar__total { display: none; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(48px, 12vh, 120px) 96px; }
.notfound__code { font-size: 15px; font-weight: 600; color: var(--accent); }
.notfound h1 { margin-top: 8px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.035em; line-height: 1.05; }
.notfound > p:not(.notfound__code) { margin-top: 12px; color: var(--muted); font-size: 18px; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
@media (max-width: 560px) {
  .intro__photo { width: 120px; }
  .intro__monogram { font-size: 40px; }
}

/* ---------- Страница кейса ---------- */
.topbar__back { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); }
.topbar__back:hover { color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); padding-top: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.cp-hero { padding-block: 20px 28px; max-width: 900px; }
.cp-hero h1 { margin-top: 10px; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; letter-spacing: -.03em; }
.cp-lead { margin-top: 16px; font-size: clamp(16px, 1.5vw, 19px); color: var(--muted); max-width: 70ch; }
.cp-cover { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); }
.cp-cover { display: flex; justify-content: center; }
.cp-cover img { width: 100%; height: auto; }
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; padding-block: 48px 24px; align-items: start; }
.cp-body { max-width: 72ch; font-size: 17px; line-height: 1.65; }
.cp-body h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.02em; margin: 40px 0 14px; }
.cp-body h2:first-child { margin-top: 0; }
.cp-body h3 { font-size: 19px; margin: 24px 0 8px; }
.cp-body p { margin: 0 0 14px; }
.cp-body ul { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cp-body ul li { position: relative; padding-left: 24px; }
.cp-body ul li::before {
  content: ""; position: absolute; left: 3px; top: .5em;
  width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.cp-body ol { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.cp-body ol li { position: relative; padding-left: 36px; counter-increment: step; }
.cp-body ol li::before {
  content: counter(step); position: absolute; left: 0; top: .1em;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 24px; text-align: center;
}
.cp-body code { font-size: .92em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.cp-faq { display: flex; flex-direction: column; gap: 10px; }
.cp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.cp-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.cp-faq summary::-webkit-details-marker { display: none; }
.cp-faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.cp-faq details[open] summary::after { content: "−"; }
.cp-faq details p { margin: 10px 0 0; color: var(--muted); }
.cp-aside { position: sticky; top: 24px; }
.cp-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.cp-facts { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.cp-facts dt { font-size: 13px; color: var(--muted); }
.cp-facts dd { margin: 2px 0 0; font-size: 15px; }
.cp-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.cp-links .btn { height: 40px; padding: 0 14px; font-size: 14px; }
.cp-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  margin: 24px 0 56px; padding: 28px 32px; border-radius: var(--radius); background: var(--accent-soft);
}
.cp-cta h2 { font-size: 24px; letter-spacing: -.02em; }
.cp-cta p { margin-top: 6px; color: var(--muted); }
.cp-related { padding-bottom: 24px; }
.cp-related h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 18px; }
.cp-related .grid { padding-bottom: 40px; }
@media (max-width: 960px) {
  .cp-layout { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .cp-aside { position: static; order: -1; }
  .cp-cta { padding: 22px; }
}
.viewer__links .btn--page { border-color: var(--accent); color: var(--accent); }

/* ---------- Компактная шапка и фильтры в две строки ---------- */
.intro {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px 24px;
  padding-block: 20px 24px;
}
.intro__photo { width: 140px; }
.intro__monogram { font-size: 44px; }
.intro__text { max-width: none; }
.intro h1 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.03em; }
.intro p { margin-top: 8px; font-size: 16px; max-width: 60ch; }
.intro__actions { margin-top: 0; flex-wrap: nowrap; }

.filter-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.filter-row__label { flex: none; width: 96px; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 40px; }   /* по первой строке чипов */
.filter-row .chips { flex: 1; flex-wrap: wrap; overflow: visible; }   /* на ПК чипы переносятся, а не уходят за край */
.filter-row .search { flex: 0 0 220px; width: auto; }
.chip { height: 36px; }
.chip:disabled { opacity: 1; color: #a3a9b4; border-style: dashed; background: transparent; }
.chip:disabled .chip__count { color: #a3a9b4; }

.work__status { min-height: 56px; padding-block: 10px; }
.work__status > p { color: var(--muted); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters:empty { display: none; }
.active-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px;
  border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.active-pill i { font-size: 14px; }
.active-pill:hover { background: #dbe3fa; }
.reset-btn { height: 32px; border: 0; background: transparent; padding: 0 6px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.reset-btn:hover { background: transparent; color: var(--text); }

@media (max-width: 1100px) and (min-width: 561px) {
  .intro { grid-template-columns: auto minmax(0, 1fr); }
  .intro__actions { grid-column: 2; }
}
@media (max-width: 860px) {
  .toolbar { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }   /* на телефоне панель не прилипает: две строки фильтров съедали бы четверть экрана */
  .intro__actions .btn__long { display: none; }
  .filter-row { flex-wrap: wrap; gap: 6px 10px; }
  .filter-row__label { width: auto; line-height: 1.4; align-self: center; }
  .filter-row .chips { flex: 1 0 100%; order: 2; flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .filter-row .search { order: 1; flex: 1 1 160px; margin-left: auto; }
  .filter-row:has(.search) .filter-row__label { align-self: center; }
}
@media (max-width: 560px) {
  .intro { grid-template-columns: 80px minmax(0, 1fr); gap: 12px 14px; padding-block: 14px 18px; }
  /* телефон: фото и имя в строку, описание под ними на всю ширину */
  .intro__text { display: contents; }
  .intro__photo { grid-row: 1; grid-column: 1; }
  .intro h1 { grid-row: 1; grid-column: 2; align-self: center; }
  .intro p { grid-row: 2; grid-column: 1 / -1; margin-top: 0; }
  .intro__actions { grid-row: 3; }
  .intro__photo { width: 80px; }
  .intro__monogram { font-size: 24px; }
  .intro h1 { font-size: 24px; }
  .intro p { font-size: 14.5px; line-height: 1.4; }
  .intro__actions { grid-column: 1 / -1; }
  .intro__actions .btn { flex: 1; justify-content: center; height: 42px; }
}

/* ---------- Скриншоты на странице кейса ---------- */
.cp-shot { margin: 0 0 20px; display: flex; flex-direction: column; align-items: center; }
.cp-shot img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cp-shot figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.cp-cover--flow { aspect-ratio: 16 / 7; }
.cp-cover--flow .case__media--flow { width: 100%; height: 100%; border: 0; }
.cp-cover--flow .flow li { font-size: 18px; padding: 11px 24px; }
.cp-cover--flow .flow { gap: 30px; }
.cp-cover--flow .flow li + li::before { top: -25px; height: 20px; }
.cp-cover--flow .flow li + li::after { top: -8px; }
@media (max-width: 560px) { .cp-cover--flow { aspect-ratio: 4 / 3; } }
