/* ==========================================================================
   xCubes — единый стиль сайта (редизайн 2026).
   Тёмная тема, электрический сине-фиолетовый акцент, Unbounded + Manrope.

   Разделы:
     1. Токены          6. Главная            11. Решение
     2. База            7. 3D-кубик            12. Гайды (prose)
     3. Шапка / меню    8. Страница ввода      13. Футер
     4. Кнопки, чипы    9. «Решаю…»            14. Адаптив
     5. Реклама        10. «Решение готово»    15. Reduced motion
   ========================================================================== */

/* ---------- 1. Токены ---------------------------------------------------- */
:root {
  --bg: #050507;
  --bg-2: #08080d;
  --surface: #0c0c14;
  --surface-2: #11111c;
  --surface-3: #181826;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --line-3: rgba(255, 255, 255, .24);
  --fg: #f4f4f8;
  --fg-2: #a7a7ba;
  --fg-3: #6f6f86;

  --accent: #7b6dff;
  --accent-2: #a9a1ff;
  --accent-3: #3a2bff;
  --glow: rgba(90, 72, 255, .5);
  --glow-2: rgba(90, 72, 255, .22);

  --ok: #4ade80;
  --danger: #ff6b6b;
  --warn: #ffc857;

  /* Цвета наклеек */
  --c-W: #f4f4f6;
  --c-Y: #ffd31a;
  --c-G: #1fbf5b;
  --c-B: #2a6af0;
  --c-R: #ee3b3b;
  --c-O: #ff8a1f;
  --c-empty: #1c1c2b;

  /* Совместимость: эти имена используют inline-стили в JS (solution.js и др.) */
  --fg-mute: var(--fg-2);
  --border: var(--line-2);
  --bg-card: var(--surface);
  --bg-card-2: var(--surface-2);

  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --wrap: 1240px;
  --gut: 24px;
  --hdr-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. База ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
/* Свечения кубика выходят за край экрана. overflow-x на body телефоны
   не всегда соблюдают (страницу можно сдвинуть пальцем), поэтому режем
   ещё и на <main>; clip, а не hidden — sticky внутри продолжает работать. */
main { overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(123, 109, 255, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 0; }
.ico { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 999px;
  background: #fff; color: #000; font-weight: 700; transition: top .2s;
}
.skip:focus { top: 12px; }
main { display: block; }

.kicker {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-2);
}
.h1, .h2 {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: -.01em; line-height: 1.08;
}
.h1 { font-size: clamp(28px, 4.2vw, 48px); }
.h2 { font-size: clamp(24px, 3vw, 38px); margin-top: 12px; }
.grad {
  background: linear-gradient(95deg, #fff 0%, var(--accent-2) 40%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
}
.panel__t { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.panel__d { color: var(--fg-2); margin-top: 6px; font-size: 15px; }
.panel__d b { color: var(--fg); font-weight: 600; }

/* Появление блоков при прокрутке (xc.js). Без JS всё видно сразу. */
.js .rv { opacity: 0; transform: translateY(18px); }
.js .rv.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- 3. Шапка / меню --------------------------------------------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(5, 5, 7, .72);
  -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.hdr.is-scrolled { border-bottom-color: var(--line); background: rgba(5, 5, 7, .86); }
.hdr__in { display: flex; align-items: center; gap: 32px; height: var(--hdr-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .logo { filter: drop-shadow(0 0 14px rgba(123, 109, 255, .45)); }
.brand__name { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__a {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--fg-2); background: none; border: 0; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav__a:hover, .nav__a[aria-current], .nav__dd:focus-within .nav__ddbtn { color: var(--fg); background: rgba(255, 255, 255, .05); }
.nav__dd { position: relative; }
.nav__ddbtn .ico { transition: transform .2s; }
.nav__panel {
  position: absolute; top: calc(100% + 10px); left: -8px; min-width: 260px; padding: 8px;
  background: rgba(14, 14, 22, .96); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .4);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility 0s .18s;
}
.nav__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav__dd:hover .nav__panel, .nav__dd:focus-within .nav__panel, .nav__dd.is-open .nav__panel {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.nav__dd:hover .nav__ddbtn .ico, .nav__dd.is-open .nav__ddbtn .ico { transform: rotate(180deg); }
.nav__panel a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--fg-2);
}
.nav__panel a:hover, .nav__panel a[aria-current] { background: rgba(255, 255, 255, .05); color: var(--fg); }
.nav__tag {
  display: inline-grid; place-items: center; min-width: 44px; height: 26px; padding: 0 6px; border-radius: 8px;
  font-size: 11px; color: var(--accent-2); background: rgba(123, 109, 255, .12); border: 1px solid rgba(123, 109, 255, .25);
}

.hdr__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* Выбор языка: кнопка «🌐 EN ▾» + список (раскрытие — как у .nav__dd). */
.lang-dd__btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 11px;
  border: 1px solid var(--line-2); border-radius: 999px; background: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--fg-2); transition: color .15s, border-color .15s, background .15s;
}
.lang-dd__btn:hover, .lang-dd.is-open .lang-dd__btn { color: var(--fg); border-color: var(--line-3); }
.lang-dd__chev { transition: transform .2s; }
.lang-dd:hover .lang-dd__chev, .lang-dd.is-open .lang-dd__chev { transform: rotate(180deg); }
.nav__panel.lang-dd__panel { left: auto; right: 0; min-width: 200px; }
.lang-dd__panel a[aria-current] .nav__tag { background: var(--fg); color: #000; border-color: var(--fg); }
.burger {
  display: none; position: relative; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line-2); background: none; cursor: pointer;
}
.burger span {
  position: absolute; left: 12px; right: 12px; height: 1.6px; border-radius: 2px; background: var(--fg);
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.burger span:first-child { top: 16px; }
.burger span:last-child { top: 24px; }
.burger[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* backdrop-filter у .hdr делает шапку контейнером для position:fixed,
   поэтому меню позиционируем абсолютно от низа шапки. */
.mnav {
  position: absolute; left: 0; right: 0; top: 100%; height: calc(100vh - var(--hdr-h));
  height: calc(100dvh - var(--hdr-h)); z-index: 59; overflow-y: auto; overscroll-behavior: contain;
  background: #060609;
  border-top: 1px solid var(--line);
  animation: mnavIn .25s var(--ease);
}
.mnav[hidden] { display: none; }
@keyframes mnavIn { from { opacity: 0; transform: translateY(-8px); } }
.mnav__in { padding-top: 20px; padding-bottom: 40px; }
.mnav__h {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-3); margin: 18px 0 12px;
}
.mnav__sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mnav__sizes .chip { justify-content: center; height: 44px; }
.mnav__list { list-style: none; margin: 0; padding: 0; }
.mnav__list a {
  display: flex; align-items: center; min-height: 52px; font-size: 17px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
html.menu-open { overflow: hidden; }

/* Полоса размеров на страницах инструмента */
.sizebar { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.sizebar__in {
  display: flex; gap: 6px; padding-top: 10px; padding-bottom: 10px; overflow-x: auto;
  scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.sizebar__in::-webkit-scrollbar { display: none; }

/* ---------- 4. Кнопки, чипы, бейджи -------------------------------------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--f-body); font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.1;
  cursor: pointer; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), background .2s, color .2s, border-color .2s, box-shadow .25s, opacity .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn--primary { background: #fff; color: #07070b; }
.btn--primary:hover:not(:disabled) { box-shadow: 0 10px 40px -6px rgba(169, 161, 255, .55); }
.btn--primary:disabled { background: var(--surface-3); color: var(--fg-3); cursor: not-allowed; }
.btn--line { background: transparent; color: var(--fg); border-color: rgba(255, 255, 255, .55); }
.btn--line:hover { background: rgba(255, 255, 255, .06); border-color: #fff; }
.btn--ghost { background: var(--surface-2); color: var(--fg); border-color: var(--line-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-3); }
.btn--ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn--lg {
  --h: 58px; padding: 0 34px; font-family: var(--f-display); font-weight: 600; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase;
}
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; flex: none; height: 36px; padding: 0 14px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 13px; color: var(--fg-2); border: 1px solid var(--line-2);
  transition: color .15s, background .15s, border-color .15s;
}
.chip:hover { color: var(--fg); border-color: var(--line-3); }
.chip.is-on { background: #fff; color: #000; border-color: #fff; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-2); border: 1px solid var(--line-2);
}
.badge--hot { background: #fff; color: #000; border-color: #fff; }

.kicker-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2);
}
.kicker-chip i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--fg-3); list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-3); }
.crumbs a { color: var(--fg-2); }
.crumbs a:hover { color: var(--fg); }

/* ---------- 5. Реклама --------------------------------------------------- */
.ad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 24px auto; }
.ad__lbl { font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); }
.ad__unit { display: inline-block; max-width: 100%; }
.ad--lb .ad__unit { width: 320px; height: 100px; }
.ad--rect .ad__unit { width: 300px; height: 250px; }
.ad--lg .ad__unit { width: 300px; height: 250px; }
@media (min-width: 400px) { .ad--lg .ad__unit { width: 336px; height: 280px; } }
@media (min-width: 768px) { .ad--lb .ad__unit { width: 728px; height: 90px; } }
.ad--preview .ad__unit {
  display: grid; place-items: center; border-radius: 14px; border: 1px dashed var(--line-2);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 10px, transparent 10px 20px);
  font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); text-align: center;
}

/* ---------- 6. Главная --------------------------------------------------- */
.page-home .ad { margin: 20px auto 0; }
.hero { position: relative; padding: 48px 0 72px; }
.hero::before {
  content: ""; position: absolute; z-index: -1; top: -260px; right: -10%; width: 980px; height: 980px;
  background: radial-gradient(closest-side, rgba(60, 40, 255, .26), transparent 72%); pointer-events: none;
}
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero__h1 {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: -.015em;
  font-size: clamp(30px, 4.1vw, 54px); line-height: 1.07; margin: 26px 0 24px;
}
.hero__line { display: block; }
.hero__lede { font-size: 18px; color: var(--fg-2); max-width: 520px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__visual { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero__hint {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--fg-3);
  transition: opacity .5s;
}
.hero__hint.is-gone { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero__text > * { animation: rise .8s var(--ease) both; }
  .hero__text > :nth-child(2) { animation-delay: .06s; }
  .hero__text > :nth-child(3) { animation-delay: .12s; }
  .hero__text > :nth-child(4) { animation-delay: .18s; }
  .hero__visual { animation: fadeIn 1.2s var(--ease) both .1s; }
}
@keyframes rise { from { transform: translateY(14px); } }
@keyframes fadeIn { from { opacity: 0; transform: scale(.96); } }

.sec { padding: 72px 0; }
.sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.sec__sub { color: var(--fg-2); margin-top: 10px; }
.sec__meta { color: var(--fg-3); font-size: 13px; }

.sizes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.size {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 20px; height: 100%; padding: 20px;
  border-radius: var(--r); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.size::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -40px; height: 56px; border-radius: 999px;
  background: linear-gradient(180deg, #3a2bff, #120a7a); filter: blur(20px); opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.size:hover { border-color: rgba(169, 161, 255, .5); transform: translateY(-4px); box-shadow: 0 22px 50px -24px var(--glow); }
.size:hover::after { opacity: .85; }
.size--hot { border-color: rgba(169, 161, 255, .28); }
.size__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.size__name { font-family: var(--f-display); font-weight: 600; font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.size__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); }
.size__go {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2);
  color: var(--fg); transition: background .2s, color .2s, border-color .2s;
}
.size:hover .size__go { background: #fff; color: #000; border-color: #fff; }

/* Мини-грань: один элемент, сетка — градиентами */
.fp {
  --gw: 1.5px;
  position: relative; display: block; width: 60px; height: 60px; padding: 3px; border-radius: 11px;
  background: #000; box-shadow: 0 0 0 1px var(--line);
}
.fp::before {
  content: ""; position: absolute; inset: 3px; border-radius: 8px;
  background-color: var(--fc);
  background-image: linear-gradient(90deg, #000 var(--gw), transparent var(--gw)), linear-gradient(#000 var(--gw), transparent var(--gw));
  background-size: calc(100% / var(--n)) calc(100% / var(--n));
  background-position: calc(var(--gw) * -.5) calc(var(--gw) * -.5);
}
.fp[style*="--n:1"]::before { --gw: 1px; }

/* «Как это работает»: прилипающий экран со сборкой кубика */
.how { position: relative; }
.js .how { height: 320vh; }
.how__sticky { padding: 72px 0; }
.js .how__sticky {
  position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h)); min-height: 560px;
  display: flex; flex-direction: column; justify-content: center; padding: 24px 0; overflow: hidden;
}
.how__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.how__steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.how__step {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; padding: 20px 22px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  transition: opacity .4s, border-color .4s, background .4s, transform .4s var(--ease);
}
.js .how__step { opacity: .38; }
.js .how__step.is-active {
  opacity: 1; border-color: rgba(169, 161, 255, .45); transform: translateX(6px);
  background: linear-gradient(90deg, rgba(90, 72, 255, .14), var(--surface) 70%);
}
.how__n {
  font-family: var(--f-display); font-weight: 700; font-size: 40px; line-height: 1; color: transparent;
  -webkit-text-stroke: 1.4px rgba(169, 161, 255, .75);
}
.how__step.is-active .how__n { color: rgba(123, 109, 255, .25); }
.how__t { font-family: var(--f-display); font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; }
.how__d { color: var(--fg-2); font-size: 15px; margin-top: 6px; }
.how__visual { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.how__seq {
  display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(12, 12, 20, .8);
}
.how__seq-lbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.how__seq-moves { display: flex; gap: 4px; font-size: 14px; }
.how__seq-moves span { padding: 2px 6px; border-radius: 6px; color: var(--fg-3); transition: color .2s, background .2s; }
.how__seq-moves span.is-done { color: var(--fg-2); }
.how__seq-moves span.is-now { color: #000; background: #fff; }
.how__hint { font-size: 13px; color: var(--fg-3); }
.how__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.how__bar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--accent-3), var(--accent-2)); }
.no-js .how__bar, .no-js .how__hint { display: none; }

.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feat {
  position: relative; overflow: hidden; padding: 26px 24px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.feat::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent); opacity: .6;
}
.feat__ic {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 22px;
  background: rgba(123, 109, 255, .1); border: 1px solid rgba(123, 109, 255, .28); color: var(--accent-2);
}
.feat__ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feat__t { font-family: var(--f-display); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: 1.3; }
.feat__d { color: var(--fg-2); font-size: 15px; margin-top: 8px; }

/* ---------- 7. 3D-кубик (cube3d.js) -------------------------------------- */
.c3 {
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; perspective: 1200px;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.c3[data-drag] { cursor: grab; touch-action: pan-y; }
.c3.is-dragging { cursor: grabbing; }
.c3__glow {
  position: absolute; inset: -18%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(88, 66, 255, .45), rgba(88, 66, 255, .14) 55%, transparent 74%);
}
.c3__floor {
  position: absolute; left: 22%; right: 22%; bottom: 2%; height: 10%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(70, 50, 255, .6), transparent); filter: blur(8px);
}
.c3__scene { position: absolute; left: 50%; top: 47%; width: 0; height: 0; transform-style: preserve-3d; }
.c3__cb { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.c3__f {
  position: absolute; left: calc(var(--h) * -1); top: calc(var(--h) * -1);
  width: calc(var(--h) * 2); height: calc(var(--h) * 2);
  background: #06060a; border-radius: 15%;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.c3__f::after {
  content: ""; position: absolute; inset: 6.5%; border-radius: 17%;
  background: linear-gradient(145deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 45%), var(--sc);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .22);
}
.c3__f.is-in::after { content: none; }
/* Простое «освещение» в пространстве куба: верх светлее, низ темнее */
.c3__f::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: #000;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.c3__f[data-d="D"]::before { opacity: .38; }
.c3__f[data-d="B"]::before, .c3__f[data-d="L"]::before { opacity: .2; }
.c3__f[data-d="R"]::before { opacity: .1; }
.c3--hero { max-width: 460px; }
.c3--how { max-width: 400px; }
.c3--sm { max-width: 260px; }

