/* ============================================================
   Hero v3 — explain + dual-CTA + chat + ТУ mockup
   Зависит от style.css (переменные --ink-*, --indigo-*, --graphite-*)
   ============================================================ */

.hero-v3 {
  padding: clamp(40px, 6vw, 88px) 0 clamp(40px, 5vw, 72px);
  background:
    radial-gradient(ellipse 60% 50% at 18% 8%, rgba(67, 56, 202, 0.07), transparent 60%),
    radial-gradient(ellipse 40% 50% at 92% 92%, rgba(67, 56, 202, 0.05), transparent 60%),
    var(--paper);
  position: relative;
  overflow: hidden;
  min-height: auto;
  display: block;
  align-items: initial;
}

/* Тонкая «миллиметровка» под фоном — намёк на чертёжку */
.hero-v3::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 27, 46, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 27, 46, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 80%);
  opacity: 0.55;
}

.hero-v3__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

@media (max-width: 1020px) {
  .hero-v3__inner { grid-template-columns: 1fr; gap: 40px; }
}

/* -------- LEFT column -------- */

.hero-v3__copy { min-width: 0; }

.hero-v3__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--paper-pure);
  border: 1px solid var(--graphite-200);
  border-radius: 999px;
  color: var(--graphite-700);
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(14, 27, 46, 0.03);
}
.hero-v3__eyebrow-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--indigo-700);
  color: var(--paper-pure);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.hero-v3__h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  margin: 0 0 20px;
  max-width: 18ch;
}
.hero-v3__h1 em {
  font-style: normal;
  color: var(--indigo-700);
  font-weight: 800;
  white-space: nowrap;
  position: relative;
}
.hero-v3__h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 8px;
  background: var(--indigo-100);
  z-index: -1;
  border-radius: 2px;
}

.hero-v3__lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--graphite-700);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-v3__lead strong {
  color: var(--ink-900);
  font-weight: 700;
  padding: 0 2px;
  background: linear-gradient(180deg, transparent 60%, var(--indigo-100) 60%);
}

/* Dual CTA */
.hero-v3__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.hero-v3__cta .btn { padding: 16px 22px; font-size: 15px; }
.hero-v3__cta-primary { box-shadow: 0 4px 14px rgba(67, 56, 202, 0.22); }
.hero-v3__cta-secondary {
  background: var(--paper-pure);
}

.hero-v3__cta-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite-500);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}
.hero-v3__cta-note-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-v3__cta-note-row strong {
  color: var(--graphite-900);
  font-weight: 600;
}
.hero-v3__dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.hero-v3__dot--indigo { background: var(--indigo-700); box-shadow: 0 0 0 3px var(--indigo-50); }
.hero-v3__dot--graphite { background: var(--graphite-500); box-shadow: 0 0 0 3px var(--graphite-100); }

/* "Или..." divider */
.hero-v3__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  color: var(--graphite-500);
}
.hero-v3__divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--graphite-200), transparent);
}
.hero-v3__divider-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--graphite-500);
  white-space: nowrap;
}
.hero-v3__divider-arrow {
  font-size: 14px;
  color: var(--indigo-700);
  animation: hero-v3-bob 2.2s ease-in-out infinite;
}
@keyframes hero-v3-bob {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50%      { transform: translateY(3px); opacity: 1; }
}

/* Chat slot — переиспользует .chat-box / .chat-input из style.css */
.hero-v3__chat { max-width: 100%; margin-bottom: 0; }
.hero-v3__chips { margin-top: 12px; }

/* Trust row */
.hero-v3__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 22px;
  border-top: 1px dashed var(--graphite-200);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--graphite-500);
  letter-spacing: 0.01em;
}
.hero-v3__trust-item strong {
  color: var(--ink-900);
  font-weight: 600;
}
.hero-v3__trust-sep { color: var(--graphite-300); }

/* ============================================================
   RIGHT — ТУ mockup
   ============================================================ */
.hero-v3__mockup {
  position: relative;
  min-width: 0;
  perspective: 1400px;
}

.tu-doc {
  position: relative;
  background: var(--paper-pure);
  border: 1px solid var(--graphite-200);
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(14, 27, 46, 0.06),
    0 24px 56px -16px rgba(14, 27, 46, 0.18),
    0 8px 24px -8px rgba(14, 27, 46, 0.12);
  overflow: hidden;
  transform: rotate(-1.2deg);
  transition: transform .4s ease;
}
.tu-doc:hover { transform: rotate(-0.4deg) translateY(-2px); }

/* ЕСКД-штамп сверху */
.tu-doc__stamp {
  background: var(--paper);
  border-bottom: 1px solid var(--graphite-300);
}
.tu-doc__stamp-grid {
  display: grid;
  grid-template-columns: 1fr 50px 50px 56px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
}
.tu-doc__stamp-cell {
  padding: 8px 10px;
  border-right: 1px solid var(--graphite-300);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
}
.tu-doc__stamp-cell:last-child { border-right: none; }
.tu-doc__stamp-label {
  color: var(--graphite-500);
  text-transform: uppercase;
  font-size: 8.5px;
  letter-spacing: 0.06em;
}
.tu-doc__stamp-value {
  color: var(--ink-900);
  font-weight: 600;
  font-size: 10.5px;
}
.tu-doc__stamp-cell--code .tu-doc__stamp-value { font-size: 11px; letter-spacing: 0.02em; }

