/* ─────────────────────────────────────────────────────────────────────────
   СХЕМЫ РАЗДЕЛОВ · направления, проекты, команда. Сила эффектов — умеренная:
   только тонкие линии и один проход света, никакого свечения «bloom».
   Движение медленное, одна кривая; состояние задаёт класс.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Общее: чипы выбора. Радиусов в языке сайта нет, единственная сигнатура — срез
   угла; выбранный чип отмечен ещё и меткой, а не только заливкой ────────── */
.chip,
.chip:hover,
.chip[aria-pressed="true"] {
  border-radius: 0;
  min-height: 44px;
}
.chip {
  position: relative;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
.chip[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset-block-start: 5px;
  inset-inline-start: 5px;
  width: 6px;
  height: 2px;
  background: var(--ox-on-accent);
}
.chip:focus-visible {
  outline: var(--bw-focus) solid var(--ox-focus);
  outline-offset: 3px;
  clip-path: none;
}

/* ── 02 · Направления ───────────────────────────────────────────────────── */
.row.has-mod {
  align-items: center;
}
@media (min-width: 52rem) {
  .row.has-mod {
    grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1.15fr) 200px;
  }
}
@media (max-width: 51.99rem) {
  /* описание на всю ширину строки (раньше оно попадало в узкую колонку индекса) */
  .row .row-d {
    grid-column: 1 / -1;
  }
  .row.has-mod .mod {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0.6rem;
  }
}

