/* ur6an.tech V3 «Точечная матрица».
   Форма: всё квадратное, радиус 8 px только у кнопок и окон агента.
   Цвет: только токены shared/tokens.css, единственный акцент --violet.
   Сигналы окна агента (alert, action, profit) и статус: значения .tui-v с живого сайта. */

:root {
  --display: "Unbounded", Arial, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 3.34vw, 64px);
  --section: clamp(72px, 8.4vw, 136px);
  --dot: 6px;
  --pitch: 22px;
  --tick: 7px;
  /* Плитка одной квадратной точки: первая четверть конуса в углу плитки. */
  --dot-soft: color-mix(in srgb, var(--soft) 16%, transparent);
  --dot-on: var(--violet);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

p,
h1,
h2,
h3,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
}

img,
svg,
canvas {
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: normal;
  hyphens: none;
}

h2 {
  font-size: clamp(28px, 4.2vw, 84px);
  line-height: 1.06;
}

h2 span,
h2 em,
.ghost {
  color: var(--violet);
  font-style: normal;
}

h2 em {
  display: block;
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 40;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.button:active {
  transform: scale(0.98);
}

.button-primary {
  background: var(--violet);
  color: var(--bg);
}


.button-line {
  border-color: var(--line-strong);
  background: var(--bg);
  color: var(--text);
}


/* Логотип как на живом сайте, точка --violet */
.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}

.brand-dot {
  color: var(--violet);
}

/* Шапка: прозрачная, стоит поверх первого экрана и уезжает с ним */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
  height: 76px;
  padding: 0 var(--gutter);
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a::before {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0;
  width: var(--dot);
  height: var(--dot);
  background: var(--violet);
  opacity: 0;
  transition: opacity 140ms ease;
}


.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}


.header-cta svg,
.arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.cta-label-short {
  display: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle svg {
  fill: currentColor;
  transition: transform 180ms ease;
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--violet);
  color: var(--violet);
}

/* 1. Первый экран */
.hero {
  position: relative;
  display: flex;
  /* Блок ниже экрана: следующая секция видна сразу, пустого фона нет. */
  min-height: min(100vh, 47vw);
  min-height: min(100svh, 47vw);
  flex-direction: column;
  justify-content: flex-end;
  /* Без JS экран всё равно заполнен полем квадратных точек. */
  background: conic-gradient(
      from 270deg at var(--dot) var(--dot),
      var(--dot-soft) 25%,
      transparent 0
    )
    8px 8px / var(--pitch) var(--pitch);
}

