/* ==========================================================================
   Шрифт Jost: файлы лежат в fonts/, без запросов к Google Fonts.
   Один вариативный файл на алфавит покрывает все начертания 300..700,
   браузер качает только те алфавиты, что есть на странице
   ========================================================================== */

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/jost-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/jost-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/jost-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Токены
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --ink: #0c0c0e;
  --ink-2: #55575e;
  --ink-3: #8b8d94;
  --line: #e6e7ea;
  --line-strong: rgba(12, 12, 14, 0.2);
  --surface: #eceef2;
  /* Фон hero из символов: цвет в покое и его прозрачность,
     цвета вспышек и их яркость. На белом всё заметнее, поэтому тише */
  --glitch-base: #838383;
  --glitch-rest: 0.08;
  --glitch-1: #8b8d94;
  --glitch-2: #1838d6;
  --glitch-flash: 0.55;
  --accent: #1838d6;
  --on-accent: #ffffff;
  /* Ошибки в формах: сдержанный красный, на тёмной теме светлее */
  --danger: #c62a2f;
  --brand: #1838d6;
  --glass-top: rgba(255, 255, 255, 0.88);
  --glass-bottom: rgba(246, 247, 250, 0.8);
  --glass-btn: rgba(255, 255, 255, 0.7);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-lo: rgba(12, 12, 14, 0.04);
  --glass-rim-a: rgba(255, 255, 255, 1);
  --glass-rim-b: rgba(12, 12, 14, 0.06);
  --glass-rim-c: rgba(12, 12, 14, 0.16);
  --glass-shadow: rgba(12, 12, 14, 0.2);
  --glass-reflect: rgba(255, 255, 255, 0.75);
  --glass-sheen: rgba(255, 255, 255, 0.9);
  --glow: rgba(24, 56, 214, 0.09);
  --glow-soft: rgba(24, 56, 214, 0.05);

  --folder-back: rgba(200, 203, 211, 0.55);
  --folder-front-top: rgba(255, 255, 255, 0.58);
  --folder-front-bottom: rgba(228, 231, 237, 0.46);
  --folder-highlight: rgba(255, 255, 255, 0.95);
  --folder-edge: rgba(255, 255, 255, 0.7);
  --folder-card-border: #f1f2f4;
  --icon-edge: rgba(12, 12, 14, 0.08);
  --meter-empty: #e3e4e8;
  --dir-light: rgba(12, 12, 14, 0.045);
  --sticker-shadow: rgba(12, 12, 14, 0.18);
  /* Пик эквалайзера в «Уровне владения»: самое яркое деление.
     На белом ярче значит глубже, на тёмном светлее */
  --meter-peak: color-mix(in srgb, var(--accent) 70%, var(--ink));
  --folder-sheen: rgba(255, 255, 255, 1);
  --folder-sheen-soft: rgba(255, 255, 255, 0.45);
  --folder-sheen-edge: rgba(12, 12, 14, 0.045);

  --font: "Jost", "Futura PT", "Futura", "Century Gothic", sans-serif;

  /* Жалюзи (blinds.js) в футере и в блоке покупки: синие сайта,
     от глубокого к светлому. Одинаковы в обеих темах */
  --blinds-a: #1838d6;
  --blinds-b: #4f6af7;

  --island-top: 14px;
  --island-h: 64px;
  --island-w: 1240px;
  /* Место, которое занимает остров вместе с отступами сверху и снизу */
  --header-h: calc(var(--island-top) * 2 + var(--island-h));
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1520px;
  --radius: 4px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Тёмная тема. Атрибут ставит скрипт в <head> до первой отрисовки */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0b0d;
  --ink: #f1f1f3;
  --ink-2: #9b9da6;
  --ink-3: #6b6d76;
  --line: #232429;
  --line-strong: rgba(255, 255, 255, 0.22);
  --surface: #1a1b1f;
  --danger: #f0686c;
  --glitch-base: #838383;
  --glitch-rest: 0.11;
  --glitch-1: #ffffff;
  --glitch-2: #4f6af7;
  --glitch-flash: 0.75;
  --accent: #4f6af7;
  --glass-top: rgba(30, 31, 36, 0.88);
  --glass-bottom: rgba(14, 14, 17, 0.82);
  --glass-btn: rgba(255, 255, 255, 0.06);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --glass-lo: rgba(0, 0, 0, 0.4);
  --glass-rim-a: rgba(255, 255, 255, 0.36);
  --glass-rim-b: rgba(255, 255, 255, 0.05);
  --glass-rim-c: rgba(255, 255, 255, 0.16);
  --glass-shadow: rgba(0, 0, 0, 0.65);
  --glass-reflect: rgba(255, 255, 255, 0.07);
  --glass-sheen: rgba(255, 255, 255, 0.14);
  --glow: rgba(79, 106, 247, 0.2);
  --glow-soft: rgba(79, 106, 247, 0.09);

  --folder-back: rgba(62, 64, 74, 0.5);
  --folder-front-top: rgba(84, 86, 98, 0.46);
  --folder-front-bottom: rgba(48, 50, 58, 0.4);
  --folder-highlight: rgba(255, 255, 255, 0.16);
  --folder-edge: rgba(255, 255, 255, 0.1);
  --folder-card-border: #3a3b42;
  --icon-edge: rgba(255, 255, 255, 0.1);
  --meter-empty: #2e2f36;
  --dir-light: rgba(255, 255, 255, 0.05);
  --sticker-shadow: rgba(0, 0, 0, 0.5);
  --meter-peak: color-mix(in srgb, var(--accent) 58%, #fff);
  --folder-sheen: rgba(255, 255, 255, 0.16);
  --folder-sheen-soft: rgba(255, 255, 255, 0.05);
  --folder-sheen-edge: transparent;
}

@media (max-width: 1023px) {
  :root {
    --island-top: 10px;
    --island-h: 58px;
  }
}

/* ==========================================================================
   База
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  /* Место под полосу прокрутки всегда занято: когда меню или окно папки
     запирает прокрутку, страница не сдвигается вбок */
  scrollbar-gutter: stable;
}

html.no-scroll { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   Кнопки
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); color: var(--on-accent); }

.btn--outline {
  background: var(--bg);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--outline:hover { border-color: var(--ink); }

.btn--sm { height: 46px; padding: 0 20px; font-size: 16px; }
.btn--block { width: 100%; }

/* Главное действие продажи («Купить»): глубокий синий в обеих темах,
   на нём белый текст читается одинаково. При наведении синий светлеет */
.btn--accent { background: #1838d6; color: #ffffff; }
.btn--accent:hover { background: #2d4ef5; color: #ffffff; }

/* Кнопки-фильтры со счётчиком (рубрики статей, типы готовых решений).
   Строгие, без скруглений-пилюль, выбранная залита цветом текста */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.chip span {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.chip:hover { border-color: var(--ink); }

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 60%, var(--ink)); }

/* ==========================================================================
   Хэдер
   ========================================================================== */

/* Хэдер-остров: отдельная стеклянная панель с отступом от краёв,
   всегда закреплена сверху. При прокрутке становится чуть уже */
.header {
  position: fixed;
  top: var(--island-top);
  right: 0;
  left: 0;
  z-index: 50;
  width: min(calc(100% - var(--gutter) * 2), var(--island-w));
  height: var(--island-h);
  margin-inline: auto;
  border-radius: 18px;
  transition:
    width 0.7s var(--ease),
    transform 0.6s var(--ease),
    opacity 0.4s ease;
}

.header.is-scrolled { --island-w: 1120px; }

/* Над футером остров уезжает вверх: у футера свои контакты и навигация,
   а хэдер закрывал бы заголовок. Класс ставит footer.js, когда футер
   подошёл под хэдер. Скрытый хэдер не ловит ни курсор, ни фокус.
   is-away: то же над галереей товара (product.js), классы ставят разные скрипты */
.header.is-hidden,
.header.is-away {
  transform: translateY(calc(-100% - var(--island-top) - 16px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    width 0.7s var(--ease),
    transform 0.6s var(--ease),
    opacity 0.4s ease,
    visibility 0s linear 0.6s;
}

/* Стекло: заливка с размытием фона под ней, внутренние грани и мягкая тень */
.header__glass {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 var(--glass-lo),
    0 18px 40px -20px var(--glass-shadow),
    0 4px 14px -8px var(--glass-shadow);
  overflow: hidden;
  pointer-events: none;
  /* В самом верху страницы стекла нет совсем: ни заливки, ни размытия,
     ни кромки с тенью. Оно проявляется, когда страницу начинают прокручивать */
  opacity: 0;
  transition: opacity 0.45s ease;
}

.header.is-scrolled .header__glass,
.header.is-menu-open .header__glass { opacity: 1; }

/* Кромка: тонкая градиентная рамка, светлая сверху слева, темнее снизу справа */
.header__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    var(--glass-rim-a),
    var(--glass-rim-b) 42%,
    var(--glass-rim-b) 62%,
    var(--glass-rim-c)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Отражение: диагональная полоса. Сдвиг --reflect задаёт main.js
   по прокрутке, поэтому отражение «плывёт», как в настоящем зеркале */
.header__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0 40%,
    var(--glass-reflect) 47%,
    transparent 54% 100%
  ) repeat-x;
  background-size: 260% 100%;
  background-position: calc(var(--reflect, 0) * 1px) 0;
}

/* Блик за курсором: координаты --sheen-x и --sheen-y ставит main.js */
.header__sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    240px circle at var(--sheen-x, 50%) var(--sheen-y, 50%),
    var(--glass-sheen),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.header.is-lit .header__sheen { opacity: 1; }

.header__inner {
  height: 100%;
  display: grid;
  transition: opacity 0.45s ease, filter 0.45s ease;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 10px 0 22px;
}

.logo {
  justify-self: start;
  display: inline-flex;
  color: var(--ink);
}

/* Белые части логотипа красятся цветом текста, синие цветом акцента,
   поэтому логотип сам подстраивается под тему */
.logo__img {
  display: block;
  width: auto;
  height: 34px;
}

.logo__accent { fill: var(--accent); }

@media (max-width: 1023px) {
  .logo__img { height: 30px; }
}

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

/* На узком ноутбуке шесть пунктов подходят к кнопкам почти вплотную:
   шаг между пунктами меньше, чтобы меню не сливалось с кнопкой темы */
@media (max-width: 1199px) {
  .nav { gap: 22px; }
}

.nav__link {
  font-size: 17px;
  padding-block: 8px;
  transition: color 0.2s ease;
}

.nav__link:hover { color: var(--accent); }

/* Со своим курсором под пунктом плашка, текст остаётся цвета текста:
   синий текст на подсвеченной плашке читался бы хуже */
.has-cursor .nav__link:hover { color: var(--ink); }

.nav__link--icon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav__icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.nav__link--icon:hover .nav__icon { background: var(--accent); color: var(--on-accent); }

.header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопки внутри острова: скругление меньше, чем у острова, на величину отступа */
.header .btn--sm {
  height: 44px;
  border-radius: 10px;
}

/* Переключатель темы: круг, закрашенный наполовину. В тёмной теме переворачивается */
/* Язык сайта RU / EN. Ссылки рисует виджет GTranslate (с флагами): флаги прячем,
   подпись берём из data-gt-lang. Активный язык на плашке цвета текста, плашка
   переезжает при переключении. Ширина задана заранее: хэдер не прыгает,
   пока виджет грузится */
.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: none;
  width: 88px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--glass-btn);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.lang:hover { border-color: var(--ink); }

.lang::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 7px;
  background: var(--ink);
  transition: transform 0.45s var(--ease);
}

.lang:has(.gt-current-lang[data-gt-lang="en"])::before { transform: translateX(100%); }

.lang a.glink {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.3s ease;
}

.lang a.glink::after { content: attr(data-gt-lang); text-transform: uppercase; }

.lang a.glink img { display: none !important; }

.lang a.glink.gt-current-lang { color: var(--bg); }

.lang a.glink:not(.gt-current-lang):hover { color: var(--ink); }

.lang a.glink:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--glass-btn);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover { border-color: var(--ink); }

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.45s var(--ease);
}

.theme-toggle circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.theme-toggle path { fill: currentColor; }

[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

/* Смена темы. Снимок старой темы стоит неподвижно, новая раскрывается
   кругом от кнопки: маска с мягким краем растёт, её анимирует main.js.
   Класс theme-vt стоит только на время смены темы: у переходов между
   страницами свои, обычные анимации */
.theme-vt::view-transition-old(root),
.theme-vt::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.theme-vt::view-transition-new(root) {
  -webkit-mask-image: radial-gradient(closest-side, #000 calc(100% - 64px), transparent);
  mask-image: radial-gradient(closest-side, #000 calc(100% - 64px), transparent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 0 0;
  mask-size: 0 0;
}

/* Запасной вариант без View Transitions: цвета плавно перетекают */
.theme-fade,
.theme-fade *,
.theme-fade *::before,
.theme-fade *::after {
  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    fill 0.5s ease,
    stroke 0.5s ease !important;
}

.burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--ink);
  transition: top 0.35s var(--ease), transform 0.35s var(--ease);
}

.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 25px; }

.is-menu-open .burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.is-menu-open .burger span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 1023px) {
  .header { border-radius: 16px; }
  .header__inner {
    grid-template-columns: 1fr auto;
    padding: 0 6px 0 16px;
  }
  .nav,
  .header__cta { display: none; }
  .burger { display: block; }

  /* С открытым меню хэдер становится частью меню: без стекла, кромки,
     тени и обводки у кнопки темы. Логотип и крестик встают по краям
     пунктов меню, как и кнопка внизу */
  .header__inner { transition: padding 0.45s var(--ease), opacity 0.45s ease, filter 0.45s ease; }
  .burger { transition: margin 0.45s var(--ease); }

  .header.is-menu-open .header__glass { opacity: 0; }
  .header.is-menu-open .header__inner { padding: 0; }
  /* Крестик повёрнут, поэтому его видимый край отстоит от кнопки на 14px */
  .header.is-menu-open .burger { margin-right: -14px; }

  .header.is-menu-open .theme-toggle,
  .header.is-menu-open .lang {
    border-color: transparent;
    background-color: transparent;
  }
}

/* ==========================================================================
   Мобильное меню
   ========================================================================== */

.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: calc(var(--header-h) + 16px) var(--gutter) max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}

.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s var(--ease);
}

.menu__nav {
  display: flex;
  flex-direction: column;
}

.menu__link {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(32px, 8.5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.2s ease;
}

.menu__link:active { color: var(--accent); }

.menu.is-open .menu__link {
  opacity: 1;
  transform: none;
  transition-delay: calc(80ms + var(--i) * 50ms), calc(80ms + var(--i) * 50ms), 0s;
}

@media (min-width: 1024px) {
  .menu { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: max(100vh, 720px);
  min-height: max(100svh, 720px);
  padding-top: calc(var(--header-h) + clamp(16px, 4vh, 48px));
  padding-bottom: clamp(24px, 4vh, 44px);
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  /* Поле символов во всю ширину. Сверху уходит под хэдер, чтобы не спорить
     с навигацией, к низу растворяется, чтобы hero мягко переходил дальше */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 calc(var(--header-h) + 16px), #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 calc(var(--header-h) + 16px), #000 62%, transparent 100%);
}

/* Мягкое свечение в цвете бренда: пятно за каруселью и лёгкая дымка сверху.
   Лежит под полем символов и медленно «дышит» */
.hero::before {
  content: "";
  position: absolute;
  /* Отступ сверху от высоты окна, а не блока: когда высота hero меняется,
     свечение не сдвигается (иначе браузер считает это сдвигом вёрстки) */
  inset: -10vh -5% 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 38% at 50% 60%, var(--glow), transparent 72%),
    radial-gradient(ellipse 45% 30% at 50% 4%, var(--glow-soft), transparent 75%);
  animation: hero-glow 14s ease-in-out infinite alternate;
}

@keyframes hero-glow {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.07); }
}

.hero__head { text-align: center; }

/* Ширина заголовка в одну строку около 15 кеглей, отсюда делитель:
   кегль подстраивается под ширину контейнера с небольшим запасом */
.hero__title {
  margin: 0;
  font-size: min(96px, calc((100vw - var(--gutter) * 2) / 15.6));
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

/* Синяя точка после слова рисуется в CSS, а не отдельным элементом:
   переводчик (GTranslate) иначе вставляет пробел перед ней */
.hero__dot::after {
  content: ".";
  color: var(--accent);
}

/* Внутренний отступ снизу, чтобы маска строки не обрезала «д» и «у» */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.line > span { display: block; }

.hero__title .line {
  display: inline-block;
  vertical-align: top;
}

.hero__lead {
  max-width: 34em;
  margin: clamp(16px, 2.6vh, 28px) auto 0;
  font-size: clamp(18px, 1rem + 0.35vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: balance;
}

/* Карусель на всю ширину экрана, высоту забирает у свободного места */
.hero .carousel {
  flex: 1 1 auto;
  min-height: 340px;
  max-height: 600px;
  margin-block: clamp(8px, 2vh, 24px);
}

/* Нижняя строка: слева кто я, по центру подпись к карточке, справа действия */
.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.hero__note {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero__note-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-2);
  text-wrap: balance;
}

.hero__name {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 500;
}

.avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}

.avatar__initials {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-2);
}

.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__actions {
  justify-self: end;
  display: flex;
  gap: 12px;
}

/* Без проектов карусели и её подписи нет: кнопки всё равно справа */
@media (min-width: 1200px) {
  .hero__note + .hero__actions { grid-column: 3; }
}

/* «Обсудить проект» в hero: по умолчанию синяя (цвет акцента темы),
   при наведении становится тёмной на светлой теме и светлой на тёмной */
.hero__actions .btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.hero__actions .btn--primary:hover {
  background: var(--ink);
  color: var(--bg);
}

/* До 1200 px: заголовок в две строки, подпись карусели отдельной строкой */
@media (max-width: 1199px) {
  .hero__title { font-size: min(96px, calc((100vw - var(--gutter) * 2) / 9.2)); }
  .hero__last { display: block; }

  .hero__foot {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "caption caption"
      "note actions";
    row-gap: 24px;
  }

  .carousel-nav { grid-area: caption; justify-self: center; }
  .hero__note { grid-area: note; }
  .hero__actions { grid-area: actions; }
}

/* Телефон: заголовок в три строки, всё по центру */
@media (max-width: 699px) {
  /* Самая длинная строка «Продвижение», около 6 кеглей */
  .hero__title { font-size: min(64px, calc((100vw - var(--gutter) * 2) / 6.3)); }
  .hero__title .line { display: block; }

  .hero__lead { font-size: 18px; }

  .hero .carousel {
    flex: none;
    min-height: 0;
    height: clamp(280px, 84vw, 400px);
  }

  .hero__foot {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "caption"
      "note"
      "actions";
    row-gap: 20px;
  }

  .hero__note { justify-self: center; }

  .hero__actions {
    justify-self: stretch;
    flex-direction: column;
  }

  .hero__actions .btn { width: 100%; }
}

/* ==========================================================================
   Карусель
   ========================================================================== */

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* Концы ленты уходят за верх и низ контейнера, поэтому там они плавно исчезают */
.carousel__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

/* Горизонтальные жесты забирает карусель, вертикальные остаются странице.
   Без WebGL лента прокручивается пальцем сама, поэтому только для .is-gl */
.carousel.is-gl {
  cursor: grab;
  touch-action: pan-y;
}

.carousel[data-dragging] { cursor: grabbing; }

