/* ==========================================================================
   Micros Pak — упаковка для банковских карт
   Тёмная премиальная тема. Общие стили для ru / uz / en.
   ========================================================================== */

/* --- Фирменный шрифт -----------------------------------------------------
   Cooper Black используется ТОЛЬКО в логотипе. Положите файл
   assets/fonts/CooperBlack.woff2 — подхватится автоматически.
   Заголовки набраны гротеском: на тёмном фоне он читается строже.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Cooper Black Local";
  src: url("../fonts/CooperBlack.woff2") format("woff2"),
       url("../fonts/CooperBlack.woff") format("woff");
  font-weight: 400 900;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   ТЕМЫ
   Ночная — база (значения в :root), дневная — переопределение в
   [data-theme="light"]. Атрибут ставится на <html> ещё до отрисовки
   страницы (скрипт в <head>), поэтому при загрузке нет вспышки.
   Все цвета живут только здесь: чтобы поправить тему, менять надо
   переменные, а не правила ниже.
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Фон: почти чёрный с синим подтоном */
  --bg:        #070B14;
  --bg-2:      #0B1220;
  --surface:   #111A2B;
  --surface-2: #16223A;

  /* Линии — только тонкие, никаких заливок-плашек */
  --line:      rgba(255, 255, 255, .09);
  --line-2:    rgba(255, 255, 255, .16);

  /* Фирменный синий и его светлая версия для тёмного фона */
  --brand:     #14519E;
  --accent:    #4A8FE0;
  --accent-dim: rgba(74, 143, 224, .14);

  /* Текст */
  --fg:        #EEF3FA;
  --fg-2:      #A9B7CC;
  --fg-3:      #6C7C94;

  --ok:        #3FB27F;
  --warn:      #D9694F;

  /* Служебные оттенки, зависящие от темы */
  --grid:          rgba(255, 255, 255, .028);   /* сетка на фоне hero */
  --stripe:        rgba(255, 255, 255, .022);   /* штриховка пустых слотов */
  --hover-tint:    rgba(255, 255, 255, .05);
  --header-bg:     rgba(7, 11, 20, .72);
  --header-bg-2:   rgba(7, 11, 20, .92);
  --caption-shade: rgba(7, 11, 20, .92);        /* подпись поверх фото */
  --overlay:       rgba(4, 7, 13, .94);         /* просмотр фото */

  /* Бумага конверта в анимации */
  --paper-back:  #C9C6BE;
  --paper-front: #D6D3CB;
  --paper-flap:  #CFCCC3;
  --paper-edge:  #B0ACA2;

  /* Строгая геометрия: почти без скруглений */
  --r:   4px;
  --r-2: 6px;

  --font-head: "Inter", "SF Pro Display", system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: var(--font-head);
  --font-logo: "Cooper Black Local", "Cooper Black", "Cooper Std Black",
               Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono",
               Menlo, Consolas, monospace;

  --wrap: 1240px;
  --header-h: 72px;
}

/* --- Дневная тема --------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:        #FFFFFF;
  --bg-2:      #F5F7FB;
  --surface:   #ECF1F8;
  --surface-2: #E2E9F4;

  --line:      rgba(11, 26, 46, .11);
  --line-2:    rgba(11, 26, 46, .22);

  --brand:      #14519E;
  --accent:     #14519E;
  --accent-dim: rgba(20, 81, 158, .09);

  --fg:   #0A1A2E;
  --fg-2: #45566F;
  --fg-3: #7A8AA1;

  --ok:   #1E8B5E;
  --warn: #C0492F;

  --grid:          rgba(11, 26, 46, .05);
  --stripe:        rgba(11, 26, 46, .045);
  --hover-tint:    rgba(11, 26, 46, .05);
  --header-bg:     rgba(255, 255, 255, .76);
  --header-bg-2:   rgba(255, 255, 255, .95);
  --caption-shade: rgba(255, 255, 255, .94);
  --overlay:       rgba(10, 16, 28, .96);

  --paper-back:  #E5E2DA;
  --paper-front: #F0EEE8;
  --paper-flap:  #EAE7E0;
  --paper-edge:  #C6C2B7;
}

/* Плавный переход между темами.
   Карточки сюда не входят: у них своя анимация появления, и общий
   transition её бы перебил. */
body, .header, .footer, .step, .form, .envelope__back, .envelope__front,
.envelope__flap, .field input, .field textarea, .field select {
  transition-property: background-color, border-color, color;
  transition-duration: .28s;
  transition-timing-function: ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--fg);
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(32px, 4.4vw, 56px); letter-spacing: -.03em; }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3 { font-size: clamp(17px, 1.5vw, 20px); font-weight: 600; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: clamp(64px, 7.5vw, 116px) 0; position: relative; }
.section--alt { background: var(--bg-2); }
.section + .section { border-top: 1px solid var(--line); }

/* Технический надзаголовок — цифра раздела + название */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: attr(data-no);
  color: var(--fg-3);
  padding-right: 12px;
  border-right: 1px solid var(--line-2);
}

.lead { font-size: clamp(16px, 1.35vw, 18px); color: var(--fg-2); max-width: 64ch; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 4.5vw, 64px); }

/* Products now live as a detailed subsection of “About the company”. */
.about__products {
  margin-top: clamp(64px, 8vw, 120px);
  padding-top: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--line);
}
.about__products .eyebrow::before { display: none; }
.about__products .eyebrow { gap: 0; }

/* --- Кнопки: прямоугольные, без теней и «таблеток» ------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--r);
  /* Обязательно: у <button> без этого остаётся системная серая заливка,
     и кнопка-элемент выглядит иначе, чем такая же кнопка-ссылка */
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: #1A62BC; border-color: #1A62BC; }

.btn--ghost { border-color: var(--line-2); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--fg); background: var(--accent-dim); }