/* Body */
.tu-doc__body {
  position: relative;
  padding: 22px 26px 18px;
}

.tu-doc__title {
  border-bottom: 1px solid var(--graphite-200);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.tu-doc__title-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite-500);
  margin-bottom: 4px;
}
.tu-doc__title-main {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.tu-doc__title-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--graphite-500);
  margin-top: 4px;
}

/* TOC list */
.tu-doc__toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tu-doc__toc-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--graphite-900);
  transition: background .25s ease, color .25s ease, transform .25s ease;
  position: relative;
}
.tu-doc__toc-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--graphite-100);
  color: var(--graphite-700);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  transition: background .25s ease, color .25s ease;
}
.tu-doc__toc-text { font-weight: 500; }
.tu-doc__toc-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--graphite-500);
  white-space: nowrap;
}
.tu-doc__toc-item--muted { opacity: 0.55; }

/* Active (highlighted) chain nodes */
.tu-doc__toc-item.is-chain-active {
  background: var(--indigo-50);
  transform: translateX(2px);
}
.tu-doc__toc-item.is-chain-active .tu-doc__toc-num {
  background: var(--indigo-700);
  color: var(--paper-pure);
}
.tu-doc__toc-item.is-chain-active .tu-doc__toc-sub {
  color: var(--indigo-800);
}
.tu-doc__toc-item.is-chain-active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  width: 4px; height: 18px;
  margin-top: -9px;
  background: var(--indigo-700);
  border-radius: 2px;
}

/* SVG chain overlay */
.tu-doc__chain {
  position: absolute;
  left: 14px;
  top: 60px;
  bottom: 6px;
  width: 18px;
  height: auto;
  color: var(--indigo-700);
  opacity: 0.0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.tu-doc.is-chain-on .tu-doc__chain { opacity: 0.55; }
.tu-doc__chain-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}
.tu-doc.is-chain-on .tu-doc__chain-path {
  animation: tu-chain-draw 1.4s ease forwards;
}
.tu-doc.is-chain-on .tu-doc__chain-path--2 { animation-delay: .4s; }
@keyframes tu-chain-draw {
  to { stroke-dashoffset: 0; }
}

/* Chain caption (bottom strip) */
.tu-doc__chain-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--ink-900);
  color: rgba(250, 250, 247, 0.92);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.tu-doc__chain-step {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(250, 250, 247, 0.85);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.tu-doc__chain-step.is-chain-active {
  background: var(--indigo-700);
  color: var(--paper-pure);
  transform: translateY(-1px);
}
.tu-doc__chain-arrow {
  color: rgba(250, 250, 247, 0.5);
  font-weight: 600;
}

/* File-format tabs */
.tu-doc__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--paper);
  border-top: 1px solid var(--graphite-200);
  font-family: var(--font-mono);
  font-size: 11px;
}
.tu-doc__tab {
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--graphite-500);
  border: 1px solid transparent;
}
.tu-doc__tab--active {
  background: var(--paper-pure);
  color: var(--ink-900);
  border-color: var(--graphite-200);
  font-weight: 600;
}
.tu-doc__tab-meta {
  margin-left: auto;
  color: var(--success);
  font-weight: 500;
}
.tu-doc__tab-meta::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

/* Floating annotation card */
.tu-doc__annotation {
  position: absolute;
  right: -8px;
  bottom: -14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--paper-pure);
  border: 1px solid var(--graphite-200);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--graphite-700);
  box-shadow: 0 8px 24px -8px rgba(14, 27, 46, 0.18);
  transform: rotate(1.5deg);
  max-width: 280px;
}
.tu-doc__annotation-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--indigo-700);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--indigo-50);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1020px) {
  .hero-v3__mockup {
    order: 2;
    max-width: 560px;
    margin: 8px auto 0;
    width: 100%;
  }
  .tu-doc { transform: none; }
  .tu-doc__annotation { right: 8px; bottom: -10px; }
}

@media (max-width: 720px) {
  .hero-v3__cta { flex-direction: column; align-items: stretch; }
  .hero-v3__cta .btn { width: 100%; justify-content: center; }
  .hero-v3__cta-note { font-size: 11.5px; }
  .hero-v3__trust { font-size: 12px; }
}

@media (max-width: 560px) {
  .hero-v3__mockup { display: none; }
  .hero-v3__h1 { font-size: 30px; }
}

/* Reduce-motion respect */
@media (prefers-reduced-motion: reduce) {
  .hero-v3__divider-arrow { animation: none; }
  .tu-doc.is-chain-on .tu-doc__chain-path { animation: none; stroke-dashoffset: 0; }
  .tu-doc__toc-item, .tu-doc__chain-step { transition: none; }
}
