/* =====================================================================
   FotG - Forge of the Gods
   Дизайн-система "HOT METAL, forged": строгая индустриально-редакторская
   сетка. Структурный левый рельс, blueprint-подложка, oxblood как красные
   чернила редактора. Линии разделяют, а не боксы. Тип несёт смысл.
   Свет по умолчанию, тёмная "кованая сталь" - опция, заперта по странице.
   ===================================================================== */

/* ---------- Токены (светлая тема - annealed drafting paper) ---------- */
:root {
  color-scheme: light;

  --bg: #F4F0E8;
  --surface: #FBF9F4;
  --surface-alt: #EAE4D8;
  --ink: #17120E;
  --ink-muted: #6E655A;
  --line: #D6CDBE;
  --accent: #7A0B0B;
  --accent-ink: #F4EDE2;

  /* Радиусы - одно тесное семейство, ничего выше 3px */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 3px;

  /* Шрифты */
  --font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-accent: "Sora", ui-monospace, system-ui, sans-serif;

  /* Сетка / рельс */
  --rail-w: clamp(112px, 12vw, 160px);
  --gap: clamp(20px, 3.2vw, 44px);
  --sheet-max: 1360px;
  --sheet-pad: clamp(20px, 5vw, 72px);
  --measure: 64ch;
  --content-max: 62rem;

  /* Глубина - только линии и заливка, без блюра */
  --edge: inset 0 1px 0 var(--line);
  --lift: 0 8px 24px -18px rgba(0, 0, 0, .45);

  --ease: cubic-bezier(.2, .7, .2, 1);

  --blueprint-alpha: .55;
}

/* ---------- Тёмная тема - forged steel ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #121417;
  --surface: #1A1D22;
  --surface-alt: #22262C;
  --ink: #E9E5DF;
  --ink-muted: #8D929B;
  --line: #2E323B;
  --accent: #A81717;
  --accent-ink: #F5EFEA;

  --lift: 0 10px 30px -18px rgba(0, 0, 0, .7);
  --blueprint-alpha: .7;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
:where(a, button, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* Числа - всегда табличные там, где Sora */
.tnum, .ledger__v, .band__index, .data { font-variant-numeric: tabular-nums; }

/* ---------- Skip-link ---------- */
.skip {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  font-family: var(--font-accent);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.skip:focus { left: 8px; }

/* Визуально скрытый, но доступный скринридерам (для служебных заголовков) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Не капсить в контексте, где родитель делает uppercase (напр. FotG в подвале) */
.nocaps { text-transform: none; }

/* ---------- Blueprint-подложка: конструкционная сетка + датумы ---------- */
.blueprint {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--blueprint-alpha);
  background-image:
    /* мажорная сетка 32px */
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    /* минорная сетка 8px по бейслайну */
    linear-gradient(to right, color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 8px 8px, 8px 8px;
}
/* Реперные тики по углам листа (машинистские метки) */
.blueprint::before,
.blueprint::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid color-mix(in srgb, var(--ink-muted) 60%, transparent);
}
.blueprint::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.blueprint::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* ---------- Верхняя навигация ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--accent); box-shadow: var(--lift); }

.topbar__inner {
  max-width: var(--sheet-max);
  margin-inline: auto;
  padding-inline: var(--sheet-pad);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  font-size: 1.4rem;
  line-height: 1;
}
.brand__mark { width: 26px; height: 26px; border-radius: var(--r-1); }

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 26px);
}
.nav__link {
  position: relative;
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 2px;
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -9px; top: 50%;
  width: 4px; height: 4px;
  margin-top: -2px;
  background: var(--accent);
}
.nav__sep { width: 1px; height: 20px; background: var(--line); }

/* Переключатель языка (EN / RU) */
.langswitch {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.langswitch__link {
  color: var(--ink-muted);
  padding: 0 9px;
  transition: color .2s var(--ease);
}
.langswitch__link:first-child { padding-left: 0; }
.langswitch__link:last-child { padding-right: 0; }
.langswitch__link:hover { color: var(--ink); }
.langswitch__link.is-active { color: var(--accent); }
.langswitch__link + .langswitch__link { border-left: 1px solid var(--line); }

.theme-btn {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--ink-muted);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.theme-btn:hover { border-color: var(--accent); color: var(--ink); }
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }

.menu-btn { display: none; }