.btn--lg { padding: 17px 32px; font-size: 16px; }
.btn--block { width: 100%; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.header.is-stuck { border-bottom-color: var(--line); background: var(--header-bg-2); }

.header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.logo { display: flex; align-items: baseline; flex-shrink: 0; }
.logo__text {
  font-family: var(--font-logo);
  font-size: 23px;
  line-height: 1;
  color: #14519e;
  letter-spacing: -.01em;
}
.logo__text span { color: #14519e; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav a:hover { color: var(--fg); border-bottom-color: var(--accent); }

/* --- Выбор языка: кнопка с текущим языком + выпадающий список ------------- */
.lang { position: relative; flex-shrink: 0; }

.lang__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.lang__btn:hover { color: var(--fg); border-color: var(--line-2); background: var(--hover-tint); }
.lang__btn svg { width: 12px; height: 12px; transition: transform .25s ease; }
.lang__btn[aria-expanded="true"] { color: var(--fg); border-color: var(--line-2); }
.lang__btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 148px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(7, 11, 20, .45);
  animation: lang-in .18s ease both;
}
.lang__menu[hidden] { display: none; }
:root[data-theme="light"] .lang__menu { box-shadow: 0 12px 28px rgba(11, 26, 46, .16); }

@keyframes lang-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.lang__menu a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 2px;
  font-size: 13px;
  color: var(--fg-2);
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.lang__menu a b {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--fg-3);
}
.lang__menu a:hover { background: var(--hover-tint); color: var(--fg); }
.lang__menu a[aria-current="page"] { background: var(--brand); color: #fff; }
.lang__menu a[aria-current="page"] b { color: #fff; }

/* --- Тумблер темы --------------------------------------------------------- */
.theme-toggle {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r); }
.theme-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 58px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
}
.theme-toggle__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--brand);
  border-radius: 2px;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}
:root[data-theme="light"] .theme-toggle__knob { transform: translateX(100%); }

.theme-toggle__ico {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: var(--fg-3);
  transition: color .3s ease;
}
:root:not([data-theme="light"]) .theme-toggle__ico--moon { color: #fff; }
:root[data-theme="light"] .theme-toggle__ico--sun { color: #fff; }
.theme-toggle:hover .theme-toggle__ico { color: var(--fg); }
:root:not([data-theme="light"]) .theme-toggle:hover .theme-toggle__ico--moon,
:root[data-theme="light"] .theme-toggle:hover .theme-toggle__ico--sun { color: #fff; }

.header__phone {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--fg);
  white-space: nowrap;
}
.header__phone:hover { color: var(--accent); }

.burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 18px; height: 1px;
  background: var(--fg);
  transition: transform .2s ease, opacity .2s ease;
}
.burger span { position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after  { top:  6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(56px, 6vw, 96px) 0 clamp(64px, 7vw, 104px);
  overflow: hidden;
}
/* Техническая сетка на фоне — вместо мягких градиентов */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 80% at 60% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 80% at 60% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { font-size: clamp(16px, 1.4vw, 18px); color: var(--fg-2); max-width: 48ch; }

/* Смысловые акценты в лиде. Маркер прочерчивается слева направо и оставляет
   под фразой тонкую линию цвета бренда; две фразы подсвечиваются по очереди,
   уже после того, как страница отрисовалась. Фон рисуется фоновым градиентом,
   а не псевдоэлементом, — тогда акцент не разъезжается при переносе строки. */
.hero__lead .hl {
  font-weight: 600;
  padding: .06em .2em;
  margin: 0 -.2em;
  background-image:
    linear-gradient(var(--accent-dim), var(--accent-dim)),
    linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 0, 0 100%;
  background-size: 0 100%, 0 2px;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  animation: hl-sweep .85s cubic-bezier(.22, .61, .36, 1) .5s both;
}
.hero__lead .hl--2 { animation-delay: 1.15s; }

@keyframes hl-sweep {
  from { background-size: 0 100%, 0 2px;       color: var(--fg-2); }
  to   { background-size: 100% 100%, 100% 2px; color: var(--fg); }
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }

/* ==========================================================================
   О компании: таймлайн
   Одна разметка на оба режима: на широком экране линия горизонтальная,
   до 900px она разворачивается в вертикальный список. Описание этапа
   раскрывается по наведению, по фокусу с клавиатуры и по клику
   (на тач-экранах работает только клик — там наведения нет).
   ========================================================================== */
.about .tl { position: relative; }

/* Направляющая: серая на всю ширину, поверх неё прочерчивается синяя */
.tl__rail {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-2);
}
.tl__rail span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.22, .61, .36, 1) .1s;
}
.tl.is-in .tl__rail span { transform: scaleX(1); }

.tl__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl__item { position: relative; padding-right: 16px; }

.tl__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  /* Точки проявляются по очереди, уже после того как линия их прошла */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease;
}
.tl.is-in .tl__btn { opacity: 1; transform: none; }
.tl.is-in .tl__item:nth-child(1) .tl__btn { transition-delay: .30s; }
.tl.is-in .tl__item:nth-child(2) .tl__btn { transition-delay: .48s; }
.tl.is-in .tl__item:nth-child(3) .tl__btn { transition-delay: .66s; }
.tl.is-in .tl__item:nth-child(4) .tl__btn { transition-delay: .84s; }
.tl__btn:focus { outline: none; }

.tl__dot {
  display: block;
  width: 13px;
  height: 13px;
  margin-bottom: 22px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg);
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tl__item:hover .tl__dot,
.tl__item.is-active .tl__dot,
.tl__btn:focus-visible .tl__dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-dim);
}

.tl__year {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.1vw, 30px);
  letter-spacing: .01em;
  line-height: 1.1;
  color: var(--fg-3);
  transition: color .25s ease;
}
.tl__item:hover .tl__year,
.tl__item.is-active .tl__year,
.tl__btn:focus-visible .tl__year { color: var(--fg); }

.tl__label {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-2);
}

/* Раскрытие описания: строка грида растёт с 0fr до 1fr — так высота
   анимируется без фиксированных значений в пикселях */
.tl__desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .4s cubic-bezier(.22, .61, .36, 1), opacity .3s ease;
}
/* Внутренний div обязателен: он режет содержимое по нулевой строке грида.
   Будь отступ на самом абзаце, в закрытом состоянии от него осталась бы
   полоска в 10px. */
