/* ==========================================================
   TR3NITY — стили. Светлый «студийный» минимализм: серый фон, матовый графит, мягкие тени.
   Прежние версии (тёмные) лежат в backup/.
   ========================================================== */

:root {
  --bg: #ebebea;          /* светло-серая «стена студии», как фон логотипа */
  --surface: #f6f6f5;
  --ink: #1d1d1f;         /* матовый графит: текст, кнопки, акцент */
  --text: #1d1d1f;
  --muted: #56565b;       /* второстепенный текст (контраст ≥ 6:1) */
  --muted-2: #77777c;     /* крупный второстепенный текст и подписи */
  --line: #d9d9d7;
  --line-2: #c3c3c0;
  --success: #16a34a;

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 64px;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1400px 900px at 18% -10%, #f8f8f7 0%, #ececeb 50%, #e3e3e2 100%) fixed, var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Пока скрипт ставит нужный язык — не показываем английский */
.i18n-pending main, .i18n-pending .header, .i18n-pending .footer { visibility: hidden; }

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--ink); color: var(--bg); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }

/* старые классы оформления: в светлой теме без градиентов и стекла */
.grad-text { color: var(--text); }
.glass { position: relative; background: var(--surface); border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -24px rgba(0, 0, 0, .28); }

/* ---------- Типографика ---------- */
.h2 { font-size: clamp(30px, 7vw, 56px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 700; text-wrap: balance; }
.h3 { font-size: clamp(21px, 4.8vw, 28px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }

/* Подписи разделов с номерами: «01 — Как это работает» */
main { counter-reset: sec; }
.section__head .label { counter-increment: sec; }
.label {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.section__head .label::before { content: counter(sec, decimal-leading-zero) " —"; color: var(--ink); font-weight: 600; letter-spacing: .04em; }

/* ---------- Кнопки ---------- */
.btn {
  --bh: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--bh); padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 16px; line-height: 1.2; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--sm { --bh: 40px; padding: 0 18px; font-size: 14px; }
.btn--lg { --bh: 58px; padding: 0 28px; font-size: 17px; }
.btn--primary { color: #fff; background: var(--ink); border: 1px solid var(--ink); }
.btn--ghost { color: var(--ink); background: transparent; border: 1px solid var(--ink); }
.btn small { font-weight: 500; font-size: 13px; opacity: .7; }
@media (hover: hover) {
  .btn--primary:hover { background: #2a2a2e; border-color: #2a2a2e; }
  .btn--ghost:hover { background: var(--ink); color: #fff; }
}

/* ---------- Шапка ---------- */
.header { position: fixed; left: 0; right: 0; top: 0; z-index: 50; height: var(--header-h); }
.header::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(235, 235, 234, .82);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.header.scrolled::after { border-bottom-color: var(--line); }
.header__inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.header__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header__cta { display: none; }

/* Логотип-надпись: «maison●ai» */
.logo { display: inline-flex; align-items: center; font-weight: 800; font-size: 22px; letter-spacing: .02em; line-height: 1; color: var(--ink); }
.logo__text { display: inline-flex; align-items: baseline; }
.logo__dot { display: inline-block; width: .21em; height: .21em; margin: 0 .07em 0 .09em; border-radius: 50%; background: currentColor; transform: translateY(-.02em); }
.logo__text b { color: var(--muted-2); font-weight: 800; }   /* «3» в названии чуть светлее */

.nav {
  position: fixed; left: 0; right: 0; top: var(--header-h);
  display: flex; flex-direction: column;
  padding: 8px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .25s, transform .25s var(--ease), visibility 0s .25s;
}
.nav a { padding: 16px 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; border-bottom: 1px solid var(--line); }
.nav a.nav__cta { margin-top: 20px; padding: 0 24px; font-size: 16px; border: 1px solid var(--ink); }
.nav.open { opacity: 1; transform: none; visibility: visible; transition: opacity .25s, transform .25s var(--ease); }

.lang { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.lang button { min-width: 38px; height: 30px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); transition: color .2s, background-color .2s; }
.lang button[aria-pressed="true"] { color: #fff; background: var(--ink); }
@media (hover: hover) { .lang button:not([aria-pressed="true"]):hover { color: var(--ink); } }

.burger { width: 44px; height: 44px; display: grid; place-content: center; gap: 6px; border-radius: 12px; }
.burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Первый экран ---------- */
.hero { position: relative; min-height: 100svh; padding: calc(var(--header-h) + 24px) 0 56px; display: flex; }
/* margin-block: auto центрирует по вертикали, но если контент выше экрана — не залезает под шапку */
.hero__inner { display: grid; gap: 8px; width: 100%; margin-block: auto; }
.hero__visual { order: -1; width: min(38vw, 150px); margin: 0 0 28px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { align-items: flex-start; }
.eyebrow__dot { flex: none; width: 7px; height: 7px; margin-top: .55em; border-radius: 50%; background: var(--ink); }
.hero__title { font-size: clamp(40px, 8.4vw, 100px); line-height: .98; letter-spacing: -0.05em; font-weight: 700; text-wrap: balance; }
.hero__title-2 { color: var(--muted-2); }
.hero__sub { margin-top: 24px; max-width: 34ch; font-size: clamp(17px, 4.4vw, 20px); color: var(--muted); }
.hero__actions { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.hero__actions .btn { width: 100%; }

/* Живой знак «m.» */
/* Знак T³: матовый графит с мягкой тенью, как объёмные буквы на стене */
.t3 { width: 100%; height: auto; overflow: visible; filter: drop-shadow(10px 16px 14px rgba(0, 0, 0, .22)) drop-shadow(2px 3px 2px rgba(0, 0, 0, .12)); }
.t3__t { transform-box: fill-box; transform-origin: 50% 100%; animation: t3-rise .9s .15s cubic-bezier(.2, .8, .2, 1) backwards; }
.t3__3 { transform-box: fill-box; transform-origin: 50% 50%; animation: t3-pop .7s .85s cubic-bezier(.3, 1.6, .5, 1) backwards, t3-float 5s 1.6s ease-in-out infinite; }
@keyframes t3-rise { from { opacity: 0; transform: translateY(14%) scaleY(.92); } }
@keyframes t3-pop { from { opacity: 0; transform: scale(.3) rotate(-12deg); } }
@keyframes t3-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8%); } }
/* ---------- Бегущая строка ---------- */
.marquee {
  overflow: hidden; padding: 22px 0; border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee__list { display: flex; flex: none; }
.marquee__list li {
  display: flex; align-items: center; gap: 32px; padding-right: 32px;
  font-size: clamp(18px, 3.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; white-space: nowrap;
}
.marquee__list li::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Секции ---------- */
.section { position: relative; padding: 96px 0; }
.section--tight { padding: 24px 0; }
.section__head { max-width: 860px; margin-bottom: 48px; }
.section__lead { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 56ch; }

/* ---------- Как это работает ---------- */
.how { display: grid; gap: 56px; align-items: center; }
.flow { display: grid; }
.flow__step { padding: 24px 22px 24px 86px; min-height: 108px; }
.flow__step h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 4px; }
.flow__step p { color: var(--muted); font-size: 15px; }
.flow__icon {
  position: absolute; left: 22px; top: 24px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--ink);
}
.flow__num { position: absolute; right: 20px; top: 18px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted-2); }
.flow__link { height: 44px; position: relative; }
.flow__link svg { position: absolute; left: 44px; top: 0; width: 44px; height: 24px; overflow: visible; transform-origin: 0 0; transform: rotate(90deg) translateY(-12px); }
.flow__base { stroke: var(--line-2); stroke-width: 1.5; fill: none; vector-effect: non-scaling-stroke; }
.flow__glow { stroke: var(--ink); stroke-width: 1.5; fill: none; vector-effect: non-scaling-stroke; stroke-dasharray: 100; stroke-dashoffset: 100; }
.flow__dots { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; fill: none; vector-effect: non-scaling-stroke; stroke-dasharray: 0.1 33.3; opacity: 0; }
.flow.run .flow__glow { animation: draw 1s var(--ease) forwards; }
.flow.run .flow__link:nth-of-type(4) .flow__glow { animation-delay: .9s; }
.flow.run .flow__dots { animation: dots-in .4s 1.2s forwards, dots 2.4s 1.2s linear infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dots-in { to { opacity: 1; } }
@keyframes dots { from { stroke-dashoffset: 33.4; } to { stroke-dashoffset: 0; } }

/* телефон с видео */
.phone { justify-self: center; width: min(76vw, 320px); text-align: center; }
.phone__frame { position: relative; padding: 9px; border-radius: 44px; background: var(--ink); box-shadow: 0 40px 80px -30px rgba(11, 11, 12, .45); }
.phone__frame .video { border-radius: 35px; }
.phone figcaption { margin-top: 16px; font-size: 14px; color: var(--muted); }
.video { position: relative; overflow: hidden; background: #111; aspect-ratio: 9 / 16; }
.video video { width: 100%; height: 100%; object-fit: cover; }
.video__play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .12); transition: opacity .3s; }
.video__play svg { width: 68px; height: 68px; padding: 21px 19px 21px 23px; border-radius: 50%; fill: var(--ink); background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
@media (hover: hover) { .video__play:hover svg { transform: scale(1.06); } }
.video.playing .video__play { opacity: 0; pointer-events: none; }

/* ---------- Карточки ---------- */
.cards { display: grid; gap: 14px; }
.card { padding: 28px 24px 30px; transition: border-color .25s, transform .3s var(--ease); }
.card h3 { margin: 22px 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.card p { color: var(--muted); font-size: 15px; }
.card__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line-2); color: var(--ink); }
.card__icon .i { width: 24px; height: 24px; }
@media (hover: hover) { .card:hover { border-color: var(--ink); transform: translateY(-3px); } }

/* ---------- Работы ---------- */
.case { padding: 26px 22px; }
.case__head { margin-bottom: 26px; }
.case__head .h3 { margin-top: 14px; max-width: 28ch; }
.case__body { display: grid; gap: 26px; }
.case__col h4 { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.case__col p { color: var(--muted); }
.checks { display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 30px; font-size: 15px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; 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='m6 12.5 4 4 8-9' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.case__hint { margin: 32px 0 14px; font-size: 14px; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--ink);
}
.tag--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  margin: 0 -22px; padding-inline: 22px; scroll-padding-inline: 22px; scrollbar-width: thin;
}
.gallery li { scroll-snap-align: start; }
.gallery__item { display: block; width: 100%; aspect-ratio: 9 / 17; overflow: hidden; border-radius: 14px; background: #11161f; border: 1px solid var(--line); transition: transform .3s var(--ease); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (hover: hover) { .gallery__item:hover { transform: translateY(-4px); } }

.study { margin-top: 14px; padding: 26px 22px; display: grid; gap: 18px; }
.study .h3 { margin: 14px 0 8px; }
.study p { color: var(--muted); }
.study__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); }
.study__icon .i { width: 24px; height: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--ink); border: 1px solid var(--line-2); }

/* ---------- Попробуйте ---------- */
.try { padding: 34px 24px; display: grid; gap: 26px; }
.try__orb { display: none; }
.try__copy p:last-child { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 46ch; }
.try .btn { width: 100%; }

/* ---------- Команда ---------- */
.person { padding: 28px 24px; display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; }
.avatar { grid-row: span 2; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; background: var(--ink); }
.avatar--2 { background: #d4d4d2; color: var(--ink); }
.avatar--3 { background: #bdbdba; color: var(--ink); }
.person h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.person p { color: var(--muted); font-size: 15px; }

/* ---------- Шаги работы ---------- */
.steps { display: grid; gap: 14px; }
.step { padding: 28px 24px; }
.step__num { display: block; font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.05em; color: var(--line-2); margin-bottom: 22px; }
.step h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Контакты: инвертированный чёрный блок ---------- */
.contact { padding: 44px 24px; background: var(--ink); color: #fff; border-color: var(--ink); text-align: left; }
.contact .grad-text { color: #fff; }
.contact__sub { margin-top: 14px; color: #a1a1a6; font-size: 18px; }
.contact__buttons { margin-top: 32px; display: grid; gap: 10px; }
.contact__buttons .btn { width: 100%; justify-content: flex-start; padding: 0 22px; }
.contact__buttons .btn small { margin-left: auto; }
.contact .btn--primary { background: #fff; color: var(--ink); border-color: #fff; }
.contact .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
@media (hover: hover) {
  .contact .btn--primary:hover { background: #e9e9ec; border-color: #e9e9ec; }
  .contact .btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
}
.socials { margin-top: 26px; display: flex; gap: 10px; }
.social { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; border: 1px solid rgba(255, 255, 255, .3); transition: background-color .2s, color .2s; }
@media (hover: hover) { .social:hover { background: #fff; color: var(--ink); } }

/* ---------- Подвал ---------- */
.footer { padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer__inner { display: grid; gap: 12px; }
.footer__made, .footer__copy { color: var(--muted); font-size: 14px; }

/* ---------- Лайтбокс ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(11, 11, 12, .94); touch-action: none; animation: fade .25s; color: #fff; }
.lightbox[hidden] { display: none; }
.lightbox__stage { display: grid; justify-items: center; gap: 12px; padding: 64px 16px 24px; transition: transform .2s, opacity .2s; }
.lightbox__stage img { max-height: calc(100svh - 140px); max-width: 100%; width: auto; border-radius: 16px; user-select: none; -webkit-user-drag: none; }
.lightbox__stage figcaption { color: #c9c9ce; font-size: 14px; text-align: center; max-width: 40ch; }
.lightbox__count { display: inline-block; margin-left: 8px; color: #fff; white-space: nowrap; font-weight: 600; }
.lightbox__close, .lightbox__nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__nav { top: 50%; margin-top: -24px; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Подсказка ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 95;
  max-width: calc(100% - 32px); padding: 14px 18px; border-radius: 14px;
  font-size: 15px; text-align: center; color: #fff; background: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Появление при прокрутке ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .hero [data-reveal] { opacity: 1; transform: none; transition: none; animation: rise .8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

/* ==========================================================
   Планшет 768+
   ========================================================== */
@media (min-width: 768px) {
  :root { --gutter: 36px; --header-h: 72px; }
  .header__cta { display: inline-flex; }
  .hero__actions { flex-direction: row; }
  .hero__actions .btn { width: auto; }
  .hero__visual { width: 220px; }
  .section { padding: 128px 0; }
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .cards--2 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .case { padding: 40px; }
  .case__body { grid-template-columns: 1fr 1.3fr; gap: 40px; }
  .gallery { grid-auto-columns: 24%; margin: 0 -40px; padding-inline: 40px; scroll-padding-inline: 40px; }
  .study { grid-template-columns: auto 1fr; padding: 34px 40px; gap: 26px; }
  .try { padding: 48px; }
  .try .btn { width: auto; justify-self: start; }
  .contact { padding: 64px 56px; }
  .contact__buttons { grid-template-columns: repeat(3, 1fr); }
  .contact__buttons .btn { flex-direction: column; align-items: flex-start; gap: 4px; height: auto; padding: 22px; white-space: normal; border-radius: 18px; }
  .contact__buttons .btn .i { width: 24px; height: 24px; margin-bottom: 10px; }
  .contact__buttons .btn small { margin-left: 0; }
  .lightbox__nav--prev { left: 24px; }
  .lightbox__nav--next { right: 24px; }
  .lightbox__close { top: 20px; right: 20px; }
  .footer__inner { grid-template-columns: auto 1fr auto; align-items: center; }
  .footer__made { justify-self: center; }
}

/* ==========================================================
   Десктоп 1024+
   ========================================================== */
@media (min-width: 1024px) {
  .burger { display: none; }
  .nav { position: static; flex-direction: row; gap: 4px; padding: 0; margin-left: 32px; background: none; border: 0; opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 8px 14px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); border: 0; border-radius: 999px; transition: color .2s; }
  .nav a:hover { color: var(--ink); }
  .nav a.nav__cta { display: none; }

  .hero { padding-bottom: 72px; }
  /* текст первого экрана ближе к левому краю, знак «m.» крупно справа */
  .hero__inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 48px; }
  /* на ноутбуках с невысоким экраном заголовок чуть меньше, чтобы кнопки были видны сразу */
  .hero__title { font-size: clamp(48px, min(6.4vw, 11.5vh), 100px); }
  .hero__visual { order: 0; width: 100%; max-width: 560px; margin: 0 0 0 auto; }
  .hero__sub { max-width: 44ch; }

  .how { grid-template-columns: 1fr 360px; gap: 80px; }
  .flow__step { padding: 28px 30px 28px 98px; }
  .flow__step h3 { font-size: 21px; }
  .flow__step p { font-size: 16px; }
  .flow__icon { left: 26px; top: 28px; width: 48px; height: 48px; }
  .flow__link { height: 56px; }
  .flow__link svg { left: 50px; width: 56px; }

  .cards--4 { grid-template-columns: repeat(4, 1fr); }
  .try { grid-template-columns: 1fr auto; align-items: center; gap: 40px; }
  .gallery { grid-template-columns: repeat(7, 1fr); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; }
}

@media (min-width: 1280px) {
  .how { grid-template-columns: 1fr 380px; gap: 110px; }
  /* на больших экранах вся страница шире, края одинаковые у шапки, первого экрана и разделов */
  .container { max-width: 1680px; padding-inline: clamp(36px, 4vw, 72px); }
}

/* При «меньше движения» в системе: без плавной прокрутки и с меньшим сдвигом */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: translateY(8px); }
}

/* ==========================================================
   Кейс-история, «кто мы», DEMO (из слайдов Instagram)
   ========================================================== */
.tone { color: var(--muted-2); }
.card__num { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.04em; color: var(--line-2); line-height: 1; }
.tag--dark { background: var(--ink); color: #fff; border-color: var(--ink); }

.cs { display: grid; gap: 72px; }
.cs-intro { display: grid; gap: 8px; padding: 28px 22px 0; overflow: hidden; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cs-title { font-size: clamp(32px, 7.4vw, 64px); line-height: 1; letter-spacing: -0.045em; font-weight: 700; text-wrap: balance; }
.cs-sub { margin-top: 18px; font-size: clamp(17px, 4.2vw, 20px); color: var(--muted); max-width: 32ch; }
.cs-intro__img { width: min(78%, 360px); justify-self: center; margin-top: 18px; }

.cs-h { font-size: clamp(28px, 6.4vw, 48px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 700; text-wrap: balance; }
.cs-block .cs-h { margin-bottom: 32px; }
.cs-problems, .cs-results { display: grid; gap: 14px; }
.cs-card { padding: 24px 22px; }
.cs-card h4 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 6px; }
.cs-card p { color: var(--muted); font-size: 15px; margin: 0; }
.cs-ico { display: block; font-size: 30px; line-height: 1; margin-bottom: 16px; }
.cs-note { margin-top: 22px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cs-block--tight .case__hint { margin-top: 0; }

/* шаги */
.cs-steps { display: grid; gap: 64px; }
.cs-steps__list { display: grid; gap: 72px; }
.cs-list { display: grid; gap: 12px; margin-top: 24px; }
.cs-list li { position: relative; padding-left: 26px; font-size: 17px; }
.cs-list li::before { content: ""; position: absolute; left: 0; top: .52em; width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }
.cs-step__img { width: min(82%, 360px); margin: 32px auto 0; }
.cs-step__img--wide { width: 100%; max-width: 560px; }
.cs-steps__visual { display: none; }
/* у кадров со слайдов свой фон и своя тень: растворяем края, чтобы не было видно прямоугольника */
.cs-intro__img, .cs-step__img, .cs-stage img {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 93%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 93%, transparent); mask-composite: intersect;
}

/* DEMO */
.demo { display: grid; gap: 28px; padding: 36px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -24px rgba(0, 0, 0, .28); }
.demo__copy p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.demo__plaque { justify-self: start; display: grid; justify-items: center; gap: 2px; padding: 20px 30px; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .5); }
.demo__plaque small { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #c9c9ce; }
.demo__plaque b { font-size: 46px; font-weight: 700; letter-spacing: .12em; line-height: 1.1; }
.demo__buttons { display: flex; flex-wrap: wrap; gap: 10px; }

/* команда: тёмные квадратные плашки с инициалами, как на слайде */
.person .avatar { border-radius: 18px; background: linear-gradient(145deg, #3a3a3e, #121214); color: #fff; font-size: 19px; letter-spacing: .02em; box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .5); }
.team__langs { margin-top: 26px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.step__num { font-size: 48px; }

@media (min-width: 768px) {
  .cs-problems { grid-template-columns: repeat(3, 1fr); }
  .cs-results { grid-template-columns: repeat(2, 1fr); }
  .cs-intro { grid-template-columns: 1.1fr .9fr; align-items: center; padding: 48px 48px 0; }
  .cs-intro__img { align-self: end; margin-top: 0; }
  .demo { grid-template-columns: 1fr auto; align-items: center; padding: 48px; }
  .demo__buttons { grid-column: 1 / -1; }
}

/* десктоп: телефон «прилипает» справа и меняет экран при прокрутке шагов */
@media (min-width: 1024px) {
  .cs-results { grid-template-columns: repeat(4, 1fr); }
  .cs-steps { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
  .cs-steps__list { gap: 0; }
  .cs-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .5s var(--ease); }
  .cs-step.is-active { opacity: 1; }
  .cs-step__img { display: none; }
  .cs-steps__visual { display: block; position: sticky; top: calc(var(--header-h) + 4vh); height: calc(100vh - var(--header-h) - 8vh); }
  .cs-stage { position: relative; height: 100%; }
  .cs-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: translateY(24px) scale(.98); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .cs-stage img.is-on { opacity: 1; transform: none; }
  .cs-dots { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
  .cs-dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background-color .3s, transform .3s; }
  .cs-dots li.is-on { background: var(--ink); transform: scale(1.3); }
  .demo { grid-template-columns: 1.2fr auto auto; }
  .demo__buttons { grid-column: auto; flex-direction: column; }
}

/* лента скриншотов внутри кейса: прокрутка до краёв экрана без выхода за них */
.cs-block .gallery { margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
@media (min-width: 1024px) { .cs-block .gallery { margin: 0; padding: 0; } }

/* компактная шапка кейса */
.cs-head { max-width: 900px; }
.cs-any { margin-top: 18px; padding-left: 16px; border-left: 2px solid var(--ink); font-size: 16px; color: var(--muted); max-width: 60ch; }
.cs { gap: 88px; }
@media (min-width: 1024px) {
  /* картинка по своему размеру, а не растянутая рамка: тогда растворение краёв ложится на сам кадр */
  .cs-stage img { inset: 0; margin: auto; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: initial; }
  .cs-steps__visual { height: calc(100vh - var(--header-h) - 12vh); top: calc(var(--header-h) + 6vh); }
  .cs-step { min-height: 64vh; }
}

/* ==========================================================
   Главная: карточки работ  ·  Страница работ: вкладки кейсов
   ========================================================== */
.work-cards { display: grid; gap: 16px; }
.work-card { display: grid; grid-template-columns: 1fr; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.work-card__img { height: 220px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #f1f1f0, #dcdcda); }
.work-card__img img { width: 62%; max-width: 230px; margin-top: 40px; align-self: start; }
.work-card__img--icon .i { width: 64px; height: 64px; color: var(--ink); opacity: .85; }
.work-card__body { padding: 24px 22px 26px; }
.work-card__body h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 4px 0 8px; }
.work-card__body p { color: var(--muted); font-size: 15px; }
.work-card__more { display: inline-flex; gap: 8px; margin-top: 18px; font-weight: 600; font-size: 15px; }
.work-card__more span:last-child { transition: transform .25s var(--ease); }
@media (hover: hover) { .work-card:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 28px 50px -26px rgba(0,0,0,.35); } .work-card:hover .work-card__more span:last-child { transform: translateX(4px); } }
.work-any { margin-top: 28px; }

.cases-hero { padding-bottom: 24px; }
.cases-hero .section__head { margin-bottom: 32px; }
.cases-body { padding-top: 24px; }
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab { flex: none; display: grid; gap: 2px; text-align: left; padding: 14px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: background-color .2s, color .2s, box-shadow .2s; }
.tabs__k { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tabs__t { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.tabs__tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 16px 30px -18px rgba(0,0,0,.5); }
.tabs__tab[aria-selected="true"] .tabs__k { color: #b4b4b9; }
@media (hover: hover) { .tabs__tab:not([aria-selected="true"]):hover { background: #fff; } }
.tab-panel[hidden] { display: none; }

.cs-video { display: grid; gap: 32px; align-items: center; }
.cs-video__copy p:last-child { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 40ch; }
.cs-results--3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .work-cards { grid-template-columns: repeat(2, 1fr); }
  .work-card__img { height: 260px; }
  .cs-video { grid-template-columns: 1fr 340px; }
  .cs-results--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) { .cs-results.cs-results--3 { grid-template-columns: repeat(3, 1fr); } }
.work-card__img img { -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); }

/* обложки карточек работ: аккуратные мини-макеты интерфейса вместо обрезанного скриншота */
.work-card__img { position: relative; height: 240px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 30% 0%, #fbfbfa 0%, #e9e9e8 55%, #dadad8 100%); }
.work-card__img::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: rgba(0, 0, 0, .06); }
.wc-panel { background: #17212b; color: #e9eef4; border-radius: 16px; padding: 14px 16px; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .15); font-size: 13px; line-height: 1.35; }
.wc-stack { position: relative; width: min(86%, 380px); height: 170px; }
.wc-panel--back { position: absolute; left: 6%; right: 0; top: 64px; transform: rotate(2.5deg); background: #1e2a36; }
.wc-row { display: flex; justify-content: space-between; align-items: baseline; }
.wc-row b { font-size: 15px; }
.wc-row em, .wc-notif em { font-style: normal; color: #8b98a6; font-size: 12px; }
.wc-panel small { display: block; margin-top: 4px; color: #9aa7b4; font-size: 12px; }
.wc-chips { display: flex; gap: 6px; margin-top: 12px; }
.wc-chips span { padding: 4px 10px; border-radius: 999px; background: #243241; font-size: 12px; }
.wc-chips span:first-child { background: #e8eef5; color: #17212b; font-weight: 600; }
.wc-notif { position: absolute; left: 0; right: 6%; top: 0; display: flex; align-items: center; gap: 10px; transform: rotate(-2deg); background: #232f3c; }
.wc-av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #5aa9e6, #3d6fd9); color: #fff; font-weight: 700; font-size: 12px; }
.wc-notif__txt { display: grid; min-width: 0; }
.wc-notif__txt b { font-size: 13px; }
.wc-notif__txt span { color: #c8d2dc; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-notif em { margin-left: auto; align-self: flex-start; }

.wc-chat { width: min(80%, 320px); display: grid; gap: 8px; padding: 16px; border-radius: 20px; background: #0e1621; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .55); transform: rotate(-1.5deg); }
.wc-bubble { justify-self: start; max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #182533; color: #e9eef4; font-size: 13px; line-height: 1.35; }
.wc-bubble b { color: #fff; }
.wc-bubble--me { justify-self: end; border-radius: 14px 14px 4px 14px; background: #2b5278; }
.wc-btns { display: flex; gap: 6px; }
.wc-btns span { flex: 1; text-align: center; padding: 6px 4px; border-radius: 10px; background: #1f2c3a; color: #cfe0f2; font-size: 12px; font-weight: 600; }
@media (min-width: 768px) { .work-card__img { height: 260px; } }
/* третий кейс: фото объекта в сообщении агента */
.wc-photo { display: grid; gap: 6px; padding: 6px 6px 8px; }
.wc-photo i { display: block; height: 62px; border-radius: 10px; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35)), linear-gradient(115deg, #6d5a48 0%, #a58b6f 30%, #3e5a4a 55%, #c9c2b6 75%, #59514a 100%); }
.wc-photo { font-size: 12px; }
/* четвёртый кейс: мини-макет мобильного сайта студии */
.wc-site { width: min(64%, 240px); border-radius: 22px; overflow: hidden; background: #fbf3ef; box-shadow: 0 24px 40px -18px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.12); transform: rotate(-1.5deg); font-size: 12px; }
.wc-site__bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.wc-site__bar b { font-weight: 800; letter-spacing: .02em; color: #1d1d1f; }
.wc-site__bar i { color: #f2385a; font-style: normal; }
.wc-site__bar span { width: 18px; height: 18px; border-radius: 50%; background: #1d1d1f; }
.wc-site__hero { display: grid; gap: 10px; justify-items: start; margin: 0 10px; padding: 18px 14px; border-radius: 14px; background: #f2385a; color: #fff; }
.wc-site__hero b { font-size: 17px; font-weight: 800; line-height: 1.05; text-transform: uppercase; letter-spacing: -0.01em; }
.wc-site__hero em { font-style: normal; font-weight: 700; font-size: 11px; padding: 6px 12px; border-radius: 999px; background: #1d1d1f; }
.wc-site__times { display: flex; gap: 6px; padding: 12px 10px 14px; }
.wc-site__times span { flex: 1; text-align: center; padding: 6px 0; border-radius: 999px; border: 1px solid #e3d6d0; color: #1d1d1f; font-weight: 600; }
.wc-site__times .is-on { background: #f2385a; border-color: #f2385a; color: #fff; }
/* карточки работ: 2×2 на планшете и ноутбуке, 4 в ряд на широком экране */
@media (min-width: 1440px) { .work-cards { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) {
  /* обложки одной высоты, чтобы заголовки карточек стояли на одной линии */
  .work-card { grid-template-rows: auto 1fr; }
  .work-cards .work-card__img.work-card__img { height: 300px; min-height: 0; padding: 0; }
}

/* высота обложки по содержимому: макет чата не обрезается на телефоне */
.work-card__img, .work-card__img.work-card__img { height: auto; min-height: 240px; padding: 30px 0; }

/* подпись под кнопками первого экрана */
.hero__note { margin-top: 14px; font-size: 14px; color: var(--muted-2); }

/* услуги: 6 компактных плиток (название + одна строка) */
.cards--svc .card { padding: 22px 22px 24px; }
.cards--svc .card__num { font-size: 15px; letter-spacing: .04em; color: var(--muted-2); }
.cards--svc .card h3 { margin: 14px 0 6px; font-size: 19px; }
@media (min-width: 640px) and (max-width: 1023px) { .cards--svc { grid-template-columns: repeat(2, 1fr); } }

/* почему мы: строки «номер · заголовок · пояснение» */
.why { border-top: 1px solid var(--line); }
.why__row { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.why__num { grid-row: span 2; font-size: 13px; font-weight: 600; color: var(--muted-2); padding-top: 5px; }
.why__row h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.why__row p { color: var(--muted); font-size: 15px; }
@media (min-width: 768px) {
  .why__row { grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1.2fr); align-items: baseline; padding: 28px 0; }
  .why__num { grid-row: auto; padding-top: 0; }
  .why__row h3 { font-size: 24px; }
  .why__row p { font-size: 16px; }
}

/* обложка карточки работы из кадра видео */
.work-cards .work-card__img--photo.work-card__img--photo { padding: 0; place-items: stretch; }
.work-card__img--photo img { width: 100%; max-width: none; height: 100%; min-height: 240px; margin: 0; object-fit: cover; object-position: 50% 4%; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 767px) { .work-card__img--photo img { height: 300px; } }

/* кейс «ИИ-ассистент для агентств»: проблема, два тарифа с видео, итог */
.aa-problem { display: grid; gap: 10px; margin-top: 14px; max-width: 62ch; }
.aa-problem li { position: relative; padding-left: 22px; font-size: clamp(17px, 2vw, 20px); line-height: 1.45; }
.aa-problem li::before { content: ""; position: absolute; left: 0; top: .62em; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.tiers { display: grid; gap: 16px; margin: 8px 0 clamp(48px, 7vw, 80px); }
.tier { display: grid; gap: 24px; padding: 26px 22px; align-content: start; }
.tier__badge { justify-self: start; display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tier--pro .tier__badge { background: var(--ink); color: #fff; border-color: var(--ink); }
.tier .cs-h { margin: 12px 0 14px; }
.tier__phone { justify-self: center; width: min(68vw, 260px); }
.video--auto { border-radius: 35px; }
@media (min-width: 900px) {
  .tiers { grid-template-columns: 1fr 1fr; }
  .tier { padding: 32px 30px; grid-template-rows: auto 1fr; }
  .tier__phone { align-self: end; }
}
.aa-result { margin-top: 22px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 17px; }
.aa-result b { font-weight: 700; }
.demo--try { align-items: center; }
@media (min-width: 900px) { .demo--try { grid-template-columns: 1fr auto; } }

/* окно выбора связи */
.cdlg { width: min(440px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.08); }
.cdlg::backdrop { background: rgba(20, 20, 22, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cdlg[open] { animation: cdlg-in .28s var(--ease); }
@keyframes cdlg-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.cdlg__box { position: relative; padding: 30px 22px 22px; }
.cdlg__x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: transparent; border: 1px solid var(--line); color: var(--ink); }
.cdlg__x .i { width: 16px; height: 16px; }
.cdlg__t { margin-top: 10px; font-size: clamp(26px, 6vw, 32px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; padding-right: 40px; }
.cdlg__sub { margin-top: 8px; color: var(--muted); font-size: 15px; }
.cdlg__list { display: grid; gap: 10px; margin-top: 22px; }
.cdlg__row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cdlg__opt { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.cdlg__ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: var(--ink); }
.cdlg__ico .i { width: 22px; height: 22px; }
.cdlg__ico--tg { background: #2aabee; }
.cdlg__ico--wa { background: #25d366; }
.cdlg__ico--mail { background: #ea4335; }
.cdlg__txt { display: grid; min-width: 0; }
.cdlg__txt b { font-size: 17px; font-weight: 700; }
.cdlg__txt small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdlg__go { margin-left: auto; font-weight: 600; transition: transform .2s var(--ease); }
.cdlg__copy { padding: 0 16px; border-radius: 18px; background: transparent; border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink); }
@media (hover: hover) {
  .cdlg__opt:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 16px 30px -20px rgba(0,0,0,.35); }
  .cdlg__opt:hover .cdlg__go { transform: translateX(4px); }
  .cdlg__copy:hover, .cdlg__x:hover { background: #fff; }
}
@media (max-width: 479px) {
  .cdlg__row { grid-template-columns: 1fr; }
  .cdlg__copy { padding: 10px 16px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .cdlg[open] { animation: none; } }

/* очень узкие телефоны (320–419px): длинные кнопки переносятся, а не растягивают страницу */
@media (max-width: 419px) {
  .contact__buttons .btn { flex-wrap: wrap; height: auto; min-height: var(--bh); padding: 12px 18px; white-space: normal; column-gap: 10px; row-gap: 2px; }
  .contact__buttons .btn small { margin-left: 0; flex-basis: 100%; padding-left: 30px; }
  .demo { padding: 28px 18px; }
  .demo__buttons .btn { width: 100%; height: auto; min-height: var(--bh); padding: 12px 18px; white-space: normal; text-align: center; }
}
/* элементы сеток не растягивают колонку длинным словом */
.cs > *, .tiers > *, .cards > *, .cs-results > *, .cs-video > *, .work-cards > * { min-width: 0; }
.cs-title, .cs-h, .h2, .cs-card h4 { overflow-wrap: break-word; }
/* планшет: в карточке команды аватар над именем, иначе имя не помещается в трёх колонках */
@media (min-width: 768px) and (max-width: 1099px) {
  .person { grid-template-columns: 1fr; row-gap: 16px; padding: 24px 20px; }
  .person .avatar { grid-row: auto; }
}

/* полноэкранный режим: вертикальное видео целиком, без обрезки (в рамке телефона оно заполняет экран через cover) */
.video video:fullscreen { object-fit: contain; background: #000; }
.video video:-webkit-full-screen { object-fit: contain; background: #000; }