/* Мобильная панель меню */
.menu {
  display: none;
  position: fixed;
  inset: 64px 0 auto 0;
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--lift);
  padding: 8px var(--sheet-pad) 20px;
}
.menu.is-open { display: block; }
.menu__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 1.25rem;
}
.menu__link:first-child { border-top: 0; }
.menu__n { font-family: var(--font-accent); font-size: .8rem; color: var(--accent); font-weight: 500; }
.menu__link.is-active { color: var(--ink); }

/* ---------- Тик-разделитель (oxblood), используется в подвале ---------- */
.runhead__tick { width: 5px; height: 5px; background: var(--accent); flex: none; }

/* ---------- Лист / сетка с рельсом ---------- */
.sheet {
  max-width: var(--sheet-max);
  margin-inline: auto;
  padding-inline: var(--sheet-pad);
  position: relative;
}
.main { position: relative; }

.band {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  column-gap: var(--gap);
  padding-block: clamp(40px, 4.5vh, 64px);
  position: relative;
}
.band + .band { border-top: 1px solid var(--line); }
/* Рельс-марка секции. Border даёт непрерывную координатную линию листа,
   которую тонированные полосы (band--alt) не перекрывают. */
.band__rail {
  text-align: right;
  padding-right: clamp(10px, 1.4vw, 18px);
  padding-top: 6px;
  border-right: 1px solid var(--line);
}
.band__id {
  display: block;
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.band__index {
  display: block;
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  color: var(--accent);
  margin-top: 6px;
  line-height: 1;
}
.band__body { max-width: var(--content-max); min-width: 0; }

/* ---------- Типографика ---------- */
.kicker {
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.01em;
  word-spacing: -.12em;
  font-size: clamp(2.75rem, 8.5vw, 7rem);
}
.h1 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .94;
  letter-spacing: -.005em;
  font-size: clamp(2rem, 5vw, 4rem);
}
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}
.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 1.2rem;
}
.lead {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.1875rem, 1.4vw, 1.375rem);
  line-height: 1.55;
  max-width: 42ch;
}
.prose { max-width: var(--measure); }
.prose p { margin-top: 1em; }
.prose p:first-child { margin-top: 0; }
.prose strong { font-weight: 700; }
.meta {
  font-family: var(--font-accent);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-muted);
}
.set-word { color: var(--accent); font-weight: 700; }

/* Крафт: балансировка заголовков и переносов, чтобы не было слов-сирот */
.h-display, .h1, .h2, .h3, .prow__title, .domain__t, .feature__title, .step__title, .plate__name { text-wrap: balance; }
.prose p, .lead, .domain__l, .step__line, .feature__line, .tl__line, .twocol__block p { text-wrap: pretty; }

/* Инлайн-ссылки в тексте - oxblood с тонким подчёркиванием */
.prose a, .step__line a, .domain__l a, .tl__line a, .twocol__block p a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: border-color .2s var(--ease);
}
.prose a:hover, .step__line a:hover, .domain__l a:hover, .tl__line a:hover, .twocol__block p a:hover { border-bottom-color: var(--accent); }

/* Заголовок секции с рисуемой линией */
.shead { margin-bottom: 28px; }
.shead .h2 + .rule, .shead .h1 + .rule { margin-top: 16px; }

/* ---------- Линии и раскрытие (Rule Draw / Entry Rise) ---------- */
.rule { height: 1px; background: var(--line); transform-origin: left; }
.rule--accent { background: var(--accent); }
.rule--tick { position: relative; }
.rule--tick::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 1px; height: 7px;
  background: currentColor;
  color: var(--ink-muted);
}

.js .rule { transform: scaleX(0); transition: transform .5s var(--ease); }
.js .rule.is-in { transform: scaleX(1); }
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal-delay="1"] { transition-delay: .06s; }
.js [data-reveal-delay="2"] { transition-delay: .12s; }
.js [data-reveal-delay="3"] { transition-delay: .18s; }
.js [data-reveal-delay="4"] { transition-delay: .24s; }

/* ---------- Кнопки: штампованная плашка ---------- */
.btnrow { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
/* Кнопки в хиро продукта - заметный отступ от текстового описания (~3x, не жмутся) */
.producthero .btnrow { margin-top: 52px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--r-2);
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }
.btn--secondary { border: 1px solid var(--line); color: var(--ink); }
.btn--secondary:hover { border-color: var(--accent); }
.btn__arrow { font-family: var(--font-accent); }

