/* =========================================================
   BimBam — digital design system
   Тёмная тема, неоновые градиенты, сетка, стекло.
   Адаптив: 320px → 4K ТВ. Без зависимостей.
   ========================================================= */

/* ---------- Шрифт больших заголовков ----------
   Elastre © 2025 The Elastre Project Authors, SIL Open Font License 1.1
   (static/fonts/Elastre-OFL.txt, источник: myskotom.ru).
   Elastre — только для КРУПНЫХ заголовков (hero, h1, h2): мелко у него
   кириллические «ж» и «к» похожи на «н». Мелкие заголовки (карточки, имена,
   проекты) набраны основным шрифтом — см. --font-heading-sm.
   Одно начертание: объявляем его на весь диапазон весов, чтобы браузер не
   рисовал «поддельный» жирный. Elastre на ~17% шире Unbounded, под который
   рассчитана вёрстка, поэтому size-adjust уменьшает его до той же ширины. */
@font-face {
  font-family: "Elastre";
  src: url("/static/fonts/Elastre.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 84%;
}

/* ---------- Токены ---------- */
:root {
  --bg: #06030d;
  --bg-2: #0c0717;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --solid: #130c22;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f4f0ff;
  --muted: #a99fc6;
  --violet: #8b5cf6;
  --violet-d: #6328b1;
  --magenta: #ff4fd8;
  --cyan: #22e5ff;
  --grad: linear-gradient(110deg, #8b5cf6 0%, #d946ef 50%, #ff4fd8 100%);
  --grad-cool: linear-gradient(110deg, #22e5ff 0%, #8b5cf6 100%);
  --radius: 1.25rem;
  --radius-s: .75rem;
  --font-display: "Elastre", "Montserrat", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading-sm: var(--font-body); /* мелкие заголовки: Elastre мелко плохо читается */
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 1.25rem;
  --header-h: 4.5rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  font-size: 16px;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  /* фон страницы задаёт html; у body он прозрачный — иначе фон body закрывает слой .bg-fx (z-index: -1) */
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(217, 70, 239, .45); color: #fff; }

/* Фокус: заметный для клавиатуры и пульта ТВ (D-pad) */
:focus { outline: 2px solid var(--cyan); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  background: #fff; color: #000; padding: .6rem 1rem; border-radius: .5rem; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Иконки ---------- */
.i { width: 1.25em; height: 1.25em; flex: none; }
.i--lg { width: 1.75rem; height: 1.75rem; }

/* ---------- Фон: сетка + свечение + шум ---------- */
.bg-fx {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(139, 92, 246, .28), transparent 60%),
    radial-gradient(50rem 36rem at -10% 30%, rgba(255, 79, 216, .16), transparent 60%),
    radial-gradient(46rem 30rem at 60% 110%, rgba(34, 229, 255, .10), transparent 60%),
    var(--bg);
}
.bg-fx::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 75%);
}
.bg-fx::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Контейнер и секции ---------- */
.container {
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: 4.5rem 0; position: relative; }
.section__head { margin-bottom: 2.5rem; max-width: 46rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.eyebrow::before { content: "// "; color: var(--magenta); }
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0;
  font-size: 1.9rem;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3rem);
  overflow-wrap: break-word;
}
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 1rem; max-width: 40rem; }
.grad {
  color: #e86bff; /* запасной цвет, если нет background-clip:text */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .75rem 1.4rem;
  border-radius: 999px;
  font-weight: 700; font-size: .95rem; line-height: 1.1;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  -webkit-user-select: none; user-select: none;
  text-align: center;
}
.btn .i { margin-left: .55rem; transition: transform .25s var(--ease); }
.btn--primary {
  color: #fff; background: #8b5cf6; background-image: var(--grad);
  box-shadow: 0 .6rem 2rem -.6rem rgba(217, 70, 239, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 1rem 2.4rem -.6rem rgba(217, 70, 239, .9), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn--primary:hover .i { transform: translateX(3px); }
.btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, .35); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Стеклянные карточки ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

/* ---------- Шапка ---------- */
.header {
  position: fixed; left: 0; top: 0; width: 100%; z-index: 100;
  height: var(--header-h);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(8, 4, 16, .86);
  border-bottom-color: var(--line);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .header.is-scrolled { background: rgba(8, 4, 16, .6); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
}
.header__row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.logo { display: block; flex: none; }
.logo img { height: 2.1rem; width: auto; }
.nav { display: none; }
.nav__list { display: flex; align-items: center; }
.nav__link {
  position: relative; display: block; padding: .5rem .95rem;
  font-size: .95rem; font-weight: 600; color: var(--muted);
  transition: color .2s;
}
.nav__link::after {
  content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .2rem; height: 2px;
  background: var(--grad); border-radius: 2px;
  -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: left; transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: #fff; }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { -webkit-transform: scaleX(1); transform: scaleX(1); }
.header__cta { display: none; }

.burger {
  position: relative; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-2);
}
.burger span {
  position: absolute; left: 50%; top: 50%; width: 1.3rem; height: 2px; margin-left: -.65rem;
  background: #fff; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s;
}
.burger span:nth-child(1) { margin-top: -6px; }
.burger span:nth-child(2) { margin-top: -1px; }
.burger span:nth-child(3) { margin-top: 4px; }
.burger[aria-expanded="true"] span:nth-child(1) { -webkit-transform: translateY(5px) rotate(45deg); transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { -webkit-transform: translateY(-5px) rotate(-45deg); transform: translateY(-5px) rotate(-45deg); }

/* Мобильное меню */
.menu {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 90;
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  background: rgba(6, 3, 13, .97);
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  overflow-y: auto;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu__link {
  display: block; padding: .9rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.5rem;
}
.menu__link[aria-current="page"] { color: var(--magenta); }
.menu .btn { margin-top: 2rem; width: 100%; }
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + 3rem) 0 3rem; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1fr; grid-gap: 3rem; align-items: center; }
.chip-live {
  display: inline-flex; align-items: center; padding: .4rem .9rem .4rem .75rem;
  font-family: var(--font-mono); font-size: .75rem; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  margin-bottom: 1.5rem;
}
.chip-live::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .6rem;
  background: #39ff9c; box-shadow: 0 0 0 0 rgba(57, 255, 156, .6); animation: pulse 2s infinite;
}
.hero__title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.05;
  font-size: 2.3rem;
  font-size: clamp(2.05rem, 1rem + 5.4vw, 4.9rem);
  overflow-wrap: break-word;
}
.hero__sub { margin-top: 1.5rem; max-width: 36rem; color: var(--muted); font-size: 1.1rem; font-size: clamp(1rem, .9rem + .5vw, 1.25rem); }
.hero__actions { margin-top: 2.25rem; display: grid; grid-gap: .85rem; grid-template-columns: 1fr; }
.hero__stats {
  margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 1.5rem;
}
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem); line-height: 1; }
.stat__label { margin-top: .5rem; font-size: .8rem; color: var(--muted); line-height: 1.3; }