html.js .hero {
  background: var(--bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

html:not(.js) canvas {
  display: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, 408px);
  align-items: end;
  gap: 48px;
  /* Сверху место под надпись из точек, чтобы заголовок на неё не наезжал. */
  padding: calc(88px + (100vw - 2 * var(--gutter)) / 7.4 + 36px) var(--gutter) 40px;
}

h1 {
  font-size: clamp(48px, 5.6vw, 120px);
  line-height: 1.04;
  white-space: nowrap;
}

/* Заголовок рисует табло из точек, настоящий текст остаётся для поиска и чтения с экрана. */
html.hero-drawn h1 .row > span {
  color: transparent;
}

.row {
  display: block;
}

.row > span {
  display: inline-block;
}

.hero-side {
  display: grid;
  gap: 24px;
}

.tail {
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions .button {
  flex: 1 1 auto;
  padding: 0 16px;
}

.meta-row {
  display: grid;
  gap: 2px;
  font-size: 15px;
  line-height: 1.5;
}

.meta-row b {
  font-weight: 600;
}

.meta-row span {
  color: var(--soft);
}.tui-window {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
}

.tui-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.tui-dots {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.tui-dots span {
  width: 8px;
  height: 8px;
  background: var(--line-strong);
}

.tui-dots span:last-child {
  background: var(--violet);
}

.tui-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tui-session {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.tui-demo-label {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 14px;
  line-height: 1.5;
}

.tui-split {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 248px minmax(0, 1fr);
}

.tui-left-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.tui-pane-lbl {
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tui-tabs {
  display: grid;
  flex: 1;
  grid-auto-rows: 1fr;
  gap: 6px;
}

.tui-item {
  display: flex;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}


.tui-item.is-active {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 14%, transparent);
}

.tui-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.tui-led {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  background: var(--line-strong);
}

.tui-item.is-active .tui-led {
  background: var(--violet);
}

.tui-item-sub {
  margin-top: 2px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.35;
}

.tui-right-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
}

.tui-inspector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tui-insp-title {
  color: var(--text);
  font-weight: 600;
}

.tui-insp-status {
  font-size: 14px;
  font-weight: 600;
}

.tui-insp-status.ok {
  color: #52f08a;
}

.tui-grid {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  align-items: start;
  gap: 12px 16px;
}

.tui-k {
  color: var(--muted);
  font-weight: 500;
}

.tui-v {
  color: var(--text);
  overflow-wrap: anywhere;
}

.tui-v.alert {
  color: #ffd166;
}

.tui-v.action {
  color: #9bc5ff;
}

.tui-v.profit {
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid rgba(82, 240, 138, 0.2);
  border-radius: 4px;
  background: rgba(82, 240, 138, 0.08);
  color: #52f08a;
  font-weight: 600;
}

.tui-telemetry-note {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.tui-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 14px;
}

/* Появление строк при смене вкладки */
@media (prefers-reduced-motion: no-preference) {
  html.js .tui-grid > * {
    animation: tui-in 280ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  html.js .tui-grid > :nth-child(n + 3) {
    animation-delay: 40ms;
  }

  html.js .tui-grid > :nth-child(n + 5) {
    animation-delay: 80ms;
  }

  html.js .tui-grid > :nth-child(n + 7) {
    animation-delay: 120ms;
  }

  html.js .tui-grid > :nth-child(n + 9) {
    animation-delay: 160ms;
  }
}

@keyframes tui-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Засечки: квадратики на пересечениях линий у сеток Р4 */
.ticks {
  position: relative;
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ticks::before,
.ticks::after,
.cell::before,
.cell::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: var(--tick);
  height: var(--tick);
  background: var(--soft);
  transition: background-color 180ms ease;
}

.ticks::before {
  top: -4px;
  right: -3px;
}

.ticks::after {
  bottom: -3px;
  left: -4px;
}

.cell {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms ease;
}

.cell::before {
  top: -4px;
  left: -4px;
}

.cell::after {
  right: -4px;
  bottom: -4px;
}



/* Пиктограммы 7×7 в ячейках цен */
.picto {
  width: clamp(56px, 4.6vw, 80px);
  height: auto;
  margin-bottom: clamp(24px, 2.4vw, 40px);
  fill: var(--line-strong);
}

.picto-off {
  fill: var(--line-soft);
}

.picto-on {
  fill: var(--soft);
}

.picto-on rect {
  transition: fill 160ms ease;
}

.picto-on rect:nth-child(3n) {
  transition-delay: 50ms;
}

.picto-on rect:nth-child(3n + 1) {
  transition-delay: 100ms;
}

.price-cell.is-lit .picto-on {
  fill: var(--violet);
}

/* 4. Список-индекс */
.index-section {
  padding: var(--section) var(--gutter) 0;
}

.index-head {
  display: grid;
  gap: 24px;
  margin-bottom: 48px;
}

.index-head-cases {
  margin-top: var(--section);
}

.works-sub {
  max-width: 44ch;
  color: var(--soft);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.5;
}

.index-list {
  border-top: 1px solid var(--line);
}

.index-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr) minmax(0, 3fr);
  align-items: center;
  gap: 32px;
  min-height: 136px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.row-name {
  display: flex;
  align-items: center;
  min-width: 0;
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}

.row-mark {
  flex: none;
  width: 0.28em;
  height: 0.28em;
  margin-right: -0.28em;
  background: var(--violet);
  opacity: 0;
  transition: opacity 180ms ease;
}

.row-name-text {
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    color 180ms ease;
}

.row-desc {
  color: var(--soft);
  font-size: 17px;
  line-height: 1.5;  transition: opacity 120ms ease;
}

.row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.35;
}

.arrow {
  flex: none;
  width: 24px;
  height: 24px;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.index-row:focus-visible .row-mark {
  opacity: 1;
}

.index-row:focus-visible .row-name-text {
  transform: translateX(0.56em);
}

.index-row:focus-visible .row-meta {
  color: var(--text);
}

.index-row:focus-visible .arrow {
  color: var(--violet);
  transform: translate(4px, -4px);
}

.row-preview {
  display: block;
}

.row-preview img {
  width: 100%;
  max-width: 458px;
  height: auto;
  border: 1px solid var(--line);
}

/* Превью у указателя: только там, где указатель есть, и от 1000 px */
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  .row-preview {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 5;
    width: 458px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%);
    clip-path: inset(0 100% 0 0);
    transition:
      opacity 120ms ease,
      clip-path 320ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .row-preview.is-following {
    right: auto;
    left: 0;
    transform: translate3d(var(--x, 0px), calc(-50% + var(--y, 0px)), 0);
  }

  .row-preview img {
    border-color: var(--line-strong);
    background: var(--surface);
  }

  .index-row:hover .row-preview,
  .index-row:focus-visible .row-preview {
    opacity: 1;
    clip-path: inset(0);
  }

  .index-row:hover {
    z-index: 6;
  }

  .has-preview:hover .row-desc,
  .has-preview:focus-visible .row-desc {
    opacity: 0;
  }
}

.index-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 48px;
}

.works-more {
  font-family: var(--display);
  font-size: clamp(17px, 1.4vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  text-transform: uppercase;
}

/* 4. Наши проекты и работы: компактный вход на отдельную страницу */
.gate {
  margin-top: var(--section);
  padding: 0 var(--gutter);
}

.gate-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.gate-head h2 {
  grid-column: 1 / 3;
}

.gate-side {
  grid-column: 3 / -1;
  display: grid;
  justify-items: start;
  gap: 16px;
  padding-left: clamp(20px, 2.2vw, 40px);
}

.gate-side .works-more {
  max-width: 24ch;
}

.gate-names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(15px, 1.2vw, 21px);
  font-weight: 500;
  line-height: 1.5;
  text-transform: uppercase;
}

.gate-names li {
  display: flex;
  align-items: center;
}

.gate-names li:not(:last-child)::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 clamp(10px, 1.1vw, 20px);
  background: var(--violet);
}