/* Без WebGL остаётся обычная лента с прокруткой */
.carousel__list {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel__item {
  flex: none;
  height: 56%;
  aspect-ratio: 4 / 3;
  scroll-snap-align: center;
}

.carousel__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* С WebGL список остаётся только для скринридеров */
.carousel.is-gl .carousel__list,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Бесконечные анимации замирают, пока блок за экраном (main.js, data-idle),
   и пока закрыто меню с папками в хэдере */
.is-idle,
.is-idle::before,
.is-idle::after,
.is-idle *,
.is-idle *::before,
.is-idle *::after,
.nav-drop:not(.is-open) *,
.nav-drop:not(.is-open) *::before,
.nav-drop:not(.is-open) *::after {
  animation-play-state: paused !important;
}

/* Подпись к текущей карточке со стрелками по бокам.
   Стоит в нижней строке hero, проявляется после интро карусели */
.carousel-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-nav.is-revealed { opacity: 1; }
.carousel-nav[hidden] { display: none; }

.carousel__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

/* Стрелки: при наведении заливаются синим, без сдвигов */
.carousel-nav__btn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.carousel-nav__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Заливка при наведении только там, где есть мышь: на телефоне она залипает после тапа */
@media (hover: hover) {
  .carousel-nav__btn:hover {
    border-color: var(--accent);
    color: var(--on-accent);
  }

  .carousel-nav__btn:hover::before { opacity: 1; }
}

/* Телефон: описание и счётчик друг под другом, описание переносится ровно */
@media (max-width: 599px) {
  .carousel-nav { gap: 12px; }

  .carousel__meta {
    flex-direction: column;
    gap: 2px;
  }

  .carousel__subtitle { text-wrap: balance; }

  /* Подписи проектов разной длины: место под название и описание в две строки
     держим всегда, иначе при смене слайда первый экран прыгает по высоте */
  .carousel__caption {
    justify-content: center;
    min-height: 120px;
  }
}

.carousel-nav__btn svg {
  position: relative;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

/* Наведение: стрелка чуть сдвигается в сторону листания */
.carousel-nav__btn svg { transition: translate 0.35s var(--ease); }

@media (hover: hover) {
  .carousel-nav__btn:hover svg { translate: 2px 0; }
  .carousel-nav__btn:first-child:hover svg { translate: -2px 0; }
}

.carousel__title {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
}

.carousel__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink-2);
}

.carousel__swap {
  display: block;
  animation: caption-in 0.52s var(--ease);
}

.carousel__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.carousel__digits { display: inline-flex; }

.carousel__digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}

.carousel__reel {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s var(--ease);
}

.carousel__reel span {
  display: block;
  height: 1em;
}

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

/* ==========================================================================
   Секции: общее
   ========================================================================== */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 64px;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section-title {
  margin: 0;
  font-size: clamp(40px, 1.6rem + 3vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.section-lead {
  justify-self: end;
  max-width: 34em;
  margin: 0;
  font-size: clamp(18px, 1rem + 0.3vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 899px) {
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-lead { justify-self: start; }
}

/* ==========================================================================
   Направления работы
   ========================================================================== */

.services {
  padding-block: clamp(80px, 11vw, 160px);
}

.dir__head {
  margin: 0;
  font: inherit;
}

.dir__btn {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: clamp(18px, 2vw, 26px) 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink-3);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Мягкое пятно света, которое идёт по строке за курсором.
   Координаты --mx и --my ставит services.js */
.dir__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--dir-light), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dir__item:first-child .dir__btn { border-top: 1px solid var(--line); }

.dir__btn[aria-expanded="true"] { color: var(--ink); }

.dir__num {
  align-self: start;
  padding-top: 0.5em;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.dir__btn[aria-expanded="true"] .dir__num { color: var(--accent); }

/* Название заливается ярким цветом слева направо: у открытого пункта
   и при наведении. Это двухцветный фон, обрезанный по буквам */
.dir__name {
  font-size: clamp(26px, 1rem + 1.7vw, 46px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
  background: linear-gradient(90deg, var(--ink) 0 46%, var(--ink-3) 54% 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.75s var(--ease);
}

.dir__btn[aria-expanded="true"] .dir__name { background-position: 0 0; }

@media (hover: hover) {
  .dir__btn:hover::before { opacity: 1; }
  .dir__btn:hover .dir__name { background-position: 0 0; }
  .dir__btn:hover .dir__num { color: var(--accent); }
}

.dir__count {
  margin-left: 4px;
  font-size: 0.45em;
  vertical-align: super;
  letter-spacing: 0;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.dir__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dir__arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.dir__btn[aria-expanded="true"] .dir__arrow { opacity: 1; }

/* На компьютере открытый пункт отмечен не стрелкой, а кольцом с точкой:
   стрелка остаётся за подсказкой у курсора, и их не спутать.
   При открытии точка появляется с пружинкой, кольцо разворачивается вокруг неё */
@media (min-width: 1024px) {
  .dir__arrow {
    position: relative;
    background: none;
  }

  .dir__arrow svg { display: none; }

  .dir__arrow::before,
  .dir__arrow::after {
    content: "";
    position: absolute;
    border-radius: 50%;
  }

  .dir__arrow::before {
    inset: 7px;
    border: 1px solid var(--accent);
    opacity: 0;
    transform: scale(0.3);
    transition: transform 0.7s var(--ease), opacity 0.4s ease;
  }

  .dir__arrow::after {
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.25s ease;
  }

  .dir__btn[aria-expanded="true"] .dir__arrow::before {
    opacity: 0.55;
    transform: none;
    transition-delay: 0.05s;
  }

  .dir__btn[aria-expanded="true"] .dir__arrow::after {
    transform: none;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

/* Подсказка у курсора над пунктами: синий кружок со стрелкой и подпись.
   Элемент создаёт services.js и двигает его за мышью */
.dir-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  /* Наклон в сторону движения считается от центра кружка */
  transform-origin: 26px 50%;
  will-change: transform;
}

/* У правого края экрана подпись слева от кружка, кружок по-прежнему под мышью */
.dir-tip.is-flip {
  flex-direction: row-reverse;
  transform-origin: calc(100% - 26px) 50%;
}

.dir-tip.is-flip .dir-tip__label { clip-path: inset(0 0 0 100%); }
.dir-tip.is-flip.is-visible .dir-tip__label { clip-path: inset(0); }

.dir-tip__dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transform: scale(0);
  transition: transform 0.3s var(--ease);
}

.dir-tip__dot svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Подпись открывается шторкой слева, от кружка */
.dir-tip__label {
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.3s var(--ease);
}

.dir-tip.is-visible .dir-tip__dot {
  transform: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dir-tip.is-visible .dir-tip__label {
  clip-path: inset(0);
  transition: clip-path 0.45s var(--ease) 0.08s;
}

/* Нажатие: кружок коротко сжимается */
.dir-tip.is-visible.is-pressed .dir-tip__dot {
  transform: scale(0.84);
  transition-duration: 0.15s;
}

/* Содержимое карточки. Синий фон задаётся отдельно: на компьютере это
   общий блок для всех направлений, на телефоне фон у каждой карточки свой */
.dir__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(28px, 3vw, 44px);
  color: #ffffff;
}

.dir__text {
  max-width: 26em;
  margin: 0;
  font-size: clamp(19px, 1rem + 0.4vw, 23px);
  line-height: 1.45;
}

.dir__label {
  margin: 0 0 12px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}

.dir__points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

.dir__points li {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 18px;
  line-height: 1.35;
}

.dir__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dir__tools li {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.2;
}

.dir__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  height: 52px;
  margin-top: auto;
  padding: 0 24px;
  border-radius: var(--radius);
  background: #ffffff;
  color: #0c0c0e;
  font-size: 17px;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.dir__cta:hover {
  background: #0c0c0e;
  color: #ffffff;
}

.dir__cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* Сетка точек из hero, растворяется от правого верхнего угла */
.dir::after,
.dir__card::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 70%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Компьютер: список слева, справа один синий блок на все направления.
   Блок не меняет ни размер, ни положение: внутри меняется только содержимое
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .dir {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    /* Последняя строка забирает лишнюю высоту, если содержимое карточки
       выше списка: так расстояние между пунктами не растягивается */
    grid-template-rows: repeat(6, auto) 1fr;
    column-gap: clamp(40px, 5vw, 96px);
  }

  /* Обёртки «растворяются», и заголовки встают в левую колонку */
  .dir__item { display: contents; }
  .dir__head { grid-column: 1; }

  /* Общий синий фон и точки занимают всю правую колонку */
  .dir::before {
    content: "";
    grid-column: 2;
    grid-row: 1 / -1;
    border-radius: var(--radius);
    background: var(--brand);
  }

  .dir::after {
    content: "";
    position: relative;
    z-index: 0;
    grid-column: 2;
    grid-row: 1 / -1;
    justify-self: end;
    align-self: start;
    width: 70%;
    height: 60%;
  }

  /* Все карточки лежат друг на друге в одной ячейке. Ячейка берёт высоту
     самой длинной, поэтому размер блока одинаковый для всех направлений */
  .dir__panel {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    visibility: hidden;
    transition: visibility 0s linear 0.22s;
  }

  /* Карточка на всю высоту блока: кнопка всегда прижата к низу и не прыгает */
  .dir__card { flex: 1; }

  .dir__panel.is-open {
    visibility: visible;
    transition: none;
  }

  /* Смена: старое содержимое гаснет, новое проявляется лесенкой снизу вверх */
  .dir__card > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.22s ease, transform 0s linear 0.22s;
  }

  .dir__panel.is-open .dir__card > * {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease, transform 0.7s var(--ease);
  }

  .dir__panel.is-open .dir__card > :nth-child(1) { transition-delay: 0.12s; }
  .dir__panel.is-open .dir__card > :nth-child(2) { transition-delay: 0.18s; }
  .dir__panel.is-open .dir__card > :nth-child(3) { transition-delay: 0.24s; }
  .dir__panel.is-open .dir__card > :nth-child(4) { transition-delay: 0.3s; }
}

/* --------------------------------------------------------------------------
   Планшет и телефон: аккордеон, карточка раскрывается под своим пунктом
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .dir__btn { grid-template-columns: 40px minmax(0, 1fr) 40px; }

  .dir__arrow {
    width: 40px;
    height: 40px;
    opacity: 1;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    transition: transform 0.4s var(--ease), background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }

  .dir__btn[aria-expanded="true"] .dir__arrow {
    transform: rotate(90deg);
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
  }

  .dir__panel {
    display: none;
    padding: 8px 0 24px;
  }

  .dir__panel.is-open { display: block; }

  .dir__card {
    border-radius: var(--radius);
    background: var(--brand);
    overflow: hidden;
    isolation: isolate;
  }

  .dir__card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: -1;
    width: 70%;
    height: 60%;
  }

  .dir__panel.is-open .dir__card > * {
    animation: dir-in 0.6s var(--ease) both;
  }

  .dir__panel.is-open .dir__card > :nth-child(2) { animation-delay: 0.06s; }
  .dir__panel.is-open .dir__card > :nth-child(3) { animation-delay: 0.12s; }
  .dir__panel.is-open .dir__card > :nth-child(4) { animation-delay: 0.18s; }
}

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

@media (max-width: 599px) {
  .dir__btn {
    grid-template-columns: 32px minmax(0, 1fr) 40px;
    gap: 12px;
  }

  .dir__points { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Проекты: папки
   ========================================================================== */

.projects {
  padding-block: clamp(80px, 11vw, 160px);
  /* Раскрытые карточки крайних папок могут выйти за край экрана.
     clip, в отличие от hidden, не обрезает их сверху и снизу */
  overflow-x: clip;
}

/* Подсказка в подзаголовке: два слова-жеста. Курсор проводит по «Наведите»,
   и слово заливается синим ровно за ним. Потом щёлкает по «нажмите»: слово
   вдавливается и вспыхивает синим, от щелчка расходится кольцо. Заливка,
   курсор и кольцо идут по одной шкале, круг повторяется, пока посетитель
   не откроет папку (folders.js). В покое слова темнее текста и подчёркнуты */
.hint__word {
  --hint-loop: 8s;
  --hint-ease: cubic-bezier(0.45, 0, 0.25, 1);

  position: relative;
  display: inline-block;
  font-weight: 500;
  white-space: nowrap;
  /* Синяя половина фона слева, цвет текста справа. Сдвиг фона ведёт
     границу цветов: при 91.67% слово целиком тёмное, при 8.33% синее */
  background: linear-gradient(90deg, var(--accent) 0 48%, var(--ink) 52% 100%);
  background-size: 220% 100%;
  background-position: 91.67% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: underline 1px var(--line-strong);
  text-underline-offset: 5px;
}

/* Курсор: острие стрелки стоит в точке left/top */
.hint__cursor {
  position: absolute;
  top: 58%;
  left: 0;
  z-index: 2;
  width: 0.8em;
  height: 1em;
  margin: -0.075em 0 0 -0.1em;
  opacity: 0;
  transform-origin: 12% 8%;
  pointer-events: none;
}

.hint__cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.hint__word--press .hint__cursor {
  top: 50%;
  left: 56%;
}

/* Кольцо щелчка расходится из острия курсора */
.hint__word--press::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 56%;
  z-index: 1;
  width: 2.4em;
  height: 2.4em;
  margin: -1.2em 0 0 -1.2em;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.1);
  pointer-events: none;
}

/* Жест стартует через секунду после появления заголовка.
   Без наблюдателя появления заголовок виден сразу, жест тоже идёт */
:is(.is-in, html:not(.reveal-ready)) .hint__word--hover {
  animation: hint-hover-fill var(--hint-loop) var(--hint-ease) 1s infinite;
}

:is(.is-in, html:not(.reveal-ready)) .hint__word--hover .hint__cursor {
  animation: hint-hover-cursor var(--hint-loop) var(--hint-ease) 1s infinite;
}

:is(.is-in, html:not(.reveal-ready)) .hint__word--press {
  animation: hint-press-word var(--hint-loop) var(--hint-ease) 1s infinite;
}

:is(.is-in, html:not(.reveal-ready)) .hint__word--press .hint__cursor {
  animation: hint-press-cursor var(--hint-loop) var(--hint-ease) 1s infinite;
}

:is(.is-in, html:not(.reveal-ready)) .hint__word--press::after {
  animation: hint-ripple var(--hint-loop) linear 1s infinite;
}

/* Папку уже открывали: круг доигран, подсказка стоит в покое */
.hint.is-learned .hint__word,
.hint.is-learned .hint__word::after,
.hint.is-learned .hint__cursor { animation: none; }

/* «Наведите»: курсор подлетает и ведёт заливку через всё слово */
@keyframes hint-hover-cursor {
  0% { left: -8%; opacity: 0; }
  6% { left: 0%; opacity: 1; }
  22% { left: 100%; opacity: 1; }
  30%, 100% { left: 100%; opacity: 0; }
}

@keyframes hint-hover-fill {
  0%, 6% { background-position: 91.67% 0; }
  22%, 56% { background-position: 8.33% 0; }
  66%, 100% { background-position: 91.67% 0; }
}

/* «нажмите»: курсор подходит снизу справа, щелчок вдавливает слово */
@keyframes hint-press-cursor {
  0%, 30% { opacity: 0; transform: translate(0.6em, 0.5em); }
  38% { opacity: 1; transform: none; }
  41% { transform: scale(0.8); }
  45% { transform: none; }
  56% { opacity: 1; }
  62%, 100% { opacity: 0; transform: none; }
}

@keyframes hint-press-word {
  0%, 40% { background-position: 91.67% 0; transform: none; }
  41.5% { background-position: 8.33% 0; transform: scale(0.94); }
  45% { transform: none; }
  70% { background-position: 8.33% 0; }
  78%, 100% { background-position: 91.67% 0; }
}

@keyframes hint-ripple {
  0%, 41% { opacity: 0; transform: scale(0.1); }
  42% {
    opacity: 1;
    transform: scale(0.15);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  60%, 100% { opacity: 0; transform: scale(1); }
}

/* Без анимации слова просто синие */
@media (prefers-reduced-motion: reduce) {
  .hint__word {
    background-position: 8.33% 0;
    animation: none !important;
  }

  .hint__word::after,
  .hint__cursor { animation: none !important; }
}

.folders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Большой отступ между рядами: раскрытые карточки поднимаются над папкой */
  gap: clamp(72px, 8vw, 120px) clamp(24px, 3vw, 48px);
  padding-top: clamp(24px, 4vw, 56px);
}

.folders__item { display: flex; justify-content: center; }

.folder {
  --spring: cubic-bezier(0.34, 1.45, 0.6, 1);

  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.folder:focus-visible { outline-offset: 8px; }

.folder__stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 280 / 220;
  margin-bottom: 20px;
}

/* Задняя стенка с язычком */
.folder__back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--folder-back);
  transform-origin: 50% 100%;
  transition: transform 0.6s var(--ease);
}

/* Работы внутри: в закрытой папке из-под створки видны только края */
.folder__cards {
  position: absolute;
  inset: 13% 0 0;
}

.folder__card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 64%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 3px solid var(--folder-card-border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px -8px rgba(12, 12, 14, 0.28);
  transition: transform 0.7s var(--spring);
}

.folder__card:nth-child(1) { transform: translate(-56%, 13%) rotate(-4deg); }
.folder__card:nth-child(2) { transform: translate(-50%, 8%) rotate(0deg); transition-delay: 0.03s; }
.folder__card:nth-child(3) { transform: translate(-44%, 15%) rotate(4deg); transition-delay: 0.06s; }

/* Четвёртая карточка и дальше лежат в папке за первыми тремя и на створке не видны:
   их показывает окно папки (folders.js) */
.folder__card:nth-child(n + 4) { transform: translate(-50%, 8%); opacity: 0; }

/* Передняя створка: откидывается к зрителю по нижнему краю */
.folder__front {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 76%;
  border-radius: 10px;
  /* Стекло: полупрозрачная заливка и лёгкое размытие, работы внутри
     просвечивают мягким силуэтом */
  background: linear-gradient(180deg, var(--folder-front-top), var(--folder-front-bottom));
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 var(--folder-highlight),
    inset 0 0 0 1px var(--folder-edge),
    0 1px 2px rgba(12, 12, 14, 0.06);
  transform-origin: 50% 100%;
  transition: transform 0.6s var(--ease);
  overflow: hidden;
}

/* Блик: светлая полоса наискосок, один раз пробегает по створке при открытии */
.folder__front::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 55%;
  /* По краям полосы лёгкая тень: на почти белой створке блик читается
     за счёт контраста света и тени, как отражение на глянце */
  background: linear-gradient(
    100deg,
    transparent 0%,
    var(--folder-sheen-edge) 22%,
    var(--folder-sheen-soft) 38%,
    var(--folder-sheen) 50%,
    var(--folder-sheen-soft) 62%,
    var(--folder-sheen-edge) 78%,
    transparent 100%
  );
  transform: translateX(-130%) skewX(-18deg);
  pointer-events: none;
}

@keyframes folder-sheen {
  from { transform: translateX(-130%) skewX(-18deg); }
  to { transform: translateX(260%) skewX(-18deg); }
}

/* Стикер на створке: приклеен к ней и откидывается вместе с ней, блик
   створки пробегает и по нему. Цвета свои в любой теме: чёрный, белый
   и синий, белая вырубка нарисована в SVG, как у стикеров в «Обо мне» */
.folder__sticker {
  --tilt: 0deg;

  position: absolute;
  right: 9%;
  bottom: 13%;
  width: 22%;
  filter: drop-shadow(0 3px 5px var(--sticker-shadow));
  transform: rotate(var(--tilt));
  transition: transform 0.6s var(--spring);
}

.folder__sticker svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Папку открывают: стикер чуть отклеивается */
@media (hover: hover) {
  .folder:hover .folder__sticker { transform: rotate(calc(var(--tilt) + 8deg)) scale(1.06); }
}

/* Появление: стикер шлёпается на створку чуть позже самой папки */
.reveal-ready .folders__item:not(.is-in) .folder__sticker {
  opacity: 0;
  transform: rotate(calc(var(--tilt) - 14deg)) scale(1.3);
}

.reveal-ready .folders__item.is-in .folder__sticker {
  animation: sticker-slap 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d, 0ms) + 450ms) backwards;
}

@media (prefers-reduced-motion: reduce) {
  .folder__sticker { transition: none; }

  .reveal-ready .folders__item.is-in .folder__sticker { animation: none; }

  .reveal-ready .folders__item:not(.is-in) .folder__sticker {
    opacity: 1;
    transform: rotate(var(--tilt));
  }
}

.folder__label {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
}

.folder__count {
  margin-top: 4px;
  font-size: 16px;
  color: var(--ink-2);
}

/* Открытая папка: по наведению, по фокусу с клавиатуры, по тапу
   и волной в режиме фокуса на папках (is-peek) */
.folder:focus-visible .folder__front,
.folder[aria-expanded="true"] .folder__front,
.folder.is-peek .folder__front { transform: perspective(700px) rotateX(-46deg); }

.folder:focus-visible .folder__front::after,
.folder[aria-expanded="true"] .folder__front::after,
.folder.is-peek .folder__front::after { animation: folder-sheen 1.1s var(--ease) 0.08s both; }

.folder:focus-visible .folder__back,
.folder[aria-expanded="true"] .folder__back,
.folder.is-peek .folder__back { transform: perspective(700px) rotateX(8deg); }

.folder:focus-visible .folder__card:nth-child(1),
.folder[aria-expanded="true"] .folder__card:nth-child(1),
.folder.is-peek .folder__card:nth-child(1) { transform: translate(-92%, -58%) rotate(-11deg); }