/* Окно терминала */
.term { position: relative; max-width: 34rem; width: 100%; margin: 0 auto; }
.term::before {
  content: ""; position: absolute; left: -12%; top: -12%; width: 124%; height: 124%; z-index: -1;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .5), transparent);
  animation: float 9s ease-in-out infinite;
}
.term__win {
  border-radius: var(--radius); border: 1px solid var(--line-2); overflow: hidden;
  background: rgba(14, 8, 26, .92);
  box-shadow: 0 2rem 5rem -1.5rem rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .term__win { background: rgba(14, 8, 26, .7); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
.term__bar { display: flex; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.term__dot { width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; background: #ff5f57; }
.term__dot:nth-child(2) { background: #febc2e; }
.term__dot:nth-child(3) { background: #28c840; }
.term__title { margin-left: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.term__body { padding: 1.25rem 1.25rem 1.5rem; font-family: var(--font-mono); font-size: .82rem; line-height: 1.9; min-height: 13.5rem; }
.term__line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__line .p { color: var(--magenta); }
.term__line .ok { color: #39ff9c; }
.term__line .k { color: var(--cyan); }
.term__line .dim { color: var(--muted); }
.caret { display: inline-block; width: .55em; height: 1.05em; margin-left: .2em; vertical-align: -.18em; background: var(--cyan); animation: blink 1s steps(2, start) infinite; }
.term__tags { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.tag-float {
  position: absolute; padding: .45rem .8rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; color: #fff;
  background: rgba(20, 12, 36, .9); border: 1px solid var(--line-2);
  box-shadow: 0 .8rem 2rem -.6rem rgba(0, 0, 0, .7);
  animation: float 7s ease-in-out infinite;
}
.tag-float:nth-child(1) { right: -.4rem; top: -1.2rem; color: var(--cyan); }
.tag-float:nth-child(2) { left: -.4rem; bottom: 2.2rem; color: var(--magenta); animation-delay: -2s; }
.tag-float:nth-child(3) { right: 1.2rem; bottom: -1.2rem; animation-delay: -4s; }

/* ---------- Бегущая строка ---------- */
.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); padding: 1.1rem 0;
  -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: -webkit-max-content; width: max-content; animation: marquee 38s linear infinite; }
.marquee__item {
  display: flex; align-items: center; flex: none; padding: 0 1.5rem;
  font-family: var(--font-mono); font-size: .9rem; color: var(--muted); white-space: nowrap;
}
.marquee__item::after { content: "✦"; margin-left: 3rem; color: var(--violet); }

/* ---------- О нас ---------- */
.about { display: grid; grid-template-columns: 1fr; grid-gap: 2.5rem; align-items: center; }
.about__text p { color: var(--muted); margin-top: 1.1rem; }
.about__text p strong { color: var(--text); font-weight: 700; }
.about__list { margin-top: 1.5rem; display: grid; grid-gap: .6rem; }
.about__list li { display: flex; align-items: center; font-weight: 600; }
.about__list .i { color: var(--cyan); margin-right: .7rem; }
.frame { position: relative; border-radius: var(--radius); padding: 1px; background: linear-gradient(140deg, rgba(139, 92, 246, .9), rgba(255, 79, 216, .15) 40%, rgba(34, 229, 255, .6)); }
.frame__in { position: relative; overflow: hidden; border-radius: calc(var(--radius) - 1px); background: var(--solid); }
.ratio { position: relative; width: 100%; height: 0; }
.ratio > img, .ratio > .ph { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.ratio--43 { padding-bottom: 75%; }
.ratio--45 { padding-bottom: 125%; }
.ratio--169 { padding-bottom: 60%; }
.ratio--16x9 { padding-bottom: 56.25%; }
/* Фото команды: холст с эффектом «пиксели → фото → аниме» (static/js/photo-reveal.js).
   pan-y: на телефоне вертикальный свайп листает страницу, касание и горизонтальный — открывают аниме. */
.pixel-reveal { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: crosshair; }
.frame__badge {
  position: absolute; left: 1rem; bottom: 1rem; padding: .5rem .85rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; background: rgba(6, 3, 13, .8); border: 1px solid var(--line-2);
}
/* Подсказка к эффекту фото: появляется после вступления, исчезает после первого наведения/касания */
.pixel-hint {
  position: absolute; right: 1rem; top: 1rem; z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; padding: .5rem .85rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; color: #fff;
  background: rgba(6, 3, 13, .8); border: 1px solid rgba(168, 120, 255, .55);
  box-shadow: 0 0 1.4rem -.3rem rgba(139, 92, 246, .7);
  opacity: 0; -webkit-transform: translateY(-.35rem); transform: translateY(-.35rem);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.pixel-hint .i { width: 1em; height: 1em; margin-right: .45rem; color: var(--magenta); }
.pixel-hint.is-shown { opacity: 1; -webkit-transform: none; transform: none; }
.pixel-hint.is-gone { opacity: 0; }
@media (max-width: 359px) { .pixel-hint { right: .6rem; top: .6rem; } }

/* ---------- Услуги (bento) ---------- */
.bento { display: grid; grid-template-columns: 1fr; grid-gap: 1rem; }
.card {
  position: relative; padding: 1.6rem; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), border-color .35s, background .35s;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 0%), rgba(139, 92, 246, .22), transparent 60%);
  transition: opacity .35s;
}
.card:hover, .card:focus-within { border-color: rgba(168, 120, 255, .5); transform: translateY(-4px); background: var(--surface-2); }
.card:hover::before, .card:focus-within::before { opacity: 1; }
.card__idx { position: absolute; right: 1.2rem; top: 1.1rem; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.card__icon {
  display: flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; margin-bottom: 1.4rem;
  border-radius: .9rem; color: #fff; background: rgba(139, 92, 246, .2); border: 1px solid rgba(168, 120, 255, .45);
  box-shadow: 0 0 1.6rem -.2rem rgba(139, 92, 246, .55);
}
.card__icon .i { width: 1.5rem; height: 1.5rem; }
.card__title { font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.1rem; line-height: 1.25; }
.card__text { margin-top: .7rem; color: var(--muted); font-size: .95rem; }

/* Вход карточек (static/js/services-fx.js). Прячем только когда JS включил эффект. */
.bento--fx > .card:not(.is-entering):not(.is-in) { opacity: 0; }
.bento--fx > .card.is-entering {
  -webkit-animation: bbCardIn .95s var(--ease) both; animation: bbCardIn .95s var(--ease) both;
  will-change: transform, opacity, clip-path, filter;
}
.bento--fx > .card.is-entering::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3.5rem; pointer-events: none;
  background: linear-gradient(to top, rgba(34, 229, 255, .22), rgba(139, 92, 246, 0));
  border-bottom: 1px solid rgba(34, 229, 255, .95);
  box-shadow: 0 .4rem 1.4rem -.2rem rgba(34, 229, 255, .7);
  -webkit-animation: bbCardScan .95s var(--ease) both; animation: bbCardScan .95s var(--ease) both;
}
.bento--fx > .card.is-entering .card__icon {
  -webkit-animation: bbIconPop .75s cubic-bezier(.3, 1.6, .5, 1) .32s both; animation: bbIconPop .75s cubic-bezier(.3, 1.6, .5, 1) .32s both;
}
.bento--fx > .card.is-entering .card__text {
  -webkit-animation: bbTextIn .7s var(--ease) .55s both; animation: bbTextIn .7s var(--ease) .55s both;
}
.bento--fx > .card.is-entering .card__idx { color: var(--cyan); text-shadow: 0 0 .6rem rgba(34, 229, 255, .8); }

@-webkit-keyframes bbCardIn {
  0%   { opacity: 0; -webkit-transform: perspective(900px) translateY(2.5rem) rotateX(16deg) scale(.94); -webkit-filter: blur(6px); }
  100% { opacity: 1; -webkit-transform: none; -webkit-filter: none; }
}
@keyframes bbCardIn {
  0%   { opacity: 0; transform: perspective(900px) translateY(2.5rem) rotateX(16deg) scale(.94); filter: blur(6px);
         clip-path: inset(100% 0 0 0 round var(--radius)); }
  15%  { opacity: 1; }
  60%  { filter: none; clip-path: inset(0 0 0 0 round var(--radius));
         border-color: rgba(34, 229, 255, .85); box-shadow: 0 0 2.2rem -.4rem rgba(34, 229, 255, .55), inset 0 0 1.5rem -.6rem rgba(34, 229, 255, .4); }
  100% { opacity: 1; transform: none; filter: none; clip-path: inset(0 0 0 0 round var(--radius)); }
}
@-webkit-keyframes bbCardScan { 0% { bottom: -3.5rem; opacity: 1; } 70% { opacity: 1; } 100% { bottom: 100%; opacity: 0; } }
@keyframes bbCardScan { 0% { bottom: -3.5rem; opacity: 1; } 70% { opacity: 1; } 100% { bottom: 100%; opacity: 0; } }
@-webkit-keyframes bbIconPop {
  0%   { opacity: 0; -webkit-transform: scale(0) rotate(-120deg); }
  100% { opacity: 1; -webkit-transform: none; }
}
@keyframes bbIconPop {
  0%   { opacity: 0; transform: scale(0) rotate(-120deg); box-shadow: 0 0 0 0 rgba(34, 229, 255, 0); }
  55%  { box-shadow: 0 0 0 .55rem rgba(34, 229, 255, .18), 0 0 2.4rem 0 rgba(34, 229, 255, .7); }
  100% { opacity: 1; transform: none; }
}
@-webkit-keyframes bbTextIn { 0% { opacity: 0; -webkit-transform: translateY(.8rem); } 100% { opacity: 1; -webkit-transform: none; } }
@keyframes bbTextIn { 0% { opacity: 0; transform: translateY(.8rem); } 100% { opacity: 1; transform: none; } }

/* ---------- Команда ---------- */
.team { display: grid; grid-template-columns: 1fr; grid-gap: 1.25rem; align-items: start; }
.member {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .35s;
}
.member:hover, .member:focus-within { border-color: rgba(168, 120, 255, .5); transform: translateY(-4px); }
.member__photo {
  position: relative; background: var(--solid);
  /* Фото обрезаем само по скруглению карточки: при наведении (подъём + zoom) и глитче браузер
     выносит его на отдельный слой, и overflow:hidden у .member перестаёт срезать углы */
  overflow: hidden; isolation: isolate;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  -webkit-clip-path: inset(0 round calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0);
  clip-path: inset(0 round calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0);
}
.member__photo img { -webkit-transition: transform .8s var(--ease); transition: transform .8s var(--ease); }
.member:hover .member__photo img { -webkit-transform: scale(1.04); transform: scale(1.04); }
/* Фото команды в стиле 8 бит (static/js/pixel-portraits.js): холст поверх фото */
.pixel-portrait {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block;
  image-rendering: -moz-crisp-edges; image-rendering: pixelated;
  -webkit-transition: transform .8s var(--ease); transition: transform .8s var(--ease);
}
.member:hover .pixel-portrait { -webkit-transform: scale(1.04); transform: scale(1.04); }
.member__photo::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(8, 4, 16, .96), transparent);
}
.ph {
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 3rem;
  color: rgba(255, 255, 255, .5); background: linear-gradient(135deg, #2a1456, #4a1a5c);
}
.member__head { position: absolute; left: 0; bottom: 0; width: 100%; padding: 1.1rem 1.25rem; z-index: 2; }
.member__role { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.member__name { margin-top: .3rem; font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.member__body { padding: 1.1rem 1.25rem 1.25rem; }
.chips { display: flex; flex-wrap: wrap; margin: 0 -.35rem -.35rem 0; }
.chip {
  margin: 0 .35rem .35rem 0; padding: .28rem .65rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; line-height: 1.4; color: #e4dcff;
  background: rgba(139, 92, 246, .16); border: 1px solid rgba(168, 120, 255, .3);
}
.chip--more { background: transparent; color: var(--muted); border-style: dashed; }
.member__more { margin-top: 1rem; font-weight: 700; font-size: .85rem; color: var(--magenta); display: inline-flex; align-items: center; min-height: 2.5rem; }
.member__more .i { margin-left: .4rem; transition: transform .3s var(--ease); }
.member__more[aria-expanded="true"] .i { -webkit-transform: rotate(180deg); transform: rotate(180deg); }
.member__extra { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.member__extra h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin-bottom: .5rem; }
.member__extra p + h4, .member__extra .chips + h4 { margin-top: 1rem; }
.member__links { margin-top: 1rem; display: flex; flex-wrap: wrap; }

/* Раскрытие карточки «взлом досье» (static/js/home.js → toggleExtra) */
.member { transition: transform .35s var(--ease), border-color .35s, box-shadow .45s var(--ease); }
.member.is-open {
  border-color: rgba(34, 229, 255, .55);
  box-shadow: 0 0 0 1px rgba(34, 229, 255, .15), 0 1.2rem 3rem -1.2rem rgba(34, 229, 255, .45), inset 0 0 2.5rem -1.5rem rgba(34, 229, 255, .5);
}
.member.is-open .member__role { text-shadow: 0 0 .7rem rgba(34, 229, 255, .8); }
.member.is-glitch .member__photo .ratio { -webkit-animation: memberGlitch .48s steps(1, end) 1; animation: memberGlitch .48s steps(1, end) 1; }
@keyframes memberGlitch {
  0%   { -webkit-clip-path: inset(8% 0 62% 0); clip-path: inset(8% 0 62% 0); transform: translateX(-6px); filter: hue-rotate(70deg) saturate(2); }
  14%  { -webkit-clip-path: inset(40% 0 30% 0); clip-path: inset(40% 0 30% 0); transform: translateX(7px); filter: drop-shadow(3px 0 var(--cyan)) drop-shadow(-3px 0 var(--magenta)); }
  28%  { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); transform: translateX(-3px); filter: invert(.15) hue-rotate(-60deg); }
  42%  { -webkit-clip-path: inset(70% 0 6% 0); clip-path: inset(70% 0 6% 0); transform: translateX(5px); filter: saturate(3); }
  56%  { -webkit-clip-path: inset(22% 0 50% 0); clip-path: inset(22% 0 50% 0); transform: translateX(-8px); filter: drop-shadow(-4px 0 var(--cyan)) drop-shadow(4px 0 var(--magenta)); }
  70%  { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); transform: translateX(2px); filter: none; }
  100% { -webkit-clip-path: none; clip-path: none; transform: none; filter: none; }
}

.member__extra { position: relative; }
.member__extra.is-opening, .member__extra.is-closing { overflow: hidden; transition: height .5s var(--ease); }
.member__extra.is-closing { transition-duration: .42s; }
/* сканирующая линия по нижней кромке растущего блока */
.member__extra.is-opening::after, .member__extra.is-closing::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--cyan) 20%, #fff 50%, var(--cyan) 80%, transparent);
  box-shadow: 0 0 .8rem .1rem rgba(34, 229, 255, .8), 0 -1.4rem 1.8rem -1rem rgba(34, 229, 255, .35);
}
.member__extra.is-opening { border-top-color: rgba(34, 229, 255, .5); }

.member__cmd {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; margin: -.2rem 0 .9rem;
  font-family: var(--font-mono); font-size: .68rem; line-height: 1.5; color: var(--cyan); letter-spacing: .02em;
}
.member__cmd-text { margin-right: .75rem; opacity: .85; }
.member__cmd-text::after { content: "▌"; margin-left: 1px; -webkit-animation: caret 1s steps(1) infinite; animation: caret 1s steps(1) infinite; }
.member__cmd-status { color: var(--muted); white-space: nowrap; }
.member__cmd-status.is-ok { color: #4dffb5; text-shadow: 0 0 .6rem rgba(77, 255, 181, .7); -webkit-animation: grantBlink .5s steps(2, end) 2; animation: grantBlink .5s steps(2, end) 2; }
.member__cmd-status.is-off { color: var(--magenta); }
@keyframes caret { 50% { opacity: 0; } }
@keyframes grantBlink { 50% { opacity: .2; } }

.member__extra .fx-wait { opacity: 0; }
.member__extra .fx-in { -webkit-animation: dossierIn .6s var(--ease) both; animation: dossierIn .6s var(--ease) both; }
.member__extra .fx-in.chips > .chip { -webkit-animation: chipPop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation: chipPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.member__extra .fx-out { transition: opacity .16s, transform .16s; opacity: 0; transform: translateX(-.6rem); }
@keyframes dossierIn {
  0%   { opacity: 0; transform: translateX(-.9rem); -webkit-clip-path: inset(0 100% 0 0); clip-path: inset(0 100% 0 0); filter: blur(3px); }
  60%  { opacity: 1; filter: none; }
  100% { opacity: 1; transform: none; -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); }
}
@keyframes chipPop {
  0%   { opacity: 0; transform: scale(.4); border-color: var(--cyan); box-shadow: 0 0 1rem rgba(34, 229, 255, .8); }
  100% { opacity: 1; transform: none; }
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin: 0 .5rem .5rem 0;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); transition: background .25s, transform .25s var(--ease);
}
.icon-btn:hover { background: rgba(139, 92, 246, .35); transform: translateY(-2px); }

/* ---------- Проекты ---------- */
.projects { display: grid; grid-template-columns: 1fr; grid-gap: 1.25rem; }
.project {
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), border-color .35s;
}
.project:hover, .project:focus-within { border-color: rgba(168, 120, 255, .5); transform: translateY(-4px); }
.project__media { position: relative; background: var(--solid); }
.project__media img { -webkit-transition: transform .8s var(--ease); transition: transform .8s var(--ease); }
.project:hover .project__media img { -webkit-transform: scale(1.04); transform: scale(1.04); }
.project__date {
  position: absolute; left: .9rem; top: .9rem; padding: .3rem .7rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; background: rgba(6, 3, 13, .78); border: 1px solid var(--line-2);
}
.project__body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1.25rem 1.35rem 1.4rem; }
.project__title { font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.15rem; line-height: 1.25; margin-top: .85rem; }
.project__text { margin-top: .7rem; color: var(--muted); font-size: .95rem; overflow-wrap: break-word; }
.project__link {
  margin-top: auto; padding-top: 1.1rem; font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; color: var(--magenta); min-height: 2.75rem;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .3em; text-decoration-thickness: 1px;
  transition: color .3s, text-decoration-color .3s, text-shadow .3s;
}
/* Вся карточка — ссылка (растянутый ::after), поэтому реагируем на наведение на КАРТОЧКУ, а не на слово:
   появляется приглашение «>», текст подсвечивается и подчёркивается, стрелка уходит вверх-вправо */
.project__link::before {
  content: ">"; display: inline-block; overflow: hidden; max-width: 0; margin-right: 0; opacity: 0; color: var(--cyan);
  font-family: var(--font-mono); transition: max-width .3s var(--ease), margin-right .3s var(--ease), opacity .3s;
}
.project__link .i { margin-left: .4rem; transition: transform .3s var(--ease); }
.project:hover .project__link, .project:focus-within .project__link {
  color: #ff8ae6; text-decoration-color: currentColor; text-shadow: 0 0 .9rem rgba(255, 79, 216, .55);
}
.project:hover .project__link::before, .project:focus-within .project__link::before { max-width: 1.2ch; margin-right: .45rem; opacity: 1; }
.project:hover .project__link .i, .project:focus-within .project__link .i { -webkit-transform: translate(3px, -3px); transform: translate(3px, -3px); }
.project__link::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; } /* вся карточка кликабельна */
.section__row { display: grid; grid-gap: 1.25rem; margin-bottom: 2.5rem; align-items: end; }
.section__row .section__head { margin-bottom: 0; }