.mod {
  --btn-notch: var(--ox-bg);
  position: relative;
  display: block;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 5 / 3;
  padding: 0;
  border: var(--bw) solid var(--ox-line-ui);
  background: var(--ox-surface);
  color: var(--ox-ink-3);
  cursor: pointer;
  transition: border-color var(--d-1) var(--ease), color var(--d-2) var(--ease);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.mod:focus-visible {
  outline: var(--bw-focus) solid var(--ox-focus);
  outline-offset: 3px;
  clip-path: none; /* срез угла обрезал бы кольцо фокуса */
}
.mod-svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.mod .sh {
  stroke: var(--ox-line);
}
.mod .ln {
  stroke: currentColor;
  opacity: 0;
  stroke-dasharray: 2 3;
  transition: opacity var(--d-3) var(--ease);
}
.mod .ln.rest {
  opacity: 0.4;
}
.mod .nd {
  fill: var(--ox-ink-3);
  stroke: none;
  opacity: 0;
  transition: opacity var(--d-3) var(--ease), fill var(--d-2) var(--ease);
}
.mod .nd.rest {
  opacity: 0.6;
}
.mod .fl {
  stroke: var(--ox-red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset var(--d-4) var(--ease), opacity var(--d-2) var(--ease);
}
/* открыто: нажатие (тач, клавиатура) или наведение (только точный указатель) */
.mod[aria-pressed="true"] {
  border-color: var(--ox-ink);
  color: var(--ox-ink-2);
}
.mod[aria-pressed="true"] .ln {
  opacity: 0.85;
  stroke-dasharray: none;
}
.mod[aria-pressed="true"] .nd {
  opacity: 1;
  fill: var(--ox-ink);
}
.mod[aria-pressed="true"] .fl {
  stroke-dashoffset: 0;
  opacity: 1;
}
/* выбранное отмечено не только цветом: метка-риска в верхнем левом углу */
.mod[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  width: 10px;
  height: 2px;
  background: var(--ox-ink);
}
@media (hover: hover) and (pointer: fine) {
  .row:hover .mod,
  .mod:hover {
    border-color: var(--ox-ink-3);
  }
  .row:hover .mod .ln,
  .mod:hover .ln {
    opacity: 0.85;
    stroke-dasharray: none;
  }
  .row:hover .mod .nd,
  .mod:hover .nd {
    opacity: 1;
    fill: var(--ox-ink);
  }
  .row:hover .mod .fl,
  .mod:hover .fl {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* ── 03 · Проекты: входящие → обработка → результат ─────────────────────── */
.proc {
  --btn-notch: var(--ox-bg);
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding: clamp(1rem, 0.8rem + 1vw, 1.6rem);
  border: var(--bw) solid var(--ox-line);
  background: var(--ox-surface);
  clip-path: polygon(0 0, calc(100% - var(--cut-panel)) 0, 100% var(--cut-panel), 100% 100%, 0 100%);
}
.proc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.proc-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: clamp(1.1rem, 0.9rem + 1vw, 1.8rem) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 52rem) {
  .proc-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.st {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 5.2rem;
  padding: 0.9rem 1rem 1rem;
  border: var(--bw) solid var(--ox-line);
  color: var(--ox-ink-3);
  transition: border-color var(--d-3) var(--ease), color var(--d-3) var(--ease), background-color var(--d-3) var(--ease);
}
.st .tag {
  color: var(--ox-ink-3);
}
.st-v {
  font-weight: 600;
  font-size: var(--t-body);
  line-height: 1.3;
  color: inherit;
}
/* соединитель к следующему этапу: тонкая линия, по которой идёт свет */
.st::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, var(--ox-red), var(--ox-violet));
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0.9;
  transition: transform var(--d-4) var(--ease);
}
.st-3::after {
  display: none;
}
@media (min-width: 52rem) {
  .st {
    border-inline-start-width: 0;
  }
  .st-1 {
    border-inline-start-width: var(--bw);
  }
  .st::after {
    inset-block-start: 50%;
    inset-inline: 100% auto;
    width: 2.4rem;
    height: 1px;
    margin-inline-start: -1.2rem;
    z-index: 1;
  }
}
@media (max-width: 51.99rem) {
  .st {
    border-block-start-width: 0;
  }
  .st-1 {
    border-block-start-width: var(--bw);
  }
  .st::after {
    inset-inline-start: 1.4rem;
    inset-block: 100% auto;
    width: 1px;
    height: 1.6rem;
    margin-block-start: -0.8rem;
    transform: scaleY(0);
    transform-origin: top;
    background: linear-gradient(180deg, var(--ox-red), var(--ox-violet));
    z-index: 1;
  }
}
/* без JS и без запуска: все три этапа читаются; запуск — последовательная подсветка */
.proc-flow.is-run .st {
  border-color: var(--ox-line);
  color: var(--ox-ink-3);
  animation: stLight var(--d-3) var(--ease) forwards;
}
.proc-flow.is-run .st-1 { animation-delay: 0s; }
.proc-flow.is-run .st-2 { animation-delay: 1.3s; }
.proc-flow.is-run .st-3 { animation-delay: 2.6s; }
.proc-flow.is-run .st::after {
  animation: stLine var(--d-4) var(--ease) forwards;
}
.proc-flow.is-run .st-1::after { animation-delay: 0.5s; }
.proc-flow.is-run .st-2::after { animation-delay: 1.8s; }
@keyframes stLight {
  to {
    border-color: var(--ox-ink);
    color: var(--ox-ink);
  }
}
@keyframes stLine {
  to { transform: scale(1); }
}
.row.is-sel .row-n {
  color: var(--ox-red);
}
.row.is-sel .row-t::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 2px;
  margin-inline-end: 0.5rem;
  vertical-align: middle;
  background: var(--ox-ink);
}

/* ── 04 · Команда: две зоны одной системы ───────────────────────────────── */
.team {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  align-items: stretch;
}
@media (min-width: 40rem) {
  .team {
    grid-template-columns: minmax(0, 1fr) clamp(4rem, 12vw, 9rem) minmax(0, 1fr);
  }
}
.tz {
  --btn-notch: var(--ox-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 5.5rem;
  padding: 1rem 1.2rem;
  text-align: start;
  font: inherit;
  color: var(--ox-ink);
  background: var(--ox-surface);
  border: var(--bw) solid var(--ox-line);
  cursor: pointer;
  transition: border-color var(--d-2) var(--ease), background-color var(--d-2) var(--ease);
}
.tz b {
  font-size: var(--t-h3);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.tz .tag {
  color: var(--ox-ink-3);
}
.tz--r { border-inline-start: 2px solid var(--ox-red); }
.tz--v { border-inline-start: 2px solid var(--ox-violet); }
.tz[aria-pressed="true"] {
  border-color: var(--ox-ink);
  background: var(--ox-surface-2);
}
.tz[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 6px;
  width: 10px;
  height: 2px;
  background: var(--ox-ink);
}
.tz:focus-visible {
  outline: var(--bw-focus) solid var(--ox-focus);
  outline-offset: 3px;
}
.tz-link {
  display: none;
  width: 100%;
  height: 100%;
  fill: none;
  stroke-width: 1;
}
@media (min-width: 40rem) {
  .tz-link {
    display: block;
    align-self: center;
  }
}
.tz-link .ch {
  stroke: var(--ox-line);
  stroke-dasharray: 3 4;
  transition: stroke var(--d-3) var(--ease);
}
.tz-link .cn {
  fill: var(--ox-ink-3);
  stroke: none;
}
.team[data-pick="0"] .ch--r,
.team[data-pick="1"] .ch--v {
  stroke: var(--ox-ink-2);
  stroke-dasharray: none;
}
.team[data-pick="0"] .ch--r { stroke: var(--ox-red); }
.team[data-pick="1"] .ch--v { stroke: var(--ox-violet); }
.team[data-pick="0"] .cn,
.team[data-pick="1"] .cn { fill: var(--ox-ink); }

@media (prefers-reduced-motion: reduce) {
  .mod .ln,
  .mod .nd,
  .mod .fl,
  .st,
  .st::after,
  .tz,
  .tz-link .ch {
    transition: none !important;
  }
  .proc-flow.is-run .st,
  .proc-flow.is-run .st::after {
    animation: none !important;
    border-color: var(--ox-ink);
    color: var(--ox-ink);
  }
  .proc-flow.is-run .st::after {
    transform: scale(1);
  }
}

/* тач-экраны: цели не меньше 44 px (рекомендация WCAG 2.2 AAA / HIG) */
@media (pointer: coarse) {
  .btn,
  .lang button,
  .chip,
  .tz,
  .pay-pick,
  .view-toggle .chip {
    min-height: 44px;
  }
  .lang button {
    min-width: 44px;
  }
}

/* метки не мельче 11.5 px (токен --t-tag); раньше на телефоне выходило 9.9 px */
.tag {
  font-size: max(11.5px, var(--t-tag));
}

/* телефон: подписи схемы конструктора крупнее, мелкие скрыты (иначе 5–6 px и налезают друг на друга) */
@media (max-width: 40rem) {
  .lat-lab { font-size: 17px; paint-order: stroke; stroke: #090a1f; stroke-width: 4px; stroke-linejoin: round; }
  .lat-lab--sm,
  .lat-lab--part { display: none; }
}

/* низкие окна: кнопки героя не уходят за нижний край */
@media (min-width: 62rem) and (max-height: 720px) {
  .hero { padding-block-start: 0.5rem; }
  .hero h1 { font-size: clamp(2.1rem, 1rem + 4.4vh, 3.3rem); margin-top: 0.7rem; }
  .hero-lede { margin-top: 0.7rem; }
  .hero-sign { margin-top: 1rem; }
}

/* схема-разрез проекта: своя форма пути у каждого проекта */
.proc-map { margin-top: 1.2rem; max-width: 36rem; }
.proc-map svg { display: block; width: 100%; height: auto; overflow: visible; }
.pm-l { fill: none; stroke: var(--ox-red); stroke-width: 1.4; opacity: 0.55; }
.pm-l.v { stroke: var(--ox-violet-text); }
.pm-f { fill: none; stroke: #fff4ea; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 0.06 0.94; animation: pmFlow 2.8s linear infinite; filter: drop-shadow(0 0 3px #e15358); }
.pm-f.v { filter: drop-shadow(0 0 3px #b36ef0); animation-delay: -1.2s; }
.pm-n { fill: #090a1f; stroke: var(--ox-red); stroke-width: 1.6; animation: pmBlink 3.4s ease-in-out infinite; }
.pm-n.v { stroke: var(--ox-violet-text); animation-delay: -1.1s; }
.pm-n.hub { fill: var(--ox-red); stroke: #ffb0b4; animation-delay: -2s; }
.pm-ring { fill: none; stroke: var(--ox-violet-text); stroke-width: 1; opacity: 0.5; transform-origin: 180px 60px; animation: pmRing 3.2s ease-in-out infinite; }
@keyframes pmFlow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pmBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes pmRing { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.35); opacity: 0.1; } }
@media (prefers-reduced-motion: reduce) { .pm-f, .pm-n, .pm-ring { animation: none; } .pm-f { display: none; } }