.tl__desc > div { overflow: hidden; }
.tl__desc p {
  margin: 0;
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-3);
}
.tl__item:hover .tl__desc,
.tl__item.is-active .tl__desc,
.tl__item:focus-within .tl__desc { grid-template-rows: 1fr; opacity: 1; }

/* --- Акцент: своя площадка вместо импорта --------------------------------- */
.pitch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
  margin-top: clamp(40px, 4.5vw, 64px);
  padding: 24px 28px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
}
.pitch__main { display: flex; align-items: center; gap: 14px; }
.pitch__main b {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg);
}
/* Метка-квадрат: тот же язык, что у остальной геометрии — без иконок */
.pitch__mark {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  background: var(--accent);
}
.pitch__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--fg-2);
}
.pitch__list li { position: relative; padding-left: 18px; }
.pitch__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

/* ==========================================================================
   Анимация: карта вкладывается в конверт
   Плоская, без градиентов и бликов. Движение прямое, без покачиваний.
   --p: 0 — карта снаружи, 1 — конверт закрыт.
   ========================================================================== */
.scene {
  --p: 0;
  --p-card: clamp(0, var(--p) / .68, 1);
  --p-flap: clamp(0, (var(--p) - .66) / .26, 1);

  /* Краска на бумаге — одинаковая в обеих темах, конверт всегда светлый */
  --paper-ink:   #6B665B;
  --paper-ink-2: #464238;

  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  display: grid;
  /* Конверт стоит внизу кадра: сверху остаётся место, откуда приходит карта */
  place-items: end center;
  padding-bottom: 14%;
  overflow: hidden;
  perspective: 1400px;
}

/* Поле считывателя: тонкие дуги, гаснут при вкладывании */
.scene__waves {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: calc(1 - var(--p-card) * 1.1);
}
.scene__waves i {
  position: absolute;
  width: 96px; height: 96px;
  border: 1px solid var(--warn);
  border-radius: 50%;
  opacity: 0;
  animation: wave 3s linear infinite;
}
.scene__waves i:nth-child(2) { animation-delay: 1s; }
.scene__waves i:nth-child(3) { animation-delay: 2s; }
@keyframes wave {
  0%   { transform: scale(.55); opacity: 0; }
  20%  { opacity: .5; }
  100% { transform: scale(2.7); opacity: 0; }
}

.envelope {
  position: relative;
  width: min(84%, 356px);
  aspect-ratio: 1.62 / 1;
  transform-style: preserve-3d;
}

/* Задняя стенка */
.envelope__back {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--paper-back);
  border: 1px solid var(--paper-edge);
}

/* Карта — плоская заливка фирменного синего */
.envelope__card {
  position: absolute;
  left: 8%;
  width: 84%;
  aspect-ratio: 1.586 / 1;          /* ISO/IEC 7810 ID-1 */
  border-radius: 3px;
  background: var(--brand);
  border: 1px solid #0F407D;
  overflow: hidden;
  top: calc(-76% + var(--p-card) * 88%);
  /* размеры надписей считаем от ширины самой карты */
  container-type: inline-size;
}
.card__chip {
  position: absolute;
  left: 9%; top: 26%;
  width: 15%; aspect-ratio: 1.32 / 1;
  border-radius: 2px;
  background: #C9A24B;
}
.card__chip::before, .card__chip::after {
  content: ""; position: absolute; background: rgba(20, 30, 50, .45);
}
.card__chip::before { left: 0; right: 0; top: 50%; height: 1px; }
.card__chip::after  { top: 0; bottom: 0; left: 50%; width: 1px; }
.card__nfc {
  position: absolute;
  left: 28%; top: 27%;
  width: 7%; aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .5);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}
.card__num {
  position: absolute;
  left: 9%; right: 9%; top: 52%;
  font-family: var(--font-mono);
  font-size: 6.6cqw;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .92);
  white-space: nowrap;
}
.card__meta {
  position: absolute;
  left: 9%; top: 71%;
  display: flex;
  align-items: center;
  gap: 4%;
  font-family: var(--font-mono);
  font-size: 3.1cqw;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .78);
}
.card__meta b { font-weight: 400; font-size: .78em; line-height: 1.05; max-width: 5em; color: rgba(255, 255, 255, .55); }
.card__name {
  position: absolute;
  left: 9%; bottom: 8%;
  font-family: var(--font-mono);
  font-size: 4cqw;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .88);
}
/* Условный знак платёжной системы */
.card__scheme { position: absolute; right: 8%; bottom: 9%; display: flex; }
.card__scheme i {
  width: 6.5cqw; height: 6.5cqw;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
}
.card__scheme i + i { margin-left: -2.6cqw; background: rgba(255, 255, 255, .5); }
.card__logo {
  position: absolute;
  right: 8%; top: 10%;
  font-family: var(--font-mono);
  font-size: 4.4cqw;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .7);
}

/* Передняя стенка с печатью: логотип банка, адресный блок, код тиража */
.envelope__front {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  z-index: 3;
  border-radius: 0 0 2px 2px;
  background: var(--paper-front);
  border: 1px solid var(--paper-edge);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5%;
  padding: 0 8% 8%;
}
.env-brand {
  align-self: flex-start;
  padding: 1.6cqw 3cqw;
  border: 1px dashed var(--paper-ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 3cqw;
  letter-spacing: .14em;
  color: var(--paper-ink-2);
}
.env-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6%; }
.env-lines { flex: 1; display: grid; gap: 2.4cqw; }
.env-lines i { height: 1.4cqw; border-radius: 1px; background: var(--paper-ink); opacity: .55; }
.env-lines i:nth-child(1) { width: 78%; }
.env-lines i:nth-child(2) { width: 56%; }
.env-lines i:nth-child(3) { width: 66%; }
/* Штрихкод — та самая прослеживаемость тиража */
.env-code { display: flex; align-items: flex-end; gap: .8cqw; height: 9cqw; }
.env-code i { width: 1cqw; height: 100%; background: var(--paper-ink-2); }
.env-code i:nth-child(2n) { width: .6cqw; height: 78%; }
.env-code i:nth-child(3n) { width: 1.6cqw; }