/* ---------- Product directory row (нумерованный каталог) ---------- */
.directory { display: block; }
.prow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px 22px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: transform .2s var(--ease);
}
.prow:first-child { border-top: 0; }
/* Разжигаемая oxblood-линия сверху (Row Ignite) */
.prow::before {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.prow:hover, .prow:focus-within { transform: translateX(7px); }
.prow:hover::before, .prow:focus-within::before { transform: scaleX(1); }

.prow__index {
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: 1rem;
  color: var(--accent);
  padding-top: 6px;
}
.prow__main { min-width: 0; }
.prow__title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
}
.prow__desc { margin-top: 10px; max-width: 52ch; color: var(--ink); }
.prow__bullets {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 6px;
  max-width: 60ch;
}
.prow__bullets li {
  position: relative;
  padding-left: 18px;
  font-size: .95rem;
  color: var(--ink-muted);
}
.prow__bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 7px; height: 1px;
  background: var(--accent);
}
.prow__ledger {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px 28px;
  max-width: 64ch;
}
.prow__ledger div { display: grid; gap: 4px; align-content: start; font-family: var(--font-accent); }
.prow__ledger dt, .prow__ledger .k {
  font-size: .64rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-muted);
}
.prow__ledger dd, .prow__ledger .v { font-size: .85rem; color: var(--ink); line-height: 1.35; }
.prow__side { text-align: right; display: grid; gap: 10px; justify-items: end; }
.prow__tag {
  font-family: var(--font-accent);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 4px 8px;
  white-space: nowrap;
}
.prow__visit {
  font-family: var(--font-accent);
  font-size: .82rem;
  letter-spacing: .03em;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.prow__visit:hover { border-bottom-color: var(--accent); }

/* ---------- Dimension divider ---------- */
.dimline {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 6px 18px;
}
.dimline__rule { grid-column: 1 / -1; }
.dimline__label {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 1.1rem;
}
.dimline__fig {
  font-family: var(--font-accent);
  font-size: .82rem;
  color: var(--accent);
  text-align: right;
}

/* ---------- Product hero plate (страница продукта) ---------- */
.plate {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface);
  box-shadow: var(--edge);
  position: relative;
  overflow: hidden;
}
.plate--chamfer { clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); }
.plate__seam { height: 3px; background: var(--accent); }
.plate__inner { padding: clamp(22px, 4vw, 44px); display: grid; gap: 22px; }
.plate__figure {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  padding: 26px;
  min-height: 160px;
}
.plate__figure img { width: clamp(84px, 16vw, 132px); height: auto; border-radius: var(--r-1); }

/* Штампованная табличка (nameplate) внутри плашки продукта */
.plate__tag {
  font-family: var(--font-accent);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.plate__name {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-top: 6px;
}
.plate__specs { list-style: none; width: 100%; display: grid; gap: 0; }
.plate__specs li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-accent);
}
.plate__specs li:last-child { border-bottom: 0; }
.plate__specs .k { color: var(--ink-muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.plate__specs .v { font-size: .9rem; text-align: right; }
.plate__foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.plate__seal { width: 24px; height: 24px; border-radius: var(--r-1); flex: none; }

.producthero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.producthero__url {
  font-family: var(--font-accent);
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--accent);
}

/* ---------- Spec ledger / matrix / pricing (Sora табличное) ---------- */
.ledger { width: 100%; border-collapse: collapse; font-family: var(--font-accent); }
.ledger th, .ledger td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th {
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  width: 38%;
  padding-right: 20px;
}
.ledger td { font-size: .95rem; }
.ledger tr:last-child th, .ledger tr:last-child td { border-bottom: 0; }

.matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.matrix__cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-1); padding: 18px; }
.matrix__k { font-family: var(--font-accent); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.matrix__v { margin-top: 8px; font-size: .96rem; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; }
.pricing__col { padding: 24px; border-left: 1px solid var(--line); }
.pricing__col:first-child { border-left: 0; }
.pricing__term { font-family: var(--font-accent); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.pricing__price { font-family: var(--font-accent); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 12px; }

/* ---------- Feature plates (зигзаг) ---------- */
.features { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-1); }
.feature { background: var(--surface); padding: clamp(18px, 3vw, 30px); display: grid; grid-template-columns: auto 1fr; gap: 4px 22px; }
.feature__n { font-family: var(--font-accent); font-weight: 500; color: var(--accent); font-size: .9rem; }
.feature__title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: 1.15rem; grid-column: 2; }
.feature__line { grid-column: 2; color: var(--ink-muted); }