/* ---------- 8. Страница ввода -------------------------------------------- */
.tool-head { padding: 28px 0 8px; }
.tool-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-top: 16px; }
.tool-head__sub { color: var(--fg-2); margin-top: 10px; }

.orient {
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 24px; padding: 20px 24px;
}
.orient__cube { width: 92px; height: 92px; }
.orient__rules { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.orient__rules li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--fg-2); }
.orient__rules b { color: var(--fg); font-weight: 700; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.orient__hint { color: var(--fg-3); font-size: 13px; margin-top: 10px; }

.ws { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.ws__side { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 14px; }
.ws__main { min-width: 0; }
.ws__net { container-type: inline-size; padding: 28px 24px 24px; overflow-x: auto; }
.ws__h {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3); margin: 0 0 12px;
}
.ws__desc { color: var(--fg-2); font-size: 14px; margin: -2px 0 22px; }
.ws__desc b { color: var(--fg); font-weight: 600; }

.dock { padding: 18px; display: grid; gap: 14px; }
.palette__colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.palette__btn {
  aspect-ratio: 1; width: 100%; min-width: 0; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c); font-size: 0; position: relative;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .25), inset 0 2px 4px rgba(255, 255, 255, .25);
  transition: transform .15s var(--ease), box-shadow .15s;
}
.palette__btn:hover { transform: scale(1.07); }
.palette__btn.selected { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px #fff, 0 0 18px 2px rgba(169, 161, 255, .45); transform: scale(1.04); }
.palette__btn--erase {
  background: transparent; border: 1.5px dashed var(--line-3); box-shadow: none; color: var(--fg-2);
  font-size: 18px !important; line-height: 1; display: grid; place-items: center;
}
.dock__row { display: flex; align-items: center; gap: 8px; }
#btn-undo { --h: 48px; padding: 0 16px; flex: none; }
#btn-solve { --h: 48px; flex: 1; padding: 0 18px; }
#btn-solve:not(:disabled) { animation: glowIn .6s var(--ease); box-shadow: 0 8px 30px -6px rgba(169, 161, 255, .6); }
@keyframes glowIn { from { transform: scale(.96); } }
.only-sm { display: none; }

.validation { font-size: 13px; line-height: 1.4; color: var(--fg-2); min-height: 18px; }
.validation.ok { color: var(--ok); font-weight: 600; }
.validation.bad { color: var(--danger); }
.validation.info { color: var(--fg-2); }
.validation.warn {
  display: block; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5;
  background: rgba(255, 200, 87, .08); border: 1px solid rgba(255, 200, 87, .4); color: var(--warn);
}
.validation.warn b { color: #ffe08a; }

.counts { padding: 18px; }
#counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--f-mono); font-size: 12px; }
.count-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); color: var(--fg-2); }
.count-row__sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.count-row__num { margin-left: auto; color: var(--fg); }
.count-row.ok { background: rgba(74, 222, 128, .07); }
.count-row.ok .count-row__num { color: var(--ok); }
.count-row.bad { background: rgba(255, 107, 107, .08); }
.count-row.bad .count-row__num { color: var(--danger); }
.count-row.info { color: var(--fg-3); background: none; padding: 4px 2px 0; }