.gate-names a {
  text-decoration: none;
  transition: color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .gate-names a:hover {
    color: var(--violet);
  }
}

@media (max-width: 720px) {
  .gate-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .gate-head h2,
  .gate-side {
    grid-column: 1;
  }

  .gate-side {
    justify-items: stretch;
    padding-left: 0;
  }

  .gate-side .button {
    width: 100%;
  }

  .gate-side .works-more {
    max-width: none;
  }

  .gate-names {
    display: grid;
    gap: 6px;
  }

  .gate-names li:not(:last-child)::after {
    display: none;
  }

  .gate-names li::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    margin-right: 12px;
    background: var(--violet);
  }
}

/* 5. Цены */
.ledger {
  padding: var(--section) var(--gutter) 0;
  scroll-margin-top: 0;
}

/* Шапка на тех же колонках, что сетка цен: абзац стоит над третьей ячейкой,
   его последняя строка на одной линии с нижней строкой заголовка. */
.ledger-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  align-items: last baseline;
  column-gap: 0;
  margin-bottom: 48px;
}

.ledger-head h2 {
  grid-column: 1 / 3;
}

.ledger-note {
  grid-column: 3 / -1;
  max-width: 56ch;
  padding-left: clamp(20px, 2.2vw, 40px);
  color: var(--soft);
  font-size: clamp(16px, 1.2vw, 19px);
}

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