/* Состояния списков */
.state {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted);
}
.state strong { display: block; color: var(--text); font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.1rem; margin-bottom: .5rem; }
.state .btn { margin-top: 1.25rem; }
.skeleton { min-height: 18rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.03) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* Панель поиска */
.toolbar { display: grid; grid-template-columns: 1fr; grid-gap: .85rem; margin-bottom: 1.25rem; }
.search { position: relative; }
.search .i { position: absolute; left: 1.1rem; top: 50%; margin-top: -.625em; color: var(--muted); pointer-events: none; }
.input {
  width: 100%; min-height: 3.25rem; padding: .8rem 1.1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  -webkit-appearance: none; appearance: none; transition: border-color .25s, background .25s, box-shadow .25s;
}
.search .input { padding-left: 3rem; }
.input::placeholder { color: #8277a3; }
.input:focus { border-color: var(--violet); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(139, 92, 246, .22); outline: none; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.seg button { min-height: 2.75rem; padding: 0 1.2rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: background .25s, color .25s; }
.seg button[aria-pressed="true"] { color: #fff; background: #8b5cf6; background-image: var(--grad); }
.meta { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-bottom: 1.25rem; min-height: 1.4em; }
.more { text-align: center; margin-top: 2.25rem; }
.page-hero { padding: calc(var(--header-h) + 3rem) 0 1.5rem; }
.h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.08; font-size: 2.2rem; font-size: clamp(2rem, 1rem + 4.4vw, 4rem); overflow-wrap: break-word; }

/* ---------- Контакты ---------- */
.cta {
  position: relative; overflow: hidden; padding: 2.25rem 1.5rem; border-radius: calc(var(--radius) * 1.4);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(255, 79, 216, .25), transparent 60%),
    radial-gradient(40rem 24rem at 0% 100%, rgba(139, 92, 246, .35), transparent 60%),
    var(--solid);
}
.cta__links { margin-top: 2rem; display: grid; grid-template-columns: 1fr; grid-gap: .85rem; }
.link-row {
  display: flex; align-items: center; padding: 1rem 1.1rem; border-radius: 1rem; min-height: 4rem;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); transition: background .25s, transform .25s var(--ease), border-color .25s;
  overflow: hidden;
}
.link-row:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); border-color: rgba(255, 255, 255, .35); }
.link-row .i { margin-right: .9rem; color: var(--cyan); width: 1.5rem; height: 1.5rem; }
.link-row small { display: block; font-family: var(--font-mono); font-size: .68rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.link-row span { font-weight: 700; overflow-wrap: anywhere; }
.qr-grid { display: grid; grid-template-columns: 1fr; grid-gap: 1.25rem; }
.qr {
  display: grid; grid-template-columns: 1fr; grid-gap: 1.25rem; padding: 1.4rem; border-radius: var(--radius); align-items: center;
  background: var(--surface); border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .35s;
}
.qr:hover, .qr:focus-within { transform: translateY(-4px); border-color: rgba(168, 120, 255, .5); }
.qr__img { width: 9.5rem; max-width: 100%; padding: .6rem; border-radius: .9rem; background: #fff; justify-self: start; }
.qr__img img { width: 100%; height: auto; }
.qr__kind { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.qr__kind .i { margin-right: .5rem; }
.qr h3 { font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.05rem; margin: .6rem 0 .8rem; line-height: 1.25; }
.qr .btn { min-height: 2.75rem; padding: .55rem 1.1rem; font-size: .85rem; }

/* ---------- Живой фон страниц (static/js/page-projects.js, page-contacts.js) ---------- */
/* z-index: 0, а контент — выше: у html и body оба фона непрозрачные, и слой с -1 уходит под фон body */
.has-page-field main, .has-page-field .footer { position: relative; z-index: 1; }
.page-field {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}

/* ---------- «Проекты»: появление карточек «деплоем» ---------- */
.projects--fx > .project:not(.is-deploying):not(.is-live) { opacity: 0; }
.project.is-deploying {
  -webkit-clip-path: inset(0 0 calc(100% - 3.1rem) 0 round var(--radius)); clip-path: inset(0 0 calc(100% - 3.1rem) 0 round var(--radius));
  transition: clip-path .75s var(--ease), -webkit-clip-path .75s var(--ease);
  -webkit-animation: deployIn .35s var(--ease) both; animation: deployIn .35s var(--ease) both;
}
.project.is-deploying.is-unfold { -webkit-clip-path: inset(0 0 0 0 round var(--radius)); clip-path: inset(0 0 0 0 round var(--radius)); }
.project.is-deploying .project__media, .project.is-deploying .project__body { opacity: 0; transition: opacity .6s var(--ease), filter .9s var(--ease); }
.project.is-deploying .project__media { -webkit-filter: blur(10px) saturate(0) brightness(1.5); filter: blur(10px) saturate(0) brightness(1.5); }
.project.is-unfold .project__media { opacity: 1; -webkit-filter: none; filter: none; }
.project.is-unfold .project__body { opacity: 1; transition-delay: .2s; }
.deploy {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; height: 3.1rem; display: flex; align-items: center; padding: 0 1rem;
  font-family: var(--font-mono); font-size: .72rem; color: var(--cyan);
  background: rgba(8, 4, 16, .95); border-bottom: 1px solid rgba(34, 229, 255, .35); transition: opacity .45s, border-color .3s;
}
.deploy__cmd { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deploy__cmd::after { content: "▌"; margin-left: 1px; -webkit-animation: caret 1s steps(1) infinite; animation: caret 1s steps(1) infinite; }
.deploy__bar { flex: 1 1 3rem; min-width: 2.5rem; height: 4px; margin: 0 .8rem; border-radius: 2px; background: rgba(139, 92, 246, .25); overflow: hidden; }
.deploy__bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 8px var(--cyan); transition: width .6s linear; }
.deploy__st { flex: 0 0 auto; color: var(--muted); white-space: nowrap; }
.deploy.is-ok { border-bottom-color: rgba(77, 255, 181, .55); }
.deploy.is-ok .deploy__st { color: #4dffb5; text-shadow: 0 0 .6rem rgba(77, 255, 181, .7); }
.deploy.is-gone { opacity: 0; }
@keyframes deployIn { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }

/* ---------- «Контакты»: карточки-каналы связи (static/js/page-contacts.js) ---------- */
.ch-grid { display: grid; grid-template-columns: 1fr; grid-gap: 1.25rem; }
.ch {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "top top" "qr info" "handle handle" "btn btn"; grid-column-gap: 1.2rem; grid-row-gap: 1rem;
  padding: 1.2rem 1.35rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(10, 6, 20, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .45s var(--ease);
}
.ch::before { /* неоновая кромка сверху */
  content: ""; position: absolute; left: 1.2rem; right: 1.2rem; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(34, 229, 255, .7), rgba(255, 79, 216, .6), transparent); opacity: .5; transition: opacity .35s;
}
.ch:hover, .ch:focus-within {
  transform: translateY(-4px); border-color: rgba(34, 229, 255, .45);
  box-shadow: 0 1.2rem 3rem -1.4rem rgba(34, 229, 255, .5), inset 0 0 2rem -1.4rem rgba(34, 229, 255, .5);
}
.ch:hover::before, .ch:focus-within::before { opacity: 1; }

.ch__top {
  grid-area: top; display: flex; align-items: center; justify-content: space-between; padding-bottom: .8rem;
  border-bottom: 1px dashed rgba(139, 92, 246, .3); font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
}
.ch__id { color: var(--cyan); }
.ch__status { display: inline-flex; align-items: center; color: #4dffb5; transition: color .3s; }
.ch__status b { font-weight: 400; }
.ch__status i { position: relative; width: .45rem; height: .45rem; margin-right: .45rem; border-radius: 50%; background: #4dffb5; box-shadow: 0 0 .5rem #4dffb5; }
.ch__status i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 50%; border: 1px solid #4dffb5;
  -webkit-animation: chPing 2.2s var(--ease) infinite; animation: chPing 2.2s var(--ease) infinite;
}

.ch__qr { grid-area: qr; position: relative; display: block; width: 7.25rem; padding: .45rem; border-radius: .7rem; background: #fff; align-self: center; }
.ch__qr img { display: block; width: 100%; height: auto; }
.ch__qr::before { /* уголки «сканера» вокруг QR */
  content: ""; position: absolute; left: -7px; top: -7px; right: -7px; bottom: -7px; pointer-events: none; opacity: .65;
  background:
    linear-gradient(var(--cyan), var(--cyan)) 0 0 / 14px 2px no-repeat, linear-gradient(var(--cyan), var(--cyan)) 0 0 / 2px 14px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) 100% 0 / 14px 2px no-repeat, linear-gradient(var(--cyan), var(--cyan)) 100% 0 / 2px 14px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) 0 100% / 14px 2px no-repeat, linear-gradient(var(--cyan), var(--cyan)) 0 100% / 2px 14px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) 100% 100% / 14px 2px no-repeat, linear-gradient(var(--cyan), var(--cyan)) 100% 100% / 2px 14px no-repeat;
  transition: left .35s var(--ease), top .35s var(--ease), right .35s var(--ease), bottom .35s var(--ease), opacity .35s;
}
.ch:hover .ch__qr::before, .ch:focus-within .ch__qr::before { left: -11px; top: -11px; right: -11px; bottom: -11px; opacity: 1; }
.ch__scan {
  position: absolute; left: .2rem; right: .2rem; top: 0; height: 2px; opacity: 0; pointer-events: none;
  background: var(--cyan); box-shadow: 0 0 .7rem .15rem rgba(34, 229, 255, .8);
}
.ch:hover .ch__scan, .ch:focus-within .ch__scan { -webkit-animation: chScan 1.7s ease-in-out infinite; animation: chScan 1.7s ease-in-out infinite; }

.ch__info { grid-area: info; align-self: center; min-width: 0; }
.ch__kind { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.ch__kind .i { margin-right: .45rem; }
.ch__title { margin-top: .45rem; font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.08rem; line-height: 1.25; }

.ch__handle {
  grid-area: handle; display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; padding: .4rem .45rem .4rem .85rem;
  border-radius: .7rem; background: rgba(34, 229, 255, .05); border: 1px solid rgba(34, 229, 255, .18);
}
.ch__handle code { min-width: 0; margin-right: .6rem; font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); overflow-wrap: anywhere; transition: opacity .3s; }
.ch__handle code::before { content: "> "; color: var(--magenta); }
.ch__copy { display: none; }
.js .ch__copy {
  display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 2rem; padding: .3rem .6rem; border-radius: .5rem;
  font-family: var(--font-mono); font-size: .66rem; color: var(--muted); border: 1px solid var(--line-2); transition: color .25s, border-color .25s, background .25s;
}
.ch__copy .i { width: .95rem; height: .95rem; margin-right: .35rem; }
.ch__copy:hover, .ch__copy:focus-visible { color: #fff; border-color: rgba(34, 229, 255, .6); background: rgba(34, 229, 255, .08); }
.ch__copy.is-done { color: #4dffb5; border-color: rgba(77, 255, 181, .6); }
.ch__btn { grid-area: btn; justify-self: start; min-height: 2.75rem; padding: .55rem 1.1rem; font-size: .85rem; }

/* появление «установкой связи» */
.ch-grid--fx > .ch:not(.is-connecting):not(.is-online) { opacity: 0; }
.ch.is-connecting { -webkit-animation: chIn .45s var(--ease) both; animation: chIn .45s var(--ease) both; border-color: rgba(255, 204, 77, .4); }
.ch.is-connecting .ch__status { color: #ffcc4d; }
.ch.is-connecting .ch__status i { background: #ffcc4d; box-shadow: 0 0 .5rem #ffcc4d; -webkit-animation: chBlink .5s steps(2, end) infinite; animation: chBlink .5s steps(2, end) infinite; }
.ch.is-connecting .ch__status i::after { display: none; }
.ch.is-connecting .ch__qr img { -webkit-clip-path: inset(0 0 100% 0); clip-path: inset(0 0 100% 0); transition: clip-path .75s linear, -webkit-clip-path .75s linear; }
.ch.is-scan .ch__qr img { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); }
.ch.is-scan .ch__scan { -webkit-animation: chScanOnce .75s linear both; animation: chScanOnce .75s linear both; }
.ch.is-connecting .ch__handle code, .ch.is-connecting .ch__copy, .ch.is-connecting .ch__btn { opacity: 0; transition: opacity .4s var(--ease); }
.ch.is-linked .ch__handle code, .ch.is-linked .ch__copy, .ch.is-linked .ch__btn { opacity: 1; }
.ch.is-linked .ch__copy { transition-delay: .25s; }
.ch.is-linked .ch__btn { transition-delay: .4s; }
.ch.is-linked { border-color: rgba(77, 255, 181, .55); box-shadow: 0 0 0 1px rgba(77, 255, 181, .12), 0 0 2.2rem -.6rem rgba(77, 255, 181, .45); }
@keyframes chIn { from { opacity: 0; transform: translateY(1rem) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes chPing { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
@keyframes chBlink { 50% { opacity: .2; } }
@keyframes chScan { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 2px); opacity: 0; } }
@keyframes chScanOnce { 0% { top: 0; opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 2px); opacity: 0; } }
@media (min-width: 640px) {
  .ch-grid { grid-template-columns: 1fr 1fr; }
  .ch-grid > .ch:last-child:nth-child(odd) { grid-column: 1 / -1; } /* последняя одинокая — на всю ширину */
}
@media (min-width: 1280px) {
  /* 5 каналов: 3 сверху и 2 снизу пошире */
  .ch-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ch-grid > .ch { grid-column: span 2; }
  .ch-grid > .ch:nth-child(n+4), .ch-grid > .ch:nth-child(n+4):last-child { grid-column: span 3; }
}

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 2rem; background: rgba(0, 0, 0, .25); }
.footer__grid { display: grid; grid-template-columns: 1fr; grid-gap: 2rem; }
.footer__about { color: var(--muted); font-size: .92rem; margin-top: 1rem; max-width: 22rem; }
.footer h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.footer li a { display: inline-block; padding: .25rem 0; color: #ddd4f5; transition: color .2s; }
.footer li a:hover { color: var(--magenta); }
.footer__bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); display: grid; grid-gap: .5rem; }

/* ---------- 404 ---------- */
.nf { min-height: 100vh; display: flex; align-items: center; text-align: center; padding: 6rem 0 3rem; }
.nf__code { font-family: var(--font-display); font-weight: 700; line-height: 1; font-size: 6.5rem; font-size: clamp(5rem, 3rem + 14vw, 12rem); letter-spacing: -.04em; }
.nf p { color: var(--muted); margin: 1.25rem auto 2rem; max-width: 28rem; }

/* ---------- Появление при скролле ---------- */
.js .reveal { opacity: 0; -webkit-transform: translateY(1.5rem); transform: translateY(1.5rem); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; -webkit-transform: none; transform: none; }

/* ---------- Анимации ---------- */
@-webkit-keyframes blink { to { visibility: hidden; } }
@keyframes blink { to { visibility: hidden; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 .6rem rgba(57, 255, 156, 0); } 100% { box-shadow: 0 0 0 0 rgba(57, 255, 156, 0); } }
@keyframes float { 0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); } 50% { -webkit-transform: translateY(-.7rem); transform: translateY(-.7rem); } }
@keyframes marquee { from { -webkit-transform: translateX(0); transform: translateX(0); } to { -webkit-transform: translateX(-50%); transform: translateX(-50%); } }
/* ---------- «Хакерские» эффекты (static/js/hacker-fx.js + CSS) ---------- */
/* Цифровое поле на фоне первого экрана; к низу растворяется, чтобы не спорить с бегущей строкой */
.hero-field {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero > .container { position: relative; z-index: 1; }

/* Живая «печатная плата» за блоком услуг (static/js/services-bg.js); края растворяются в соседние секции */
.svc-field {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
#services > .container { position: relative; z-index: 1; }

/* 3D-конь в блоке проектов (static/js/knight.js). Показываем, только если JS-модуль и WebGL есть. */
.knight-stage { display: none; position: relative; height: 22rem; margin: -.5rem 0 1rem; pointer-events: none; }
.knight-stage.is-on { display: block; }
.knight-stage::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 15%; bottom: 0; z-index: 0;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .28), rgba(34, 229, 255, .06) 60%, transparent);
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.knight-canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; z-index: 1; opacity: 0; transition: opacity .8s var(--ease); }
.knight-stage.is-ready::before, .knight-stage.is-ready .knight-canvas { opacity: 1; }
.knight-hud {
  position: absolute; right: .25rem; bottom: .25rem; z-index: 2; display: flex; flex-direction: column; align-items: flex-end;
  padding: .45rem .7rem; font-family: var(--font-mono); font-size: .64rem; line-height: 1.55; color: var(--muted); white-space: nowrap;
  border-right: 1px solid rgba(34, 229, 255, .6); opacity: 0; transition: opacity .8s var(--ease) .6s;
}
.knight-hud b { font-weight: 600; color: var(--cyan); }
/* Подпись-объяснение под пьедесталом: «почему конь» */
.knight-motto {
  position: absolute; left: 50%; bottom: 1.9rem; z-index: 2; width: 100%; max-width: 23rem; padding: 0 1rem;
  transform: translate(-50%, .6rem); text-align: center; pointer-events: none;
  opacity: 0; transition: opacity .9s var(--ease) 1.4s, transform .9s var(--ease) 1.4s; /* после «печати» коня */
}
.knight-stage.is-ready .knight-motto { opacity: 1; transform: translate(-50%, 0); }
.knight-motto__tag { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .04em; color: var(--cyan); text-shadow: 0 0 .6rem rgba(34, 229, 255, .6); }
/* ударная фраза — фирменный Elastre с градиентом и неоновым свечением, как у заголовков секций */
.knight-motto__title {
  display: inline-block; margin-top: .3rem; font-family: var(--font-display); font-weight: 400;
  font-size: 1.65rem; line-height: 1.1; letter-spacing: .01em;
  -webkit-filter: drop-shadow(0 0 .9rem rgba(217, 70, 239, .45)); filter: drop-shadow(0 0 .9rem rgba(217, 70, 239, .45));
}
/* пояснение — моноширинный «вывод терминала» */
.knight-motto__text {
  display: block; margin: .55rem auto 0; max-width: 21rem;
  font-family: var(--font-mono); font-size: .7rem; line-height: 1.6; letter-spacing: .01em; color: var(--muted);
  text-shadow: 0 1px 1rem rgba(6, 3, 13, .9);
}
@media (max-width: 1023px) {
  /* телефон/планшет: конь в верхней части блока, подпись — под ним, HUD — в верхнем углу */
  .knight-stage { height: 28.5rem; }
  .knight-stage .knight-canvas { height: calc(100% - 6.5rem); }
  .knight-motto { bottom: .25rem; }
  .knight-hud { top: 0; bottom: auto; border-right: 1px solid rgba(34, 229, 255, .6); }
}
.knight-hud__hint { color: var(--magenta); opacity: .8; }
.knight-stage.is-ready .knight-hud { opacity: 1; }
#projects.is-knight-hover, #projects.is-knight-hover .knight-canvas { cursor: grab; }
#projects.is-knight-drag, #projects.is-knight-drag * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
/* холст ловит перетаскивание; touch-action: pan-y — вертикальный свайп по-прежнему листает страницу */
.knight-canvas { pointer-events: auto; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
#projects .section__row { position: relative; z-index: 1; }
@media (hover: none) { .knight-hud__hint { display: none; } }

/* Доска проектов: конь по центру, проекты по бокам, от карточек к пьедесталу идут дорожки */
.pboard { position: relative; --pgap: 2.5rem; }
.pboard .projects { position: relative; z-index: 2; pointer-events: none; } /* пустая середина сетки пропускает мышь к коню */
.pboard .projects > li { pointer-events: auto; }
.pboard__wires { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; display: none; opacity: 0; transition: opacity 1s var(--ease) .5s; }
.wire__base { fill: none; stroke: rgba(139, 92, 246, .45); stroke-width: 1.2; stroke-linejoin: round; transition: stroke .3s; }
.wire__flow {
  fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 10 190;
  filter: drop-shadow(0 0 4px rgba(34, 229, 255, .9));
  -webkit-animation: wireFlow 2.6s linear infinite; animation: wireFlow 2.6s linear infinite;
}
.wire__pad { fill: #0b0616; stroke: rgba(168, 120, 255, .8); stroke-width: 1.4; }
.wire__via { fill: var(--cyan); filter: drop-shadow(0 0 4px var(--cyan)); }
.wire.is-active .wire__base { stroke: rgba(34, 229, 255, .8); }
.wire.is-active .wire__flow { stroke: #fff; stroke-dasharray: 18 60; -webkit-animation-duration: .9s; animation-duration: .9s; }
.wire.is-active .wire__pad { stroke: var(--cyan); fill: rgba(34, 229, 255, .35); }
@keyframes wireFlow { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }

/* Свободный слот: пустая клетка доски, приглашение обсудить проект */
.pslot { display: flex; }
.pslot__frame {
  position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 18rem; padding: 1.6rem 1.4rem; border-radius: var(--radius);
  border: 1px dashed rgba(34, 229, 255, .35);
  background:
    linear-gradient(rgba(34, 229, 255, .05) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, rgba(34, 229, 255, .05) 1px, transparent 1px) 0 0 / 22px 100%,
    rgba(8, 4, 16, .55);
  transition: border-color .35s, box-shadow .35s, transform .35s var(--ease);
}
.pslot:hover .pslot__frame, .pslot:focus-within .pslot__frame {
  border-color: rgba(34, 229, 255, .75); transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(34, 229, 255, .15), 0 1.2rem 3rem -1.4rem rgba(34, 229, 255, .55);
}
.pslot__id { font-family: var(--font-mono); font-size: .72rem; color: var(--cyan); }
.pslot__id::after { content: "▌"; margin-left: 2px; -webkit-animation: caret 1s steps(1) infinite; animation: caret 1s steps(1) infinite; }
.pslot__icon {
  display: flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; margin: 1.2rem 0 1.1rem;
  border-radius: .9rem; font-family: var(--font-mono); font-size: 1.6rem; color: var(--cyan);
  border: 1px dashed rgba(34, 229, 255, .55); background: rgba(34, 229, 255, .06);
}
.pslot__title { font-family: var(--font-heading-sm); font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.pslot__text { margin-top: .6rem; color: var(--muted); font-size: .92rem; }
.pslot__btn { margin-top: 1.3rem; }

@media (min-width: 1024px) {
  /* три колонки: проекты | конь | проекты; нечётные карточки слева, чётные справа */
  .pboard .projects {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-auto-flow: row dense; column-gap: var(--pgap); row-gap: 1.5rem;
    min-height: 36rem; align-content: center; align-items: start;
  }
  .pboard .projects > li:nth-child(odd) { grid-column: 1; }
  .pboard .projects > li:nth-child(even) { grid-column: 3; }
  .pboard .projects > .state { grid-column: 1 / -1; }
  .knight-stage {
    position: absolute; top: -1.5rem; bottom: -1.5rem; height: auto; margin: 0; z-index: 0;
    left: calc((100% - 2 * var(--pgap)) / 3.25 + var(--pgap)); width: calc((100% - 2 * var(--pgap)) * 1.25 / 3.25);
  }
  .knight-stage.is-on ~ .pboard__wires { display: block; }
  .knight-stage.is-ready ~ .pboard__wires { opacity: 1; } /* дорожки загораются вместе с конём */
  /* под конём — своя полоса для подписи «Ходим конём», чтобы она не наезжала на пьедестал */
  .pboard { padding-bottom: 2.5rem; }
  .knight-stage { bottom: -1rem; }
  .knight-stage .knight-canvas { height: calc(100% - 3.6rem); }
  .knight-hud { right: 50%; transform: translateX(50%); bottom: -.5rem; align-items: center; border-right: 0; border-top: 1px solid rgba(34, 229, 255, .5); flex-direction: row; }
  .knight-hud span + span { margin-left: .9rem; }
}
/* Карточки над платой — матовое стекло: фон светится сквозь них мягко и не мешает читать */
#services .card {
  background-color: rgba(8, 4, 16, .62); background-image: linear-gradient(var(--surface), var(--surface));
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#services .card:hover, #services .card:focus-within { background-image: linear-gradient(var(--surface-2), var(--surface-2)); }

/* Глитч при наведении: текст на мгновение «сбоит» и расслаивается на фиолетовый и голубой.
   Сдвиг — через свойство translate, чтобы не перебивать transform у кнопок. */
@keyframes glitch {
  0%   { text-shadow: 2px 0 var(--cyan), -2px 0 var(--magenta); translate: 0 0; }
  20%  { text-shadow: -2px 1px var(--cyan), 2px -1px var(--magenta); translate: -1px 1px; }
  40%  { text-shadow: 3px -1px var(--cyan), -3px 1px var(--magenta); translate: 1px -1px; }
  60%  { text-shadow: -1px 0 var(--cyan), 1px 0 var(--magenta); translate: -1px 0; }
  80%  { text-shadow: 1px 1px var(--cyan), -1px -1px var(--magenta); translate: 1px 0; }
  100% { text-shadow: none; translate: 0 0; }
}
@keyframes glitch-img {
  0%   { filter: drop-shadow(2px 0 var(--cyan)) drop-shadow(-2px 0 var(--magenta)); translate: 0 0; }
  30%  { filter: drop-shadow(-3px 0 var(--cyan)) drop-shadow(3px 0 var(--magenta)); translate: -1px 1px; }
  60%  { filter: drop-shadow(2px 1px var(--cyan)) drop-shadow(-2px -1px var(--magenta)); translate: 1px -1px; }
  100% { filter: none; translate: 0 0; }
}
@media (hover: hover) {
  .nav__link:hover, .btn:hover, .menu__link:hover, .footer li a:hover, .member__more:hover { animation: glitch .32s steps(2, end) 1; }
  .logo:hover img { animation: glitch-img .36s steps(2, end) 1; }
}

/* Карточки команды: сканлайны как у старого монитора поверх 8-бит фото */
.member__photo .ratio::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(6, 3, 13, .28) 2px, rgba(6, 3, 13, .28) 3px);
  transition: opacity .45s var(--ease);
}
.member:hover .member__photo .ratio::after, .member:focus-within .member__photo .ratio::after { opacity: .35; }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-field, .svc-field { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; -webkit-transform: none; transform: none; }
  .marquee__track { animation: none; }
}

/* =========================================================
   АДАПТИВ
   360–479 телефоны (база) · 480 · 640 · 768 планшет · 1024 ноутбук
   1280 · 1536 · 1920 FullHD/ТВ · 2560 QHD · 3840 4K ТВ
   ========================================================= */

/* маленькие телефоны */
@media (max-width: 359px) {
  :root { --gutter: 1rem; }
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .btn { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 639px) {
  .member__photo .ratio--45 { padding-bottom: 100%; }
  .member__photo .ratio > img { object-position: center 20%; }
}

@media (min-width: 480px) {
  .hero__actions { grid-template-columns: -webkit-max-content -webkit-max-content; grid-template-columns: max-content max-content; }
}

@media (min-width: 640px) {
  :root { --gutter: 1.75rem; }
  .section { padding: 5.5rem 0; }
  .bento { grid-template-columns: 1fr 1fr; }
  .team, .projects { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr -webkit-max-content; grid-template-columns: 1fr max-content; }
  .qr-grid { grid-template-columns: 1fr 1fr; }
  .qr { grid-template-columns: 1fr; }
  .cta { padding: 3rem 2.5rem; }
  .cta__links { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer__bottom { grid-template-columns: 1fr auto; }
  .section__row { grid-template-columns: 1fr -webkit-max-content; grid-template-columns: 1fr max-content; }
}

/* планшет */
@media (min-width: 768px) {
  :root { --header-h: 5rem; }
  .hero { padding-top: calc(var(--header-h) + 4rem); }
  .hero__stats { max-width: 32rem; }
  .about { grid-template-columns: 1fr 1fr; grid-gap: 3.5rem; }
  .qr { grid-template-columns: auto 1fr; }
  .cta__links { grid-template-columns: repeat(3, 1fr); }
  .team { grid-template-columns: repeat(3, 1fr); } /* в команде трое — с планшета все в один ряд */
}

/* ноутбук: появляется горизонтальная навигация */
@media (min-width: 1024px) {
  .nav { display: block; }
  .header__cta { display: inline-flex; min-height: 2.75rem; padding: .55rem 1.2rem; }
  .burger, .menu { display: none; }
  .hero__grid { grid-template-columns: 1.15fr .85fr; grid-gap: 4rem; }
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento > :nth-child(1), .bento > :nth-child(2) { grid-column: span 3; }
  .bento > :nth-child(n+3) { grid-column: span 2; }
  .team { grid-template-columns: repeat(3, 1fr); }
  .projects { grid-template-columns: repeat(3, 1fr); }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .nf__code { margin-top: 0; }
}

@media (min-width: 1280px) {
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
  .qr { grid-template-columns: 1fr; }
}

/* Full HD и ТВ: общий масштаб растёт, всё считается в rem */
@media (min-width: 1920px) {
  html { font-size: 19px; }
  :root { --gutter: 3rem; }
  .container { max-width: 84rem; }
}
@media (min-width: 2560px) {
  html { font-size: 25px; }
}
@media (min-width: 3840px) {
  html { font-size: 36px; }
}

/* ТВ / «лёжа» с небольшой высотой: не раздуваем hero */
@media (min-width: 1024px) and (max-height: 700px) {
  .hero { padding-top: calc(var(--header-h) + 2rem); padding-bottom: 2rem; }
  .hero__stats { margin-top: 2rem; }
}

/* Планшеты/телефоны в ландшафте */
@media (max-height: 480px) and (orientation: landscape) {
  .menu__link { font-size: 1.1rem; padding: .55rem 0; }
  .hero { padding-top: calc(var(--header-h) + 1.5rem); }
}

/* Устройства без наведения (тач, ТВ-пульт): hover-эффекты не должны «залипать» */
@media (hover: none) {
  .card:hover, .member:hover, .project:hover, .qr:hover { transform: none; }
  .member:hover .member__photo img, .project:hover .project__media img { -webkit-transform: none; transform: none; }
  .member:hover .pixel-portrait { -webkit-transform: none; transform: none; }
}

/* Режим высокого контраста / принудительные цвета */
@media (forced-colors: active) {
  .btn--primary, .seg button[aria-pressed="true"] { border-color: CanvasText; }
  .chip, .card, .member, .project { border-color: CanvasText; }
}

/* Печать */
@media print {
  .bg-fx, .header, .menu, .marquee, .term, .btn, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .js .reveal { opacity: 1; -webkit-transform: none; transform: none; }
}