/* Клапан */
.envelope__flap {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 64%;
  z-index: 4;
  background: var(--paper-flap);
  border: 1px solid var(--paper-edge);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
  transform-origin: top center;
  transform: rotateX(calc(180deg * (1 - var(--p-flap))));
  backface-visibility: hidden;
  container-type: inline-size;
}
/* Тиснение производителя на клапане */
.env-flap-mark {
  position: absolute;
  left: 0; right: 0; top: 12%;
  text-align: center;
  font-family: var(--font-logo);
  font-size: 3.4cqw;
  letter-spacing: .06em;
  color: var(--paper-ink);
  opacity: .5;
}

/* Подпись-указатель на сцене */
.scene__note {
  position: absolute;
  left: 0; bottom: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ==========================================================================
   Карточки-пункты
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  position: relative;
  background: var(--bg);
  padding: 38px 30px 40px;
  transition: background-color .35s ease;
}
.section--alt .card { background: var(--bg-2); }
.card:hover, .section--alt .card:hover { background: var(--surface); }

/* Тонкая акцентная черта, прочерчивается при наведении */
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}
.card:hover::before { transform: scaleX(1); }

.card h3 { margin-bottom: .5em; }
/* Метка «опция» — ярлык в правом верхнем углу карточки. Цветом уводим
   в акцент: это не оговорка мелким шрифтом, а то, что стоит заметить.
   Работает и в .card, и в .product — обе карточки position: relative. */
.card__opt {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 4px 9px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
  transition: background-color .3s ease, color .3s ease;
}
.card:hover .card__opt,
.product:hover .card__opt {
  background: var(--accent);
  color: #fff;
}
/* --- Кнопка «Опция: интеграция NFC» ---------------------------------------
   Стоит внизу карточки во всю её ширину: ярлык в углу принимали за подпись.
   Синяя рамка, стрелка вниз и заливка при наведении — набор признаков,
   по которым кнопку узнают, не наводя курсор. */
.nfc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  /* auto прижимает кнопку к низу: .product — колонка флексов */
  margin-top: auto;
  padding: 11px 14px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.nfc-toggle:hover,
.nfc-toggle:focus-visible,
.nfc-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; }

.nfc-toggle__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}
.nfc-toggle[aria-expanded="true"] .nfc-toggle__ico { transform: rotate(180deg); }

/* Подсказка «сюда можно нажать»: стрелка раз в несколько секунд качается
   вниз-вверх. Класс вешает скрипт, когда карточка появляется на экране,
   и снимает после первого нажатия — дальше подсказка не нужна. */
.nfc-toggle.is-hint .nfc-toggle__ico { animation: nfc-bob 2.6s ease-in-out infinite; }
.nfc-toggle:hover .nfc-toggle__ico,
.nfc-toggle:focus-visible .nfc-toggle__ico { animation: none; }

@keyframes nfc-bob {
  0%, 55%, 100% { transform: translateY(0); }
  25%           { transform: translateY(4px); }
  40%           { transform: translateY(1px); }
}

/* Кнопка есть только у одной карточки — у остальных снизу остаётся воздух,
   чтобы ряд выглядел ровно */
.products .product { padding-bottom: 26px; }

/* --- Панель «Интеграция NFC» --------------------------------------------- */
.nfc {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.22, .61, .36, 1),
              opacity .3s ease;
  opacity: 0;
}
.nfc.is-open { grid-template-rows: 1fr; opacity: 1; }
.nfc__inner { overflow: hidden; }
.nfc__box {
  margin-top: 1px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--accent);
  background: var(--accent-dim);
}
.nfc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.nfc__box h3 { font-size: clamp(18px, 1.8vw, 22px); margin: 0 0 14px; }
.nfc__box p { color: var(--fg-2); margin: 0 0 16px; max-width: 68ch; }
.nfc__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.nfc__close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.nfc__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 32px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  color: var(--fg);
  font-size: 15px;
}
.nfc__list li { position: relative; padding-left: 20px; }
.nfc__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 9px;
  height: 1px;
  background: var(--accent);
}
.nfc__box p.nfc__note { font-size: 14px; color: var(--fg-3); margin: 0; }
.card p { color: var(--fg-2); font-size: 15px; margin: 0; }

/* --- Иконки: крупная линия, контур прочерчивается при появлении --------- */
.card__icon { color: var(--fg-2); margin-bottom: 28px; }
.card__icon svg {
  width: 52px; height: 52px;
  overflow: visible;
  transition: color .35s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
}
.card:hover .card__icon svg { color: var(--fg); transform: translateY(-3px); }
.card__icon .ico-accent { stroke: var(--accent); }

.card__icon svg [pathLength] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.5s cubic-bezier(.32, .72, .32, 1);
}
.card.is-in .card__icon svg [pathLength] { stroke-dashoffset: 0; }
/* Галочка/засечка дорисовывается после основного контура */
.card.is-in .card__icon .ico-accent { transition-delay: .75s; }

/* Появление карточки: чуть длиннее обычного reveal, чтобы не мельтешило */
.cards .card {
  transition: opacity .8s ease, transform .8s cubic-bezier(.22, .61, .36, 1),
              background-color .35s ease;
}

/* Каждая следующая карточка стартует чуть позже предыдущей */
.cards .card:nth-child(2) { transition-delay: .12s; }
.cards .card:nth-child(3) { transition-delay: .24s; }
.cards .card:nth-child(4) { transition-delay: .36s; }
.cards .card:nth-child(2).is-in .card__icon svg [pathLength] { transition-delay: .12s; }
.cards .card:nth-child(3).is-in .card__icon svg [pathLength] { transition-delay: .24s; }
.cards .card:nth-child(4).is-in .card__icon svg [pathLength] { transition-delay: .36s; }
.cards .card:nth-child(2).is-in .card__icon .ico-accent { transition-delay: .87s; }
.cards .card:nth-child(3).is-in .card__icon .ico-accent { transition-delay: .99s; }
.cards .card:nth-child(4).is-in .card__icon .ico-accent { transition-delay: 1.11s; }