.price-cell {
  display: flex;
  min-height: clamp(320px, 25vw, 460px);
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(20px, 2.2vw, 40px);
}

.num {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.2em;
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 46px);
  font-weight: 300;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings:
    "tnum" 1,
    "lnum" 1;
  line-height: 1.1;
  white-space: nowrap;
  transition: color 180ms ease;
}

.num i {
  color: var(--soft);
  font-family: var(--body);
  font-size: max(16px, 0.42em);
  font-style: normal;
  font-weight: 400;
}


.price-cell h3 {
  margin-top: 32px;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.3;
}

.price-cell p {
  margin-top: auto;
  padding-top: 24px;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.5;
}

.ledger-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 48px;
}

.ledger-end p {
  max-width: 44ch;
  color: var(--text);
  font-size: clamp(16px, 1.2vw, 19px);
}

/* 6. Как мы работаем */
.how {
  padding-top: var(--section);
}

.how-head {
  display: grid;
  gap: 24px;
  padding: 0 var(--gutter);
  margin-bottom: 72px;
}

.how-head p {
  max-width: 40ch;
  color: var(--soft);
  font-size: clamp(16px, 1.2vw, 19px);
}

.how-track {
  --p: 0;
  position: relative;
}

html:not(.js) .how-track {
  --p: 1;
}

.how-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 45vh;
  pointer-events: none;
  visibility: hidden;
}

.dotline {
  position: relative;
  width: 100%;
  height: var(--dot);
  background: conic-gradient(
      from 270deg at var(--dot) var(--dot),
      var(--line-strong) 25%,
      transparent 0
    )
    0 0 / var(--pitch) var(--dot) repeat-x;
}

.dotline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(
      from 270deg at var(--dot) var(--dot),
      var(--violet) 25%,
      transparent 0
    )
    0 0 / var(--pitch) var(--dot) repeat-x;
  clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0);
  transition: clip-path 180ms linear;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: 40px var(--gutter) 0;
}

.step {
  position: relative;
}

.step::before {
  content: "";
  position: absolute;
  top: -44px;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--soft);
  transition: background-color 300ms ease;
}

html:not(.js) .step::before,
.step.is-on::before {
  background: var(--violet);
}

.how-step {
  display: block;
  margin-bottom: 40px;
  color: var(--soft);
  font-family: var(--display);
  font-size: clamp(34px, 3.6vw, 68px);
  font-weight: 400;
  line-height: 1;
  transition: color 300ms ease;
}

html:not(.js) .how-step,
.step.is-on .how-step {
  color: var(--violet);
}

.step h3 {
  min-height: 2.6em;
  margin-bottom: 16px;
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.3;
}

.step p {
  color: var(--soft);
  font-size: 17px;
}

/* 7. AI-агенты: заголовок и абзац слева, окно справа */
.agents {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 5vw, 96px);
  padding: var(--section) var(--gutter) 0;
}

.agents-copy h2 {
  font-size: clamp(26px, 3.1vw, 62px);
}

.agents-copy h2 span {
  display: block;
}

.agents-copy p {
  max-width: 46ch;
  margin-top: 32px;
  color: var(--soft);
  font-size: clamp(16px, 1.2vw, 19px);
}

.agents-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Запас по высоте: окно не меняет размер при смене задачи. */
.tui-small {
  min-height: 600px;
}

@media (max-width: 1400px) {
  .tui-small {
    min-height: 640px;
  }
}

/* 8. Финальный призыв */
.shout {
  position: relative;
  margin-top: var(--section);
  overflow: hidden;
}

.shout-canvas {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
}

.shout-inner {
  position: relative;
  padding: 0 var(--gutter) 120px;
}

.shout-link {
  display: block;
  font-family: var(--display);
  font-size: clamp(36px, 6.8vw, 156px);
  font-weight: 600;
  line-height: 1.04;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 180ms ease;
}


.shout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.shout-actions p {
  max-width: 44ch;
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.45;
}