/* ---------- Numbered steps / principles ---------- */
.steps { display: grid; gap: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 4px 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step__n { font-family: var(--font-accent); font-weight: 500; color: var(--accent); font-size: 1rem; }
.step__title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: 1.2rem; grid-column: 2; }
.step__line { grid-column: 2; color: var(--ink-muted); max-width: 60ch; }

/* ---------- Timeline rail ---------- */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); }
.tl:first-child { border-top: 0; }
.tl__mark { position: relative; padding-left: 16px; }
.tl__mark::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; background: var(--accent); }
.tl__line { max-width: 60ch; }

/* ---------- Two-column asymmetric ---------- */
.twocol { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(20px, 4vw, 56px); align-items: start; }
.twocol--rev { grid-template-columns: .65fr 1.35fr; }
.twocol__block h3 { margin-bottom: 8px; }
.twocol__block p { color: var(--ink-muted); max-width: 46ch; }

/* ---------- Tile-grid diagram (Habitrex) ---------- */
.tilegrid { display: grid; gap: 20px; }
.tilegrid__grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; max-width: 520px; }
.tilegrid__t { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); }
.tilegrid__t.is-on { background: var(--accent); border-color: var(--accent); }
.tilegrid__legend { display: flex; gap: 20px; font-family: var(--font-accent); font-size: .74rem; color: var(--ink-muted); letter-spacing: .04em; }
.tilegrid__key { display: inline-flex; align-items: center; gap: 8px; }
.tilegrid__swatch { width: 12px; height: 12px; border: 1px solid var(--line); }
.tilegrid__swatch.is-on { background: var(--accent); border-color: var(--accent); }

/* ---------- Platforms ---------- */
.platforms { display: flex; flex-wrap: wrap; gap: 10px; }
.platform {
  font-family: var(--font-accent);
  font-size: .82rem;
  letter-spacing: .03em;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 8px 14px;
}

/* ---------- Callout band (oxblood reversed) ---------- */
.callout { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-1); }
.callout__inner {
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  gap: 18px;
  justify-items: start;
}
.callout .h2, .callout .h1 { color: var(--accent-ink); }
.callout p { color: color-mix(in srgb, var(--accent-ink) 88%, transparent); max-width: 52ch; }
.callout .btn--primary { background: var(--accent-ink); color: var(--accent); }
.callout .btn--primary:hover { background: #fff; }

/* ---------- Domain triptych (home) ---------- */
.triptych { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: clamp(18px, 3vw, 40px); }
.triptych--4 { grid-template-columns: repeat(4, 1fr); }

/* Стор-бейджи (текстовые, без логотипов - в строгом стиле) */
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.store {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-2);
  padding: 8px 16px; min-height: 46px;
  transition: border-color .2s var(--ease);
}
.store:hover { border-color: var(--accent); }
.store__t { display: grid; line-height: 1.1; }
.store__t .s { font-family: var(--font-accent); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.store__t .b { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: 1rem; letter-spacing: .02em; }
.domain__n { font-family: var(--font-accent); color: var(--accent); font-size: .82rem; font-weight: 500; }
.domain__t { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: 1.3rem; margin: 10px 0 8px; }
.domain__l { color: var(--ink-muted); max-width: 34ch; }

/* ---------- Masthead (home) - две колонки, контент по центру свободной области ---------- */
.band--masthead .band__body { max-width: none; }
.band--masthead .band__rail { padding-top: 0; }
.masthead-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 4vw, 72px);
  align-items: center;                 /* вертикальный центр обеих колонок */
  min-height: min(70vh, 680px);        /* высота-герой, чтобы было где центрировать */
}
.masthead-grid > * { min-width: 0; }
/* Тайтл-блок по левому краю - в одну линию с секциями ниже (левый датум) */
.masthead-hero { text-align: left; }
.masthead-hero .kicker { margin-bottom: 20px; }
/* Компенсация левого сайдбиринга огромного дисплей-глифа - оптический левый край
   тайтла в одну линию с кикером и секциями ниже (em, чтобы держалось на всех ширинах) */
