/* ─────────────────────────────────────────────────────────────────────────
 * Главная v3: интерактивные блоки поверх landing-v2.css.
 *
 * Правила бренда те же: один акцент #e06733 как фон, оранжевый текст —
 * #ff8f5e на тёмном и #b34f26 на светлом; Manrope 400/600/700; радиусы
 * 8/10/16/9999; разделители — смена поверхности; градиентов нет.
 * Анимации — Motion (MIT, assets/vendor/motion) из home-v3.js и CSS;
 * при prefers-reduced-motion всё показывается сразу, без движения.
 *
 * Без JavaScript все панели видны списком: скрытие неактивных включается
 * классом .v3-js на <html>, который ставит скрипт.
 * ───────────────────────────────────────────────────────────────────────── */

body.v2 .v3-ic {
  width: 18px;
  height: 18px;
  flex: none;
}
body.v2 .v3-ic-sm {
  width: 14px;
  height: 14px;
}

/* ── Герой с живой демонстрацией ─────────────────────────────────────── */
.v3-hero {
  background: var(--ink-deep);
}
.v3-hero-inner {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: center;
  padding-block: 72px 80px;
}
.v3-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
body.v2 .v3-hero h1 {
  font-size: 50px;
  line-height: 1.08;
}

.v3-demo {
  background: var(--ink-raised);
  border-radius: 16px;
  padding: 8px;
  min-width: 0;
}
.v3-demo-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
}
body.v2 .v3-demo-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--on-dark-2);
  font: 600 14px/1 "Manrope", system-ui, sans-serif;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.2s, color 0.2s;
}
body.v2 .v3-demo-tab:hover {
  color: var(--on-dark);
}
body.v2 .v3-demo-tab.is-active {
  background: var(--tile-on-dark);
  color: var(--on-dark);
}
body.v2 .v3-demo-tab:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 2px;
}
.v3-demo-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 9999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
/* Остановленная анимация Motion оставляет последний кадр — у неактивной вкладки полоску не показываем */
.v3-demo-tab:not(.is-active) .v3-demo-progress {
  opacity: 0;
}

.v3-demo-stage {
  position: relative;
  min-height: 330px;
  margin-top: 4px;
  padding: 20px;
  border-radius: 10px;
  background: var(--ink);
}
.v3-js .v3-scene:not(.is-active) {
  display: none;
}
.v3-scene + .v3-scene {
  margin-top: 28px;
}
.v3-js .v3-scene + .v3-scene {
  margin-top: 0;
}
.v3-scene-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark-2);
}
.v3-scene-head > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.v3-live,
.v3-rec {
  font-size: 12px;
  color: var(--on-dark-3);
}
.v3-live i,
.v3-rec i {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #22c55e; /* зелёный — только состояние «в работе» */
  animation: v3-blink 1.6s ease-in-out infinite;
}
.v3-rec i {
  background: #ef4444; /* красный — только состояние «идёт запись» */
}
@keyframes v3-blink {
  50% {
    opacity: 0.35;
  }
}
.v3-scene-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px !important;
  font-size: 13px;
  color: var(--on-dark-3);
}

/* Platform: очередь */
.v3-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v3-ticket {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--tile-on-dark);
}
.v3-src {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--ink-raised);
  color: var(--accent-on-dark);
}
.v3-ticket-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.v3-ticket-main b {
  font-weight: 600;
  font-size: 14px;
  color: var(--on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-ticket-main small {
  font-size: 12px;
  color: var(--on-dark-3);
}
.v3-owner {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: var(--ink-raised);
  font-size: 11px;
  font-weight: 700;
  color: var(--on-dark-2);
}
.v3-sla {
  padding: 4px 8px;
  border-radius: 9999px;
  background: rgba(255, 143, 94, 0.14);
  color: var(--accent-on-dark);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Gate: сессия */
.v3-term {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 10px;
  background: var(--ink-deep);
  font-size: 14px;
  color: var(--on-dark-2);
}
.v3-line {
  margin: 0 !important;
}
.v3-prompt {
  color: var(--accent-on-dark);
  font-weight: 700;
  margin-right: 6px;
}
.v3-mask {
  letter-spacing: 0.12em;
  color: var(--on-dark);
}
.v3-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 143, 94, 0.14);
  color: var(--accent-on-dark);
  font-size: 13px;
  font-weight: 600;
}

/* AI Guard: запрос */
.v3-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v3-bubble {
  padding: 14px 16px;
  border-radius: 16px 16px 16px 8px;
  background: var(--tile-on-dark);
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-dark);
}
.v3-bubble mark {
  padding: 1px 4px;
  border-radius: 8px;
  background: rgba(255, 143, 94, 0.18);
  color: var(--accent-on-dark);
  transition: background-color 0.3s, color 0.3s;
}
.v3-bubble mark.is-masked {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.v3-route {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark-2);
}
.v3-bubble-sys {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-radius: 16px 16px 8px 16px;
  background: var(--ink-deep);
  color: var(--on-dark-2);
  font-size: 13px;
}
.v3-bubble-sys .v3-ic {
  color: #22c55e;
  margin-top: 3px;
}

