/* ==========================================================================
   София — стили сайта
   Базовый макет: 1440px (в макете 1080pt × 4/3). Всё резиновое: clamp() + grid.
   ========================================================================== */

/* ---------- Шрифты ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
}

/* ---------- Переменные ---------- */
:root {
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-muted: #e4e4e0;
  --tile: #efefec;
  --ink: #000000;
  --ink-2: #5e5e5a;
  --ink-3: #8e8e89;
  --ink-4: #9b9b97;
  --ink-brand: #7c7c78;
  --line: #d9d9d5;
  --accent: #d4ff3a;
  --accent-hover: #c6f21f;
  --backdrop: rgba(18, 18, 16, 0.475);

  --gutter: clamp(16px, 2.78vw, 40px);
  --gap: 12px;
  --r-hero: 20px;
  --r-card: 16px;
  --r-panel: 14px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

::selection { background: rgba(201, 255, 0, 0.45); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted { color: var(--ink-4); }

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

.label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: var(--ink-4);
}

/* ---------- Кнопка ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }

/* ---------- Шапка ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: clamp(60px, 5.28vw, 76px);
}

.logo {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.95vw, 28px);
}

.nav__link {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s;
}
[data-current-view="about"] .nav__link:not([aria-current]) { color: var(--ink-4); }
.nav__link:hover,
[data-current-view="about"] .nav__link:not([aria-current]):hover { color: var(--ink); }

.nav__tg {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: transform 0.2s;
}
.nav__tg:hover { transform: scale(1.06); }
.nav__tg .icon { width: 17px; height: 17px; margin-left: -1px; }

/* ---------- Экраны ---------- */
.view { animation: view-in 0.35s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Главная: герой ---------- */
.hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1020 / 622;
  max-height: max(460px, calc(100svh - 96px));
  width: 100%;
  border-radius: var(--r-hero);
  background: #dededa;
}

.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% 22%;
}

.hero__content {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 3.06vw, 44px);
  padding-bottom: clamp(22px, 2.8vw, 40px);
}

.hero__title {
  font-size: clamp(18px, 2.085vw, 30px);
  font-weight: 600;
  line-height: 1.134;
  letter-spacing: -0.028em;
}
.hero__title span { display: block; }
.hero__title .muted { color: var(--ink-3); }

.hero .btn { flex: none; margin-bottom: 4px; }

/* ---------- Главная: клиенты ---------- */
.clients {
  padding-top: clamp(44px, 6.1vw, 88px);
  padding-bottom: clamp(20px, 3.3vw, 48px);
}

.clients__label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink-3);
  text-align: center;
}

.clients__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(24px, 2.9vw, 42px);
  padding-inline: clamp(0px, 4.17vw, 60px);
  font-size: clamp(20px, 1.945vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.028em;
  color: var(--ink-brand);
}

/* ---------- О проекте: заголовок ---------- */
.about-head { padding-top: clamp(18px, 3.4vw, 49px); }

.about-head__title {
  margin-left: -0.028em;
  font-size: clamp(54px, 9.45vw, 136px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.056em;
}

.about-head__row {
  display: grid;
  grid-template-columns: minmax(140px, 25.15%) minmax(0, 1fr) auto;
  align-items: start;
  margin-top: clamp(16px, 2.2vw, 32px);
}

.about-head__tag {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}
.about-head__tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.about-head__lead {
  max-width: 27.5em;
  font-size: clamp(18px, 1.67vw, 24px);
  font-weight: 500;
  line-height: 1.29;
  letter-spacing: -0.02em;
}

.about-head__hint {
  padding: 2px 0 0 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-4);
  text-align: right;
  white-space: nowrap;
}

/* ---------- О проекте: сетка карточек ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: var(--gap);
  margin-top: clamp(24px, 3.05vw, 44px);
}

.bento__what { grid-column: span 2; grid-row: span 2; }
.bento__how,
.bento__cases,
.bento__clients,
.bento__demo { grid-column: span 2; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--surface);
  transition: box-shadow 0.25s, transform 0.25s;
}

/* Ссылка-«плюс», растянутая на всю карточку */
.card__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.card__open::after {
  content: "";
  position: absolute;
  top: 17px;
  right: 21px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7.5v9M7.5 12h9' stroke='%23fff' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / 24px no-repeat;
  transition: transform 0.3s;
}
.card__open:focus-visible { outline-offset: -4px; }