.band--masthead .h-display { margin-left: -0.036em; }
.masthead-aside > :first-child { margin-top: 0; }
.masthead__ethos { font-size: clamp(1.25rem, 1.9vw, 1.5rem); margin-top: 22px; max-width: 26ch; }
.masthead__ledger { margin-top: 26px; display: grid; gap: 4px; max-width: 40ch; }
.masthead__ledger div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-family: var(--font-accent); font-size: .82rem; }
.masthead__ledger .k { color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.band--masthead .btnrow { margin-top: 26px; }
@media (max-width: 900px) {
  .masthead-grid { grid-template-columns: 1fr; gap: clamp(20px, 4vw, 32px); min-height: 0; }
  .masthead-hero { text-align: left; }
}

/* ---------- Footer ---------- */
.foot {
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  margin-top: 0;
}
.foot__inner {
  max-width: var(--sheet-max);
  margin-inline: auto;
  padding: clamp(40px, 7vh, 80px) var(--sheet-pad) 0;
}
.foot__cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: 44px;
}
.foot__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.foot__coord { font-family: var(--font-accent); font-size: .74rem; color: var(--ink-muted); letter-spacing: .05em; margin-top: 12px; line-height: 1.9; }
.foot__h { font-family: var(--font-accent); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 14px; }
.foot__list { list-style: none; padding: 0; display: grid; gap: 10px; }
.foot__list > li > a { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; transition: color .2s var(--ease); }
.foot__list .fl__l { display: inline-flex; gap: 8px; align-items: baseline; }
.foot__list .n { font-family: var(--font-accent); font-size: .74rem; color: var(--accent); }
.foot__list .fl__u { font-family: var(--font-accent); font-size: .72rem; color: var(--ink-muted); }
.foot__list > li > a:hover { color: var(--accent); }
.foot__ethos { font-size: .95rem; color: var(--ink-muted); max-width: 34ch; }
.foot__echo {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--font-accent);
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.foot__echo .runhead__tick { align-self: center; }

/* ---------- Утилиты ---------- */
.stack > * + * { margin-top: var(--stack, 20px); }
.band__body > * + * { margin-top: clamp(16px, 2vh, 24px); }
.nowrap { white-space: nowrap; }

/* Тёмная тема: осветлённый акцент для ТЕКСТА и фокус-кольца (WCAG AA >= 4.5:1),
   при этом заливки (кнопки, швы, тики) остаются на насыщенном --accent. */
:root[data-theme="dark"] :is(.kicker, .band__index, .prow__index, .prow__visit,
  .dimline__fig, .plate__tag, .matrix__k, .feature__n, .step__n, .domain__n,
  .producthero__url, .set-word, .menu__n, .foot__list .n,
  .prose a, .step__line a, .domain__l a, .tl__line a, .twocol__block p a) { color: #EB5B5F; }
:root[data-theme="dark"] .foot__list > li > a:hover { color: #EB5B5F; }
:root[data-theme="dark"] :where(a, button, input):focus-visible { outline-color: #EB5B5F; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .rule { transform: none; transition: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .prow, .prow::before { transition: none; }
  .plate__seam { animation: none !important; }
}

/* =====================================================================
   Адаптив
   ===================================================================== */
@media (max-width: 900px) {
  .producthero { grid-template-columns: 1fr; }
  .triptych { grid-template-columns: 1fr 1fr; }
  .twocol, .twocol--rev { grid-template-columns: 1fr; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  /* Рельс схлопывается, id уезжает над заголовком */
  .band { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .band__rail { text-align: left; padding-right: 0; border-right: 0; display: flex; align-items: baseline; gap: 14px; }
  .band__index { margin-top: 0; font-size: 1.1rem; }
  .band--masthead .h-display { margin-left: 0; }
  /* Леджер домейнов: стек по вертикали, чтобы key+value не распирали вьюпорт */
  .masthead__ledger { max-width: none; }
  .masthead__ledger div { flex-direction: column; align-items: flex-start; gap: 2px; }

  .nav { display: none; }
  .menu-btn {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: 40px; height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--r-1);
    color: var(--ink);
  }
  .menu-btn svg { width: 18px; height: 18px; }
  .topbar__inner { gap: 12px; }

  .prow { grid-template-columns: auto minmax(0, 1fr); }
  .prow__ledger { grid-template-columns: 1fr 1fr; }
  .prow__side { grid-column: 1 / -1; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .prow:hover, .prow:focus-within { transform: none; }

  .triptych { grid-template-columns: 1fr; }
  .foot__cols { grid-template-columns: 1fr; }
  .tilegrid__grid { grid-template-columns: repeat(10, 1fr); }
}