/* ── Главы продуктов со схемой ───────────────────────────────────────── */
.v3-chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-block: 48px;
}
.v3-chapter + .v3-chapter {
  margin-top: 24px;
}
.v3-chapter-flip .v3-chapter-copy {
  order: 2;
}
.v3-chapter-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.v3-chapter-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.v2 .v3-num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-text);
}
body.v2 .v3-chapter h3 {
  font-size: 40px;
  line-height: 1.1;
}
body.v2 .v3-problem {
  font-size: 21px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
}
.v3-chapter-copy > p:not(.v3-problem) {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  max-width: 60ch;
}
.v3-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v3-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
  line-height: 1.5;
}
.v3-points .v3-ic {
  color: var(--accent-text);
  margin-top: 2px;
}

.v3-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(118px, auto) 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  border-radius: 16px;
  background: var(--surface-sunk);
}
.v3-flow-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.v3-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  white-space: nowrap;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.v3-node .v3-ic {
  color: var(--accent-text);
}
.v3-node-core {
  white-space: normal;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--ink);
  color: var(--on-dark);
}
.v3-node-core .v3-ic {
  width: 28px;
  height: 28px;
  color: var(--accent-on-dark);
}
.v3-node-core b {
  font-size: 14px;
  font-weight: 700;
}
.v3-node-core small {
  font-size: 12px;
  font-weight: 400;
  color: var(--on-dark-2);
}
.v3-flow-link {
  position: relative;
  height: 2px;
  background: var(--hairline);
  overflow: hidden;
}
.v3-flow-link i {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 2px;
  background: var(--accent);
  animation: v3-flow 1.8s linear infinite;
}
@keyframes v3-flow {
  from {
    transform: translateX(-12px);
  }
  to {
    transform: translateX(32px);
  }
}

/* ── Сегменты ────────────────────────────────────────────────────────── */
.v3-seg-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 9999px;
  background: var(--tile-on-dark);
  margin-bottom: 32px;
}
body.v2 .v3-seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--on-dark-2);
  font: 600 15px/1 "Manrope", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
body.v2 .v3-seg-tab:hover {
  color: var(--on-dark);
}
body.v2 .v3-seg-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}
body.v2 .v3-seg-tab:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 2px;
}
.v3-seg-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.v3-seg-panel + .v3-seg-panel {
  margin-top: 48px;
}
.v3-js .v3-seg-panel + .v3-seg-panel {
  margin-top: 0;
}
.v3-js .v3-seg-panel:not(.is-active) {
  display: none;
}
.v3-seg-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
body.v2 .v3-seg-copy h3 {
  font-size: 32px;
  line-height: 1.15;
}
.v3-seg-copy p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--on-dark-2);
}
.v3-seg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v3-seg-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px;
  border-radius: 16px;
  background: var(--tile-on-dark);
}
.v3-seg-product {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--on-dark);
}
.v3-seg-product .v3-ic {
  color: var(--accent-on-dark);
}
.v3-seg-text {
  color: var(--on-dark-2);
  line-height: 1.55;
}

/* ── Один рабочий день ───────────────────────────────────────────────── */
.v3-day-wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: stretch;
}
.v3-day-track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v3-day-track::before {
  content: "";
  position: absolute;
  left: 79px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--hairline);
}
body.v2 .v3-day-stop {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 28px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font: 600 15px/1.35 "Manrope", system-ui, sans-serif;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
body.v2 .v3-day-stop::before {
  content: "";
  position: absolute;
  left: 74px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: var(--canvas);
  box-shadow: 0 0 0 2px var(--hairline);
}
body.v2 .v3-day-stop time {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
body.v2 .v3-day-stop span {
  padding-left: 12px;
}
body.v2 .v3-day-stop:hover {
  color: var(--ink);
}
body.v2 .v3-day-stop.is-active {
  background: var(--canvas);
  color: var(--ink);
}
body.v2 .v3-day-stop.is-active::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(224, 103, 51, 0.2);
}
body.v2 .v3-day-stop.is-active time {
  color: var(--accent-text);
}
body.v2 .v3-day-stop:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.v3-day-scenes {
  position: relative;
}
.v3-day-scene {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  height: 100%;
  padding: 40px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--on-dark);
}
.v3-day-scene + .v3-day-scene {
  margin-top: 16px;
}
.v3-js .v3-day-scene + .v3-day-scene {
  margin-top: 0;
}
.v3-js .v3-day-scene:not(.is-active) {
  display: none;
}
body.v2 .v3-day-scene h3 {
  font-size: 32px;
  line-height: 1.15;
  color: var(--on-dark);
}
.v3-day-scene p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-dark-2);
}
.v3-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--tile-on-dark);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark-2);
}
.v3-tag .v3-ic {
  color: var(--accent-on-dark);
}
body.v2 .v3-day-result {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  padding: 16px;
  border-radius: 10px;
  background: var(--ink-raised);
  color: var(--on-dark);
  font-size: 15px;
  font-weight: 600;
}
.v3-day-result .v3-ic {
  color: var(--accent-on-dark);
  margin-top: 2px;
}