@media (hover: hover) {
  .card:has(.card__open):hover { box-shadow: 0 12px 32px rgba(18, 18, 16, 0.08); }
  .card:has(.card__open):hover .card__open::after { transform: rotate(90deg) scale(1.1); }
}

.card__body { position: relative; margin-top: auto; }

.card__title {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.025em;
}
.card__title--lg {
  margin-top: 0;
  font-size: clamp(20px, 1.81vw, 26px);
  line-height: 1.115;
}
.card__title--xl {
  font-size: clamp(26px, 2.36vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.032em;
}
.card__title--case {
  font-size: clamp(24px, 2.085vw, 30px);
  line-height: 1.1;
}

.card__text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-2);
}
.card__text--lg {
  max-width: 19.6em;
  margin-top: 8px;
  font-size: 15px;
  line-height: 21.5px;
}

.icon-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 24px;
  border-radius: 8px;
  background: var(--tile);
}
.icon-tile--white { background: var(--surface); }

.avatars { display: flex; margin-bottom: 24px; }
.avatars img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatars img + img { margin-left: -8px; }
.avatars--sm { margin-bottom: 0; }
.avatars--sm img { width: 24px; height: 24px; }
.avatars--sm img + img { margin-left: -5px; }

/* Карточка «Что такое София» */
.card--photo {
  padding: 28px;
  background: #dededa;
}
.card--photo .card__open::after { top: 21px; right: 29px; }
.card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
}
/* Фото по высоте карточки; центр фигуры привязан к ~73% ширины карточки,
   но не правее, чем позволяет левый край снимка (56.9% ширины кадра = 93.2% высоты). */
.card__bg {
  position: absolute;
  top: 0;
  left: 73%;
  left: min(75cqw, 93.2cqh);
  width: auto;
  max-width: none;
  height: 100%;
  transform: translateX(-56.9%);
}
.card--photo .label { color: var(--ink-3); }
.card--photo .card__title { max-width: 10em; margin-top: 6px; }

/* Карточка «Как устроена» */
.how {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3.1vw, 45px);
  padding: 4px 4px 0 5px;
}

.triangle {
  position: relative;
  width: 160px;
  height: 142px;
}
.triangle svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.triangle .num {
  position: absolute;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
}
.triangle__n1 { left: 50%; top: 17.6%; }
.triangle__n2 { left: 16.9%; top: 82.4%; }
.triangle__n3 { left: 83.1%; top: 82.4%; }

.num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}
.num--filled { background: var(--ink); color: #fff; }

/* Карточка «Наши кейсы» */
.card--case {
  flex-direction: row;
  gap: 22px;
  padding: 10px;
}
.case-cover {
  flex: none;
  width: 42.7%;
  min-height: 230px;
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 30%;
}
.card--case .card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 0;
  padding: 8px 10px 10px 0;
}
.card--case .card__open::after { top: 17px; right: 21px; }
.case-info { margin-top: auto; padding-top: 16px; }
.case-more {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 24px;
  color: var(--ink-4);
}

/* Карточка «Клиенты» */
.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.9vw, 27px) 16px;
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 6px;
  font-size: clamp(18px, 1.81vw, 26px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.028em;
  color: var(--ink-brand);
}

/* Карточка «Демонстрация» */
.card--demo { background: var(--surface-muted); }
.card--demo .label { color: var(--ink-3); }
.card--demo .card__title { margin-top: 10px; }
.card--demo .card__title .muted { display: block; color: var(--ink-3); }
.card--demo .btn { align-self: flex-start; margin-top: 17px; }
.demo__contact {
  margin-top: 11px;
  padding-top: 13px;
  border-top: 1px solid #cfcfca;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}
.demo__contact a:hover,
.site-footer a:hover { color: var(--ink); }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 30px; }
.site-footer__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 28px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink-3);
  text-wrap: pretty;
}
.site-footer strong { font-weight: 500; color: var(--ink); }
.site-footer__policy { white-space: nowrap; }

/* ==========================================================================
   Модальные окна
   ========================================================================== */