/* ==========================================================================
   Производство — конвейер по скроллу
   ========================================================================== */
/* Лента едет сама; пользователь может перехватить её мышью,
   пальцем или колесом — автопрокрутка на это время замирает. */
.line { --lp: 0; position: relative; margin-top: clamp(40px, 4vw, 60px); }
.line__track {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  padding-bottom: 28px;
}
.line__track::-webkit-scrollbar { display: none; }
.line__track.is-dragging { cursor: grabbing; user-select: none; }
.line__belt {
  display: flex;
  gap: 1px;
  width: max-content;
}
.step {
  flex: 0 0 264px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 26px 24px 28px;
}
.section--alt .step { background: var(--bg); }
.step__no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 18px;
}
.step h3 { font-size: 18px; margin-bottom: .4em; }
.step p { font-size: 14px; color: var(--fg-2); margin: 0; }

/* Направляющая под лентой */
.line__rail {
  position: relative;
  height: 1px;
  background: var(--line-2);
}
.line__rail::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 22%;
  height: 3px;
  background: var(--accent);
  transform: translateX(calc(var(--lp) * 354%));
}

/* Затухание только справа — там, откуда карточки въезжают: этап словно
   проявляется из дымки и дальше едет уже чётким. Слева лента обрывается
   по границе, и первый этап читается целиком (при прежних 7% слева тень
   съедала треть карточки). */
.line__track {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 60px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 60px), transparent 100%);
}

/* --- Цифры производства -------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(48px, 5vw, 72px);
}
.stat {
  background: var(--bg-2);
  padding: 34px 28px 32px;
  transition: background-color .35s ease, opacity .8s ease,
              transform .8s cubic-bezier(.22, .61, .36, 1);
}
.section--alt .stat { background: var(--bg); }
.stat:hover { background: var(--surface); }

.stat__num {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: clamp(46px, 5.4vw, 72px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.045em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.stat__num i { font-style: normal; font-size: .42em; letter-spacing: -.02em; color: var(--accent); }

.stat__bar { height: 2px; background: var(--line-2); margin: 22px 0 16px; }
.stat__bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.3s cubic-bezier(.22, .61, .36, 1) .15s;
}
.stat.is-in .stat__bar span { transform: scaleX(1); }

.stat__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.stat__note { font-size: 13px; line-height: 1.55; color: var(--fg-3); margin: 0; }

/* Колонки включаются по очереди */
.stats .stat:nth-child(2) { transition-delay: .12s; }
.stats .stat:nth-child(3) { transition-delay: .24s; }
.stats .stat:nth-child(4) { transition-delay: .36s; }
.stats .stat:nth-child(2).is-in .stat__bar span { transition-delay: .27s; }
.stats .stat:nth-child(3).is-in .stat__bar span { transition-delay: .39s; }
.stats .stat:nth-child(4).is-in .stat__bar span { transition-delay: .51s; }

/* ==========================================================================
   Продукция
   ========================================================================== */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.product {
  position: relative;
  background: var(--bg);
  padding: 26px 28px 34px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: background-color .35s ease;
}
.section--alt .product { background: var(--bg-2); }
.product:hover { background: var(--surface); }

/* Шапка карточки: номер и линейка, которая прочерчивается при появлении */
.product__head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.product__no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--fg-3);
  transition: color .3s ease;
}
.product:hover .product__no { color: var(--accent); }
.product__rule {
  flex: 1;
  height: 1px;
  background: var(--line-2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.22, .61, .36, 1);
}
.product.is-in .product__rule { transform: scaleX(1); }

.product__icon { color: var(--fg-2); margin-bottom: 24px; }
.product__icon svg {
  width: 46px; height: 46px;
  overflow: visible;
  transition: color .35s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
}
.product:hover .product__icon svg { color: var(--fg); transform: translateY(-3px); }
.product__icon .ico-accent { stroke: var(--accent); }
.product__icon svg [pathLength] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s cubic-bezier(.32, .72, .32, 1) .35s;
}
.product.is-in .product__icon svg [pathLength] { stroke-dashoffset: 0; }
.product.is-in .product__icon .ico-accent { transition-delay: 1s; }

.product h3 {
  margin: 0 0 .4em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .7s ease .5s, transform .7s cubic-bezier(.22, .61, .36, 1) .5s;
}
.product p {
  font-size: 14px;
  color: var(--fg-2);
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .7s ease .62s, transform .7s cubic-bezier(.22, .61, .36, 1) .62s;
}
.product.is-in h3, .product.is-in p { opacity: 1; transform: none; }

/* Карточки включаются одна за другой: 01 → 02 → 03 → 04 */
.products .product { transition: opacity .8s ease, transform .8s cubic-bezier(.22, .61, .36, 1), background-color .35s ease; }
.products .product:nth-child(2) { transition-delay: .18s; }
.products .product:nth-child(3) { transition-delay: .36s; }
.products .product:nth-child(4) { transition-delay: .54s; }
.products .product:nth-child(2).is-in .product__rule,
.products .product:nth-child(2).is-in .product__icon svg [pathLength],
.products .product:nth-child(2).is-in h3 { transition-delay: .53s; }
.products .product:nth-child(3).is-in .product__rule,
.products .product:nth-child(3).is-in .product__icon svg [pathLength],
.products .product:nth-child(3).is-in h3 { transition-delay: .71s; }
.products .product:nth-child(4).is-in .product__rule,
.products .product:nth-child(4).is-in .product__icon svg [pathLength],
.products .product:nth-child(4).is-in h3 { transition-delay: .89s; }
.products .product:nth-child(2).is-in p { transition-delay: .65s; }
.products .product:nth-child(3).is-in p { transition-delay: .83s; }
.products .product:nth-child(4).is-in p { transition-delay: 1.01s; }
.products .product:nth-child(2).is-in .product__icon .ico-accent { transition-delay: 1.18s; }
.products .product:nth-child(3).is-in .product__icon .ico-accent { transition-delay: 1.36s; }
.products .product:nth-child(4).is-in .product__icon .ico-accent { transition-delay: 1.54s; }