/* ── Миссия и принципы ───────────────────────────────────────────────── */
.v3-mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.v3-mission-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}
body.v2 .v3-quote {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-dark);
}
body.v2 .v3-quote-sub {
  font-size: 14px;
  color: var(--on-dark-3);
  margin-bottom: 8px;
}
.v3-principles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v3-principle {
  border-radius: 16px;
  background: var(--tile-on-dark);
  transition: background-color 0.2s;
}
.v3-principle[open] {
  background: var(--ink-raised);
}
.v3-principle summary {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--on-dark);
}
.v3-principle summary::-webkit-details-marker {
  display: none;
}
body.v2 .v3-principle .v3-num {
  color: var(--accent-on-dark);
}
.v3-principle summary:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: -2px;
  border-radius: 16px;
}
body.v2 .v3-plus {
  color: var(--on-dark-2);
  transition: transform 0.25s;
}
.v3-principle[open] .v3-plus {
  transform: rotate(45deg);
}
.v3-principle-body {
  padding: 0 24px 22px 72px;
}
.v3-principle-body p {
  color: var(--on-dark-2);
  line-height: 1.6;
}

/* ── Адаптив ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .v3-hero-inner,
  .v3-chapter,
  .v3-seg-panel,
  .v3-day-wrap,
  .v3-mission-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .v3-chapter-flip .v3-chapter-copy {
    order: 0;
  }
  body.v2 .v3-hero h1 {
    font-size: 44px;
  }
}

@media (max-width: 767px) {
  .v3-hero-inner {
    padding-block: 32px 48px;
  }
  body.v2 .v3-hero h1 {
    font-size: 34px;
    line-height: 1.1;
  }
  .v3-demo-stage {
    min-height: 0;
    padding: 14px;
  }
  body.v2 .v3-demo-tab span {
    font-size: 13px;
  }
  .v3-ticket {
    grid-template-columns: auto 1fr auto;
  }
  .v3-owner {
    display: none;
  }
  .v3-chapter {
    padding-block: 24px;
  }
  body.v2 .v3-chapter h3 {
    font-size: 30px;
  }
  body.v2 .v3-problem {
    font-size: 18px;
  }
  /* Схема на телефоне — вертикально, связи поворачиваются */
  .v3-flow {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .v3-flow-link {
    width: 2px;
    height: 24px;
    justify-self: center;
  }
  .v3-flow-link i {
    width: 2px;
    height: 10px;
    animation-name: v3-flow-down;
  }
  .v3-seg-tabs {
    display: flex;
    border-radius: 16px;
  }
  body.v2 .v3-seg-tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 12px 14px;
    font-size: 14px;
  }
  body.v2 .v3-seg-copy h3,
  body.v2 .v3-day-scene h3 {
    font-size: 26px;
  }
  .v3-seg-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  /* Лента дня — горизонтально, с прокруткой и фиксацией по карточке */
  .v3-day-track {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    margin-inline: -20px;
    padding-inline: 20px;
    gap: 8px;
  }
  .v3-day-track::before {
    display: none;
  }
  .v3-day-track li {
    scroll-snap-align: start;
    flex: 0 0 72%;
  }
  body.v2 .v3-day-stop {
    grid-template-columns: 1fr;
    gap: 4px;
    height: 100%;
    background: var(--canvas);
  }
  body.v2 .v3-day-stop::before {
    display: none;
  }
  body.v2 .v3-day-stop span {
    padding-left: 0;
  }
  body.v2 .v3-day-stop.is-active {
    background: var(--ink);
    color: var(--on-dark);
  }
  body.v2 .v3-day-stop.is-active time {
    color: var(--accent-on-dark);
  }
  .v3-day-scene {
    padding: 24px;
  }
  body.v2 .v3-quote {
    font-size: 28px;
  }
  .v3-principle summary {
    padding: 18px;
    font-size: 16px;
  }
  .v3-principle-body {
    padding: 0 18px 18px 66px;
  }
}
@keyframes v3-flow-down {
  from {
    transform: translateY(-10px);
  }
  to {
    transform: translateY(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .v3-flow-link i,
  .v3-live i,
  .v3-rec i {
    animation: none;
  }
  .v3-demo-progress {
    display: none;
  }
}