.shout-hint {
  max-width: 62ch;
  margin-top: 24px;
  color: var(--soft);
  font-size: 16px;
}

/* 9. Подвал */
.site-footer {
  padding: 48px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto;
  align-items: start;
  gap: 32px;
}

.footer-info {
  display: grid;
  gap: 4px;
  color: var(--soft);
  font-size: 16px;
}

.footer-info a,
.footer-tg {
  text-underline-offset: 4px;
  transition: color 160ms ease;
}


.footer-tg {
  font-family: var(--mono);
  font-size: 17px;
}

.footer-matrix {
  margin-top: 56px;
}

.footer-canvas {
  width: 100%;
  height: 0;
}

/* Без JS вместо логотипа полоса квадратных точек */
html:not(.js) .footer-matrix {
  height: 132px;
  background: conic-gradient(
      from 270deg at var(--dot) var(--dot),
      var(--dot-soft) 25%,
      transparent 0
    )
    0 0 / var(--pitch) var(--pitch);
}

/* Наведение только там, где оно есть: на телефоне состояние не залипает после касания. */
@media (hover: hover) {
  .price-cell:hover .picto-on {
    fill: var(--violet);
  }

  .index-row:hover .row-mark {
    opacity: 1;
  }

  .index-row:hover .row-name-text {
    transform: translateX(0.56em);
  }

  .index-row:hover .row-meta {
    color: var(--text);
  }

  .index-row:hover .arrow {
    color: var(--violet);
    transform: translate(4px, -4px);
  }

  .button-primary:hover {
    background: var(--text);
  }

  .button-line:hover {
    border-color: var(--violet);
    color: var(--violet);
  }

  .site-nav a:hover::before {
    opacity: 1;
  }

  .header-cta:hover {
    border-color: var(--violet);
    color: var(--violet);
  }

  .tui-item:not(.is-active):hover {
    border-color: var(--line);
    background: var(--line-soft);
  }

  .cell:hover {
    background: var(--surface);
  }

  .cell:hover::before,
  .cell:hover::after {
    z-index: 2;
    background: var(--violet);
  }

  .price-cell:hover .num {
    color: var(--violet);
  }

  .shout-link:hover {
    color: var(--violet);
  }

  .footer-info a:hover,
  .footer-tg:hover {
    color: var(--violet);
  }
}