.actions { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .ws__h { grid-column: 1 / -1; margin-bottom: 4px; }
.actions .btn {
  --h: 44px; width: 100%; padding: 6px 10px; font-size: 13px; font-weight: 600; line-height: 1.2;
  white-space: normal; border-radius: 14px;
}

/* Развёртка */
.net {
  --gap: 14px;
  --face-w: 180px;
  display: grid; grid-template-columns: repeat(4, max-content); gap: calc(var(--gap) + 10px) var(--gap);
  justify-content: center; align-content: start; padding-top: 18px;
}
@supports (width: 1cqi) {
  .ws__net .net { --face-w: min(calc(var(--cube-n) * 58px + 20px), calc((100cqi - 3 * var(--gap)) / 4)); }
}
.face {
  position: relative; width: var(--face-w); display: grid;
  grid-template-columns: repeat(var(--cube-n), 1fr); gap: max(1px, calc(6px - var(--cube-n) * .3px));
  padding: max(3px, calc(7px - var(--cube-n) * .25px)); border-radius: 12px;
  background: #000; box-shadow: 0 0 0 1px var(--line);
}
.face__label {
  position: absolute; left: 2px; bottom: calc(100% + 6px); max-width: 100%;
  font-size: 11px; line-height: 1.2; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.face--U { grid-column: 2; grid-row: 1; }
.face--L { grid-column: 1; grid-row: 2; }
.face--F { grid-column: 2; grid-row: 2; }
.face--R { grid-column: 3; grid-row: 2; }
.face--B { grid-column: 4; grid-row: 2; }
.face--D { grid-column: 2; grid-row: 3; }
.sticker {
  position: relative; aspect-ratio: 1; min-width: 0; border-radius: max(2px, calc(9px - var(--cube-n) * .45px));
  background: var(--c-empty); cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; transition: transform .08s, background-color .12s;
}
.sticker[data-color="W"] { background: var(--c-W); }
.sticker[data-color="Y"] { background: var(--c-Y); }
.sticker[data-color="G"] { background: var(--c-G); }
.sticker[data-color="B"] { background: var(--c-B); }
.sticker[data-color="R"] { background: var(--c-R); }
.sticker[data-color="O"] { background: var(--c-O); }
.sticker[data-color]:not([data-color="null"]):not([data-color="undefined"]) { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .18); }
.sticker.center { outline: 2px dashed rgba(255, 255, 255, .55); outline-offset: -3px; }
@media (hover: hover) {
  .ws__net .sticker:hover { transform: scale(1.12); z-index: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
}
.sticker--uncertain { outline: 2px dashed var(--warn); outline-offset: -2px; animation: unsure 1.6s ease-in-out infinite; }
@keyframes unsure { 50% { outline-color: #ffe08a; box-shadow: 0 0 0 4px rgba(255, 200, 87, .35); } }
/* Невозможный куб: клетки, на которые указала проверка (input.js → setMarks) */
.sticker--bad { z-index: 1; outline: 3px solid var(--danger); outline-offset: -1px; animation: badcell 1.2s ease-in-out infinite; }
@keyframes badcell { 50% { box-shadow: 0 0 0 4px rgba(255, 107, 107, .45); } }
/* Режим «исправить в один клик»: кликабельны только детали-кандидаты */
.ws__net.is-fixing .sticker { opacity: .35; cursor: default; }
.ws__net.is-fixing .sticker--fixable { opacity: 1; cursor: pointer; outline: 2px dashed #fff; outline-offset: -2px; }
.ws__net.is-fixing .sticker--fixable.sticker--bad { outline: 3px solid var(--danger); }
.fixbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--fg); }
.fixbar[hidden] { display: none; }
.fixbar__hint { flex: 1 1 200px; min-width: 0; }

/* Заполнение по граням (facewizard.js). Без JS — обычный крест. */
.fw, .fw__nav, .fw__card { display: none; }
.js .fw { display: block; margin: 0 0 18px; }
.js .fw__nav { display: flex; }
.js .fw__card { display: grid; }
.js .fw__stage { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.js .fw-all .fw__stage { grid-template-columns: minmax(0, 1fr); }

.fw__tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 8px; }
.fw__tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  padding: 10px 6px 9px; text-align: center;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: border-color .2s, background .2s;
}
.fw__tab:hover { border-color: var(--line-3); }
.fw__tab i {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  font: 700 12px var(--f-mono); font-style: normal; color: rgba(0, 0, 0, .55); background: var(--c, transparent);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .2);
}
.fw__tab--all i { width: auto; padding: 0 2px; color: var(--fg); font: 700 13px var(--f-body); box-shadow: none; display: none; }
.fw__meta { display: flex; flex-direction: column; align-items: center; max-width: 100%; min-width: 0; line-height: 1.2; }
.fw__name { max-width: 100%; font-size: 12px; font-weight: 600; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw__cnt { font-size: 11px; color: var(--fg-3); letter-spacing: -.02em; white-space: nowrap; margin-top: 3px; }
.fw__cross { color: var(--fg-3); }
.fw__tab--all .fw__cross { order: -1; width: 30px; height: 23px; margin: 3px 0 6px; color: var(--fg-2); }
.fw__tab.is-on { border-color: #fff; background: var(--surface-3); box-shadow: 0 0 0 1px #fff; }
.fw__tab.is-done .fw__cnt { color: var(--ok); }
/* Заполненная грань: вместо буквы — галочка */
.fw__tab.is-done:not(.is-on) i { position: relative; color: transparent; }
.fw__tab.is-done:not(.is-on) i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(0, 0, 0, .7); font-size: 15px; }

.fw__card {
  grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 18px 16px 20px; text-align: center; align-self: center;
  border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(160px 140px at 50% 32%, rgba(88, 66, 255, .24), transparent), #07070c;
}
.fw__cube { width: 168px; max-width: none; }
.fw__cube .c3__glow { inset: -4%; }
.fw__step { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); }
.fw__hint { font-size: 14px; line-height: 1.5; color: var(--fg); margin-top: 6px; }
.fw__keys { font-size: 11px; color: var(--fg-3); margin-top: 10px; }
.fw-all .fw__card { grid-template-columns: 1fr; padding: 12px 16px; justify-items: start; text-align: left; }
.fw-all .fw__cube, .fw-all .fw__keys { display: none; }

/* Режим одной грани: показываем только выбранную, крупно */
.ws__net .net[data-fw]:not([data-fw="all"]) { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
.ws__net .net[data-fw]:not([data-fw="all"]) .face {
  display: none; grid-column: 1; grid-row: 1; justify-self: center;
  width: min(100%, calc(var(--cube-n) * 92px + 16px), 62vh);
  padding: max(3px, calc(8px - var(--cube-n) * .3px)); gap: max(2px, calc(6px - var(--cube-n) * .25px)); border-radius: 14px;
}
.ws__net .net[data-fw]:not([data-fw="all"]) .sticker { border-radius: max(3px, calc(10px - var(--cube-n) * .5px)); }
.ws__net .net[data-fw]:not([data-fw="all"]) .face__label { display: none; }
/* Специфичность как у правила display:none выше (+ :not), иначе не перебьёт. */
.ws__net .net[data-fw="F"]:not([data-fw="all"]) .face--F, .ws__net .net[data-fw="R"]:not([data-fw="all"]) .face--R,
.ws__net .net[data-fw="B"]:not([data-fw="all"]) .face--B, .ws__net .net[data-fw="L"]:not([data-fw="all"]) .face--L,
.ws__net .net[data-fw="U"]:not([data-fw="all"]) .face--U, .ws__net .net[data-fw="D"]:not([data-fw="all"]) .face--D {
  display: grid; animation: faceIn .35s var(--ease);
}
@keyframes faceIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.fw__nav { gap: 10px; margin-top: 22px; justify-content: flex-end; }
.fw__nav .btn { --h: 46px; min-width: 0; white-space: normal; text-align: center; }
.fw__nav [data-fw-next] { min-width: 200px; }

/* Фото-ввод (3×3) */
.photo { margin-top: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.photo-slot {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; text-align: center; cursor: pointer; border-radius: 16px;
  border: 1.5px dashed var(--line-3); background: var(--surface-2); color: var(--fg-3);
  transition: border-color .15s, color .15s, background .15s;
}
.photo-slot:hover { border-color: var(--accent-2); color: var(--fg); }
.photo-slot__label { font-size: 13px; font-weight: 700; color: var(--fg); line-height: 1.25; }
.photo-slot__placeholder { font-size: 12px; }
.photo-slot--filled { background: var(--preview) center / cover; border-style: solid; border-color: var(--accent-2); }
.photo-slot--filled .photo-slot__label { background: rgba(0, 0, 0, .6); padding: 2px 8px; border-radius: 6px; }
.photo-slot--filled .photo-slot__placeholder { display: none; }
.photo-slot--loading { opacity: .55; }
.photo__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Текст под инструментом (size_about / home_about) */
.prose-sec { padding: 56px 0 24px; }
body .size-about, body .home-about {
  max-width: 760px; margin: 0; padding: 0; font-size: 16px; line-height: 1.75; color: var(--fg-2);
}
body .size-about__h, body .home-about__h {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.15; letter-spacing: -.01em; color: var(--fg); margin: 0 0 20px;
}
body .size-about__h3, body .home-about__h3 { font-size: 18px; font-weight: 700; color: var(--fg); margin: 32px 0 10px; }
body .size-about p, body .home-about p { margin: 0 0 14px; }
body .size-about a, body .home-about a { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(169, 161, 255, .4); text-underline-offset: 3px; }
body .size-about a:hover, body .home-about a:hover { text-decoration-color: var(--accent-2); }
body .size-about strong, body .home-about strong { color: var(--fg); }
body .size-about__facts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 16px; }
body .size-about__facts li { margin: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
body .size-about__facts strong { display: block; font-family: var(--f-display); font-size: 22px; font-weight: 600; margin-bottom: 2px; }
body .size-about__list { margin: 0 0 16px; padding-left: 20px; }
body .size-about__list li { margin: 0 0 8px; }
body .size-about__faq { margin: 0 0 16px; }
body .size-about__faq dt { font-weight: 700; color: var(--fg); margin: 18px 0 6px; }
body .size-about__faq dd { margin: 0; }
body .size-about__links { font-size: 14px; opacity: 1; }
body .home-about__steps, body .home-about__links { padding-left: 22px; margin: 0 0 14px; }
body .home-about__steps li, body .home-about__links li { margin: 0 0 10px; padding-left: 4px; }
body .home-about__steps li::marker { color: var(--accent-2); font-weight: 700; }
.sec--prose .home-about { margin: 0 auto; }

/* 404 */
.e404 { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 32px 72px; }
.e404 .c3 { margin-bottom: 8px; }
.e404 .sec__sub { max-width: 460px; }

/* ---------- 9. «Решаю…» -------------------------------------------------- */
.solving { padding-block: 40px 64px; }
.solving__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.solving__sub { color: var(--fg-2); margin-top: 12px; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.stat { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.stat__l { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.stat__v { font-family: var(--f-display); font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__v--sm { font-size: 17px; line-height: 1.5; }
.trace { margin-top: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: #07070c; }
.trace__h { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.trace ol { list-style: none; margin: 0; padding: 0; min-height: 132px; }
.v2-trace__line {
  font-family: var(--f-mono); font-size: 13px; line-height: 22px; color: var(--fg-2);
  opacity: 0; transform: translateX(-6px); transition: opacity .5s, transform .5s var(--ease);
}
.v2-trace__line--shown { opacity: 1; transform: none; }
.v2-trace__line--shown:last-of-type, .v2-trace__line--shown:not(:has(+ .v2-trace__line--shown)) { color: var(--accent-2); }
.solving__status { margin-top: 18px; font-weight: 700; color: var(--accent-2); }
.solving__hint { margin-top: 6px; font-size: 14px; color: var(--fg-3); }
.solving__cancel { margin-top: 20px; }
.solving__visual { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.solving .ad { margin: 24px 0 0; align-items: flex-start; }

/* ---------- 10. «Решение готово» ---------------------------------------- */
.ready { padding-block: 32px 64px; text-align: center; }
.ready__cube { display: flex; justify-content: center; margin: 0 auto 4px; }
.ready .c3 { max-width: 240px; }
.ready__sub:empty { display: none; }
.ready__sub { margin-top: 12px; }
.ready .stats { max-width: 560px; margin: 28px auto 0; text-align: left; }
.ready-cta {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  min-width: min(420px, 100%); height: 64px; margin-top: 32px; padding: 0 28px; border-radius: 999px;
  background: #fff; color: #07070b; font-family: var(--f-display); font-weight: 600; font-size: 14px;
  letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 14px 50px -10px rgba(169, 161, 255, .55);
  transition: transform .15s var(--ease);
}
.ready-cta:active { transform: scale(.985); }
.ready-cta__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #d9d5ff, #b8b0ff); }
.ready-cta__label, .ready-cta__timer { position: relative; }
.ready-cta__timer {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px;
  background: #07070b; color: #fff; font-family: var(--f-mono); font-size: 13px; letter-spacing: 0;
}
.ready__auto { margin-top: 12px; font-size: 13px; color: var(--fg-3); font-family: var(--f-mono); }
.ready .ad { margin-top: 40px; }

/* ---------- 11. Решение -------------------------------------------------- */
.sol { padding-block: 28px 64px; }
.sol__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-top: 16px; }
.sol__summary { color: var(--fg-2); margin-top: 10px; max-width: 720px; font-size: 15px; }
.sol__counter {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 3vw, 36px); font-variant-numeric: tabular-nums;
  padding: 10px 20px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface);
}
.sol__progress { margin-top: 24px; padding: 18px 22px; }
.solution-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.solution-progress__bar {
  height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 0 14px var(--glow); transition: width .3s var(--ease);
}
.sol__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.phase-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--fg-3); border: 1px solid var(--line-2); white-space: nowrap;
}
.phase-chip--active { background: #fff; color: #000; border-color: #fff; }
.phase-chip--done { color: var(--accent-2); border-color: rgba(169, 161, 255, .35); }

#steps-container { margin-top: 16px; }
.cube-visual {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "iso net" "cap cap";
  gap: 20px 28px; align-items: center; padding: 24px; border-radius: var(--r);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.cube-iso-wrap { display: contents; }
.cube-iso-nav { display: none; }
.cube-iso {
  grid-area: iso; align-self: start; padding: 14px; border-radius: 18px; text-align: center;
  background: radial-gradient(closest-side, rgba(88, 66, 255, .22), transparent), #07070c; border: 1px solid var(--line);
}
.cube-iso__title { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.cube-iso__svg { width: 210px; height: auto; margin: 0 auto; }
.iso-cell { stroke: rgba(0, 0, 0, .6); stroke-width: .5; }
.iso-cell--hot { stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 0 2.5px rgba(169, 161, 255, .95)); }
.iso-cell--dim { opacity: .5; }
.iso-strip { fill: none; stroke: #fff; stroke-width: 2.6; pointer-events: none; filter: drop-shadow(0 0 1px var(--accent-3)) drop-shadow(0 0 1px var(--accent-3)); }
.iso-strip-head { fill: #fff; stroke: #ff3d3d; stroke-width: 1.4; stroke-linejoin: round; pointer-events: none; }
.iso-strip-inner { display: none; }
.iso-arrow { pointer-events: none; filter: drop-shadow(0 .6px 1.1px rgba(0, 0, 0, .85)); }
.iso-arrow polygon { fill: #fff; stroke: #0b0e1a; stroke-width: .45; stroke-linejoin: round; }
.cube-visual > .net { grid-area: net; }
.cube-visual__caption, .cube-visual__done { grid-area: cap; text-align: center; font-size: 14px; color: var(--fg-2); }
.cube-visual__caption b { color: var(--fg); }
.cube-visual__done { color: var(--ok); font-weight: 700; font-size: 16px; }

.net--small { container-type: inline-size; width: 100%; --gap: 10px; gap: calc(var(--gap) + 8px) var(--gap); padding-top: 16px; }
.net--small .face { --face-w: 120px; padding: 3px; gap: 1px; border-radius: 9px; }
@supports (width: 1cqi) {
  .net--small .face { --face-w: max(calc(var(--cube-n) * 7px + 8px), min(calc(var(--cube-n) * 36px + 10px), calc((100cqi - 3 * var(--gap)) / 4))); }
}
.net--small .face__label { font-size: 0; bottom: calc(100% + 4px); }
.net--small .face__label::before { content: attr(data-face); font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); }
.net--small .sticker { cursor: default; border-radius: max(1px, calc(6px - var(--cube-n) * .35px)); }
.sticker--hot { outline: 2px solid #fff; outline-offset: -1px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .3), 0 0 10px 2px rgba(169, 161, 255, .9); z-index: 2; }
.sticker--dim { opacity: .22; filter: saturate(.6); }
.face--moving { box-shadow: 0 0 0 2px var(--accent-2), 0 0 18px rgba(123, 109, 255, .6); }
.sticker-arrow { position: absolute; inset: 1px; z-index: 3; pointer-events: none; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .85)); }
.sticker-arrow polygon { fill: #fff; stroke: #0b0e1a; stroke-width: 1.2; stroke-linejoin: round; }
.face__spin {
  position: absolute; top: 50%; left: 50%; width: 82%; height: 82%; transform: translate(-50%, -50%);
  z-index: 4; pointer-events: none; opacity: .92;
  filter: drop-shadow(0 0 6px rgba(169, 161, 255, .9)) drop-shadow(0 0 2px rgba(0, 0, 0, .95));
}
.face__spin path { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; }
.face__spin marker path, .face__spin marker polygon { fill: #fff; stroke: none; }
.face__spin polygon { fill: #fff; stroke: #0b0e1a; stroke-width: 1.5; stroke-linejoin: round; }
.face__spin text { fill: #fff; stroke: #0b0e1a; stroke-width: .6; font: 800 24px var(--f-body); paint-order: stroke; }

.nav-buttons { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr 1fr; gap: 10px; margin: 16px 0; }
.nav-buttons .btn { --h: 50px; padding: 0 14px; }
.step {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; padding: 24px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
}
.step h2 { font-family: var(--f-display); font-size: 26px; text-transform: uppercase; }
.step__move {
  font-family: var(--f-mono); font-weight: 500; font-size: clamp(40px, 6vw, 56px); line-height: 1.1; margin: 8px 0 10px;
  color: #fff; text-shadow: 0 0 30px rgba(169, 161, 255, .55);
}
.step__desc { font-size: 17px; font-weight: 600; }
.step__note { color: var(--fg-2); font-size: 14px; margin-top: 8px; }
.sol__moves { margin-top: 16px; }
.sol__moves pre {
  margin: 12px 0 0; padding: 16px; border-radius: 14px; background: #07070c; border: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 14px; line-height: 1.9; color: var(--fg-2); white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
.sol__notation { margin-top: 16px; }
.sol__notation summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.sol__notation summary::-webkit-details-marker { display: none; }
.sol__notation summary::after { content: "+"; font-family: var(--f-mono); font-size: 20px; color: var(--accent-2); transition: transform .2s; }
.sol__notation[open] summary::after { transform: rotate(45deg); }
.sol__notation p { color: var(--fg-2); margin-top: 12px; font-size: 15px; }
.sol__notation b { color: var(--fg); }

/* ---------- 12. Гайды (prose) -------------------------------------------- */
.doc { padding-block: 28px 72px; }
.doc__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; margin-top: 24px; }
.prose { min-width: 0; max-width: 740px; font-size: 17px; line-height: 1.78; color: var(--fg-2); }
.prose h1 {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1; letter-spacing: -.01em; color: var(--fg); margin: 0 0 28px;
}
.prose h2 { font-family: var(--f-display); font-weight: 600; font-size: 22px; line-height: 1.3; color: var(--fg); margin: 44px 0 14px; }
.prose h3 { font-size: 18px; font-weight: 700; color: var(--fg); margin: 30px 0 10px; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 0 0 8px; padding-left: 4px; }
.prose li::marker { color: var(--accent-2); }
.prose a { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(169, 161, 255, .4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-2); }
.prose a.btn { color: var(--fg); text-decoration: none; }
.prose strong, .prose b { color: var(--fg); }
.prose code {
  font-family: var(--f-mono); font-size: .86em; padding: 2px 7px; border-radius: 6px;
  background: rgba(123, 109, 255, .12); color: #d6d2ff; border: 1px solid rgba(123, 109, 255, .2);
}
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--fg); font-weight: 700; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose .meta { color: var(--fg-3); font-size: 14px; margin-top: -16px; }
.doc__aside { position: sticky; top: calc(var(--hdr-h) + 20px); display: grid; gap: 14px; }
.doc__cta { padding: 22px; overflow: hidden; }
.doc__cta::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(88, 66, 255, .5), transparent); pointer-events: none;
}
.doc__cta .panel__t { font-family: var(--f-display); font-size: 16px; text-transform: uppercase; }
.doc__sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; position: relative; z-index: 1; }
.doc__sizes .chip { height: 34px; padding: 0; justify-content: center; font-size: 12px; }
.doc__nav { padding: 10px; }
.doc__nav .ws__h { padding: 10px 12px 2px; }
.doc__nav a { display: block; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--fg-2); }
.doc__nav a:hover { background: rgba(255, 255, 255, .04); color: var(--fg); }
.doc__nav a[aria-current] { background: rgba(123, 109, 255, .12); color: var(--fg); }
.doc__back { display: inline-flex; margin-top: 32px; }

/* ---------- 13. Футер ---------------------------------------------------- */
.ftr { margin-top: 48px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(60, 40, 255, .05)); }
.ftr__grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 32px; padding: 56px 0 40px; }
.ftr__tag { color: var(--fg-3); font-size: 14px; max-width: 300px; margin-top: 14px; }
.ftr__h { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 14px; }
.ftr__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; color: var(--fg-2); }
.ftr__list a:hover, .ftr__contact:hover { color: var(--fg); }
.ftr__contact { padding: 0; background: none; border: 0; cursor: pointer; color: var(--fg-2); font-size: 14px; text-align: left; }
.ftr__base {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 18px 0 26px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3);
}
.ftr__made { text-align: center; }
.ftr__mail { justify-self: end; display: flex; justify-content: flex-end; border-radius: 999px; }
.ftr__mail.is-flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(169, 161, 255, .6); } 100% { box-shadow: 0 0 0 3px transparent; } }
.ftr__pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: none; cursor: pointer; font-size: 13px; color: var(--fg-2);
  transition: color .15s, border-color .15s, background .15s;
}
.ftr__pill:hover { color: var(--fg); border-color: var(--line-3); background: rgba(255, 255, 255, .04); }
.site-footer__contact-revealed { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-footer__email { color: var(--fg); border-bottom: 1px solid var(--line-3); word-break: break-all; }
.site-footer__copy {
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: none; cursor: pointer;
  font-size: 12px; color: var(--fg-2);
}
.site-footer__copy--done { color: var(--ok); border-color: var(--ok); }

/* ---------- 14. Адаптив --------------------------------------------------- */
@media (max-width: 1100px) {
  .ws { grid-template-columns: 260px minmax(0, 1fr); }
  .feats { grid-template-columns: repeat(2, 1fr); }
  .doc__grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; }
}