.modal {
  width: min(1080px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
}
.modal--wide { width: min(1180px, calc(100% - 32px)); }
.modal--narrow { width: min(960px, calc(100% - 32px)); }

.modal:focus { outline: none; }
.modal::backdrop { background: var(--backdrop); }

.modal[open] { animation: modal-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.modal[open]::backdrop { animation: fade-in 0.28s ease both; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

html.is-modal-open { overflow: hidden; }

.modal__inner { padding: 36px; }

.modal__close {
  position: sticky;
  top: 17px;
  z-index: 3;
  float: right;
  width: 40px;
  height: 40px;
  margin: -19px -19px 0 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f0ed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='m14.5 14.5 11 11m0-11-11 11' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 40px no-repeat;
  font-size: 0;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}
.modal__close:hover { background-color: #e4e4e0; transform: rotate(90deg); }

.modal__title {
  margin-top: 6px;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.037em;
}

.modal__lead {
  max-width: 36em;
  margin-top: 22px;
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.016em;
}

.modal__subtitle {
  margin-top: 26px;
  font-size: 18px;
  font-weight: 600;
  line-height: 21px;
}
.modal__subtitle + .grid { margin-top: 13px; }

.modal__cta { margin-top: 24px; }

.grid {
  display: grid;
  gap: var(--gap);
  margin-top: 24px;
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.panel {
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-panel);
  background: var(--bg);
}
.panel--dark { background: var(--surface-muted); }

/* Теги-пилюли */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.tags li {
  padding: 0 14px;
  border: 1px solid #d6d6d1;
  border-radius: 999px;
  font-size: 13px;
  line-height: 30px;
  color: var(--ink-2);
  white-space: nowrap;
}
.tags--footer { margin-top: 16px; }

/* Списки с разделителями */
.lines { margin-top: 16px; }
.lines li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}
.lines--bold li {
  padding: 8px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
}

/* «Что такое София» — режимы */
.mode {
  display: flex;
  flex-direction: column;
  min-height: 297px;
  padding: 26px;
}
.mode__title {
  max-width: 12em;
  margin-top: 8px;
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.027em;
}
.mode__text {
  max-width: 30em;
  margin-top: 10px;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-2);
}

/* «Как устроена» — блоки */
.block { padding: 22px; min-height: 370px; }
.block__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.02em;
}
.block__text {
  min-height: 42px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-2);
}

.chars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
}
.chars img {
  width: 100%;
  aspect-ratio: 55 / 74;
  margin-bottom: 8px;
  border-radius: 8px;
  object-fit: cover;
}
.chars b,
.chars span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chars b { font-size: 12px; font-weight: 600; line-height: 16px; }
.chars span { font-size: 11px; line-height: 15px; color: var(--ink-4); }

/* Карточки с иконкой */
.feature { min-height: 164px; }
.features--tall .feature { min-height: 204px; }
.grid--4 .feature { min-height: 184px; }
.feature .icon-tile { margin-bottom: 0; }
.feature h3 {
  margin-top: 15px;
  font-size: 18px;
  font-weight: 600;
  line-height: 21px;
  letter-spacing: -0.005em;
  hyphens: auto;
}
.feature p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 20.5px;
  color: var(--ink-2);
}

/* Кейсы */
.case {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 170px;
  padding: 10px;
}
.case__img {
  flex: none;
  width: 120px;
  height: 150px;
  border-radius: 10px;
  object-fit: cover;
}
.case__img--empty {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--surface-muted);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-3);
  text-align: center;
}
.case__body { min-width: 0; padding: 4px 10px 4px 0; }
.case__title {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.02em;
}
.case__text {
  max-width: 26em;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 20px;
  color: var(--ink-2);
}
.case .tags { margin-top: 10px; }
.case--draft {
  border: 1px dashed #cfcfca;
  background: var(--surface);
}

/* Команда */
.team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}
.team__people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.team__people img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
}
.team__people b {
  display: block;
  margin-top: 10px;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
}
.team__clients .lines { margin-top: 3px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */

/* Подсказка уходит под лид */
@media (max-width: 1380px) {
  .card--photo .card__text--lg { max-width: 16.5em; }
  .about-head__row { grid-template-columns: minmax(120px, 25.15%) minmax(0, 1fr); }
  .about-head__hint { grid-column: 2; margin-top: 14px; padding-left: 0; text-align: left; white-space: normal; }
}

@media (max-width: 1180px) {
  .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .features--tall .feature { min-height: 0; }
}

/* Планшет: сетка 2 колонки */
@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .card.bento__what { grid-row: auto; min-height: clamp(420px, 60vw, 560px); }
  .card { min-height: 230px; }
  .card--static { min-height: 0; }
  .card__bg {
    left: 0;
    width: 100%;
    transform: none;
    object-fit: cover;
    object-position: 20% 30%;
  }
  .card__title--lg { font-size: 24px; }
  .hero .btn { min-height: 46px; padding: 0 24px; font-size: 14px; }
}