/* ==========================================================================
   Наши работы: видео + фотогалерея
   ========================================================================== */
/* Два ролика в ряд: широкий задаёт высоту строки, вертикальный
   подстраивается под неё и кадрируется по центру. */
.showreels {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1px;
}
/* Production videos introduce the process before the six manufacturing stages. */
#production .section-head { margin-bottom: 0; }
.production__media .showreels {
  margin: clamp(32px, 4vw, 56px) 0 clamp(40px, 5vw, 72px);
}
.showreel {
  position: relative;
  margin: 0;
  background: var(--bg-2);
  overflow: hidden;
}
.showreel--wide { aspect-ratio: 16 / 9; }
/* Видео вынуто из потока: иначе вертикальный ролик тянул бы строку грида
   по своей высоте и ломал ряд. Высоту задаёт широкий ролик. */
.showreel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.showreel figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--fg);
  background: linear-gradient(to top, var(--caption-shade), transparent);
  pointer-events: none;
}

/* Состояние «файла ещё нет» */
.slot {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(45deg,
      var(--stripe) 0 12px,
      transparent 12px 24px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.slot b { color: var(--fg-2); font-weight: 500; }

/* --- Логотипы клиентов ---------------------------------------------------
   Статичная сетка на несколько партнёров: карточки проявляются по очереди.
   ------------------------------------------------------------------------- */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.partner {
  position: relative;
  margin: 0;
  background: var(--bg);
  padding: 38px 28px 30px;
  display: grid;
  gap: 20px;
  justify-items: center;
  transition: opacity .8s ease, transform .8s cubic-bezier(.22, .61, .36, 1),
              background-color .35s ease;
}
.section--alt .partner { background: var(--bg-2); }
.partner:hover { background: var(--surface); }

/* Черта под логотипом прочерчивается при появлении */
.partner::after {
  content: "";
  position: absolute;
  left: 28px; right: 28px; bottom: 22px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.22, .61, .36, 1) .25s;
}
.partner.is-in::after { transform: scaleX(1); }

.partner__logo {
  position: relative;
  width: 100%;
  height: 64px;
  display: grid;
  place-items: center;
}
.partner__logo img {
  /* All partner marks use the same visual frame. `contain` keeps each
     original logo proportion intact while aligning their perceived size. */
  width: 150px;
  height: 52px;
  max-width: 100%;
  object-fit: contain;
  opacity: .7;
  filter: grayscale(1);
  transition: opacity .3s ease, filter .3s ease, transform .3s ease;
}
/* На тёмной теме одноцветные логотипы выворачиваем в светлые */
:root:not([data-theme="light"]) .partner__logo img { filter: grayscale(1) invert(1) brightness(1.7); }
.partner:hover .partner__logo img { opacity: 1; filter: none; transform: scale(1.04); }

/* Четвёртая карточка — приглашение, а не пустой слот. Пунктир вместо
   логотипа: видно, что место оставлено намеренно. */
.partner--free .partner__logo {
  border: 1px dashed var(--line-2);
  transition: border-color .3s ease;
}
.partner--free:hover .partner__logo { border-color: var(--accent); }
.partner__invite {
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--fg-3);
  transition: color .3s ease;
}
.partner--free:hover .partner__invite { color: var(--accent); }

.partner__role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.partners .partner:nth-child(2) { transition-delay: .12s; }
.partners .partner:nth-child(3) { transition-delay: .24s; }
.partners .partner:nth-child(4) { transition-delay: .36s; }
.partners .partner:nth-child(2).is-in::after { transition-delay: .37s; }
.partners .partner:nth-child(3).is-in::after { transition-delay: .49s; }
.partners .partner:nth-child(4).is-in::after { transition-delay: .61s; }

.clients__note {
  margin: clamp(28px, 3vw, 40px) 0 0;
  font-size: 14px;
  color: var(--fg-3);
  max-width: 60ch;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
/* Снимки за пределами показанных рядов. display:none, а не opacity:
   скрытое фото не должно ловить клик и попадать в обход с клавиатуры. */
.work.is-hidden { display: none; }

.gallery-more { display: flex; justify-content: center; margin-top: 28px; }
.gallery-more__left { color: var(--fg-3); }

.work {
  position: relative;
  margin: 0;
  background: var(--bg-2);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: zoom-in;
}
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .2s ease; }
.work:hover img { transform: scale(1.03); }
.work figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px;
  font-size: 13px;
  color: var(--fg);
  background: linear-gradient(to top, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .88) 52%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* Просмотр фото на весь экран */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 32px;
  background: var(--overlay);
}
.lightbox.is-open { display: grid; }

.lightbox__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: center;
  width: 100%;
  max-width: 1100px;
}
.lightbox__stage { display: grid; place-items: center; min-width: 0; }
.lightbox__stage img { max-width: 100%; max-height: 82vh; object-fit: contain; }

/* Подложка просмотра всегда тёмная — значит и текст на ней всегда светлый,
   независимо от выбранной темы. Переменные темы здесь использовать нельзя:
   в дневной теме текст стал бы тёмным на тёмном. */
.lightbox__panel { color: #EEF3FA; }
.lightbox__title { font-size: 22px; margin-bottom: 20px; color: #FFFFFF; }

.lightbox__toggle {
  padding: 12px 22px;
  font-size: 14px;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, .3);
  background: transparent;
}
.lightbox__toggle:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .08);
}
.lightbox__toggle::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .25s ease;
}
.lightbox__toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translate(-3px, -3px); }