@media (max-width: 900px) {
  :root { --hdr-h: 62px; }
  .nav { display: none; }
  .burger { display: block; }
  .hdr__in { gap: 16px; }

  .hero { padding: 16px 0 48px; }
  .hero__grid { grid-template-columns: 1fr; gap: 0; }
  .hero__visual { order: -1; margin: 0 auto 8px; width: min(300px, 70vw); }
  .hero__h1 { margin-top: 18px; }
  .hero__hint { margin-top: 0; font-size: 12px; }

  .how__grid { grid-template-columns: 1fr; gap: 12px; }
  .js .how { height: 260vh; }
  .js .how__sticky { min-height: 0; padding: 12px 0; }
  .js .how__grid { grid-template-rows: auto 1fr; }
  .how__text { order: 2; }
  .how__visual { order: 1; gap: 10px; }
  .c3--how { max-width: min(300px, 38vh); }
  .how__steps { margin-top: 16px; position: relative; }
  .js .how__steps { display: block; min-height: 132px; }
  .js .how__step { position: absolute; inset: 0 0 auto; opacity: 0; transform: translateY(10px); pointer-events: none; }
  .js .how__step.is-active { opacity: 1; transform: none; pointer-events: auto; }
  .how .h2 { font-size: 22px; }
  .how__seq { padding: 8px 12px; }
  .how__seq-lbl { display: none; }
  .how__seq-moves { font-size: 13px; gap: 2px; }
  .how__seq-moves span { padding: 2px 5px; }
  .how .kicker { display: none; }
  .how__hint { display: none; }

  .ws { grid-template-columns: 1fr; }
  .ws__side { position: static; display: contents; }
  .dock { order: 3; }
  .counts { order: 1; }
  .actions { order: 2; }
  .ws__main { order: 4; }

  .solving__grid { grid-template-columns: 1fr; gap: 0; }
  .solving__visual { order: -1; }
  .solving .c3 { max-width: 220px; }
  .solving .ad { align-items: center; }

  .doc__grid { grid-template-columns: minmax(0, 1fr); }
  .doc__aside { position: static; }

  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .ftr__brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --gut: 16px; --r: 18px; }
  body { font-size: 15px; }
  .sec { padding: 52px 0; }
  .sec__head { margin-bottom: 22px; }
  .hero__h1 { font-size: min(30px, 6.6vw); margin: 16px 0 16px; }
  .hero__lede { font-size: 16px; }
  .page-home .ad { margin-top: 12px; }
  .hero__cta { margin-top: 26px; gap: 10px; }
  .hero__cta .btn { flex: 1 1 0; padding: 0 14px; font-size: 12px; }
  .sizes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .size { padding: 16px; gap: 16px; }
  .size__name { font-size: 22px; }
  .size .badge { display: none; }
  .size--hot .badge { display: inline-flex; }
  .fp { width: 52px; height: 52px; }
  .size__go { width: 30px; height: 30px; flex: none; }
  .size__foot .mono { white-space: nowrap; font-size: 11px; letter-spacing: -.02em; }
  .feats { grid-template-columns: 1fr; gap: 10px; }
  .feat { display: grid; grid-template-columns: 46px 1fr; column-gap: 16px; padding: 20px; }
  .feat__ic { grid-row: span 2; margin: 0; }
  .feat__d { margin-top: 4px; }

  .panel { padding: 18px; }

  /* Ввод: палитра + «Решить» прибиты к низу экрана */
  .page-input { padding-bottom: 150px; }
  .orient { grid-template-columns: 64px 1fr; gap: 14px; padding: 16px; margin-top: 18px; }
  .orient__cube { width: 64px; height: 64px; }
  .orient .panel__t { font-size: 16px; }
  .orient__rules { margin-top: 8px; gap: 4px 14px; }
  .orient__rules li { font-size: 14px; }
  .orient__hint { display: none; }
  .ws { gap: 10px; }
  .counts { padding: 14px; }
  .counts .ws__h { display: none; }
  #counts { grid-template-columns: repeat(3, 1fr); font-size: 11px; gap: 5px; }
  .count-row { padding: 6px 8px; gap: 6px; }
  /* Инструменты: две кнопки в ряд, нечётная последняя — на всю ширину */
  .actions { grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; background: none; border: 0; }
  .actions .ws__h { display: none; }
  .actions .btn { --h: 44px; font-size: 13px; padding: 6px 10px; border-radius: 14px; }
  .actions .btn:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }

  /* Док: [палитра ×7] / [проверка | ↶ | Решить] */
  .dock {
    position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0;
    grid-template-columns: minmax(0, 1fr) auto; gap: 10px 8px; align-items: center;
    padding: 12px max(var(--gut), calc((100vw - 440px) / 2)) calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 12, 20, .95); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .9);
  }
  .dock .ws__h { display: none; }
  .dock .palette__colors { grid-column: 1 / -1; grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .dock .palette__btn { max-height: 46px; }
  .dock .validation { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .dock .validation.warn { padding: 6px 8px; font-size: 11px; }
  .dock .fixbar { order: 5; grid-column: 1 / -1; font-size: 12px; }
  .dock .fixbar .btn { --h: 36px; padding: 0 12px; font-size: 13px; }
  #btn-undo { --h: 44px; width: 44px; padding: 0; font-size: 0; }
  #btn-undo::before { content: "↶"; font-size: 20px; }
  #btn-solve { --h: 44px; flex: none; padding: 0 20px; font-size: 14px; }
  .only-sm { display: inline; }
  .only-lg { display: none; }
  .ws__net { padding: 20px 14px 16px; }

  /* Развёртка на телефоне. «Вся развёртка» (и без JS) — тот же крест, что на
     компьютере, ужатый по ширине. Режим одной грани — общие правила выше. */
  .ws__net .net { --gap: 6px; gap: 20px var(--gap); padding-top: 14px; }
  @supports (width: 1cqi) { .ws__net .net { --face-w: calc((100cqi - 3 * var(--gap)) / 4); } }
  .ws__net .face { padding: 2px; gap: 1px; border-radius: 6px; }
  .ws__net .sticker { border-radius: 2px; }
  .ws__net .face__label { font-size: 0; bottom: calc(100% + 3px); }
  .ws__net .face__label::before { content: attr(data-face); font: 500 11px var(--f-mono); color: var(--fg-3); }

  .fw__tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .fw__tab { gap: 5px; padding: 7px 2px 6px; border-radius: 12px; }
  .fw__tab i { width: 26px; height: 26px; border-radius: 8px; }
  .fw__tab--all i { display: grid; font-size: 12px; }
  .fw__name { display: none; }
  .fw__cnt { font-size: 9px; margin-top: 0; }
  .fw__tab--all .fw__cross { order: 0; width: 16px; height: 12px; margin: 0; }
  .js .fw { margin-bottom: 12px; }
  .js .fw__stage, .js .fw-all .fw__stage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .fw__card {
    grid-template-columns: 96px 1fr; justify-items: start; text-align: left; gap: 14px; padding: 10px 14px 10px 6px;
    background: radial-gradient(120px 100px at 48px 50%, rgba(88, 66, 255, .22), transparent), #07070c;
  }
  .fw__cube { width: 96px; }
  .fw__hint { margin-top: 4px; }
  .fw__keys { display: none; }
  .fw-all .fw__card { padding: 10px 14px; }
  .fw__nav { margin-top: 16px; }
  .fw__nav .btn { flex: 1; }
  .fw__nav [data-fw-prev] { flex: 0 0 auto; }
  .fw__nav [data-fw-next] { min-width: 0; }
  .ws__desc { font-size: 13px; margin-bottom: 14px; }

  .stats { gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat__v { font-size: 19px; }
  .stat__v--sm { font-size: 14px; }

  .sol__counter { padding: 8px 14px; }
  .cube-visual { grid-template-columns: 1fr; grid-template-areas: "iso" "net" "cap"; padding: 16px 12px; gap: 14px; }
  .cube-iso-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; grid-area: iso; }
  .cube-iso { padding: 10px; }
  .cube-iso__svg { width: 168px; }
  .cube-iso-nav {
    display: grid; place-items: center; width: 48px; height: 72px; border-radius: 14px; font-size: 28px; line-height: 1;
    border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg); cursor: pointer;
  }
  .net--small { overflow-x: auto; }
  .nav-buttons {
    position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; margin: 0;
    grid-template-columns: .9fr 1.3fr 1.3fr .9fr; gap: 6px;
    padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 12, 20, .94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid var(--line-2);
  }
  .nav-buttons .btn { --h: 46px; padding: 0 6px; font-size: 13px; }
  .page-solution { padding-bottom: 76px; }
  .step { grid-template-columns: 1fr; padding: 18px; gap: 14px; }

  .doc { padding-top: 20px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 19px; margin-top: 36px; }
  .ftr__grid { padding: 40px 0 28px; gap: 28px 20px; }
  .ftr__base { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; }
  .ftr__mail { justify-self: center; justify-content: center; }
  .ftr__copy { order: 3; }
}