/* Узкий десктоп: шапка в одну строку без вылета за край */
@media (min-width: 1000px) and (max-width: 1239px) {
  .agents {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .site-header {
    gap: 24px;
  }

  .site-nav {
    gap: 20px;
  }

  .cta-label-long {
    display: none;
  }

  .cta-label-short {
    display: inline;
  }

  .row-name {
    font-size: 30px;
  }
}

/* Планшет и телефон: всё обычным потоком */
@media (max-width: 999px) {
  body {
    font-size: 16px;
  }

  h2 {
    font-size: clamp(28px, 8.6vw, 64px);
  }

  .site-header {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    height: 72px;
  }

  .nav-toggle {
    order: 3;
  }

  html.nav-ready .nav-toggle {
    display: grid;
  }

  .header-cta {
    order: 2;
  }

  .site-nav {
    order: 4;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 4px 20px;
  }

  html:not(.nav-ready) .site-header {
    height: auto;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  html.nav-ready .site-nav {
    position: absolute;
    top: 72px;
    right: var(--gutter);
    left: var(--gutter);
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-strong);
  }

  html.nav-ready .site-nav.is-open {
    display: flex;
  }

  html.nav-ready .site-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0;
    font-size: 17px;
  }

  html.nav-ready .site-nav a + a {
    border-top: 1px solid var(--line);
  }

  .site-nav a::before {
    display: none;
  }

  .brand {
    font-size: clamp(20px, 6vw, 28px);
  }

  .cta-label-long {
    display: none;
  }

  .cta-label-short {
    display: inline;
  }

  .header-cta {
    padding: 0 12px;
    font-size: 15px;
    gap: 4px;
  }

  .header-cta svg {
    width: 16px;
    height: 16px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: calc(76px + (100vw - 2 * var(--gutter)) / 7.4 + 24px) var(--gutter) 32px;
  }

  h1 {
    font-size: min(11.4vw, 88px);
  }

  .tail {
    max-width: 60ch;
    font-size: 16px;
  }

  .hero-side {
    gap: 20px;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }.tui-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .tui-left-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .tui-right-pane {
    padding: 16px;
  }

  .tui-window {
    font-size: 14px;
  }

  .tui-title {
    white-space: normal;
  }

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

  .tui-v + .tui-k {
    margin-top: 10px;
  }

  .tui-footer {
    flex-direction: column;
  }

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

  .picto {
    width: 56px;
    margin-bottom: 20px;
  }

  .index-head {
    margin-bottom: 32px;
  }

  .index-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 24px 0;
  }

  .row-name {
    font-size: clamp(26px, 7.4vw, 48px);
    overflow-wrap: normal;
  }

  .row-desc {
    font-size: 16px;
  }

  .row-meta {
    order: -1;
    font-size: 14px;
  }

  .row-preview {
    order: 4;
    margin-top: 8px;
  }

  .ledger-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }

  .ledger-head h2,
  .ledger-note {
    grid-column: 1;
  }

  .ledger-note {
    padding-left: 0;
  }

  .num {
    font-size: 38px;
  }

  .price-cell {
    min-height: 0;
    gap: 0;
    padding: 24px 20px;
  }

  .price-cell h3 {
    margin-top: 24px;
    font-size: 15px;
  }

  .price-cell p {
    font-size: 16px;
  }

  .how-head {
    margin-bottom: 40px;
  }

  .how-track {
    padding-left: var(--gutter);
  }

  .how-sentinel {
    display: none;
  }

  .dotline {
    position: absolute;
    top: 8px;
    bottom: 0;
    left: var(--gutter);
    width: var(--dot);
    height: auto;
    background: conic-gradient(
        from 270deg at var(--dot) var(--dot),
        var(--line-strong) 25%,
        transparent 0
      )
      0 0 / var(--dot) var(--pitch) repeat-y;
  }

  .dotline::after {
    background: conic-gradient(
        from 270deg at var(--dot) var(--dot),
        var(--violet) 25%,
        transparent 0
      )
      0 0 / var(--dot) var(--pitch) repeat-y;
    clip-path: inset(0 0 calc(100% - var(--p) * 100%) 0);
    transition: clip-path 480ms ease;
  }

  .steps-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding: 0 var(--gutter) 0 32px;
  }

  .step::before {
    top: 8px;
    left: -36px;
  }

  .how-step {
    margin-bottom: 16px;
  }

  .step h3 {
    min-height: 0;
    margin-bottom: 12px;
  }

  .step p {
    font-size: 16px;
  }

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

  .agents-copy h2 {
    font-size: clamp(28px, 8.6vw, 64px);
  }

  .agents-actions .button {
    flex: 1 1 auto;
  }

  .tui-small {
    min-height: 0;
  }

  .shout-canvas {
    height: 200px;
  }

  .shout-inner {
    padding-bottom: 80px;
  }

  .shout-link {
    font-size: min(12.4vw, 96px);
    white-space: normal;
  }

  .shout-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 32px;
  }

  .shout-actions .button {
    width: 100%;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .footer-matrix {
    margin-top: 40px;
  }
}

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

@media (max-width: 479px) {
  .button {
    white-space: normal;
  }

  .num {
    font-size: 38px;
  }
}

/* Планшет: окно и превью шире, сетка цен в две колонки */
@media (min-width: 640px) and (max-width: 999px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .button {
    flex: 0 1 auto;
  }

  .tui-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .row-name,
  .row-desc {
    grid-column: 1 / -1;
  }

  .row-meta {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  .how-track {
    --p: 1;
  }

  .how-step {
    color: var(--violet);
  }
}

@media (max-width: 720px) {
  .ledger-end .button {
    width: 100%;
  }
}