@media (max-width: 900px) {
  /* Герой: фото сверху, текст и кнопка — под ним */
  .hero {
    overflow: visible;
    aspect-ratio: auto;
    max-height: none;
    border-radius: 0;
    background: none;
  }
  .hero__media {
    position: relative;
    inset: auto;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    max-height: 68svh;
    border-radius: var(--r-hero);
    background: #dededa;
  }
  .hero__media img { object-position: 58% 22%; }
  .hero__content {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 22px 0 0;
  }
  .hero__title { max-width: none; font-size: clamp(22px, 4.2vw, 30px); }
  .hero__title span:not(.muted) { display: inline; }
  .hero .btn { align-self: flex-start; min-height: 52px; margin: 0; padding: 0 28px; font-size: 15px; }

  .clients__list {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
    padding-inline: 0;
  }

  .about-head__row { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .about-head__hint { grid-column: auto; margin-top: 0; }

  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 .feature { min-height: 0; }
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .block,
  .feature { min-height: 0; }
  .block__text { min-height: 0; }
  .chars { max-width: 380px; }
  .team { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .mode { min-height: 0; }
  .mode__title { max-width: none; }
  .case { min-height: 0; }
}

/* Телефон: одна колонка */
@media (max-width: 640px) {
  .hero__media { aspect-ratio: 4 / 5; max-height: 62svh; }
  .hero__media img { object-position: 62% 22%; }
  .hero .btn { align-self: stretch; }

  .clients__list { grid-template-columns: repeat(2, auto); justify-content: space-around; text-align: center; }

  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento > * { grid-column: auto; }
  .card { min-height: 0; }

  /* Фото-карточка: изображение сверху с растворением, текст ниже */
  .card.bento__what { min-height: 0; }
  .card--photo { padding: 0; background: #dcdcd7; }
  .card__media { position: static; overflow: visible; container-type: normal; }
  .card__bg {
    position: static;
    aspect-ratio: 4 / 3;
    height: auto;
    object-position: 60% 20%;
    -webkit-mask-image: linear-gradient(#000 72%, transparent);
    mask-image: linear-gradient(#000 72%, transparent);
  }
  .card--photo .card__body { margin-top: -14px; padding: 0 20px 24px; }
  .card--photo .card__title { max-width: none; }
  .card--photo .card__text--lg { max-width: none; }
  .card--photo .card__open::after { top: 17px; right: 17px; }
  .card__open::after { right: 17px; }

  .how { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 20px; padding: 20px 0 0; }
  .triangle { width: 136px; height: 121px; }
  .triangle .num { width: 42px; height: 42px; }

  .icon-tile,
  .avatars { margin-bottom: 28px; }
  .avatars--sm { margin-bottom: 0; }

  .card--case { flex-direction: column; gap: 0; }
  .case-cover { width: 100%; min-height: 0; aspect-ratio: 16 / 10; }
  .card--case .card__body { padding: 16px 10px 10px; }
  .card--case .card__open::after {
    top: 20px;
    right: 20px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  }
  .case-info { padding-top: 6px; }

  .client-grid { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .card--demo .btn { align-self: stretch; padding-inline: 16px; }

  /* Модальные окна — почти во весь экран */
  .modal,
  .modal--wide,
  .modal--narrow {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }
  .modal__inner { padding: 24px 18px 20px; }
  .modal__close { top: 12px; margin: -12px -6px 0 12px; }
  .modal__title { margin-top: 8px; }
  .modal__lead { margin-top: 14px; }
  .grid { margin-top: 20px; }
  .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 16px; }
  .mode { padding: 20px 18px; }
  .block { padding: 18px 16px; }
  .block__title { font-size: 22px; }
  .case { align-items: flex-start; gap: 14px; padding: 10px; }
  .case__img { width: 92px; height: 116px; }
  .case__title { font-size: 21px; line-height: 26px; }
  .tags li { padding: 5px 13px; border-radius: 15px; line-height: 18px; white-space: normal; }
  .team__people { gap: 8px; }
  .team__people img { border-radius: 12px; }
  .team__people b { font-size: 13px; line-height: 17px; }
  .modal__cta { width: 100%; padding-inline: 16px; }
}

@media (max-width: 420px) {
  .grid--4,
  .grid--5 { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 12px; }
  .nav__link { font-size: 13px; }
  .nav__tg { margin-left: 0; }
  .btn { white-space: normal; text-align: center; }
}

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

@media print {
  .view[hidden] { display: block !important; }
  .card__open::after,
  .nav__tg { display: none; }
}