@media (max-width: 380px) {
  .mnav__sizes { grid-template-columns: repeat(3, 1fr); }
  .hero__cta { flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
}

/* ---------- 15. Reduced motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .rv { opacity: 1; transform: none; }
}

/* ---------- 16. Языки: китайский, арабский, письмо справа налево --------- */
/* Unbounded / Manrope / JetBrains Mono не содержат иероглифов и арабских букв.
   Латиница и цифры остаются в фирменных шрифтах, остальное берётся из
   системных шрифтов устройства — ничего лишнего не скачивается. */
:root:lang(zh) {
  --f-display: "Unbounded", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --f-body: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
}
:root:lang(ar) {
  --f-display: "Unbounded", "Segoe UI", "Geeza Pro", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", "Geeza Pro", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Segoe UI", Tahoma, monospace;
}
/* Разрядка ломает слитное арабское письмо (буквы рассыпаются), а у иероглифов
   «капслок»-разрядка заголовков выглядит как опечатка. */
:root:lang(ar) body *, :root:lang(zh) body * { letter-spacing: 0 !important; }
:root:lang(ar) body { line-height: 1.75; }

/* Зеркальная вёрстка (dir="rtl" ставит сервер). Всё, что изображает кубик или
   идёт «слева направо» по смыслу — развёртка, 3D-кубики, вкладки граней,
   плеер ходов, записи ходов, полоса размеров, — остаётся как есть: иначе
   левая и правая грани поменялись бы местами относительно настоящего кубика. */
[dir="rtl"] .net, [dir="rtl"] .c3, [dir="rtl"] .xn, [dir="rtl"] .fp,
[dir="rtl"] .fw__tabs, [dir="rtl"] .fw__nav, [dir="rtl"] .sizebar__in,
[dir="rtl"] .how__seq, [dir="rtl"] .sec__meta { direction: ltr; }
[dir="rtl"] .face__label { direction: rtl; left: auto; right: 2px; }
[dir="rtl"] .fw__name, [dir="rtl"] .how__seq-lbl { direction: rtl; }
[dir="rtl"] .how__seq { flex-direction: row-reverse; }

[dir="rtl"] .hdr__end { margin-left: 0; margin-right: auto; }
[dir="rtl"] .nav__panel { left: auto; right: -8px; }
[dir="rtl"] .nav__panel.lang-dd__panel { right: auto; left: 0; }
[dir="rtl"] .crumbs li + li::before { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .count-row__num { margin-left: 0; margin-right: auto; }
[dir="rtl"] .js .how__step.is-active { transform: translateX(-6px); }
[dir="rtl"] .how__bar i { transform-origin: right; }
[dir="rtl"] .v2-trace__line { transform: translateX(6px); }
[dir="rtl"] .v2-trace__line--shown { transform: none; }
[dir="rtl"] .fw-all .fw__card, [dir="rtl"] .ready .stats,
[dir="rtl"] .ftr__contact, [dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .prose li { padding-left: 0; padding-right: 4px; }
[dir="rtl"] body .home-about__steps, [dir="rtl"] body .home-about__links { padding-left: 0; padding-right: 22px; }
[dir="rtl"] body .home-about__steps li, [dir="rtl"] body .home-about__links li { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .ready-cta__fill { left: auto; right: 0; }
/* Стрелки «вперёд» в кнопках смотрят влево. */
[dir="rtl"] .hero__cta .ico, [dir="rtl"] .size__go .ico { transform: scaleX(-1); }
/* Записи ходов (R U R' …) внутри арабского текста — отдельным блоком слева направо. */
[dir="rtl"] .prose code, [dir="rtl"] .home-about code, [dir="rtl"] .size-about code { direction: ltr; unicode-bidi: isolate; }
