/* Лендинг Envoy v4: услуги на площадке и схема перевода, путь гостя (главный момент). */

.sec-head { margin-bottom: 48px; }

/* Услуги: четыре равных кадра 3:2 в ряд; под ними схема перевода (HTML, без масштабируемого SVG-текста) */
.kit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px var(--gap); }
.kit img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-lg); background: var(--hall-2); }
.kit .h3 { margin-top: 16px; }
.kit p { margin-top: 8px; font-size: 16px; line-height: 1.5; }
@media (max-width: 1023px) { .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .kit { row-gap: 24px; }
  .kit .h3 { margin-top: 12px; font-size: 17px; }
  .kit p { display: none; }
}

.flow { margin: 48px 0 0; --fg: clamp(64px, 8.6vw, 136px); --ln: var(--hall-small); --lw: 2px; --dot: 8px; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--fg); align-items: center; }
.node {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 14px; align-items: center;
  min-height: 64px; padding: 12px 18px; border-radius: var(--r-md); background: var(--hall-2); border: 1px solid var(--hall-line);
}
.node svg { width: 24px; height: 24px; fill: currentColor; }
.node b { font-size: 17px; line-height: 1.3; font-weight: 600; }
.node span { font-size: 14px; line-height: 1.4; color: var(--hall-small); }
.guests { display: grid; grid-auto-rows: 1fr; gap: 16px; }
/* Соединения: тонкая линия во весь промежуток, на конце точка (без стрелок); вилка от системы перевода к двум гостям */
.flow li { position: relative; }
.flow li:nth-child(-n+3) > .node::after, .guests::before, .guests .node::before { content: ""; position: absolute; }
.flow li:nth-child(-n+2) > .node::after { left: calc(100% + 1px); top: calc(50% - var(--dot) / 2); width: calc(var(--fg) - 2px); height: var(--dot); background: var(--link-r); }
.flow li:nth-child(3) > .node::after { left: calc(100% + 1px); top: calc(50% - var(--lw) / 2); width: calc(var(--fg) / 2); height: var(--lw); background: var(--ln); }
/* карточки гостей равной высоты: вилка от центра верхней до центра нижней */
.guests::before { left: calc(var(--fg) / -2); top: calc((100% - 16px) / 4); bottom: calc((100% - 16px) / 4); width: var(--lw); background: var(--ln); }
.guests .node::before { left: calc(var(--fg) / -2); top: calc(50% - var(--dot) / 2); width: calc(var(--fg) / 2 - 1px); height: var(--dot); background: var(--link-r); }
.flow {
  /* линия ровно 2 px и точка 8 px: целые пиксели, на телефонах без размытия */
  --link-r: linear-gradient(var(--ln) 0 0) left center / calc(100% - var(--dot)) var(--lw) no-repeat, radial-gradient(circle calc(var(--dot) / 2) at calc(100% - var(--dot) / 2) 50%, var(--hall-text) 96%, transparent 100%);
  --link-d: linear-gradient(var(--ln) 0 0) center top / var(--lw) calc(100% - var(--dot)) no-repeat, radial-gradient(circle calc(var(--dot) / 2) at 50% calc(100% - var(--dot) / 2), var(--hall-text) 96%, transparent 100%);
}
/* Компьютер: карточки по ширине названия, линии между ними тянутся и равны (li без своей коробки, его ::after в ряду) */
@media (min-width: 1024px) {
  .flow ol { display: flex; align-items: center; gap: 0; }
  .flow li:nth-child(-n+3) { display: contents; }
  .flow li > .node { flex: none; }
  .node b { white-space: nowrap; }
  .flow li:nth-child(-n+3) > .node::after { content: none; }
  .flow li:nth-child(-n+2)::after { content: ""; flex: 1 1 0; min-width: 48px; height: var(--dot); margin: 0 8px 0 1px; background: var(--link-r); }
  /* вилка: отрезок до развилки и ветки к гостям одной длины (48 px), остальные линии делят свободное место поровну */
  .flow li:nth-child(3)::after { content: ""; flex: 0 0 48px; height: var(--lw); margin-left: 1px; background: var(--ln); }
  .flow li:last-child { flex: none; }
  .guests { position: relative; padding-left: 56px; }
  .guests::before { left: 0; }
  .guests .node::before { left: -56px; width: 48px; }
}
@media (max-width: 1023px) {
  .flow ol { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .flow li:nth-child(-n+2) > .node::after { left: calc(50% - var(--dot) / 2); top: calc(100% + 1px); width: var(--dot); height: 31px; background: var(--link-d); }
  .flow li:nth-child(3) > .node::after { left: calc(50% - var(--lw) / 2); top: calc(100% + 1px); width: var(--lw); height: 20px; }
  .guests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guests::before { left: calc((100% - 16px) / 4 - var(--lw) / 2); right: calc((100% - 16px) / 4 - var(--lw) / 2); top: -20px; bottom: auto; width: auto; height: var(--lw); }
  .guests .node::before { left: calc(50% - var(--dot) / 2); top: -20px; width: var(--dot); height: 13px; background: var(--link-d); }
  /* две узкие карточки гостей: значок над названием, всё по центру, название в одну строку */
  .guests .node { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 8px; padding: 16px 12px; text-align: center; }
  .guests .node b { white-space: nowrap; }
}

/* Путь гостя. Шаги с номерами 01–04 и линией между кружками; справа один телефон, экраны в одной ячейке */
.trip-grid { align-items: start; row-gap: 48px; }
.trip-left { grid-column: 1 / 7; }
.trip-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.trip-step { position: relative; }
.trip-step:not(:last-child)::before { content: ""; position: absolute; left: 16.25px; top: 42px; bottom: -30px; width: 1.5px; background: var(--paper-line); transition: background-color var(--t-state) var(--ease); }
.trip-step.past::before { background: var(--stub); }
.trip-h { margin: 0; font-size: var(--fs-h3); line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.trip-btn {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; align-items: center; width: 100%;
  min-height: 48px; padding: 0; border: 0; border-radius: var(--r-md); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.trip-btn .num { position: relative; z-index: 1; background: var(--paper); font-size: 16px; font-weight: 650; transition: background-color var(--t-state) var(--ease), border-color var(--t-state) var(--ease); }
.trip-step p { margin-top: 8px; padding-left: 48px; max-width: 30em; }
.trip-step.on .num { background: var(--stub); border-color: var(--stub); }
.trip-phone { grid-column: 8 / 13; display: flex; flex-direction: column; align-items: center; }
.trip-phone .iphone { --w: 340px; max-width: 100%; margin-right: 4px; }
.ip-shot { opacity: 0; transition: opacity 0ms linear var(--t-panel); }
.ip-shot.on { opacity: 1; z-index: 2; transition: opacity var(--t-panel) var(--ease) 0ms; }
.ip-shot.prev { z-index: 1; }
.ip-shots > .ip-shot:only-child { opacity: 1; }
.js:not(.motion) .ip-shot, .js:not(.motion) .ip-shot.on { transition: none; }

@media (max-width: 1023px) {
  .trip-left, .trip-phone { grid-column: 1 / -1; }
  .trip-phone .iphone { --w: 280px; }
  .trip.tap .trip-step:not(.on) p { display: none; }
  .trip.tap .trip-steps { gap: 12px; }
  .trip.tap .trip-step:not(:last-child)::before { bottom: -10px; }
}
@media (min-width: 1024px) { .trip-phone { justify-self: end; } }
/* Без липкого режима (мало движения) путь гостя помещается в один экран */
@media (min-width: 1024px) and (min-height: 700px) { .trip.tap { min-height: min(100svh, 1000px); } }

/* Липкий вариант: только с JS, при обычном движении и на широком экране */
@media (min-width: 1024px) {
  .trip.scroll .trip-left { grid-column: 1 / 8; }
  .trip.scroll .trip-steps { gap: 0; }
  .trip.scroll .trip-step { min-height: 27svh; }
  .trip.scroll .trip-step:last-child { min-height: 36svh; }
  .trip.scroll .trip-step:not(:last-child)::before { bottom: 0; top: 42px; height: calc(100% - 36px); }
  .trip.scroll .trip-step:not(.on) .trip-btn, .trip.scroll .trip-step:not(.on) p { color: var(--graphite); }
  .trip.scroll .trip-step .trip-btn, .trip.scroll .trip-step p { transition: color var(--t-state) var(--ease); }
  .trip.scroll .trip-phone { position: sticky; top: calc(var(--head) + max(24px, (100svh - var(--head) - var(--ph)) / 2)); }
  .trip.scroll .trip-phone .iphone { --w: min(340px, (100svh - var(--head) - 96px) * 0.4793); }
  .trip { --ph: min(709px, 100svh - var(--head) - 96px); }
}