.lightbox__desc {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  animation: descIn .35s ease both;
}
@keyframes descIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.lightbox__text { display: grid; gap: 6px; font-size: 15px; line-height: 1.65; color: #C6D2E2; }
.lightbox__text p { margin: 0; }
.lightbox__text strong { color: #FFFFFF; font-weight: 700; }
.lightbox__cta { font-size: 14px; color: #93A4BE; margin: 0; }
.lightbox__cta a { color: #7FB0EE; border-bottom: 1px solid currentColor; }
.lightbox__cta a:hover { color: #FFFFFF; }
.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 2;
  width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r);
  background: transparent;
  color: #FFFFFF;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { border-color: #FFFFFF; background: rgba(255, 255, 255, .08); }

/* ==========================================================================
   Заявка
   ========================================================================== */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.contact__list { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact__list li { padding: 20px 0; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: baseline; }
.contact__list b {
  flex: 0 0 156px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.contact__list a, .contact__list span.val { font-size: 19px; color: var(--fg); letter-spacing: -.01em; }
.contact__list a:hover { color: var(--accent); }

.form { border: 1px solid var(--line); background: var(--bg-2); padding: clamp(26px, 3vw, 38px); }
.section--alt .form { background: var(--bg); }
.form h3 { margin-bottom: 1.2em; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color .15s ease;
}
.field select option { background: var(--surface); color: var(--fg); }
.field textarea { min-height: 92px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-3); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input:invalid:not(:placeholder-shown) { border-color: var(--warn); }

.form__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--fg-3); margin: 22px 0; }
.form__consent input { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 3px; accent-color: var(--brand); }

.form__status { margin-top: 14px; font-size: 14px; min-height: 20px; color: var(--fg-2); }
.form__status[data-state="ok"]  { color: var(--ok); }
.form__status[data-state="err"] { color: var(--warn); }

/* ==========================================================================
   Подвал
   ========================================================================== */
.footer { background: var(--bg); border-top: 1px solid var(--line); padding: 56px 0 28px; font-size: 14px; color: var(--fg-2); }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 18px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer a:hover { color: var(--accent); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--fg-3);
}

.fab { position: fixed; right: 14px; bottom: 14px; z-index: 90; display: none; gap: 8px; }

/* Плавающий блок в углу: презентация и «наверх» стоят в ряд, поэтому
   позиционируется контейнер, а не каждая кнопка по отдельности. */
.dock {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 91;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Скачать презентацию */
.dock__doc {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.dock__doc:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.dock__doc svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* Стрелка ныряет вниз, к «полу» иконки — намёк на загрузку файла */
.dock__doc:hover svg { animation: doc-dip .5s ease; }

@keyframes doc-dip {
  0%, 100% { transform: translateY(0); }
  45%      { transform: translateY(3px); }
}

/* Кнопка «наверх». Круглая и залитая фирменным синим: серая на сером фоне
   терялась. Появляется после первого экрана прокрутки. */
.to-top {
  position: relative;
  z-index: 1;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--brand);
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  /* Тень отрывает кнопку от контента под ней — без неё синий круг
     сливается с тёмными блоками страницы */
  box-shadow: 0 6px 18px rgba(7, 11, 20, .45);
  transition: background-color .25s ease, border-color .25s ease,
              color .25s ease, transform .25s ease, box-shadow .25s ease;
  /* Пока скрыта — именно display: в ряду с презентацией невидимая кнопка
     не должна резервировать пустое место */
  display: none;
}
/* Без fill-mode: заполняющая анимация зафиксировала бы transform и hover
   уже не смог бы приподнять кнопку */
.to-top.is-on { display: grid; animation: to-top-in .3s ease; }

@keyframes to-top-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.to-top:hover {
  background: #1A62BC;
  border-color: #1A62BC;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(7, 11, 20, .5);
}
.to-top svg { width: 21px; height: 21px; }
/* На светлом фоне та же тень выглядит грязным пятном — делаем легче */
:root[data-theme="light"] .to-top { box-shadow: 0 6px 18px rgba(11, 26, 46, .20); }
:root[data-theme="light"] .to-top:hover { box-shadow: 0 10px 24px rgba(11, 26, 46, .26); }

/* --- Спросить перед загрузкой (узкий экран) ------------------------------- */
.ask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
  background: var(--overlay);
  padding: 16px;
  animation: ask-in .2s ease both;
}
.ask[hidden] { display: none; }
.ask__box {
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: 22px 20px;
  animation: ask-up .28s cubic-bezier(.22, .61, .36, 1) both;
}
.ask__title { font-size: 17px; color: var(--fg); margin: 0 0 6px; }
.ask__meta { font-size: 13px; color: var(--fg-3); margin: 0 0 20px; }
.ask__row { display: flex; gap: 10px; }
.ask__row .btn { flex: 1 1 0; justify-content: center; }

@keyframes ask-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ask-up { from { transform: translateY(16px); } to { transform: none; } }

/* ==========================================================================
   Появление при скролле — сдержанное
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }
.reveal:nth-child(4) { transition-delay: .18s; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 900px) {
  /* Просмотр фото: описание уезжает под снимок */
  .lightbox { padding: 20px; align-content: start; overflow-y: auto; }
  .lightbox__inner { grid-template-columns: 1fr; gap: 20px; padding: 48px 0 24px; }
  .lightbox__stage img { max-height: 52vh; }
  .lightbox__title { font-size: 19px; margin-bottom: 14px; }

  .hero__grid { grid-template-columns: 1fr; }
  .scene { max-width: 380px; }

  /* Ролики встают друг под друга: вертикальный получает свои пропорции */
  .showreels { grid-template-columns: 1fr; }
  .showreel--tall { aspect-ratio: 3 / 4; }

  /* Таймлайн разворачивается в вертикальный список: линия уходит влево,
     под точки, и прочерчивается сверху вниз. */
  .tl__rail {
    top: 0;
    bottom: 0;
    left: 6px;
    right: auto;
    width: 1px;
    height: auto;
  }
  .tl__rail span {
    width: 100%;
    transform: scaleY(0);
    transform-origin: center top;
    transition-property: transform;
  }
  .tl.is-in .tl__rail span { transform: scaleY(1); }

  .tl__list { grid-template-columns: 1fr; gap: 0; }
  .tl__item { padding: 0 0 0 34px; }
  .tl__item:not(:last-child) { padding-bottom: 26px; }
  .tl__dot { position: absolute; left: 0; top: 4px; margin-bottom: 0; }
  .tl__year { font-size: 24px; }
  .tl__btn { transform: translateX(8px); }
  .tl.is-in .tl__btn { transform: none; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .header__phone { display: none; }
  .burger { display: flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 4px 28px 18px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 15px 0; border-bottom: 1px solid var(--line); }
  .header__inner { gap: 14px; }
  .lang { margin-left: auto; }
  .fab { display: flex; }
  /* Внизу справа уже стоят плавающие кнопки — поднимаем «наверх» над ними */
  /* Внизу уже стоят Telegram и «Позвонить» — поднимаем блок над ними.
     Подпись у презентации убираем: в ряд с круглой кнопкой она не влезет,
     остаётся иконка, а что произойдёт по нажатию — объясняет окно. */
  .dock { right: 14px; bottom: 72px; gap: 8px; }
  .dock__doc {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .dock__label { display: none; }
  .to-top { width: 46px; height: 46px; }
}

@media (max-width: 640px) {
  /* Шапка: на узком экране всё ужимаем, иначе переключатель языков режется */
  .header__inner { gap: 10px; }
  .logo__text { font-size: 19px; }
  .theme-toggle__track { width: 46px; height: 26px; }
  .theme-toggle__ico { width: 13px; height: 13px; }
  .lang__btn { padding: 6px 7px; font-size: 10px; gap: 4px; }
  .burger { flex: 0 0 auto; width: 38px; height: 38px; }

  /* Плавающие кнопки не должны заслонять пол-экрана */
  .fab .btn { padding: 11px 16px; font-size: 14px; }

  .hero__cta .btn { flex: 1 1 100%; }
  .pitch { padding: 20px; gap: 14px; }
  .pitch__list { gap: 8px 20px; }
  .contact__list li { flex-direction: column; gap: 6px; }
  .contact__list b { flex-basis: auto; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .step { flex-basis: 230px; }
  .wrap, .header__inner { padding: 0 20px; }
}

/* ==========================================================================
   Уважение к системной настройке «меньше движения»
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .tl__btn { opacity: 1; transform: none; }
  .tl__rail span { transform: none; }
  .scene { --p: 1; }
  .line__belt { transform: none; }
  .product__rule { transform: scaleX(1); }
  .product h3, .product p { opacity: 1; transform: none; }
  .card__icon svg [pathLength], .product__icon svg [pathLength] { stroke-dashoffset: 0; }
}

/* Десктопная шапка: пункты меню не переносятся на вторую строку. */
@media (min-width: 901px) and (max-width: 1280px) {
  .header__inner { gap: 18px; padding-left: 20px; padding-right: 20px; }
  .nav { gap: 18px; }
  .nav a { white-space: nowrap; font-size: 13px; }
  .header__phone { font-size: 12px; }
}
/* Первый экран: коллаж из реальных работ вместо анимированного конверта. */
.hero__media--works { display: grid; place-items: center; min-height: min(40vw, 470px); }
.hero-showcase { position: relative; width: min(100%, 460px); aspect-ratio: 1 / .88; }
.hero-showcase__item { position: absolute; margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 18px 34px rgba(11, 26, 46, .12); }
.hero-showcase__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-showcase__item--main { width: 63%; height: 72%; left: 18%; top: 13%; z-index: 2; transform: rotate(-2deg); }
.hero-showcase__item--top { width: 39%; height: 39%; right: 0; top: 0; z-index: 3; transform: rotate(6deg); }
.hero-showcase__item--bottom { width: 38%; height: 38%; left: 0; bottom: 0; z-index: 3; transform: rotate(-7deg); }
.hero-showcase__label { position: absolute; right: 2%; bottom: 2%; z-index: 4; padding: 7px 9px; background: var(--bg); border: 1px solid var(--line); color: var(--fg-3); font: 10px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 900px) { .hero__media--works { min-height: 340px; } .hero-showcase { max-width: 390px; } }
/* Корректное положение коллажа в первом экране. */
@media (min-width: 901px) {
  .hero__media--works { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; width: 100%; min-height: 0; }
  .hero-showcase { width: min(100%, 430px); }
}
/* Первый экран: один аккуратный слайд из реальных работ. */
.hero__media--slider { display: grid; place-items: center; min-height: min(36vw, 420px); }
.hero-slider { position: relative; width: min(100%, 430px); aspect-ratio: 1 / 1.12; overflow: visible; background: transparent; }
.hero-slider__image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.25); transition: opacity .7s ease; }
.hero-slider__image.is-active { opacity: 1; }
@media (min-width: 901px) { .hero__media--slider { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; width: 100%; min-height: 0; } }
@media (max-width: 900px) { .hero__media--slider { min-height: 320px; } .hero-slider { max-width: 390px; } }
@media (prefers-reduced-motion: reduce) { .hero-slider__image { transition: none; } }
/* Переключение работ в полноэкранном просмотре. */
.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 52px;
  height: 72px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 2px;
  background: rgba(11, 26, 46, .42);
  color: #fff;
  font: 44px/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .2s ease, border-color .2s ease;
}
.lightbox__nav:hover, .lightbox__nav:focus-visible { background: rgba(30, 91, 169, .8); border-color: #fff; outline: none; }
.lightbox__nav--prev { left: 28px; }
.lightbox__nav--next { right: 28px; }
.lightbox__nav span { margin-top: -5px; }
@media (max-width: 900px) {
  .lightbox__nav { top: auto; bottom: 20px; width: 48px; height: 48px; font-size: 38px; transform: none; }
  .lightbox__nav--prev { left: 20px; }
  .lightbox__nav--next { right: 20px; }
}
/* Иконки способов связи в подвале. */
.footer__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer__contact-link svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--blue);
  transition: transform .2s ease, color .2s ease;
}
.footer__contact-link:hover svg { color: var(--fg); transform: translateX(2px); }