.folder:focus-visible .folder__card:nth-child(2),
.folder[aria-expanded="true"] .folder__card:nth-child(2),
.folder.is-peek .folder__card:nth-child(2) { transform: translate(-50%, -48%) rotate(-2deg); }

.folder:focus-visible .folder__card:nth-child(3),
.folder[aria-expanded="true"] .folder__card:nth-child(3),
.folder.is-peek .folder__card:nth-child(3) { transform: translate(-6%, -66%) rotate(9deg); }

/* Наведение только там, где есть мышь: на телефоне hover «залипает» после тапа */
@media (hover: hover) {
  .folder:hover .folder__front { transform: perspective(700px) rotateX(-46deg); }
  .folder:hover .folder__front::after { animation: folder-sheen 1.1s var(--ease) 0.08s both; }
  .folder:hover .folder__back { transform: perspective(700px) rotateX(8deg); }
  .folder:hover .folder__card:nth-child(1) { transform: translate(-92%, -58%) rotate(-11deg); }
  .folder:hover .folder__card:nth-child(2) { transform: translate(-50%, -48%) rotate(-2deg); }
  .folder:hover .folder__card:nth-child(3) { transform: translate(-6%, -66%) rotate(9deg); }
}

@media (max-width: 1099px) {
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Фокус на папках: посетитель навёл курсор или нажал на сами слова
   подсказки. Всё, кроме папок, уходит под матовую пелену, папки по очереди
   приоткрываются. Пелена лежит в одном слое с папками (её вставляет
   folders.js), папки поднимаются над ней. Хэдер над пеленой, поэтому
   его содержимое гаснет и размывается само */
.focus-veil {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.is-focusing .focus-veil {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease;
}

.is-focusing .folders {
  position: relative;
  z-index: 6;
}

.is-focusing .header__inner {
  opacity: 0.35;
  filter: blur(3px);
}

@media (max-width: 599px) {
  .folders { column-gap: 16px; }
  .folder__label { font-size: 18px; }
}

/* --------------------------------------------------------------------------
   Окно папки: карточки вылетают из папки и встают веером, по клику
   проект открывается крупно с описанием. Окно создаёт folders.js,
   он же двигает карточки: веер считается в скрипте, а место большой
   карточки и миниатюр задают пустые блоки в разметке окна
   -------------------------------------------------------------------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.viewer[hidden] { display: none; }

.viewer__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.viewer.is-open .viewer__backdrop { opacity: 1; }

/* Верхняя строка окна вместо хэдера: назад, название папки, закрыть */
.viewer__bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.viewer.is-open .viewer__bar {
  opacity: 1;
  transition-delay: 0.15s;
}

.viewer__back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, color 0.25s ease, visibility 0s linear 0.35s;
}

.viewer__back svg,
.viewer__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer[data-mode="detail"] .viewer__back {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease 0.2s, color 0.25s ease;
}

.viewer__heading { text-align: center; }

.viewer__folder {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.viewer__count {
  margin: 2px 0 0;
  font-size: 16px;
  color: var(--ink-3);
}

.viewer__close {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass-btn);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease;
}

@media (hover: hover) {
  .viewer__close:hover { border-color: var(--ink); }
  .viewer__back:hover { color: var(--accent); }
}

/* Подсказка под веером */
.viewer__hint {
  position: absolute;
  right: 0;
  bottom: clamp(32px, 9vh, 96px);
  left: 0;
  margin: 0;
  font-size: 16px;
  color: var(--ink-3);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.viewer.is-open[data-mode="fan"] .viewer__hint {
  opacity: 1;
  transition-delay: 0.45s;
}

/* Раскладка подробного вида. Сам блок пустой под картинкой: туда прилетает
   большая карточка, а в слоты внизу маленькие */
.viewer__detail {
  position: absolute;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding-block: clamp(16px, 4vh, 48px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

/* Описание видно только в открытом окне: при закрытии оно гаснет сразу,
   пока карточки ещё летят обратно в папку */
.viewer.is-open[data-mode="detail"] .viewer__detail {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.viewer__media {
  justify-self: center;
  width: min(100%, calc((100vh - var(--header-h) - 120px) * 4 / 3));
  aspect-ratio: 4 / 3;
}

.viewer__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.viewer__kind {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
}

.viewer__title {
  margin: 0;
  font-size: clamp(32px, 1rem + 2.4vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.viewer__text {
  max-width: 32em;
  margin: 0;
  font-size: clamp(17px, 1rem + 0.25vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.viewer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.viewer__tags li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.3;
}

.viewer__cta { margin-top: 6px; }

.viewer__others {
  align-self: stretch;
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.viewer__label {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--ink-3);
}

.viewer__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Много проектов в папке: миниатюры «Ещё в папке» мельче и в несколько рядов */
.viewer__slots:has(> :nth-child(4)) { gap: 10px; }
.viewer__slots:has(> :nth-child(4)) .viewer__slot { width: clamp(72px, 6.4vw, 104px); }

.viewer__slot {
  width: clamp(96px, 9vw, 136px);
  aspect-ratio: 4 / 3;
}

/* Карточки. Размер у всех один, как у большой: веер и миниатюры
   получаются уменьшением, поэтому картинка в крупном виде чёткая */
.viewer__cards {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.viewer__card {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--folder-card-border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 30px 60px -24px rgba(12, 12, 14, 0.5);
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.viewer__card[hidden] { display: none; }

.viewer__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* Большая карточка в подробном виде просто картинка */
.viewer__card.is-main { cursor: default; }

/* Перестановка без анимации: стартовое место у папки, ресайз, прокрутка */
.viewer.is-instant .viewer__card { transition: none !important; }

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

/* Телефон: картинка сверху, описание под ней, прокрутка внутри окна */
@media (max-width: 759px) {
  .viewer__bar { grid-template-columns: auto minmax(0, 1fr) auto; }

  .viewer__back span { display: none; }

  .viewer__detail {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 22px;
    overflow-y: auto;
    padding: 8px var(--gutter) 32px;
    overscroll-behavior: contain;
  }

  .viewer__media { width: 100%; }
  .viewer__info { gap: 14px; }
  .viewer__title { font-size: 30px; }
  .viewer__slot { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .viewer__card,
  .viewer__backdrop,
  .viewer__bar,
  .viewer__detail,
  .viewer__hint,
  .viewer__back { transition: none; }
}

/* --------------------------------------------------------------------------
   Сцена «сортировка»: карточки карусели летят в папки при прокрутке.
   Класс has-sorter ставит sorter.js на широком и высоком экране
   -------------------------------------------------------------------------- */

.projects { position: relative; }

.projects__anchor {
  position: absolute;
  top: 0;
  left: 0;
}

/* Секция выше экрана, а её содержимое закреплено: пока прокручиваешь
   лишнюю высоту, карточки долетают и папки закрываются, а потом
   папки собираются в одну стопку. Отрезки сцен считает sorter.js */
.has-sorter .projects {
  /* Закрепление кончается, когда стопка начинает улетать в меню:
     дальше секция уезжает вверх, а снизу сразу поднимается следующая */
  --pin-dist: 185vh;
  height: calc(100vh + var(--pin-dist));
  padding-block: 0;
}

/* Якорь «Проекты» там, где карточки уже лежат в папках, а стопка ещё не собралась
   (sorter.js: SCENE_END 1, STACK_AT от 1,15 экрана) */
.has-sorter .projects__anchor { top: calc(106vh + var(--header-h)); }

/* Папки в стопке: sorter.js двигает их от мест в сетке к центру */
.has-sorter .folders { position: relative; }
.has-sorter .folder { position: relative; }

/* Финал сцены: стопка улетела в пункт «Проекты» в меню. Пункт коротко
   увеличивается и вспыхивает синим, как будто принял её. Класс ставит sorter.js */
.nav__link.is-catching,
.burger.is-catching { animation: dock-catch 0.7s var(--ease); }

@keyframes dock-catch {
  0% { transform: none; color: var(--accent); }
  35% { transform: scale(1.14); color: var(--accent); }
  100% { transform: none; }
}

/* Значок папки у пункта «Проекты»: появляется, когда в него прилетела стопка,
   и остаётся, пока страница ниже сцены. От значка расходится кольцо */
.nav__link { position: relative; }

.nav__badge {
  position: absolute;
  top: -4px;
  right: -20px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.3s ease, opacity 0.2s ease;
  pointer-events: none;
}

.nav__badge svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.nav__badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.nav__link.has-projects .nav__badge {
  opacity: 1;
  transform: none;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.nav__link.is-catching .nav__badge::after { animation: badge-ring 0.9s ease-out; }

@keyframes badge-ring {
  from { opacity: 0.9; transform: scale(1); }
  to { opacity: 0; transform: scale(3); }
}

/* Меню с папками под пунктом «Проекты». Папки выпадают из значка:
   стеклянная панель раскрывается от него, маленькие папки летят из точки
   значка вниз к своим местам, с пружинкой и по очереди. Меню создаёт
   folders.js, отступ сверху нужен, чтобы курсор доходил до меню без разрыва */
.nav__link.has-projects.is-dropping .nav__badge { transform: scale(1.2); }

.nav-drop {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 12px;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.4s;
}

.nav-drop.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: none;
}

.nav-drop__panel {
  position: relative;
  padding: 18px 20px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 0 0 1px var(--glass-rim-b),
    0 24px 48px -24px var(--glass-shadow),
    0 6px 18px -10px var(--glass-shadow);
  opacity: 0;
  transform: translateY(-10px) scale(0.94);
  transform-origin: var(--origin-x, 50%) 0;
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.nav-drop.is-open .nav-drop__panel {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease, transform 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.nav-drop__title {
  margin: 0 4px 22px;
  font-size: 16px;
  color: var(--ink-2);
}

.nav-drop__list {
  display: grid;
  grid-template-columns: repeat(4, 128px);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Папка стартует в точке значка: уменьшенная, повёрнутая, выше своего места */
.nav-drop__list li {
  opacity: 0;
  transform: translate(var(--fx, 0px), -34px) scale(0.4) rotate(-14deg);
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.nav-drop__list li:nth-child(even) { transform: translate(var(--fx, 0px), -34px) scale(0.4) rotate(12deg); }

.nav-drop.is-open .nav-drop__list li {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.3s ease calc(var(--k) * 65ms + 80ms),
    transform 0.7s cubic-bezier(0.34, 1.5, 0.6, 1) calc(var(--k) * 65ms + 80ms);
}

/* Маленькая папка: тоньше рамки карточек и мельче скругления */
.nav-drop__folder { max-width: none; }

.nav-drop .folder__stage { margin-bottom: 12px; }
.nav-drop .folder__front { border-radius: 7px; }

.nav-drop .folder__card {
  border-width: 2px;
  border-radius: 5px;
  box-shadow: 0 6px 14px -6px rgba(12, 12, 14, 0.3);
}

.nav-drop .folder__label {
  font-size: 16px;
  line-height: 1.2;
}

.nav-drop .folder__count {
  margin-top: 2px;
  font-size: 16px;
  color: var(--ink-3);
}

/* Пока меню с папками открыто, страница уходит под матовую пелену.
   Пелена ниже хэдера (у него z-index 50), поэтому хэдер и меню остаются
   чёткими, а всё остальное размывается. Клики пелена пропускает */
.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.drop-veil.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .nav-drop__panel,
  .nav-drop__list li,
  .drop-veil { transition: none !important; }
}

/* Хэдер принимает стопку: по стеклу пробегает блик, кромка коротко синеет */
.header.is-absorbing .header__glass { animation: header-absorb 1.1s ease; }

.header.is-absorbing .header__sheen {
  opacity: 1;
  background: linear-gradient(105deg, transparent 38%, var(--glass-sheen) 50%, transparent 62%);
  background-size: 260% 100%;
  animation: header-sweep 0.9s var(--ease) both;
}

@keyframes header-absorb {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 var(--glass-hi),
      inset 0 -1px 0 var(--glass-lo),
      0 18px 40px -20px var(--glass-shadow),
      0 4px 14px -8px var(--glass-shadow),
      inset 0 0 0 1px transparent;
  }
  30% {
    box-shadow:
      inset 0 1px 0 var(--glass-hi),
      inset 0 -1px 0 var(--glass-lo),
      0 18px 40px -20px var(--glass-shadow),
      0 4px 14px -8px var(--glass-shadow),
      inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent);
  }
}

@keyframes header-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.has-sorter .projects__pin {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  padding-top: var(--header-h);
}

/* Слой с летящими карточками: поверх страницы, под хэдером */
.sorter {
  position: fixed;
  inset: 0;
  z-index: 40;
  perspective: 1600px;
  pointer-events: none;
  visibility: hidden;
}

.sorter.is-active { visibility: visible; }

.sorter__card {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Тень «поднятой» карточки. Рисуется один раз, в полёте меняется только
   её прозрачность: перерисовывать размытую тень каждый кадр слишком дорого */
.sorter__shadow {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 34px 60px -14px rgba(12, 12, 14, 0.42);
  opacity: 0;
  will-change: opacity;
}

/* Две стороны: лицевая как карточка карусели, оборотная как карточка в папке */
.sorter__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.sorter__face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Лицевая: без рамки и тени, как в карусели */
.sorter__face--front { border-radius: 4px; }


/* Оборотная: рамка и тень как у карточки в папке, поэтому посадка незаметна */
.sorter__face--back {
  border: 3px solid var(--folder-card-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px -8px rgba(12, 12, 14, 0.28);
  transform: rotateY(180deg);
}

/* Папка ждёт карточки: створка откинута, свои карточки спрятаны на местах приёма */
.folder.is-receiving,
.folder.is-handoff { pointer-events: none; }

.folder.is-receiving .folder__front,
.folder.is-handoff .folder__front {
  transform: perspective(700px) rotateX(-46deg);
  /* Пока идёт сцена, матовое стекло створки не нужно: за ней пусто,
     а пересчёт размытия на каждом кадре прокрутки дорогой */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.folder.is-receiving .folder__back,
.folder.is-handoff .folder__back { transform: perspective(700px) rotateX(8deg); }

.folder.is-receiving .folder__card:nth-child(1),
.folder.is-handoff .folder__card:nth-child(1) { transform: translate(-92%, -58%) rotate(-11deg); }

.folder.is-receiving .folder__card:nth-child(2),
.folder.is-handoff .folder__card:nth-child(2) { transform: translate(-50%, -48%) rotate(-2deg); }

.folder.is-receiving .folder__card:nth-child(3),
.folder.is-handoff .folder__card:nth-child(3) { transform: translate(-6%, -66%) rotate(9deg); }

.folder.is-receiving .folder__card { opacity: 0; }

/* Папка захлопнулась: короткое «оседание» и блик по створке */
.folder.is-sealed .folder__stage { animation: folder-settle 0.7s var(--ease); }
.folder.is-sealed .folder__front::after { animation: folder-sheen 1.1s var(--ease) 0.15s both; }

@keyframes folder-settle {
  0% { transform: none; }
  35% { transform: scale(1.025, 0.975); }
  100% { transform: none; }
}

/* ==========================================================================
   Уровень владения: эквалайзер
   ========================================================================== */

.skills {
  padding-block: clamp(80px, 11vw, 160px);
}

/* Иконка инструмента в виде иконки приложения. Тонкая обводка нужна белым
   плиткам (HTML, Figma, Python), иначе на светлой теме они сливаются с фоном */
.tool-icon {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24%;
  background: var(--surface);
}

.tool-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--icon-edge);
  pointer-events: none;
}

.tool-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* У PNG-иконки свои мягкие скруглённые края: чуть увеличиваем и обрезаем их */
.tool-icon img.is-app { transform: scale(1.12); }

.tool-icon--go {
  background: #00add8;
  color: #ffffff;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
}

/* Плашка из букв вместо логотипа: цвета задаются в админке «Стек» */
.tool-icon--badge {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat__icon.tool-icon--badge { font-size: clamp(16px, 0.7rem + 0.4vw, 20px); }

/* Эквалайзер. Группы стоят в ряд, ширина группы по числу инструментов (--n),
   внутри столбики: оценка, десять делений снизу вверх, иконка и название.
   Линий нет, группы разделяет воздух */
.stats {
  display: flex;
  align-items: flex-start;
  gap: clamp(32px, 4.5vw, 80px);
}

.stats__group {
  flex: var(--n, 1) 1 0;
  min-width: 0;
}

.stats__head { margin-bottom: clamp(24px, 2.6vw, 36px); }

.stats__title {
  margin: 0;
  font-size: clamp(20px, 1rem + 0.5vw, 24px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stats__sub {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-3);
}

.stats__list {
  display: grid;
  grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  transition: opacity 0.4s ease;
}

.stat__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  line-height: 0.9;
}

.stat__num {
  font-size: clamp(34px, 1.4rem + 1.5vw, 52px);
  font-weight: 300;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.stat__of {
  font-size: 16px;
  color: var(--ink-3);
}

/* Десять делений снизу вверх: горят до оценки */
.stat__bar {
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  width: 100%;
  max-width: 68px;
}

.stat__bar i {
  display: block;
  height: clamp(9px, 0.35rem + 0.45vw, 15px);
  border-radius: 3px;
  background: var(--line);
  transition: background-color 0.3s ease;
}

/* Горящие деления ступеньками светлеют снизу вверх, как на аппаратном
   индикаторе уровня: нижние глубже, верхние ярче (--s: номер деления) */
.stat__bar .is-on { background: color-mix(in srgb, var(--accent) calc(52% + var(--s) * 4.8%), var(--bg)); }

/* Верхнее горящее деление ярче всех: пик, как на пульте */
.stat__bar .is-peak { background: var(--meter-peak); }

.stat__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stat__icon {
  flex: none;
  width: clamp(40px, 1.4rem + 1vw, 52px);
  height: clamp(40px, 1.4rem + 1vw, 52px);
}

.stat__icon.tool-icon--go { font-size: clamp(16px, 0.7rem + 0.4vw, 20px); }

.stat__name {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.stat__level {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.25;
  color: var(--accent);
}

/* Наведение: столбик выходит вперёд, соседние гаснут. Пустые деления
   чуть подсвечиваются, чтобы была видна вся шкала, появляется уровень */
@media (hover: hover) {
  .stat__level {
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .stats:has(.stat:hover) .stat:not(:hover) { opacity: 0.4; }
  .stat:hover .stat__num { color: var(--accent); }
  .stat:hover .stat__bar i:not(.is-on) { background: color-mix(in srgb, var(--accent) 18%, transparent); }
  .stat:hover .stat__level { opacity: 1; }
}

/* Появление. Класс is-armed ставит skills.js, поэтому без скрипта всё видно сразу.
   Подписи поднимаются, цифры набегают от нуля, деления загораются снизу вверх,
   столбик за столбиком */
.stats.is-armed .stats__head,
.stats.is-armed .stat__value,
.stats.is-armed .stat__meta {
  opacity: 0;
  transform: translateY(14px);
}

.stats.is-armed .stat__bar .is-on { background: var(--line); }

.stats.is-drawn .stats__head {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s ease calc(var(--g) * 120ms),
    transform 0.9s var(--ease) calc(var(--g) * 120ms);
}

.stats.is-drawn .stat__value,
.stats.is-drawn .stat__meta {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s ease calc(var(--i) * 70ms + 200ms),
    transform 0.9s var(--ease) calc(var(--i) * 70ms + 200ms);
}

.stats.is-drawn .stat__bar .is-on {
  background: color-mix(in srgb, var(--accent) calc(52% + var(--s) * 4.8%), var(--bg));
  transition: background-color 0.2s ease calc(var(--i) * 90ms + var(--s) * 55ms + 300ms);
}

.stats.is-drawn .stat__bar .is-peak { background: var(--meter-peak); }

.stat__bar i:nth-child(1) { --s: 1; }
.stat__bar i:nth-child(2) { --s: 2; }
.stat__bar i:nth-child(3) { --s: 3; }
.stat__bar i:nth-child(4) { --s: 4; }
.stat__bar i:nth-child(5) { --s: 5; }
.stat__bar i:nth-child(6) { --s: 6; }
.stat__bar i:nth-child(7) { --s: 7; }
.stat__bar i:nth-child(8) { --s: 8; }
.stat__bar i:nth-child(9) { --s: 9; }
.stat__bar i:nth-child(10) { --s: 10; }

/* Планшет и телефон: группы друг под другом, столбики ложатся в строки.
   Слева иконка и название, дальше шкала из десяти делений, справа оценка */
@media (max-width: 899px) {
  .stats {
    flex-direction: column;
    align-items: stretch;
    gap: 44px;
  }

  .stats__group { flex: none; }
  .stats__head { margin-bottom: 8px; }

  .stats__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    text-align: left;
  }

  .stat__meta {
    order: 1;
    flex-direction: row;
    gap: 14px;
  }

  .stat__bar {
    order: 2;
    flex-direction: row;
    gap: 3px;
    width: auto;
    max-width: none;
  }

  .stat__bar i {
    width: 8px;
    height: 22px;
    border-radius: 2px;
  }

  .stat__value {
    order: 3;
    justify-content: flex-end;
    min-width: 72px;
  }

  .stat__num { font-size: 40px; }
  .stat__level { opacity: 1; }
}

/* Телефон: шкала сама показывает «из десяти», подпись «/ 10» читает
   только экранный диктор */
@media (max-width: 599px) {
  .stat { gap: 12px; }
  .stat__meta { gap: 12px; }
  .stat__icon { width: 40px; height: 40px; }
  .stat__bar i { width: 6px; }
  .stat__value { min-width: 40px; }
  .stat__num { font-size: 36px; }

  .stat__of {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ==========================================================================
   Обо мне: bento-сетка со стикерами
   ========================================================================== */

.about {
  padding-block: clamp(80px, 11vw, 160px);
}

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(300px, auto);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bento__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 2.4vw, 34px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

/* Главная плитка: два ряда и две колонки */
.bento__tile--lead {
  grid-column: span 2;
  grid-row: span 2;
}

.bento__tile--wide { grid-column: span 2; }

/* Широкая плитка с текстом слева и стикером справа */
.bento__tile--row {
  flex-direction: row;
  align-items: center;
}

.bento__tile--row .bento__text { flex: 1; }
.bento__tile--row .bento__art { flex: none; width: 38%; }

/* Место под стикер: стикер по центру, с запасом под наклон */
.bento__art {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  padding: 6px;
}

.bento__title {
  margin: 0;
  font-size: clamp(22px, 1rem + 0.6vw, 26px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bento__tile--lead .bento__title {
  max-width: 14em;
  font-size: clamp(30px, 1rem + 1.8vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.bento__desc {
  max-width: 34em;
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.bento__tile--lead .bento__desc { font-size: clamp(16px, 1rem + 0.2vw, 19px); }

/* ---------- Стикеры ----------
   Свои цвета в любой теме: чёрный, белый и синий, как у настоящих наклеек.
   Белая вырубка по краю нарисована в самом SVG, лёгкая тень отрывает
   наклейку от плитки, особенно на светлой теме */

.sticker {
  --tilt: 0deg;

  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 18px var(--sticker-shadow));
  transform: rotate(var(--tilt));
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticker--rocket { max-width: 360px; }
.sticker--ribbon { max-width: 420px; }
.sticker--team { max-width: 190px; }
.sticker--cloud { max-width: 260px; }
.sticker--toggle { max-width: 190px; }
.sticker--orbit { max-width: 260px; }
.sticker--shield { max-width: 190px; }

.sticker text { font-family: var(--font); }

/* Стикер чуть отклеивается: поворот и приподнятость */
@media (hover: hover) {
  .bento__tile:hover .sticker { transform: rotate(calc(var(--tilt) + 4deg)) scale(1.04); }
}

/* Появление: стикер «шлёпается» на плитку, как будто его приклеили.
   Без скрипта наблюдателя всё видно сразу */
.reveal-ready .bento__tile:not(.is-in) .sticker {
  opacity: 0;
  transform: rotate(calc(var(--tilt) - 14deg)) scale(1.3);
}

.reveal-ready .bento__tile.is-in .sticker {
  animation: sticker-slap 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d, 0ms) + 250ms) backwards;
}

@keyframes sticker-slap {
  from { opacity: 0; transform: rotate(calc(var(--tilt) - 14deg)) scale(1.3); }
}

/* Ракета: текст по кругу медленно вращается, пламя дрожит, звёзды мерцают */
.sticker__ring-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  fill: #ffffff;
}

.sticker__spin {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: sticker-spin 32s linear infinite;
}

.sticker__flame {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: sticker-flame 0.45s ease-in-out infinite alternate;
}

.sticker__twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: sticker-twinkle 2.6s ease-in-out infinite;
}

.sticker__twinkle--late { animation-delay: 1.3s; }

/* Лента: текст плывёт вдоль волны (about.js) */
.sticker__ribbon-text {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.3px;
  fill: #111214;
}

/* Команда: крупные слоги и синяя звёздочка */
.sticker__arc { color: var(--ink-3); }

.sticker__word {
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -2px;
  fill: #111214;
}

.sticker__asterisk {
  transform-box: fill-box;
  transform-origin: center;
  animation: sticker-spin 9s linear infinite;
}

/* Облако */
.sticker__cloud-text {
  font-size: 25px;
  letter-spacing: -0.2px;
  font-weight: 500;
  fill: #ffffff;
}

/* Переключатель: включается, когда плитка появилась, и его можно пощёлкать */
.bento__switch {
  display: block;
  width: 100%;
  max-width: 190px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.bento__switch:focus-visible { outline-offset: 6px; }

.sticker__track {
  fill: #2b2c31;
  transition: fill 0.35s ease;
}

.sticker__knob {
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bento__switch[aria-pressed="true"] .sticker__track { fill: #1838d6; }
.bento__switch[aria-pressed="true"] .sticker__knob { transform: translateX(110px); }

/* Орбита и щит: орбиты текут, звезда мерцает и поворачивается */
.sticker__orbit { animation: sticker-dash 7s linear infinite; }
.sticker__orbit--reverse {
  stroke-dasharray: 2 10;
  animation-direction: reverse;
  animation-duration: 11s;
}

.sticker__star {
  transform-box: fill-box;
  transform-origin: center;
  animation: sticker-star 4.5s ease-in-out infinite;
}

.sticker__shield-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.5px;
  fill: #111214;
}

.sticker__label {
  font-size: 15px;
  font-weight: 500;
  fill: #ffffff;
}

.sticker__trail {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: sticker-flame 0.6s ease-in-out infinite alternate;
}

@keyframes sticker-spin { to { transform: rotate(360deg); } }

@keyframes sticker-flame {
  from { transform: scaleY(0.82); }
  to { transform: scaleY(1.12); }
}

@keyframes sticker-twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes sticker-dash { to { stroke-dashoffset: -110; } }

@keyframes sticker-star {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(45deg) scale(0.86); }
}

/* Планшет: две колонки */
@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__tile--lead { grid-row: span 1; }
  .bento__tile--lead .bento__art { min-height: 260px; }
}

/* Телефон: одна колонка, широкие плитки тоже в столбик */
@media (max-width: 599px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  .bento__tile--lead,
  .bento__tile--wide { grid-column: auto; }

  .bento__tile--row { flex-direction: column-reverse; align-items: stretch; }
  .bento__tile--row .bento__art { width: 100%; }
  .bento__art { min-height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  .sticker,
  .sticker__knob,
  .sticker__track { transition: none; }

  .reveal-ready .bento__tile.is-in .sticker,
  .sticker__spin,
  .sticker__flame,
  .sticker__twinkle,
  .sticker__asterisk,
  .sticker__orbit,
  .sticker__star,
  .sticker__trail { animation: none; }

  .reveal-ready .bento__tile:not(.is-in) .sticker {
    opacity: 1;
    transform: rotate(var(--tilt));
  }
}

/* ==========================================================================
   Кейсы: плитки
   ========================================================================== */

.cases {
  padding-block: clamp(80px, 11vw, 160px);
}

/* Две крупные плитки в ряд: кейсы читаются как истории,
   а не как витрина (витрина у «Готовых решений») */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 5vw, 80px) clamp(20px, 2.4vw, 40px);
}

.tile__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Картинка чуть поворачивается вслед за курсором: углы --rx и --ry
   ставит cases.js. Пока курсор над плиткой, поворот догоняет его быстро,
   после ухода плавно возвращается. Сама плитка стоит на месте */
.tile__media {
  position: relative;
  aspect-ratio: 3 / 2;
  margin-bottom: clamp(20px, 2vw, 28px);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.8s var(--ease);
}

.tile__media.is-tilting { transition-duration: 0.2s; }

/* Блик: мягкое световое пятно скользит по картинке за курсором */
.tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tile__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

/* Видео обложки кейса: играет при наведении поверх картинки (cases.js) */
.tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 1s var(--ease);
}

.tile__media.is-playing .tile__video { opacity: 1; }

.tile__kind {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ink-2);
}

/* Заголовок двухцветный по буквам: при наведении синий заливает его
   слева направо, как пункты услуг и контакты в футере */
.tile__title {
  margin: 0 0 12px;
  font-size: clamp(26px, 1rem + 1.2vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  background: linear-gradient(90deg, var(--accent) 0 46%, var(--ink) 54% 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.75s var(--ease);
}

.tile__text {
  max-width: 32em;
  margin: 0 0 20px;
  font-size: clamp(17px, 1rem + 0.15vw, 19px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Теги прижаты к низу: в ряду они стоят на одной линии, даже если описания разной длины */
.tile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tile__tags li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.2;
  transition: border-color 0.35s ease;
}

/* Наведение только там, где есть мышь. Плитка под курсором оживает,
   соседние гаснут и теряют цвет, чтобы внимание было на одной */
@media (hover: hover) {
  /* Гаснет внутренний блок: у самой плитки свой переход появления */
  .tile__inner { transition: opacity 0.5s ease, filter 0.5s ease; }

  .tiles:has(.tile:hover) .tile:not(:hover) .tile__inner {
    opacity: 0.45;
    filter: saturate(0.2);
  }

  .tile:hover .tile__media img,
  .tile:hover .tile__video { transform: scale(1.06); }
  .tile:hover .tile__media::after { opacity: 1; }
  .tile:hover .tile__title { background-position: 0 0; }

  /* Обводки тегов темнеют по очереди, слева направо */
  .tile:hover .tile__tags li { border-color: var(--ink); }
  .tile:hover .tile__tags li:nth-child(2) { transition-delay: 0.06s; }
  .tile:hover .tile__tags li:nth-child(3) { transition-delay: 0.12s; }
  .tile:hover .tile__tags li:nth-child(4) { transition-delay: 0.18s; }
}

@media (prefers-reduced-motion: reduce) {
  .tile__media,
  .tile__media img,
  .tile__title { transition: none; }
}

@media (max-width: 599px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Кейсы: плитка ведёт на страницу кейса
   ========================================================================== */

/* Вся плитка ведёт на страницу кейса: ссылка растянута поверх плитки,
   в углу картинки при наведении бейдж «Подробнее» */
.tile__inner { position: relative; }

.tile__open {
  position: absolute;
  inset: -8px;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
}

.tile__open:focus-visible { outline-offset: 0; }

@media (prefers-reduced-motion: reduce) {
  .tile__more { transition: none; }
}

/* Бейдж в углу картинки: проявляется при наведении, без сдвига */
.tile__more {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 16px;
  border-radius: 10px;
  background: rgba(12, 12, 14, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 16px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
  pointer-events: none;
}

.tile__more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

@media (hover: hover) {
  .tile:hover .tile__more {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Готовые решения: витрина продуктов
   ========================================================================== */

.solutions {
  padding-block: clamp(80px, 11vw, 160px);
}

/* Фильтр по типу над витриной. Кнопки собирает solutions.js */
.sol-filter { margin-bottom: clamp(28px, 3.4vw, 48px); }

/* Плашка выбранной категории (solutions.js): одна на весь фильтр и переезжает
   к нажатой кнопке, кнопки над ней прозрачные */
.sol-filter.has-pill { position: relative; isolation: isolate; }

.sol-filter__pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: var(--radius);
  background: var(--ink);
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), width 0.55s cubic-bezier(0.22, 1, 0.36, 1), height 0.3s ease;
}

/* Все кнопки прозрачные: плашка видна, пока едет под соседними */
.sol-filter.has-pill .chip { background: transparent; }

.sol-filter.has-pill .chip[aria-pressed="true"] {
  background: transparent;
  transition: color 0.3s ease 0.1s, border-color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .sol-filter__pill { transition: none; }
}
.sol-filter:empty { display: none; }

.sol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sol-item.is-fresh { animation: al-in 0.5s var(--ease) both; }

/* Карточка товара: превью в рамке, тип, название, описание, две строки
   характеристик, внизу цена и кнопка. Низ прижат, чтобы цены в ряду
   стояли на одной линии */
.sol-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
}

/* Видео на карточке витрины вместо картинки (первое в галерее товара) */
.sol-card__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sol-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg);
}

.sol-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.sol-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(18px, 1.8vw, 26px) clamp(12px, 1.2vw, 18px) clamp(10px, 1vw, 14px);
}

.sol-card__type {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ink-2);
}

.sol-card__type::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Название двухцветное по буквам, как у плиток кейсов: при наведении
   синий заливает его слева направо */
.sol-card__title {
  margin: 0;
  font-size: clamp(22px, 1rem + 0.6vw, 28px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  background: linear-gradient(90deg, var(--accent) 0 46%, var(--ink) 54% 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.75s var(--ease);
}

.sol-card__text {
  margin: 10px 0 20px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Длинное описание не распирает карточку: не больше четырёх строк, дальше
   многоточие. Полный текст на странице товара */
.sol-card__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

/* Отступ до характеристик уже дал текст */
.sol-card__text + .sol-card__specs { margin-top: 0; }

.sol-card__specs {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
}

.sol-card__specs div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 4px 0;
}

.sol-card__specs dt {
  font-size: 16px;
  color: var(--ink-3);
}

.sol-card__specs dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.sol-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: auto;
  padding-top: 20px;
}

.sol-card__price {
  margin: 0;
  font-size: clamp(26px, 1rem + 0.9vw, 34px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sol-card__price span {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
}

/* Вся карточка ведёт на страницу товара: ссылка названия растянута
   на карточку, кнопка «Оформить заказ» лежит над ней */
.sol-card { position: relative; }

.sol-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.sol-card__link:focus-visible { outline: none; }

.sol-card:has(.sol-card__link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sol-card__buy {
  position: relative;
  z-index: 2;
}

@media (hover: hover) {
  .sol-card:hover .sol-card__media img { transform: scale(1.05); }
  .sol-card:hover .sol-card__title { background-position: 0 0; }
}

.sol-card:has(.sol-card__link:focus-visible) .sol-card__title { background-position: 0 0; }

/* Не нашли готовое: строка с предложением под витриной */
.sol-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line);
}

.sol-custom__text {
  max-width: 30em;
  margin: 0;
  font-size: clamp(20px, 1rem + 0.5vw, 25px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.sol-custom__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .sol-item.is-fresh { animation: none; }
  .sol-card__media img,
  .sol-card__title { transition: none; }
}

@media (max-width: 1023px) {
  .sol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .sol-grid { grid-template-columns: minmax(0, 1fr); }

  .sol-custom__btn { width: 100%; }
}

/* ==========================================================================
   Статьи: главная статья и колонка цифр
   ========================================================================== */

.articles {
  padding-block: clamp(80px, 11vw, 160px);
}

/* Слева главная статья, справа список. Обе колонки одной высоты:
   карточка тянется под список, цифра в ней встаёт посередине */
.posts {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 4vw, 64px);
}

.posts__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post__inner { position: relative; }

/* Вся статья кликается: ссылка заголовка растянута на весь блок */
.post__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Фокус рисуем вокруг статьи целиком, а не вокруг строки заголовка */
.post__link:focus-visible { outline: none; }

.post__inner:has(.post__link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

/* Одной строкой: при переносе точка-разделитель уезжала бы в начало строки */
.post__meta {
  display: flex;
  margin: 0;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-2);
}

.post__meta > * + *::before {
  content: "·";
  margin-inline: 10px;
  color: var(--ink-3);
}

.post__figure { margin: 0; }

.post__num {
  display: block;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--ink);
  transition: color 0.35s ease;
}

.post__caption {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-3);
}

/* Заголовок двухцветный по буквам, как у плиток кейсов:
   при наведении синий заливает его слева направо */
.post__title {
  margin: 12px 0 0;
  font-size: clamp(22px, 1rem + 0.6vw, 28px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  background: linear-gradient(90deg, var(--accent) 0 46%, var(--ink) 54% 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.75s var(--ease);
}

.post__text {
  max-width: 36em;
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Главная статья ---------- */

.post--lead .post__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 56px);
  height: 100%;
  min-height: 520px;
  padding: clamp(24px, 3vw, 48px);
  border-radius: var(--radius);
  background: var(--surface);
}

.post--lead .post__figure { margin-block: auto; }

.post--lead .post__num {
  /* Запас сверху и снизу, чтобы маска появления не срезала знаки */
  padding-block: 0.06em;
  font-size: clamp(88px, 3rem + 7vw, 184px);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.post--lead .post__caption {
  margin-top: 14px;
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  color: var(--ink-2);
}

.post--lead .post__title {
  max-width: 18em;
  margin-top: 0;
  font-size: clamp(28px, 1rem + 1.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.post--lead .post__text { font-size: clamp(17px, 1rem + 0.2vw, 19px); }

.post__read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 17px;
  font-weight: 500;
  transition: color 0.35s ease;
}

.post__read svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* Цифра главной статьи прописывается слева направо, когда секция
   доезжает до экрана. Класс is-in ставит main.js */
.reveal-ready .post--lead .post__num {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.4s var(--ease) 0.3s, color 0.35s ease;
}

.reveal-ready .post--lead:not(.is-in) .post__num { clip-path: inset(0 100% 0 0); }

/* ---------- Список: цифра слева, текст справа ---------- */

.posts__list .post {
  padding-block: clamp(24px, 2.4vw, 32px);
  border-top: 1px solid var(--line);
}

.posts__list .post:first-child {
  padding-top: 0;
  border-top: 0;
}

.posts__list .post:last-child { padding-bottom: 0; }

.posts__list .post__inner {
  display: grid;
  grid-template-columns: clamp(104px, 9vw, 140px) minmax(0, 1fr);
  gap: 0 clamp(16px, 2vw, 28px);
}

.posts__list .post__num { font-size: clamp(30px, 1rem + 1vw, 42px); }

/* Наведение только там, где есть мышь. Статья под курсором оживает,
   соседние гаснут, как плитки кейсов */
@media (hover: hover) {
  .post__inner { transition: opacity 0.5s ease, filter 0.5s ease, background-color 0.35s ease; }

  .posts:has(.post:hover) .post:not(:hover) .post__inner {
    opacity: 0.45;
    filter: saturate(0.2);
  }

  .post:hover .post__title { background-position: 0 0; }
  .post:hover .post__num,
  .post:hover .post__read { color: var(--accent); }

  .post--lead:hover .post__inner { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
}

/* Ссылка на список всех статей под секцией */
.articles__more { margin-top: clamp(40px, 5vw, 64px); }

.articles__more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* С клавиатуры статья в фокусе выглядит так же, как под курсором */
.post:has(.post__link:focus-visible) .post__title { background-position: 0 0; }
.post:has(.post__link:focus-visible) .post__num,
.post:has(.post__link:focus-visible) .post__read { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .post__title,
  .post__num,
  .reveal-ready .post--lead .post__num { transition: none; }

  .reveal-ready .post--lead:not(.is-in) .post__num { clip-path: none; }
}

@media (max-width: 1279px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .posts { grid-template-columns: minmax(0, 1fr); }

  .post--lead .post__inner { min-height: 0; }
}

/* В узкой колонке (две колонки на ноутбуке или телефон) цифра встаёт
   строкой над текстом, подпись рядом с ней. Текст получает всю ширину */
@media (min-width: 900px) and (max-width: 1279px), (max-width: 599px) {
  .posts__list .post__inner { grid-template-columns: minmax(0, 1fr); }

  .posts__list .post__figure {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
  }

  .posts__list .post__caption { margin-top: 0; }
}

/* ==========================================================================
   Переходы между страницами
   ========================================================================== */

/* Страницы сайта мягко сменяют друг друга, а картинка кейса перетекает
   из плитки в обложку страницы кейса и обратно (cases.js, case.js).
   Работает там, где есть View Transitions между страницами */
@view-transition { navigation: auto; }

::view-transition-group(case-cover) {
  animation-duration: 0.75s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* У плитки и обложки разные пропорции: картинка заполняет рамку целиком */
::view-transition-old(case-cover),
::view-transition-new(case-cover) {
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Страница кейса (case.html)
   ========================================================================== */

.cs { padding-top: var(--header-h); }

/* Первый экран: огромный номер кейса контуром, название, коротко о кейсе
   и факты */
.cs-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 80px) 0 clamp(40px, 5vw, 72px);
}

.cs-hero__inner { position: relative; }

.cs-hero__num {
  position: absolute;
  top: -0.06em;
  right: var(--gutter);
  font-size: clamp(160px, 26vw, 400px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  pointer-events: none;
  user-select: none;
}

.cs-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.cs-back:hover { color: var(--accent); }

.cs-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.cs-eyebrow {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  margin: clamp(36px, 5vw, 72px) 0 clamp(16px, 2vw, 24px);
  font-size: 16px;
  color: var(--ink-2);
}

.cs-kind {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cs-kind::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cs-count {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.cs-title {
  position: relative;
  margin: 0;
  font-size: clamp(60px, 1.5rem + 8.4vw, 176px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.cs-title--long {
  max-width: 12em;
  font-size: clamp(44px, 1.2rem + 5.4vw, 116px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.cs-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px clamp(40px, 6vw, 120px);
  margin-top: clamp(32px, 4vw, 64px);
}

.cs-lead {
  max-width: 30em;
  margin: 0;
  font-size: clamp(19px, 1rem + 0.5vw, 24px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.cs-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

/* Кнопка «Перейти на сайт» под описанием кейса */
.cs-hero__main { min-width: 0; }

.cs-visit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(20px, 2.4vw, 32px);
}

.cs-visit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.cs-visit:hover svg { transform: translate(2px, -2px); }

.cs-facts div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cs-facts dt {
  font-size: 16px;
  color: var(--ink-3);
}

.cs-facts dd {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

/* Обложка во всю ширину окна. Сначала её обрезает по краю контейнера
   и скругляет case.js (clip-path), по прокрутке обрезка уходит и обложка
   встаёт на весь экран. Картинка внутри при этом чуть отдаляется,
   поверх неё холст «жидкого стекла» (case-glass.js) */
.cs-stage { position: relative; }

.cs-cover {
  position: relative;
  height: min(56.25vw, 100vh);
  height: min(56.25vw, 100svh);
  margin: 0;
  background: var(--surface);
  overflow: hidden;
}

.cs-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}

/* Холст рисует ту же картинку и тем же кадром, поэтому подменяет её
   незаметно. Проявляется, когда нарисован первый кадр */
.cs-cover__glass {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 0.5s ease;
}

.cs-cover__glass.is-on { opacity: 1; }

/* Результат цифрами: тёмный остров, как футер и хэдер. Три крупных
   числа между тонкими вертикальными линиями, числа набегают (case.js) */
.cs-results {
  --bg: #0c0c0e;
  --ink: #f1f1f3;
  --ink-2: #9b9da6;
  --ink-3: #6b6d76;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #4f6af7;

  color-scheme: dark;
  margin: clamp(8px, 1vw, 16px);
  padding-block: clamp(48px, 6vw, 104px);
  border-radius: 18px;
  background: var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] .cs-results {
  --bg: #141519;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.cs-results__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(32px, 4.4vw, 72px);
  font-size: 16px;
  color: var(--ink-2);
}

.cs-results__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cs-metrics__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-metrics__list li {
  padding: 4px clamp(16px, 3vw, 48px);
  border-left: 1px solid var(--line);
}

.cs-metrics__list li:first-child {
  padding-left: 0;
  border-left: 0;
}

.cs-results__index {
  display: block;
  font-size: 16px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.cs-metric {
  display: block;
  margin-top: clamp(16px, 2vw, 28px);
  font-size: clamp(56px, 2rem + 5vw, 144px);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.055em;
  white-space: nowrap;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cs-results__text {
  display: block;
  max-width: 16em;
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Разделы: подпись слева липнет к верху, пока раздел проезжает экран */
.cs-block {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 2.3fr);
  gap: 24px clamp(32px, 5vw, 96px);
  padding-block: clamp(56px, 7vw, 112px);
}

.cs-block + .cs-block,
.cs-solution + .cs-block { border-top: 1px solid var(--line); }

.cs-label {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font-size: clamp(20px, 1rem + 0.5vw, 24px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cs-label--flat { position: static; }

.cs-label span {
  font-size: 16px;
  font-weight: 400;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Крупная фраза задачи: слова загораются по мере чтения (case.js) */
.cs-statement {
  max-width: 20em;
  margin: 0;
  font-size: clamp(30px, 1rem + 2.8vw, 66px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.cs-w {
  color: color-mix(in srgb, var(--ink) 18%, var(--bg));
  transition: color 0.45s ease;
}

.cs-w.is-lit { color: var(--ink); }

.cs-text {
  max-width: 38em;
  margin: clamp(24px, 2.4vw, 36px) 0 0;
  font-size: clamp(18px, 1rem + 0.25vw, 20px);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Решение: таймлайн из трёх шагов. Линия тянется слева направо
   по прокрутке, точки и контурные номера заливаются синим, когда
   линия до них дошла (case.js) */
.cs-solution {
  padding-block: clamp(56px, 7vw, 112px);
  border-top: 1px solid var(--line);
}

/* Галерея кейса под «Решением»: первая картинка во всю ширину, остальные по две */
.cs-shots { padding-bottom: clamp(56px, 7vw, 112px); }

.cs-shots__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}

.cs-shot {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.cs-shot:first-child,
.cs-shots__grid > .cs-shot:last-child:nth-child(even) { grid-column: 1 / -1; }

/* Видео в галерее кейса: как скриншот, во всю ширину своей ячейки */
.cs-shot video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
}

/* Видео в обложке: поверх картинки, проявляется, когда пошли кадры */
.cs-cover__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 0.8s ease;
}

.cs-cover.is-playing .cs-cover__video { opacity: 1; }

.cs-shot img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 599px) {
  .cs-shots__grid { grid-template-columns: minmax(0, 1fr); }
}

.cs-solution__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: clamp(40px, 5vw, 80px);
}

.cs-solution__note {
  max-width: 24em;
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-2);
}

.cs-timeline { position: relative; }

.cs-timeline__track {
  position: absolute;
  top: 5px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line-strong);
}

.cs-timeline__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.cs-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(24px, 3vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-step {
  position: relative;
  padding-top: clamp(36px, 4vw, 56px);
}

.cs-step__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color 0.4s ease, box-shadow 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-step.is-on .cs-step__dot {
  background: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  transform: scale(1.3);
}

.cs-step__num {
  display: block;
  font-size: clamp(88px, 3rem + 6vw, 176px);
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  font-variant-numeric: tabular-nums;
  transition: color 0.7s ease, -webkit-text-stroke-color 0.7s ease;
}

.cs-step.is-on .cs-step__num {
  color: var(--accent);
  -webkit-text-stroke-color: transparent;
}

.cs-step__title {
  margin: clamp(24px, 3vw, 40px) 0 12px;
  font-size: clamp(22px, 1rem + 0.8vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.cs-step__text {
  max-width: 26em;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Стек: плитки с иконкой и названием */
.cs-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-tool {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: clamp(160px, 14vw, 210px);
  padding: clamp(20px, 2vw, 28px);
  border-radius: var(--radius);
  background: var(--surface);
}

.cs-stack__icon {
  flex: none;
  width: 64px;
  height: 64px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-stack__badge {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
}

.cs-tool__name {
  font-size: clamp(20px, 1rem + 0.5vw, 26px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

@media (hover: hover) {
  .cs-tool:hover .cs-stack__icon { transform: rotate(-6deg) scale(1.06); }
}

/* Итог: глубокая синяя панель, огромный контурный номер в углу,
   крупная мысль и кнопка. Синий один и тот же в обеих темах */
.cs-final { padding-block: clamp(8px, 1vw, 16px) clamp(64px, 8vw, 128px); }

.cs-final__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 96px);
  border-radius: var(--radius);
  background: #1838d6;
  color: #ffffff;
}

.cs-final__num {
  position: absolute;
  right: clamp(16px, 3vw, 48px);
  bottom: -0.1em;
  font-size: clamp(160px, 24vw, 380px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
  pointer-events: none;
  user-select: none;
}

.cs-final__label {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 clamp(28px, 4vw, 56px);
  font-size: clamp(20px, 1rem + 0.5vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cs-final__label span {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.cs-final__title {
  position: relative;
  max-width: 16em;
  margin: 0;
  font-size: clamp(32px, 1rem + 3.2vw, 76px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.cs-final__text {
  position: relative;
  max-width: 34em;
  margin: clamp(20px, 2vw, 28px) 0 0;
  font-size: clamp(18px, 1rem + 0.25vw, 20px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  text-wrap: pretty;
}

.cs-final__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  margin-top: clamp(28px, 3vw, 44px);
  padding: 0 26px;
  border-radius: var(--radius);
  background: #ffffff;
  color: #0c0c0e;
  font-size: 17px;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.cs-final__cta:hover {
  background: #0c0c0e;
  color: #ffffff;
}

.cs-final__cta:focus-visible { outline-color: #ffffff; }

.cs-final__cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* Следующий кейс: полоса во всю ширину. Название бежит крупной строкой,
   над ней парит обложка следующего кейса, к её углу приклеен круглый бейдж
   «Смотреть кейс» с бегущим по кругу текстом. При наведении строка синеет,
   обложка тянется за курсором (case.js) и приближается, бейдж подрастает */
.cs-next { padding-bottom: clamp(64px, 8vw, 128px); }

.cs-next__link {
  position: relative;
  display: block;
  padding: clamp(28px, 3vw, 44px) 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
}

.cs-next__head,
.cs-next__foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 16px;
  color: var(--ink-2);
}

.cs-next__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cs-next__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cs-next__num {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.cs-next__stack { color: var(--ink-3); }

/* Сцена: бегущая строка по центру, обложка поверх */
.cs-next__stage {
  position: relative;
  display: block;
  height: clamp(240px, 28vw, 420px);
  margin: clamp(16px, 2.4vw, 36px) 0;
}

.cs-next__marquee {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateY(-50%);
}

.cs-next__track {
  display: inline-flex;
  animation: cs-marquee 30s linear infinite;
}

.cs-next__track > span {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  padding-right: 0.32em;
  font-size: clamp(60px, 1.6rem + 8.4vw, 184px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.cs-next__track em {
  font-style: normal;
  color: var(--ink);
  transition: color 0.5s ease;
}

.cs-next__star {
  flex: none;
  width: 0.38em;
  height: 0.38em;
  fill: var(--accent);
}

@keyframes cs-marquee {
  to { transform: translateX(-50%); }
}

/* Обложка и бейдж: двигаются вместе, сдвиг за курсором в --fx и --fy */
.cs-next__float {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: clamp(220px, 24vw, 400px);
  transform:
    translate(-50%, -50%)
    translate(calc(var(--fx, 0) * 56px), calc(var(--fy, 0) * 28px))
    rotate(calc(-6deg + var(--fx, 0) * 4deg));
}

.cs-next__media {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

.cs-next__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

/* Бейдж «Смотреть кейс»: синий круг, текст бежит по кругу, в центре стрелка */
.cs-next__badge {
  position: absolute;
  right: calc(clamp(120px, 11vw, 156px) * -0.38);
  bottom: calc(clamp(120px, 11vw, 156px) * -0.38);
  display: grid;
  place-items: center;
  width: clamp(120px, 11vw, 156px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  transform: rotate(6deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-next__badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.cs-next__ring {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: sticker-spin 18s linear infinite;
}

.cs-next__ring text {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  fill: currentColor;
}

.cs-next__arrow svg {
  display: block;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.cs-next__link:hover .cs-next__track em,
.cs-next__link:focus-visible .cs-next__track em { color: var(--accent); }

.cs-next__link:hover .cs-next__media img { transform: scale(1.06); }

.cs-next__link:hover .cs-next__badge,
.cs-next__link:focus-visible .cs-next__badge { transform: rotate(6deg) scale(1.1); }

/* Планшет и телефон: всё в одну колонку. Таймлайн без линии:
   номер шага заливается, когда шаг поднялся на экран */
@media (max-width: 899px) {
  .cs-hero__grid,
  .cs-block { grid-template-columns: minmax(0, 1fr); }

  .cs-label { position: static; }

  .cs-metrics__list { grid-template-columns: minmax(0, 1fr); }

  .cs-metrics__list li,
  .cs-metrics__list li:first-child {
    padding: 28px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .cs-metrics__list li:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .cs-steps { grid-template-columns: minmax(0, 1fr); }

  .cs-timeline__track,
  .cs-step__dot { display: none; }

  .cs-step { padding-top: 0; }
}

@media (max-width: 599px) {
  .cs-cover { height: 75vw; }

  .cs-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .cs-tool {
    gap: 28px;
    min-height: 0;
  }

  .cs-stack__icon {
    width: 52px;
    height: 52px;
  }
  .cs-facts div { grid-template-columns: 76px minmax(0, 1fr); }
  .cs-next__stage { height: 230px; }
  .cs-next__float { width: 58vw; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-cover img { transform: none; }
  .cs-w,
  .cs-step__dot,
  .cs-step__num,
  .cs-stack__icon,
  .cs-next__track em,
  .cs-next__badge,
  .cs-next__media img { transition: none; }

  .cs-next__track,
  .cs-next__ring { animation: none; }
}

/* ==========================================================================
   Страница статьи (article.html)
   ========================================================================== */

.ar { padding-top: var(--header-h); }

/* Полоса чтения по верхнему краю окна: сколько текста прочитано (article.js) */
.ar-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}

.ar-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Первый экран: рубрика, дата и время чтения, заголовок, вступление */
.ar-hero { padding-block: clamp(32px, 5vw, 80px) clamp(36px, 4.4vw, 64px); }

.ar-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.ar-back:hover { color: var(--accent); }

.ar-back svg,
.ar-share__btn svg,
.ar-author__cta svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Пункты через отступ, как на странице кейса: при переносе строка
   не начинается с разделителя */
.ar-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: clamp(36px, 5vw, 72px) 0 clamp(16px, 2vw, 24px);
  font-size: 16px;
  color: var(--ink-3);
}

.ar-kind {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
}

.ar-kind::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.ar-title {
  max-width: 15em;
  margin: 0;
  font-size: clamp(40px, 1.2rem + 4.4vw, 104px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.ar-lead {
  max-width: 34em;
  margin: clamp(24px, 3vw, 40px) 0 0;
  font-size: clamp(19px, 1rem + 0.5vw, 24px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Карточка статьи вместо обложки: главная цифра крупно, рядом «Главное».
   Цифра прописывается слева направо, когда страница открылась */
.ar-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 72px);
  padding: clamp(28px, 4vw, 64px);
  border-radius: var(--radius);
  background: var(--surface);
}

.ar-card__figure {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0;
}

.ar-card__num {
  display: block;
  padding-block: 0.06em;
  font-size: clamp(88px, 3rem + 8vw, 220px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.is-ready .ar-card__num { animation: ar-wipe 1.4s var(--ease) 0.45s both; }

@keyframes ar-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.ar-card__caption {
  display: block;
  margin-top: 14px;
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  line-height: 1.4;
  color: var(--ink-2);
}

.ar-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-3);
}

/* Выводы с номерами: номер синий, между пунктами тонкие линии */
.ar-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: brief;
}

.ar-card__list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(17px, 1rem + 0.2vw, 19px);
  line-height: 1.45;
  counter-increment: brief;
  text-wrap: pretty;
}

.ar-card__list li::before {
  content: counter(brief, decimal-leading-zero);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Текст: слева липкое содержание и кнопки, справа статья */
.ar-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  align-items: start;
  gap: 40px clamp(40px, 6vw, 120px);
  padding-block: clamp(56px, 7vw, 112px) clamp(64px, 8vw, 128px);
}

.ar-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 32px;
}

.ar-toc__title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--ink-3);
}

.ar-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.ar-toc__list li { counter-increment: toc; }

/* Пункт содержания: номер и название, у текущего раздела синяя точка */
.ar-toc__list a {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 8px 0 8px 18px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-2);
  transition: color 0.25s ease;
}

.ar-toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.ar-toc__list a::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ar-toc__list a:hover,
.ar-toc__list a.is-current { color: var(--ink); }

/* Наведение: пункт чуть сдвигается, слева проступает точка поменьше, чем у текущего */
.ar-toc__list a,
.pp-toc__list a { transition: color 0.25s ease, translate 0.35s var(--ease); }

.ar-toc__list a:hover,
.pp-toc__list a:hover { translate: 4px 0; }

.ar-toc__list a:hover:not(.is-current)::after,
.pp-toc__list a:hover:not(.is-current)::after { transform: scale(0.6); opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .ar-toc__list a:hover,
  .pp-toc__list a:hover { translate: none; }
}
.ar-toc__list a.is-current::before { color: var(--accent); }
.ar-toc__list a.is-current::after { transform: none; }

.ar-share {
  display: grid;
  gap: 4px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.ar-share__btn {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease;
}

.ar-share__btn:hover,
.ar-share__btn.is-done { color: var(--accent); }

/* Статья: колонка для чтения, около 70 знаков в строке */
.ar-content {
  min-width: 0;
  max-width: 38em;
  font-size: clamp(18px, 1rem + 0.15vw, 20px);
}

.ar-h {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: clamp(48px, 5vw, 80px) 0 20px;
  font-size: clamp(26px, 1rem + 1.3vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.ar-h:first-child { margin-top: 0; }

.ar-h span {
  flex: none;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ar-p {
  margin: 0 0 1.1em;
  line-height: 1.7;
  text-wrap: pretty;
}

/* Список: номера синим в отдельной колонке */
.ar-list {
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.ar-list li {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  padding: 10px 0;
  line-height: 1.6;
  counter-increment: item;
}

.ar-list li::before {
  content: counter(item, decimal-leading-zero);
  font-size: 16px;
  line-height: 1.9;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Цитата: крупный текст между тонкими линиями */
.ar-quote {
  margin: clamp(40px, 5vw, 64px) 0;
  padding-block: clamp(28px, 3vw, 40px);
  border-block: 1px solid var(--line);
}

.ar-quote blockquote {
  margin: 0;
  font-size: clamp(24px, 1rem + 1.2vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.ar-quote figcaption {
  margin-top: 16px;
  font-size: 16px;
  color: var(--ink-3);
}

/* Цифра на подложке: число синим, рядом пояснение */
.ar-fact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px clamp(24px, 3vw, 40px);
  margin: clamp(32px, 4vw, 48px) 0;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius);
  background: var(--surface);
}

.ar-fact__value {
  font-size: clamp(52px, 2rem + 3vw, 96px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.05em;
  white-space: nowrap;
  color: var(--meter-peak);
}

.ar-fact__text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Совет в рамке со всех сторон */
.ar-note {
  margin: clamp(32px, 4vw, 48px) 0;
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.ar-note__label {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
}

.ar-note__text {
  margin: 0;
  line-height: 1.6;
}

/* Картинка во всю колонку текста, подпись под ней */
.ar-image { margin: clamp(36px, 4.4vw, 56px) 0; }

.ar-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--surface);
}

.ar-image figcaption {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-3);
  text-wrap: pretty;
}

/* Автор в конце статьи */
.ar-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: clamp(56px, 6vw, 88px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.ar-author__photo {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

.ar-author__text { flex: 1 1 260px; }

.ar-author__name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.ar-author__role {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-2);
}

/* «Читать дальше»: остальные статьи тремя колонками */
.ar-more {
  padding-block: clamp(56px, 7vw, 112px) clamp(80px, 10vw, 160px);
  border-top: 1px solid var(--line);
}

.ar-more__title {
  margin: 0 0 clamp(32px, 4vw, 56px);
  font-size: clamp(32px, 1rem + 2.2vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.ar-more__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 3vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ar-more__card {
  height: 100%;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.ar-more__card .post__num { font-size: clamp(36px, 1rem + 1.6vw, 52px); }
.ar-more__card .post__meta { margin-top: 20px; }

@media (hover: hover) {
  .ar-more__list:has(.post:hover) .post:not(:hover) .post__inner {
    opacity: 0.45;
    filter: saturate(0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-ready .ar-card__num { animation: none; }
}

@media (max-width: 1023px) {
  .ar-body { grid-template-columns: minmax(0, 1fr); }

  /* Содержание уходит над текстом и больше не липнет */
  .ar-aside {
    position: static;
    padding: clamp(20px, 3vw, 28px);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .ar-content { max-width: 40em; }

  .ar-more__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-more__list .post:nth-child(3) { display: none; }
}

@media (max-width: 767px) {
  .ar-card { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599px) {
  .ar-fact { grid-template-columns: minmax(0, 1fr); }

  .ar-more__list { grid-template-columns: minmax(0, 1fr); }
  .ar-more__list .post:nth-child(3) { display: block; }

  .ar-author__cta { width: 100%; }
}

/* ==========================================================================
   Список статей (articles.html)
   ========================================================================== */

.al { padding-top: var(--header-h); }

/* Первый экран: огромное «Статьи», рядом вступление */
.al-hero { padding-block: clamp(32px, 5vw, 80px) clamp(32px, 4vw, 56px); }

.al-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: clamp(36px, 5vw, 72px) 0 clamp(16px, 2vw, 24px);
  font-size: 16px;
  color: var(--ink-3);
}

.al-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px clamp(40px, 6vw, 120px);
}

.al-title {
  margin: 0;
  font-size: clamp(64px, 1.5rem + 8vw, 168px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.al-lead {
  justify-self: end;
  max-width: 30em;
  margin: 0;
  font-size: clamp(19px, 1rem + 0.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.al-body { padding-bottom: clamp(80px, 10vw, 160px); }

/* Рубрики над списком */
.al-filter { margin-bottom: clamp(32px, 4vw, 56px); }

/* Пока статей нет: одна строка вместо пустого списка и фильтра */
.al-empty {
  max-width: 36em;
  margin: 0 0 clamp(48px, 6vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
}

.al-filter[hidden] { display: none; }

/* Строки статей между тонкими линиями: цифра, текст, превью */
.al-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.al-item { border-top: 1px solid var(--line); }

.al-item.is-fresh { animation: al-in 0.5s var(--ease) both; }

@keyframes al-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.al-row {
  display: grid;
  grid-template-columns: clamp(140px, 14vw, 220px) minmax(0, 1fr) clamp(220px, 22vw, 340px);
  align-items: start;
  gap: 20px clamp(24px, 3vw, 56px);
  padding-block: clamp(28px, 3.2vw, 48px);
}

.al-row .post__num { font-size: clamp(40px, 1rem + 2.6vw, 72px); }

.al-row .post__title {
  margin-top: 14px;
  font-size: clamp(24px, 1rem + 1vw, 36px);
  letter-spacing: -0.03em;
}

.al-row .post__text { max-width: 34em; }

.al-row__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.al-row__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

@media (hover: hover) {
  .al-list:has(.post:hover) .post:not(:hover) .post__inner {
    opacity: 0.45;
    filter: saturate(0.2);
  }

  .al-item:hover .al-row__media img { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .al-item.is-fresh { animation: none; }
  .al-row__media img { transition: none; }
}

@media (max-width: 1023px) {
  .al-row { grid-template-columns: clamp(120px, 16vw, 160px) minmax(0, 1fr) clamp(160px, 22vw, 220px); }
}

@media (max-width: 899px) {
  .al-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .al-lead { justify-self: start; }
}

/* Телефон: превью сверху во всю ширину, цифра строкой над текстом */
@media (max-width: 767px) {
  .al-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .al-row__media {
    order: -1;
    aspect-ratio: 16 / 10;
  }

  .al-row__figure {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }

  .al-row__figure .post__caption { margin-top: 0; }
}

/* ==========================================================================
   Страница готового решения (product.html)
   ========================================================================== */

.pd { padding-top: var(--header-h); }

/* Первый экран: слева тип, название, коротко и факты,
   справа блок покупки на тёмном острове */
.pd-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(32px, 5vw, 80px) clamp(32px, 4vw, 56px);
}

/* Лучи света из левого верхнего угла экрана на заголовок: пять мягких широких
   полос расходятся из угла, каждая медленно покачивается вокруг него и дышит
   в своём ритме. Слой за текстом, от верха страницы и левого края окна, книзу
   гаснет. Только в тёмной теме: на белом свет не виден */
.pd-rays {
  --ray: 196 208 255;
  --ray-a: 0.15;
  --len: 1300px;
  position: absolute;
  top: calc(-1 * var(--header-h));
  bottom: 0;
  left: calc(50% - 50vw);
  width: min(78vw, 1200px);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
  animation: pd-rays-in 2.4s var(--ease) 0.2s both;
}

:root[data-theme="light"] .pd-rays { display: none; }

/* Полоса начинается в углу (верх её середины ровно в углу) и уходит
   под своим углом вниз вправо */
.pd-rays i {
  position: absolute;
  top: -60px;
  left: 0;
  width: var(--w);
  height: var(--len);
  margin-left: calc(var(--w) / -2);
  border-radius: 50%;
  background: linear-gradient(to bottom,
    rgb(var(--ray) / calc(var(--ray-a) * var(--k, 1))) 0%,
    rgb(var(--ray) / calc(var(--ray-a) * var(--k, 1) * 0.7)) 45%,
    rgb(var(--ray) / calc(var(--ray-a) * var(--k, 1) * 0.3)) 75%,
    transparent 100%);
  filter: blur(16px);
  transform-origin: 50% 0;
  transform: rotate(var(--r));
  animation: pd-ray var(--t) ease-in-out var(--delay) infinite alternate;
  will-change: transform, opacity;
}

.pd-rays i:nth-child(1) { --w: clamp(70px, 9vw, 150px);  --r: -24deg; --t: 13s; --delay: -2s; }
.pd-rays i:nth-child(2) { --w: clamp(40px, 4vw, 70px);   --r: -34deg; --t: 9s;  --delay: -6s; --k: 0.8; }
.pd-rays i:nth-child(3) { --w: clamp(90px, 12vw, 200px); --r: -45deg; --t: 15s; --delay: -4s; }
.pd-rays i:nth-child(4) { --w: clamp(36px, 3.5vw, 60px); --r: -55deg; --t: 11s; --delay: -8s; --k: 0.7; }
.pd-rays i:nth-child(5) { --w: clamp(60px, 7vw, 120px);  --r: -64deg; --t: 17s; --delay: -1s; --k: 0.6; }

/* Покачивание на пару градусов вокруг угла и дыхание яркости */
@keyframes pd-ray {
  0% { transform: rotate(var(--r)); opacity: 1; }
  50% { opacity: 0.55; }
  100% { transform: rotate(calc(var(--r) + 3deg)); opacity: 0.85; }
}

@keyframes pd-rays-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Телефон: заголовок ближе к краю, веер круче вниз, лучей три */
@media (max-width: 767px) {
  .pd-rays { width: 100vw; --len: 820px; }
  .pd-rays i:nth-child(1) { --r: -22deg; }
  .pd-rays i:nth-child(2) { --r: -34deg; }
  .pd-rays i:nth-child(3) { --r: -46deg; }
  .pd-rays i:nth-child(n + 4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-rays,
  .pd-rays i { animation: none; }
}

.pd-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  align-items: end;
  gap: 40px clamp(40px, 6vw, 112px);
  margin-top: clamp(36px, 5vw, 72px);
}

.pd-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: 0 0 clamp(16px, 2vw, 24px);
  font-size: 16px;
  color: var(--ink-3);
}

.pd-title {
  max-width: 13em;
  margin: 0;
  font-size: clamp(44px, 1.2rem + 4.8vw, 108px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.pd-lead {
  max-width: 32em;
  margin: clamp(24px, 3vw, 36px) 0 0;
  font-size: clamp(19px, 1rem + 0.5vw, 24px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.pd-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px clamp(16px, 2vw, 32px);
  margin: clamp(32px, 4vw, 56px) 0 0;
}

.pd-facts div {
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.pd-facts dt {
  font-size: 16px;
  color: var(--ink-3);
}

.pd-facts dd {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

/* Блок покупки: тёмный остров в любой теме. Токены переопределены,
   поэтому кнопки внутри сами становятся светлыми на тёмном */
.pd-buy,
.pd-plan--featured {
  --bg: #0c0c0e;
  --ink: #f1f1f3;
  --ink-2: #9b9da6;
  --ink-3: #6b6d76;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #4f6af7;
  --on-accent: #ffffff;

  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] .pd-buy,
:root[data-theme="dark"] .pd-plan--featured {
  --bg: #141519;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.pd-buy {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 2.6vw, 36px);
  border-radius: 18px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* Жалюзи на подложке: под ценой светятся полосы, пятно света идёт
   за курсором, к кнопкам полосы гаснут (blinds.js). Без WebGL
   подложка просто тёмная */
.pd-buy__fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.pd-buy__fx.is-on { opacity: 1; }

.pd-buy > :not(.pd-buy__fx) {
  position: relative;
  z-index: 1;
}

.pd-buy__label {
  margin: 0;
  font-size: 16px;
  color: var(--ink-3);
}

.pd-buy__price {
  margin: 10px 0 0;
  font-size: clamp(44px, 1.6rem + 2.4vw, 72px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pd-from,
.pd-unit {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-2);
}

.pd-buy__note {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-2);
}

.pd-buy__actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.pd-buy__ask svg,
.pd-more__head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-buy__terms { margin: 24px 0 0; }

.pd-buy__terms div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.pd-buy__terms dt { color: var(--ink-3); }

.pd-buy__terms dd {
  margin: 0;
  text-align: right;
}

/* Галерея: большой скриншот и миниатюры под ним */
.pd-gallery { padding-bottom: clamp(56px, 7vw, 112px); }

.pd-gallery__main {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  touch-action: pan-y;
}

.pd-gallery__main img,
.pd-gallery__main video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Видео с кнопками: целиком, без обрезки, на тёмном фоне */
.pd-gallery__main video[controls] { object-fit: contain; background: #000; }

/* Миниатюра видео: первый кадр и значок воспроизведения */
.pd-thumb { position: relative; }

.pd-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pd-thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.6);
  color: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pd-thumb__play svg { width: 14px; height: 14px; margin-left: 2px; fill: currentColor; }

/* Новый кадр поверх старого: открывается шторкой (product.js) */
.pd-gallery__main .pd-gallery__layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  will-change: clip-path, transform;
}

/* Стрелки на кадре: видны при наведении, на телефоне всегда */
.pd-gallery__step {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s var(--ease), background-color 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.pd-gallery__step--prev { left: 16px; }
.pd-gallery__step--next { right: 16px; }

.pd-gallery__step svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-gallery__main:hover .pd-gallery__step,
.pd-gallery__step:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.pd-gallery__step:hover { background: var(--accent); }

.pd-gallery__step svg { transition: translate 0.35s var(--ease); }
.pd-gallery__step--prev:hover svg { translate: -2px 0; }
.pd-gallery__step--next:hover svg { translate: 2px 0; }
.pd-gallery__step:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Номер кадра в углу */
.pd-gallery__count {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(12, 12, 14, 0.55);
  color: #fff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (hover: none) {
  .pd-gallery__step {
    width: 44px;
    height: 44px;
    opacity: 1;
    transform: translateY(-50%);
  }
}

.pd-gallery__thumbs {
  display: flex;
  gap: 12px;
  /* Много миниатюр: ряд листается вбок сам, без полосы. Поля в 3px, чтобы
     рамку и фокус миниатюр не обрезало */
  margin: 9px -3px 0;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-gallery__thumbs::-webkit-scrollbar { display: none; }

.pd-thumb {
  width: clamp(88px, 10vw, 140px);
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.pd-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-thumb:hover { opacity: 0.85; }

.pd-thumb[aria-pressed="true"] {
  border-color: var(--ink);
  opacity: 1;
}

/* Разделы страницы: заголовок слева, коротко справа */
.pd-section {
  padding-block: clamp(56px, 7vw, 112px);
  border-top: 1px solid var(--line);
}

.pd-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 40px;
  margin-bottom: clamp(32px, 4vw, 64px);
}

.pd-head__title {
  margin: 0;
  font-size: clamp(32px, 1rem + 2.4vw, 60px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pd-head__lead {
  max-width: 26em;
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Что умеет: четыре плитки, номер крупно слева */
.pd-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(20px, 2.4vw, 40px);
  min-height: clamp(180px, 15vw, 230px);
  padding: clamp(24px, 3vw, 44px);
  border-radius: var(--radius);
  background: var(--surface);
}

.pd-feature__num {
  grid-row: span 2;
  font-size: clamp(48px, 2rem + 2vw, 80px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--meter-peak);
  font-variant-numeric: tabular-nums;
}

.pd-feature__title {
  margin: 0;
  font-size: clamp(22px, 1rem + 0.8vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.pd-feature__text {
  max-width: 28em;
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Тарифы: обычный в рамке, рекомендуемый на тёмном острове */
.pd-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}

.pd-plan {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
}

.pd-plan--featured { border-color: transparent; }

.pd-plan__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.pd-plan__name {
  margin: 0;
  font-size: clamp(22px, 1rem + 0.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pd-plan__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--ink-2);
}

.pd-plan__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pd-plan__price {
  margin: clamp(20px, 2.4vw, 32px) 0 0;
  font-size: clamp(40px, 1.6rem + 2vw, 64px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pd-plan__text {
  margin: 12px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
}

.pd-plan__list {
  margin: 28px 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: inc;
}

.pd-plan__list li {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  padding: 12px 0;
  border-top: 1px solid var(--line-strong);
  font-size: 17px;
  line-height: 1.45;
  counter-increment: inc;
}

.pd-plan__list li::before {
  content: counter(inc, decimal-leading-zero);
  font-size: 16px;
  line-height: 1.6;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pd-plan .btn { margin-top: auto; }

/* Плитки bento (product.js): сетка в 4 колонки, плитки 1×1, широкие 2×1, высокие 1×2
   и большие 2×2. Пустые места заполняют следующие плитки (dense). Цвет: обычная
   (как карточки сайта), синяя и тёмная. Картинка сверху, без текста на всю плитку */
.pd-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(clamp(200px, 17vw, 260px), auto);
  grid-auto-flow: dense;
  gap: clamp(10px, 1.2vw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.pd-tile--w { grid-column: span 2; }
.pd-tile--t { grid-row: span 2; }
.pd-tile--l { grid-column: span 2; grid-row: span 2; }

.pd-tile--accent { background: var(--accent); color: #fff; }
.pd-tile--dark { background: #0c0c0e; color: #f1f1f3; }

:root[data-theme="dark"] .pd-tile--dark {
  background: #050506;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pd-tile__media {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  overflow: hidden;
}

.pd-tile__media img,
.pd-tile__media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

@media (hover: hover) {
  .pd-tile:hover .pd-tile__media img,
  .pd-tile:hover .pd-tile__media video { transform: scale(1.03); }
}

.pd-tile__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(20px, 2vw, 28px);
}

/* Без картинки текст прижат книзу, а крупная цифра стоит сверху */
.pd-tile:not(.has-media) .pd-tile__body {
  flex: 1;
  justify-content: flex-end;
}

.pd-tile__stat {
  margin: 0 0 auto;
  padding-bottom: 16px;
  font-size: clamp(44px, 1rem + 3.4vw, 84px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.pd-tile--l .pd-tile__stat { font-size: clamp(60px, 1rem + 6vw, 128px); }

.pd-tile.has-media .pd-tile__stat {
  margin: 0;
  padding-bottom: 4px;
  font-size: clamp(36px, 1rem + 2vw, 56px);
}

.pd-tile__title {
  margin: 0;
  font-size: clamp(20px, 1rem + 0.45vw, 26px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pd-tile--l .pd-tile__title { font-size: clamp(24px, 1rem + 1.1vw, 36px); }

.pd-tile__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
}

.pd-tile--accent .pd-tile__text { color: rgba(255, 255, 255, 0.84); }
.pd-tile--dark .pd-tile__text { color: #a9abb3; }

@media (max-width: 1023px) {
  .pd-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .pd-bento {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  .pd-tile--w,
  .pd-tile--t,
  .pd-tile--l {
    grid-column: auto;
    grid-row: auto;
  }

  .pd-tile:not(.has-media) { min-height: 180px; }
  .pd-tile__media { flex: none; aspect-ratio: 16 / 10; }
  .pd-tile.is-bare .pd-tile__media { aspect-ratio: 4 / 3; }
}

/* Характеристики: пары «параметр, значение» между тонкими линиями, в две колонки */
.pd-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 5vw, 72px);
  margin: 0;
}

.pd-specs__row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding-block: 16px;
  border-top: 1px solid var(--line);
}

.pd-specs dt {
  font-size: 16px;
  color: var(--ink-3);
}

.pd-specs dd {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .pd-specs { grid-template-columns: minmax(0, 1fr); }
}

/* Ссылка на демо в блоке покупки: со стрелкой «наружу» */
.pd-buy__demo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Как проходит покупка: четыре шага между тонкими линиями */
.pd-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(20px, 2.4vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-step {
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.pd-step__num {
  display: block;
  font-size: 16px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pd-step__title {
  margin: clamp(28px, 4vw, 56px) 0 10px;
  font-size: clamp(22px, 1rem + 0.6vw, 28px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pd-step__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Вопросы: слева заголовок липнет к верху, справа раскрывающиеся ответы */
.pd-faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  align-items: start;
  gap: 32px clamp(40px, 6vw, 120px);
}

.pd-head--side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

.pd-faq__list { border-top: 1px solid var(--line-strong); }

.pd-qa { border-bottom: 1px solid var(--line-strong); }

.pd-qa__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  font-size: clamp(19px, 1rem + 0.4vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  list-style: none;
  cursor: pointer;
}

.pd-qa__q::-webkit-details-marker { display: none; }

.pd-qa__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 0.4s var(--ease), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.pd-qa__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.pd-qa__q:hover .pd-qa__icon { border-color: var(--ink); }

/* Наведение на вопрос: текст стоит на месте, подсказку даёт курсор
   (синий круг «Открыть» или «Скрыть», cursor.js), у плюса темнеет рамка */

.pd-qa[open] .pd-qa__icon {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  transform: rotate(45deg);
}

.pd-qa__a {
  max-width: 40em;
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
  animation: pd-qa-in 0.4s var(--ease);
}

@keyframes pd-qa-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Другие решения: те же карточки, что на витрине главной */
.pd-more {
  padding-block: clamp(56px, 7vw, 112px) clamp(80px, 10vw, 160px);
  border-top: 1px solid var(--line);
}

.pd-more__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(32px, 4vw, 56px);
}

/* Панель покупки снизу: тёмный островок с ценой и кнопкой.
   Появляется, когда блок покупки уехал вверх (product.js) */
.pd-bar {
  position: fixed;
  bottom: clamp(10px, 2vw, 20px);
  left: 50%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(calc(100% - 20px), 720px);
  padding: 10px 10px 10px 22px;
  border-radius: 16px;
  background: #0c0c0e;
  color: #f1f1f3;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 40px));
  transition: transform 0.5s var(--ease), opacity 0.3s ease, visibility 0s linear 0.5s;
}

:root[data-theme="dark"] .pd-bar {
  background: #1a1b1f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 40px -20px rgba(0, 0, 0, 0.8);
}

.pd-bar.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: transform 0.5s var(--ease), opacity 0.3s ease;
}

/* С открытым мобильным меню панель не мешает */
.no-scroll .pd-bar { visibility: hidden; }

.pd-bar__info {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.pd-bar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  color: #9b9da6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-bar__price {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pd-bar__price .pd-from,
.pd-bar__price .pd-unit {
  font-size: 16px;
  color: #9b9da6;
}

.pd-bar__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  background: #1838d6;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.pd-bar__btn:hover {
  background: #2d4ef5;
  color: #ffffff;
}

/* Пока видна панель, кнопка «Наверх» остаётся. На широком экране панель
   по центру и ей не мешает, на узком кнопка поднимается над панелью */
@media (max-width: 959px) {
  .has-buybar .to-top { bottom: calc(100px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .pd-buy__fx,
  .pd-gallery__main img,
  .pd-qa__icon,
  .pd-bar,
  .pd-bar.is-on { transition: none; }

  .pd-qa__a { animation: none; }
}

@media (max-width: 1023px) {
  .pd-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .pd-buy { max-width: 560px; }
  .pd-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .pd-faq { grid-template-columns: minmax(0, 1fr); }
  .pd-head--side { position: static; }
}

@media (max-width: 767px) {
  .pd-features,
  .pd-plans { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599px) {
  .pd-facts { grid-template-columns: minmax(0, 1fr); }

  .pd-facts div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
  }

  .pd-facts dd { margin: 0; }

  .pd-feature {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .pd-feature__num {
    grid-row: auto;
    margin-bottom: 20px;
  }

  .pd-steps { grid-template-columns: minmax(0, 1fr); }

  .pd-bar {
    gap: 12px;
    padding-left: 18px;
    bottom: 8px;
    width: calc(100% - 16px);
  }

  .pd-bar__title { display: none; }
}

/* ==========================================================================
   Политика конфиденциальности (privacy.html)
   ========================================================================== */

.pp { padding-top: var(--header-h); }

/* Полоса чтения по верхнему краю окна (privacy.js) */
.pp-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}

.pp-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Первый экран: как у страницы кейса, только без обложки */
.pp-hero { padding-block: clamp(32px, 5vw, 80px) clamp(40px, 5vw, 72px); }

.pp-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.pp-back:hover { color: var(--accent); }

.pp-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.pp-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  margin: clamp(36px, 5vw, 72px) 0 clamp(16px, 2vw, 24px);
  font-size: 16px;
  color: var(--ink-3);
}

.pp-kind {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
}

.pp-kind::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pp-title {
  margin: 0;
  font-size: clamp(44px, 1.2rem + 6vw, 128px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.pp-lead {
  max-width: 34em;
  margin: clamp(24px, 3vw, 40px) 0 0;
  font-size: clamp(19px, 1rem + 0.5vw, 24px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Коротко: три главных обещания крупно, на подложке */
.pp-brief { padding-bottom: clamp(56px, 7vw, 112px); }

.pp-brief__title {
  margin: 0 0 20px;
  font-size: clamp(20px, 1rem + 0.5vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pp-brief__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: brief;
}

.pp-brief__list li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 2.2vw, 32px);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: brief;
}

.pp-brief__list li::before {
  content: counter(brief, decimal-leading-zero);
  margin-bottom: clamp(20px, 3vw, 44px);
  font-size: clamp(44px, 1.8rem + 2vw, 72px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pp-brief__list b {
  font-size: clamp(20px, 1rem + 0.5vw, 25px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pp-brief__list span {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Текст: слева липкое содержание, справа разделы */
.pp-body {
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) minmax(0, 2.25fr);
  align-items: start;
  gap: 40px clamp(40px, 6vw, 120px);
  padding-bottom: clamp(64px, 8vw, 128px);
}

.pp-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.pp-toc__title {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--ink-3);
}

.pp-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.pp-toc__list li { counter-increment: toc; }

/* Пункт содержания: номер и название, у текущего раздела синяя точка */
.pp-toc__list a {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 8px 0 8px 18px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-2);
  transition: color 0.25s ease, translate 0.35s var(--ease);
}

.pp-toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.pp-toc__list a::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pp-toc__list a:hover { color: var(--ink); }

.pp-toc__list a.is-current { color: var(--ink); }
.pp-toc__list a.is-current::before { color: var(--accent); }
.pp-toc__list a.is-current::after { transform: none; }

.pp-section {
  padding-block: clamp(32px, 3.6vw, 52px);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.pp-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.pp-section h2 {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 20px;
  font-size: clamp(26px, 1rem + 1.4vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.pp-section h2 span {
  flex: none;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pp-section p {
  max-width: 42em;
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

.pp-section p b,
.pp-section li b {
  font-weight: 500;
  color: var(--ink);
}

/* Списки: вместо точек короткие синие черты */
.pp-section ul {
  max-width: 42em;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.pp-section ul li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
}

.pp-section ul li::before {
  content: "";
  position: absolute;
  top: calc(6px + 0.8em);
  left: 0;
  width: 12px;
  height: 1.5px;
  background: var(--accent);
}

/* Места, которые нужно заполнить своими данными */
.pp-fill {
  padding: 0 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--ink);
}

.pp-contacts {
  display: grid;
  gap: 0;
  max-width: 42em;
  margin: 0 0 28px;
}

.pp-contacts div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.pp-contacts div:last-child { border-bottom: 1px solid var(--line); }

.pp-contacts dt {
  font-size: 16px;
  color: var(--ink-3);
}

.pp-contacts dd {
  margin: 0;
  font-size: 18px;
}

@media (max-width: 899px) {
  .pp-brief__list { grid-template-columns: minmax(0, 1fr); }
  .pp-brief__list li::before { margin-bottom: 8px; }

  .pp-body { grid-template-columns: minmax(0, 1fr); }

  /* На узком экране содержание стоит перед текстом и не липнет */
  .pp-toc {
    position: static;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
  }
}

@media (max-width: 599px) {
  .pp-contacts div { grid-template-columns: 96px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .pp-toc__list a::after { transition: none; }
}

/* ==========================================================================
   Кнопка «Наверх»
   ========================================================================== */

/* Стеклянная плитка в стиле хэдера-острова */
.to-top {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 0 0 1px var(--glass-rim-c),
    0 12px 30px -14px var(--glass-shadow);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease),
    bottom 0.5s var(--ease),
    color 0.25s ease,
    visibility 0s linear 0.35s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease),
    bottom 0.5s var(--ease),
    color 0.25s ease;
}

/* При наведении плитка заливается синим, без сдвигов */
.to-top::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

@media (hover: hover) {
  .to-top:hover { color: var(--on-accent); }
  .to-top:hover::before { opacity: 1; }
}

.to-top svg {
  position: relative;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Открытое мобильное меню: кнопка не нужна */
.no-scroll .to-top {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 599px) {
  .to-top {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
}

/* ==========================================================================
   Футер: тёмный экран с жалюзи и логотипом
   ========================================================================== */

/* Футер тёмный в любой теме: на тёмном логотип в родных цветах, белый
   и синий. Токены переопределены внутри, всё содержимое берёт их.
   Футер выше пелены, которая гасит страницу (36), и ниже мобильного меню (40) */
.footer {
  --bg: #0c0c0e;
  --ink: #f1f1f3;
  --ink-2: #9b9da6;
  --ink-3: #6b6d76;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #4f6af7;
  --on-accent: #ffffff;
  --pad-x: clamp(20px, 4vw, 64px);
  position: relative;
  z-index: 37;
  color-scheme: dark;
}

/* На тёмной теме футер чуть светлее страницы, чтобы остров был виден,
   пока он раскрывается */
:root[data-theme="dark"] .footer { --bg: #141519; }

/* Панель на весь экран: сверху вступление и контакты, внизу логотип,
   между ними сцена для жалюзи. Хэдер над футером прячется,
   поэтому сверху обычный отступ, без запаса под остров.
   Пока футер поднимается, footer.js обрезает панель по бокам
   и скругляет углы (clip-path), к верху окна она во всю ширину */
.footer__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  padding: clamp(40px, 8vh, 96px) var(--pad-x) clamp(20px, 2.4vw, 36px);
}

.footer__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

/* Жалюзи во весь остров, под текстом. Холст проявляется, когда нарисован
   первый кадр: без WebGL футер остаётся спокойным тёмным экраном */
.footer__blinds {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.footer__blinds.is-on { opacity: 1; }

/* Свободное место между контактами и низом: здесь ходит пятно света
   жалюзи. Растягивается на всё, что осталось от высоты экрана */
.footer__stage {
  flex: 1 0 auto;
  min-height: clamp(150px, 26vh, 420px);
}

/* Пелена над страницей: пока футер поднимается, всё над ним гаснет.
   Прозрачность ставит footer.js, клики пелена пропускает */
.footer-veil {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: #0c0c0e;
  opacity: 0;
  pointer-events: none;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px clamp(32px, 5vw, 96px);
}

/* Заголовок в две строки, как надпись в логотипе: белая и синяя */
.footer__title {
  margin: 0;
  font-size: clamp(34px, 1.2rem + 2.4vw, 60px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.footer__title-accent { color: var(--accent); }

.footer__lead {
  max-width: 30em;
  margin: clamp(16px, 1.6vw, 24px) 0 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Контакты: крупные строки с тонкими линиями, как пункты мобильного меню.
   При наведении имя заливается синим слева направо, кружок со стрелкой
   заливается следом. Ничего не сдвигается */
.footer__contacts { border-top: 1px solid var(--line); }

.contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  padding: clamp(12px, 1.1vw, 16px) 0;
  border-bottom: 1px solid var(--line);
}

.contact__name {
  font-size: clamp(24px, 1rem + 0.7vw, 30px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  background: linear-gradient(90deg, var(--accent) 0 46%, var(--ink) 54% 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.75s var(--ease);
}

.contact__note {
  font-size: 16px;
  color: var(--ink-2);
  text-align: right;
}

/* Стикер с логотипом сервиса: как стикеры на папках (белая вырубка в SVG, тень),
   но стоят ровно. При наведении чуть приподнимается, при появлении футера
   проявляется по очереди */
.contact__sticker {
  display: block;
  width: clamp(46px, 4vw, 60px);
  filter: drop-shadow(0 3px 5px var(--sticker-shadow));
  transition: transform 0.5s cubic-bezier(0.34, 1.45, 0.6, 1);
}

.contact__sticker svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (hover: hover) {
  .contact:hover .contact__sticker { transform: translateY(-2px) scale(1.08); }
}

.reveal-ready .footer__contacts:not(.is-in) .contact__sticker {
  opacity: 0;
  transform: scale(0.7);
}

.reveal-ready .footer__contacts.is-in .contact__sticker {
  animation: contact-sticker-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s backwards;
}

@keyframes contact-sticker-in {
  from { opacity: 0; transform: scale(0.7); }
}

.reveal-ready .footer__contacts.is-in li:nth-child(2) .contact__sticker { animation-delay: 0.47s; }
.reveal-ready .footer__contacts.is-in li:nth-child(3) .contact__sticker { animation-delay: 0.59s; }

.contact__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.contact__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.contact:hover .contact__name,
.contact:focus-visible .contact__name { background-position: 0 0; }

.contact:hover .contact__arrow,
.contact:focus-visible .contact__arrow {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--on-accent);
}

/* Низ: логотип слева, справа навигация, под ней копирайт и «Наверх».
   Обе части стоят по нижнему краю */
.footer__base {
  display: grid;
  grid-template-columns: minmax(0, clamp(280px, 30vw, 460px)) auto;
  justify-content: space-between;
  align-items: end;
  gap: 24px 48px;
}

/* Справа от логотипа два ровных ряда одной ширины: меню, под линией
   копирайт слева, политика по центру, «Наверх» справа */
.footer__meta {
  display: grid;
  gap: 16px;
  width: min(620px, 100%);
  font-size: 16px;
  color: var(--ink-2);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.footer__copy { margin: 0; }

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px clamp(20px, 2.4vw, 36px);
}

.footer__nav a,
.footer__up {
  color: var(--ink);
  transition: color 0.2s ease;
}

.footer__policy {
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.footer__nav a:hover,
.footer__up:hover,
.footer__policy:hover { color: var(--accent); }

.footer__up {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer__up svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

/* ---------- Логотип ----------
   Части знака съезжаются к месту, буквы поднимаются из-под строк.
   Сдвиги ставит footer.js по прокрутке: к последнему пикселю страницы
   логотип собран. Без скрипта он сразу целый */
@property --lens {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.footer__brand {
  --logo-a: var(--ink);
  --logo-b: var(--accent);
  --lens: 0px;

  position: relative;
  display: block;
  border-radius: 6px;
  transition: --lens 0.55s var(--ease);
}

.footer__logo {
  display: block;
  width: 100%;
  height: auto;
  /* Части знака заезжают из-за краёв логотипа */
  overflow: hidden;
}

.footer__logo .logo-a { fill: var(--logo-a); }
.footer__logo .logo-b { fill: var(--logo-b); }

/* Блик проходит один раз, когда логотип встал на место.
   Маска повторяет контуры логотипа, как у прелоадера */
.footer__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 255, 255, 0.55) 50%, transparent 56%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-mask: url("../img/logo/logo-mask.svg") 0 0 / 100% 100% no-repeat;
  mask: url("../img/logo/logo-mask.svg") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

.footer__brand.is-assembled::after {
  animation: preloader-glint 1.2s cubic-bezier(0.45, 0, 0.2, 1) 0.1s both;
}

/* Линза: копия логотипа с белым и синим наоборот, видна только внутри
   круга под курсором. Круг тянется за мышью с небольшой задержкой.
   Копию создаёт footer.js, радиус растёт при наведении */
.footer__brand.is-lensing { --lens: clamp(44px, 4vw, 72px); }

.footer__logo--swap {
  --logo-a: var(--accent);
  --logo-b: var(--ink);

  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle var(--lens) at var(--lx, 50%) var(--ly, 50%), #000 calc(100% - 1px), transparent 100%);
  mask: radial-gradient(circle var(--lens) at var(--lx, 50%) var(--ly, 50%), #000 calc(100% - 1px), transparent 100%);
}

/* Тонкое кольцо по краю линзы: видно и там, где под ней нет букв */
.footer__lens {
  position: absolute;
  top: var(--ly, 50%);
  left: var(--lx, 50%);
  width: calc(var(--lens) * 2);
  height: calc(var(--lens) * 2);
  margin: calc(var(--lens) * -1) 0 0 calc(var(--lens) * -1);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.footer__brand.is-lensing .footer__lens { opacity: 1; }

/* У футера своя ссылка наверх, плавающая кнопка над ним не нужна */
.at-footer .to-top.is-visible {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease),
    visibility 0s linear 0.35s;
}

@media (max-width: 899px) {
  .footer__top { grid-template-columns: minmax(0, 1fr); }
}

/* Планшет и телефон: навигация сверху, логотип под ней */
@media (max-width: 767px) {
  .footer__base { grid-template-columns: minmax(0, 1fr); }

  .footer__meta {
    order: -1;
    width: 100%;
  }

  .footer__nav { justify-content: flex-start; }

  .footer__brand { max-width: 260px; }
}

@media (max-width: 599px) {
  /* Подпись уходит под имя, стрелка остаётся справа */
  .contact {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 14px;
  }

  .contact__sticker { grid-row: 1 / span 2; }

  .contact__note {
    grid-row: 2;
    grid-column: 2;
    text-align: left;
  }

  .contact__arrow {
    grid-row: 1 / span 2;
    grid-column: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer__brand { transition: none; }
  .footer__brand.is-assembled::after { animation: none; }
  .contact__name,
  .footer__blinds,
  .contact__sticker { transition: none; }

  .reveal-ready .footer__contacts.is-in .contact__sticker { animation: none; }

  .reveal-ready .footer__contacts:not(.is-in) .contact__sticker {
    opacity: 1;
    transform: none;
  }

  .footer-veil { display: none; }

  .header,
  .header.is-hidden,
  .header.is-away { transition: none; }
}

/* ==========================================================================
   Свой курсор (cursor.js): точка и кольцо с задержкой
   ========================================================================== */

/* Обычный курсор прячется, только когда свой включён (мышь, а не палец).
   В полях ввода остаётся текстовая каретка */
.has-cursor,
.has-cursor * { cursor: none !important; }

.has-cursor input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]),
.has-cursor textarea,
.has-cursor select,
.has-cursor [contenteditable="true"] { cursor: text !important; }

.cursor {
  --cursor-color: var(--ink);

  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor.is-on { opacity: 1; }

.cursor__dot,
.cursor__ring {
  position: fixed;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cursor-color);
  transition: opacity 0.2s ease, background-color 0.25s ease;
}

/* Кольцо: размер, скругление и заливка меняются плавно по состоянию,
   положение ставит cursor.js. Центр всегда под точкой */
.cursor__ring {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--cursor-color) 45%, transparent);
  border-radius: 50%;
  background: transparent;
  transition:
    width 0.4s var(--ease),
    height 0.4s var(--ease),
    border-radius 0.4s var(--ease),
    border-color 0.3s ease,
    background-color 0.3s ease,
    opacity 0.25s ease,
    scale 0.25s ease;
}

.cursor__label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #ffffff;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.25s ease, scale 0.4s var(--ease);
}

/* Ссылка: кольцо подрастает и чуть заливается, точки нет */
.cursor[data-mode="link"] .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: transparent;
  background: color-mix(in srgb, var(--cursor-color) 12%, transparent);
}

.cursor[data-mode="link"] .cursor__dot,
.cursor[data-mode="hug"] .cursor__dot,
.cursor[data-mode="label"] .cursor__dot { opacity: 0; }

/* Кнопка: кольцо обнимает её по форме (размер ставит cursor.js), плотная рамка
   и лёгкая заливка вокруг, кнопка тянется за мышью */
.cursor[data-mode="hug"] .cursor__ring {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--cursor-color) 80%, transparent);
  background: color-mix(in srgb, var(--cursor-color) 6%, transparent);
}

/* Плитки, статьи, товары: синий круг с подписью */
.cursor[data-mode="label"] .cursor__ring {
  width: 104px;
  height: 104px;
  border-color: transparent;
  background: #1838d6;
}

.cursor[data-mode="label"] .cursor__label {
  opacity: 1;
  scale: 1;
}

/* Карусель: по бокам круга стрелки, мягко качаются наружу: ленту можно листать */
.cursor__arrow {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  fill: none;
  stroke: var(--cursor-color);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.25s ease, translate 0.4s var(--ease);
}

.cursor__arrow--l { right: 100%; translate: 14px 0; }
.cursor__arrow--r { left: 100%; translate: -14px 0; }

.cursor.has-arrows .cursor__arrow { opacity: 1; }
.cursor.has-arrows .cursor__arrow--l { translate: -8px 0; animation: cursor-nudge-l 1.6s ease-in-out 0.4s infinite; }
.cursor.has-arrows .cursor__arrow--r { translate: 8px 0; animation: cursor-nudge-r 1.6s ease-in-out 0.4s infinite; }

@keyframes cursor-nudge-l {
  0%, 100% { translate: -8px 0; }
  50% { translate: -14px 0; }
}

@keyframes cursor-nudge-r {
  0%, 100% { translate: 8px 0; }
  50% { translate: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor.has-arrows .cursor__arrow--l,
  .cursor.has-arrows .cursor__arrow--r { animation: none; }
}

/* Поле ввода: свой курсор прячется. Свой эффект под мышью: только точка */
.cursor[data-mode="text"],
.cursor[data-mode="none"] { opacity: 0; }

/* Пункт меню: мягкая плашка под текстом, без рамки */
.cursor.is-soft[data-mode="hug"] .cursor__ring {
  border-color: transparent;
  background: color-mix(in srgb, var(--cursor-color) 9%, transparent);
}

.cursor[data-mode="dot"] .cursor__ring {
  opacity: 0;
  scale: 0.4;
}

/* Подпись у курсора заменяет бейдж «Подробнее» на плитке кейса */
.has-cursor .tile__more { display: none; }

/* Клик: от точки клика расходится тонкая волна и тает.
   Само кольцо при этом не сжимается */
/* Центр ставится отступами, а не transform: так волна растёт ровно
   из точки клика. Размер растёт быстро и мягко тормозит, а гаснет
   волна равномерно, чтобы её успели заметить */
.cursor__pulse {
  position: fixed;
  width: var(--pulse, 36px);
  height: var(--pulse, 36px);
  margin: calc(var(--pulse, 36px) / -2) 0 0 calc(var(--pulse, 36px) / -2);
  border: 1px solid color-mix(in srgb, var(--cursor-color) 70%, transparent);
  border-radius: 50%;
  pointer-events: none;
  animation:
    cursor-pulse-grow 0.75s var(--ease) forwards,
    cursor-pulse-fade 0.75s linear forwards;
}

@keyframes cursor-pulse-grow {
  from { scale: 0.6; }
  to { scale: 2; }
}

@keyframes cursor-pulse-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor__ring,
  .cursor__label { transition: none; }
}

/* ==========================================================================
   Прелоадер: логотип собирается по частям и улетает в хэдер
   ========================================================================== */

/* Виден только пока у страницы класс is-loading: его ставит скрипт в <head>,
   если в системе не просили обойтись без анимации */
.preloader { display: none; }

.is-loading .preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vh, 56px);
  color: var(--ink);
}

/* Фон отдельным слоем: на выходе он гаснет, а логотип ещё в полёте */
.preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

.preloader__logo {
  position: relative;
  width: min(600px, 78vw);
  /* Полёт в хэдер считается от левого верхнего угла */
  transform-origin: 0 0;
  transition: transform 1s cubic-bezier(0.7, 0, 0.2, 1);
}

.preloader__svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Блик: светлая полоса один раз проходит по собранному логотипу.
   Маска повторяет контуры логотипа, поэтому свет ложится только на буквы */
.preloader__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 255, 255, 0.7) 50%, transparent 56%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-mask: url("../img/logo/logo-mask.svg") 0 0 / 100% 100% no-repeat;
  mask: url("../img/logo/logo-mask.svg") 0 0 / 100% 100% no-repeat;
  animation: preloader-glint 1.1s cubic-bezier(0.45, 0, 0.2, 1) 2.05s both;
  pointer-events: none;
}

/* Знак: сначала стоит по центру, контур рисуется линией, потом заливается
   и отъезжает влево, освобождая место надписи */
.preloader__mark {
  transform: translateX(527px);
  animation: preloader-slide 0.55s cubic-bezier(0.65, 0, 0.25, 1) 0.85s forwards;
}

.preloader__shape {
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* pathLength="1" у контура: 1 это вся его длина */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    preloader-draw 0.75s cubic-bezier(0.65, 0, 0.35, 1) 0.1s forwards,
    preloader-fill 0.45s ease 0.6s forwards;
}

.preloader__shape--accent {
  color: var(--accent);
  animation-delay: 0.22s, 0.68s;
}

/* Надпись: буквы по очереди поднимаются из-под невидимой линии,
   как строки заголовка на странице. Стартуют, когда знак почти отъехал,
   иначе первая буква проглядывала бы в просвете буквы K */
.preloader__row--1 { --from: 170px; --start: 1.25s; --step: 0.045s; }
.preloader__row--2 { --from: 165px; --start: 1.35s; --step: 0.032s; color: var(--accent); }

.preloader__letter {
  fill: currentColor;
  transform: translateY(var(--from));
  animation: preloader-rise 0.62s var(--ease) calc(var(--start) + var(--i) * var(--step)) forwards;
}

/* Линия загрузки: заполняется по мере того, как грузятся шрифт и картинки */
.preloader__line {
  position: relative;
  width: clamp(120px, 12vw, 168px);
  height: 2px;
  overflow: hidden;
  background: var(--line);
  opacity: 0;
  animation: fade-in 0.6s ease 0.3s forwards;
}

.preloader__fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Выход: линия сворачивается, фон гаснет во второй половине полёта логотипа */
.preloader.is-leaving .preloader__line { animation: preloader-line-out 0.35s ease forwards; }

.preloader.is-leaving::before {
  opacity: 0;
  transition: opacity 0.45s ease 0.55s;
}

@keyframes preloader-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes preloader-fill {
  to { fill-opacity: 1; stroke-opacity: 0; }
}

@keyframes preloader-slide {
  to { transform: none; }
}

@keyframes preloader-rise {
  to { transform: none; }
}

@keyframes preloader-glint {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@keyframes preloader-line-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scaleX(0); }
}

/* ==========================================================================
   Интро-анимация
   ========================================================================== */

/* Проявляется содержимое хэдера, а не сам хэдер: анимация прозрачности
   на самом острове отрезала бы стеклу доступ к странице, и размытие пропало бы.
   Стекло в анимации не участвует, его показывает прокрутка */
.js .header__inner > :not(.logo) { opacity: 0; }
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .line > span { transform: translateY(110%); }

/* Логотип не проявляется: в него прилетает логотип из прелоадера */
.is-loading .logo { visibility: hidden; }

.is-ready .header__inner > :not(.logo) { animation: fade-in 0.8s ease both; }
.is-ready .reveal { animation: reveal 1s var(--ease) var(--d, 0ms) both; }
.is-ready .line > span { animation: rise 1.1s var(--ease) var(--d, 0ms) both; }

/* Появление при прокрутке. Класс reveal-ready ставит main.js,
   поэтому без скрипта всё сразу видно */
.reveal-ready [data-reveal] {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}

.reveal-ready [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(28px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { transform: translateY(110%); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .header__inner > :not(.logo),
  .js .reveal,
  .js .line > span {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .preloader { display: none !important; }

  .header,
  .header__inner,
  .focus-veil,
  .menu,
  .menu__link,
  .to-top,
  .burger,
  .burger span,
  .carousel__reel,
  .theme-toggle svg { transition: none; }

  .carousel__swap,
  .hero::before,
  .dir__panel.is-open .dir__card > *,
  .folder__front::after { animation: none !important; }

  .reveal-ready [data-reveal]:not(.is-in) { transform: none; }

  .dir__arrow,
  .dir__arrow::before,
  .dir__arrow::after,
  .dir__card > *,
  .dir__panel.is-open .dir__card > * { transition: none; transform: none; }

  /* Папки открываются сразу, без движения: положение карточек сохраняется */
  .folder__back,
  .folder__front,
  .folder__card { transition: none; }

  .folder.is-sealed .folder__stage { animation: none; }

  .tile__media img { transition: none; }

  .tile:hover .tile__media img { transform: none; }

  /* Эквалайзер появляется сразу, без зажигания делений */
  .stats__head,
  .stat__bar i,
  .stat__value,
  .stat__meta {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Окно заявки «Обсудить проект» (partials/site/lead-form.php, js/lead-form.js)
   ========================================================================== */

/* Кнопка в футере под текстом про задачу */
.footer__cta { margin-top: clamp(24px, 2.4vw, 32px); }

/* Окно заявки по шагам на весь экран (partials/site/lead-form.php, js/lead-form.js).
   Сверху прогресс и счётчик, по центру один вопрос крупно, справа внизу контурный
   номер шага, слева внизу строка ответов. Шаг появляется: вопрос выезжает из-под
   маски по словам, ответы поднимаются по очереди (--i); назад шаг едет с другой стороны */
.lead {
  --lead-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lead-pad: clamp(16px, 4vw, 56px);

  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lead.is-open {
  opacity: 1;
  transition-duration: 0.45s;
}

.lead::backdrop { background: transparent; }

/* Свой курсор сайта остаётся под окном: внутри окна обычный */
.has-cursor .lead,
.has-cursor .lead * { cursor: auto !important; }

.has-cursor .lead a,
.has-cursor .lead button,
.has-cursor .lead label,
.has-cursor .lead input[type="radio"],
.has-cursor .lead input[type="checkbox"],
.has-cursor .lead input[type="range"] { cursor: pointer !important; }

.has-cursor .lead input[type="text"],
.has-cursor .lead textarea { cursor: text !important; }

/* Крупный контурный номер шага: фон, к нему ничего не прикасается */
.lead__bignum {
  position: fixed;
  right: calc(var(--lead-pad) - 0.06em);
  bottom: -0.14em;
  z-index: 0;
  font-size: clamp(200px, 30vw, 520px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  pointer-events: none;
  user-select: none;
}

.lead__bignum.is-enter { animation: lead-num 0.9s var(--lead-ease) both; }

@keyframes lead-num {
  from { opacity: 0; transform: translateY(12%); }
  to { opacity: 1; transform: none; }
}

/* Верхняя полоса: название, прогресс из четырёх делений, счётчик, крестик */
.lead__top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  padding: clamp(16px, 2.4vw, 28px) var(--lead-pad);
  background: linear-gradient(var(--bg) 70%, transparent);
}

.lead__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.lead__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.lead__progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}

.lead__progress i {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.lead__progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--lead-ease);
}

.lead[data-pos="1"] .lead__progress i:nth-child(-n + 1)::after,
.lead[data-pos="2"] .lead__progress i:nth-child(-n + 2)::after,
.lead[data-pos="3"] .lead__progress i:nth-child(-n + 3)::after,
.lead[data-pos="4"] .lead__progress i:nth-child(-n + 4)::after,
.lead.is-done .lead__progress i::after { transform: none; }

/* Покупка: два шага, два деления */
.lead[data-total="2"] .lead__progress { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 240px; }
.lead[data-total="2"] .lead__progress i:nth-child(n + 3) { display: none; }

/* Заголовки и подсказки для обычной заявки и для покупки */
.lead:not(.is-buy) .lead__only-buy,
.lead.is-buy .lead__only-lead { display: none !important; }

/* Карточка покупки над шагом: что покупают, тариф, цена */
.lead__buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 24px;
  margin-bottom: clamp(24px, 4.4vh, 44px);
  padding: 18px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  animation: lead-up 0.6s var(--lead-ease) both;
}

.lead__buy[hidden] { display: none; }

/* С превью решения: картинка слева на всю высоту карточки */
.lead__buy.has-img { grid-template-columns: auto minmax(0, 1fr) auto; }

.lead__buy-img {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 88px;
  height: 66px;
  margin-right: 6px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.lead__buy-img[hidden] { display: none; }

.lead__buy.has-img .lead__buy-label,
.lead__buy.has-img .lead__buy-title,
.lead__buy.has-img .lead__buy-plan { grid-column: 2; }

.lead__buy.has-img .lead__buy-price { grid-column: 3; }

.lead__buy-label {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-3);
}

.lead__buy-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.lead__buy-title {
  grid-column: 1;
  font-size: clamp(19px, 1rem + 0.5vw, 23px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.lead__buy-plan {
  grid-column: 1;
  font-size: 15px;
  color: var(--ink-2);
}

.lead__buy-plan:empty { display: none; }

.lead__buy-price {
  grid-column: 2;
  grid-row: 1 / span 3;
  font-size: clamp(22px, 1rem + 1vw, 30px);
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

@media (max-width: 599px) {
  .lead__buy { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .lead__buy-price { grid-column: 1; grid-row: auto; margin-top: 6px; font-size: 22px; }
  .lead__buy.has-img { grid-template-columns: auto minmax(0, 1fr); }
  .lead__buy.has-img .lead__buy-price { grid-column: 2; }
  .lead__buy-img { grid-row: 1 / span 4; width: 72px; height: 54px; }
}

.lead__count {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.lead__count b {
  font-weight: 500;
  color: var(--ink);
}

.lead__close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  transition: transform 0.4s var(--lead-ease), border-color 0.2s ease;
}

.lead__close:hover {
  border-color: var(--ink);
  transform: rotate(90deg);
}

.lead__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Форма: одна колонка, шаг по центру по вертикали */
.lead__form {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: min(900px, 100% - var(--lead-pad) * 2);
  min-height: calc(100% - 104px);
  margin: 0 auto;
  padding: clamp(24px, 6vh, 72px) 0 clamp(96px, 14vh, 140px);
}

.lead__form[hidden] { display: none; }

.lead__step { min-width: 0; }

.lead__step.is-enter { animation: lead-step-in 0.6s var(--lead-ease) both; }
.lead__step.is-enter[data-dir="back"] { animation-name: lead-step-back; }

@keyframes lead-step-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

@keyframes lead-step-back {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: none; }
}

/* Не прошли проверку: шаг вздрагивает */
.lead__step.is-shake { animation: lead-shake 0.42s ease both; }

@keyframes lead-shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.lead__q {
  margin: 0 0 18px;
  font-size: clamp(44px, 1.2rem + 4.8vw, 104px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.lead__q label { cursor: inherit; }

.lead__mask {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  vertical-align: bottom;
}

.lead__mask > span { display: inline-block; }

.lead__step.is-enter .lead__mask > span {
  animation: lead-word 0.85s var(--lead-ease) both;
  animation-delay: calc(0.05s + var(--w, 0) * 0.06s);
}

@keyframes lead-word {
  from { transform: translateY(105%); }
  to { transform: none; }
}

.lead__hint {
  max-width: 34em;
  margin: 0 0 clamp(28px, 5vh, 48px);
  font-size: clamp(17px, 0.9rem + 0.3vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
}

.lead__step.is-enter .lead__in {
  animation: lead-up 0.7s var(--lead-ease) both;
  animation-delay: calc(0.18s + var(--i, 0) * 0.05s);
}

@keyframes lead-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Шаг 1: карточки направлений. Номер сверху, название снизу, стрелка проявляется */
.lead__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lead__card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: space-between;
  gap: 28px;
  min-height: 132px;
  padding: 18px 20px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.4s var(--lead-ease);
}

.lead__card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

.lead__card-num {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: color 0.3s ease;
}

.lead__card-name {
  align-self: end;
  max-width: 13em;
  font-size: clamp(18px, 0.9rem + 0.5vw, 21px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lead__card-go {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  transform: scale(0.6) rotate(-45deg);
  transition: opacity 0.25s ease, transform 0.45s var(--lead-ease), background-color 0.3s ease, color 0.3s ease;
}

.lead__card-go svg,
.lead__next svg,
.lead__back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead__card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.lead__card:hover .lead__card-go {
  opacity: 1;
  transform: none;
}

.lead__card:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.lead__card:has(input:checked) .lead__card-num { color: color-mix(in srgb, var(--bg) 60%, transparent); }

.lead__card:has(input:checked) .lead__card-go {
  background: var(--accent);
  color: #fff;
  opacity: 1;
  transform: none;
}

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

/* Шаг 2: большое поле и подсказки-фразы */
.lead__input {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 17px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: clamp(18px, 0.95rem + 0.3vw, 20px);
  line-height: 1.45;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.lead__input::placeholder { color: var(--ink-3); }
.lead__input:hover { border-color: var(--ink-3); }

.lead__input:focus {
  border-color: var(--ink);
  background: var(--bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 7%, transparent);
}

.lead__input--area {
  min-height: 168px;
  overflow: hidden;
  resize: none;
}

.lead__input[aria-invalid="true"] { border-color: var(--danger); }

.lead__ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.lead__idea {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.lead__idea:hover {
  border-color: var(--ink);
  border-style: solid;
  color: var(--ink);
}

.lead__idea.is-used {
  border-style: solid;
  border-color: transparent;
  background: var(--surface);
  color: var(--ink-3);
}

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

/* Шаг 3: сумма огромными цифрами, ползунок под ней */
.lead__budget-value {
  display: block;
  margin-bottom: clamp(20px, 4vh, 36px);
  font-size: clamp(52px, 1.6rem + 6vw, 136px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: color 0.3s ease;
}

.lead__budget-value.is-set { color: var(--ink); }

.lead__range {
  --p: 0%;

  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}

.lead__range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--line-strong) var(--p));
}

.lead__range::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--line-strong);
}

.lead__range::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--ink);
}

.lead__range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -12px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 6px var(--bg);
  -webkit-appearance: none;
  transition: transform 0.25s var(--lead-ease);
}

.lead__range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 6px var(--bg);
}

.lead__range:hover::-webkit-slider-thumb,
.lead__range:active::-webkit-slider-thumb { transform: scale(1.15); }

.lead__range:focus-visible { outline: none; }
.lead__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--accent); }
.lead__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--accent); }

/* Центр бегунка ходит от 14px до ширины минус 14px: подписи по той же шкале */
.lead__ticks {
  position: relative;
  height: 20px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-3);
}

.lead__ticks span {
  position: absolute;
  top: 0;
  left: calc(14px + (100% - 28px) * var(--at));
  white-space: nowrap;
  transform: translateX(-50%);
}

.lead__ticks span:first-child { left: 0; transform: none; }
.lead__ticks span:last-child { left: auto; right: 0; transform: none; }

/* Шаг 4: контакты */
.lead__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.lead__label {
  display: block;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
}

.lead__consent { margin-top: 22px; }

.lead__check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  max-width: 34em;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
}

.lead__check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.lead__check a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.lead__check a:hover { text-decoration-color: currentColor; }

.lead__error {
  display: none;
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--danger);
}

.lead__error.is-on { display: block; }

.lead__trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Навигация: назад слева, подсказка про Enter и кнопка дальше справа */
.lead__nav {
  display: flex;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(32px, 6vh, 56px);
}

.lead__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.lead__back:hover { border-color: var(--ink); }
.lead__back[hidden] { display: none; }

.lead__status {
  flex: 1;
  margin: 0;
  font-size: 15px;
  color: var(--danger);
}

.lead__key {
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-3);
  white-space: nowrap;
}

.lead__status:not(:empty) + .lead__key { margin-left: 0; }

.lead__next {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: none;
  height: 64px;
  padding: 0 10px 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.2s ease;
}

.lead__next svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: var(--bg);
  stroke: var(--ink);
  transition: transform 0.45s var(--lead-ease), background-color 0.25s ease, stroke 0.25s ease;
}

.lead__next:hover,
.lead__next.is-final { background: var(--accent); color: #fff; }

.lead__next:hover svg,
.lead__next.is-final svg { background: #fff; stroke: var(--accent); }

.lead__next:hover svg { transform: translateX(4px); }

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

.lead__next.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

/* Строка ответов слева внизу: нажатие возвращает к шагу */
.lead__summary {
  position: fixed;
  bottom: clamp(16px, 3vh, 28px);
  left: var(--lead-pad);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(640px, 60vw);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead__summary button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  min-height: 36px;
  padding: 6px 14px 6px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: lead-up 0.5s var(--lead-ease) both;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lead__summary button.is-kept { animation: none; }

.lead__summary button span {
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.lead__summary button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* После отправки: шаги уходят, по центру окна галочка и текст */
.lead.is-done .lead__bignum,
.lead.is-done .lead__count { visibility: hidden; }

.lead__done {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  min-height: calc(100% - 104px);
  padding: 48px 20px 96px;
  text-align: center;
  animation: lead-up 0.7s var(--lead-ease) both;
}

.lead__done[hidden] { display: none; }
.lead__done:focus { outline: none; }

.lead__done-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--accent);
  animation: lead-pop 0.6s var(--lead-ease) both;
}

.lead__done-mark svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  animation: lead-draw 0.5s 0.25s ease both;
}

.lead__done-title {
  margin: 0;
  font-size: clamp(40px, 1rem + 4vw, 80px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.lead__done-text {
  max-width: 28em;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
}

.lead__done-back {
  height: 56px;
  margin-top: 14px;
  padding: 0 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.lead__done-back:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

@keyframes lead-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

@keyframes lead-draw {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

/* На сенсорных экранах про Enter не пишем */
@media (hover: none) {
  .lead__key { display: none; }
}

@media (max-width: 899px) {
  .lead__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Телефон: карточки строками, навигация прилипает к низу, строки ответов нет */
@media (max-width: 599px) {
  .lead__top { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lead__progress { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .lead__brand { font-size: 15px; }

  .lead__form {
    align-content: start;
    min-height: 0;
    padding: 20px 0 24px;
  }

  .lead__cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }

  .lead__card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: none;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 12px 56px 12px 16px;
  }

  .lead__card-name { align-self: center; }
  .lead__card-go { top: 50%; margin-top: -18px; }
  .lead__card:hover { transform: none; }

  .lead__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .lead__nav {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 28px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, var(--bg) 30%);
  }

  .lead__next { margin-left: auto; height: 58px; padding-left: 24px; }
  .lead__back { height: 52px; }
  .lead__back span { display: none; }
  .lead__status { order: -1; flex-basis: 100%; }
  .lead__nav { flex-wrap: wrap; }

  .lead__summary { display: none; }
  .lead__bignum { font-size: 52vw; opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .lead,
  .lead__close,
  .lead__card,
  .lead__card-go,
  .lead__next svg,
  .lead__progress i::after { transition: none; }

  .lead__step.is-enter,
  .lead__step.is-enter .lead__in,
  .lead__step.is-enter .lead__mask > span,
  .lead__step.is-shake,
  .lead__bignum.is-enter,
  .lead__summary button,
  .lead__done,
  .lead__done-mark,
  .lead__done-mark svg { animation: none; }
}

/* Напоминание хозяину, что включён режим обслуживания (layouts/site.php) */
.mnt-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 300;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.mnt-bar a {
  margin-left: 8px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Свой блок решения (лендинг из админки) в изолированной рамке, product.js.
   Высоту ставит скрипт по сообщению из рамки */
.pd-rich { margin-block: clamp(40px, 6vw, 88px); }

.pd-rich__frame {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.pd-rich--wide .pd-rich__frame { border-radius: 0; }

/* Свой блок прямо в странице: его стили внутри @scope (product.js) */
.pd-rich__root { position: relative; }

/* Мышь над рамкой своего блока: страница её не видит, свой курсор прячется */
.is-cursor-off .cursor { opacity: 0 !important; }

/* Текст статьи из админки: лишняя пустая строка даёт отступ, ссылки и выделение */
.ar-gap {
  height: 1.1em;
  margin: 0;
}

.ar-p a,
.ar-list a,
.ar-note a,
.ar-quote a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.ar-p a:hover,
.ar-list a:hover,
.ar-note a:hover,
.ar-quote a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.ar-p b,
.ar-list b,
.ar-note b { font-weight: 600; }

/* Картинка в статье: размер и положение из админки. Слева и справа текст обтекает
   картинку, на телефоне все встают по центру */
.ar-image--s { width: min(40%, 320px); }
.ar-image--m { width: 64%; }

.ar-image--s.ar-image--center,
.ar-image--m.ar-image--center { margin-inline: auto; }

@media (min-width: 700px) {
  .ar-image--left {
    float: left;
    margin: 0.35em 1.6em 1em 0;
  }

  .ar-image--right {
    float: right;
    margin: 0.35em 0 1em 1.6em;
  }
}

/* После обтекания разделы, цитаты, цифры и большие картинки начинаются с новой строки */
.ar-h,
.ar-quote,
.ar-fact,
.ar-note,
.ar-image--l,
.ar-image--center { clear: both; }

.ar-content::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 699px) {
  .ar-image--s { width: 70%; margin-inline: auto; }
  .ar-image--m { width: 100%; }
}
