/* ================= HERO V2 ================= */
.hero-v2 {
  position: relative;
  padding-top: 160px;
  padding-bottom: 64px;
  /* overflow: visible — чтобы watermark «чисто» переходил в следующую секцию.
     Орбы и hero-orbs клипуются собственным overflow:hidden внутри своих контейнеров. */
  overflow: visible;
}

/* Giant watermark word, центрирован, чуть выходит за низ hero в следующий блок */
.hero-watermark {
  position: absolute;
  bottom: -3vw;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(320px, 42vw, 640px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.05);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
}

/* Ambient floating glows */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  /* blur уменьшен 90px → 40px — большой радиус блюра пересчитывается
     каждый scroll-frame и был самым дорогим эффектом hero. */
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  contain: paint;
}
.hero-glow-a {
  width: 520px; height: 520px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(34,211,238,0.28) 0%, rgba(34,211,238,0) 70%);
}
.hero-glow-b {
  width: 440px; height: 440px;
  bottom: 40px; left: 10%;
  background: radial-gradient(circle, rgba(167,139,250,0.18) 0%, rgba(167,139,250,0) 70%);
}

/* ----- Side orbs: ambient частицы по бокам ----- */
.hero-orbs {
  position: absolute;
  top: 80px;
  bottom: 60px;
  width: clamp(160px, 16vw, 280px);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.hero-orbs-l { left: 0; }
.hero-orbs-r { right: 0; }

.orb {
  position: absolute;
  left: var(--x, 50%);
  bottom: -40px;
  width: var(--s, 6px);
  height: var(--s, 6px);
  border-radius: 50%;
  /* filter:blur и will-change убраны — каждая частица создавала
     свой GPU-слой, общая нагрузка на композит = scroll lag.
     Глоу обеспечивают radial-gradient и box-shadow. */
  opacity: 0;
  animation: orbDrift var(--t, 20s) linear infinite;
  animation-delay: var(--d, 0s);
}
.orb[style*="--c:cyan"]        { background: radial-gradient(circle, rgba(34,211,238,0.95) 0%, rgba(34,211,238,0) 70%); box-shadow: 0 0 12px rgba(34,211,238,0.55); }
.orb[style*="--c:cyan-soft"]   { background: radial-gradient(circle, rgba(103,232,249,0.85) 0%, rgba(103,232,249,0) 70%); box-shadow: 0 0 14px rgba(103,232,249,0.5); }
.orb[style*="--c:violet"]      { background: radial-gradient(circle, rgba(167,139,250,0.9)  0%, rgba(167,139,250,0) 70%);  box-shadow: 0 0 12px rgba(167,139,250,0.55); }
.orb[style*="--c:violet-soft"] { background: radial-gradient(circle, rgba(196,181,253,0.85) 0%, rgba(196,181,253,0) 70%); box-shadow: 0 0 14px rgba(196,181,253,0.5); }

@keyframes orbDrift {
  0%   { transform: translate(0, 0)        scale(0.6); opacity: 0; }
  10%  { opacity: 0.9; }
  35%  { transform: translate(14px, -38vh) scale(1); }
  65%  { transform: translate(-14px, -68vh) scale(1); opacity: 0.9; }
  90%  { opacity: 0; }
  100% { transform: translate(0, -100vh)   scale(0.6); opacity: 0; }
}

@media (max-width: 1180px) {
  .hero-orbs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; opacity: 0; }
}

/* Single-column layout (panel removed) */
.hero-grid {
  position: relative;
  z-index: 1;
  display: block;
}

/* ----- LEFT COPY ----- */
.hero-copy {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 10px;
  background: var(--glass-2); border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-2);
  letter-spacing: 0.08em; text-transform: uppercase;
  backdrop-filter: var(--blur-sm);
  margin-bottom: 32px;
}
.hero-copy .eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 8px var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero-copy h1.hero-h1 {
  font-family: var(--font-display-alt);
  font-weight: 500;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0 0 28px;
  max-width: min(1080px, 100%);
}
.hero-copy h1 .h1-row { display: block; white-space: nowrap; }
.hero-copy h1 .h1-row-morph { display: flex; justify-content: center; align-items: baseline; }
.h1-lead, .h1-dot { display: inline-block; }

/* Морфинг-слово: ghost (visibility:hidden, в потоке) держит ширину под
   текущее активное слово — контейнер не растягивается под самое длинное.
   Активные/уходящие слова лежат absolute поверх ghost.
   Ширина адаптируется плавно через JS-controlled transition (см. main.js). */
.h1-morph {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  transition: width 420ms cubic-bezier(0.22,1,0.36,1);
}
.h1-morph .m-ghost {
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-style: normal;
}
.h1-morph .m-w {
  position: absolute;
  inset: 0;
  font-style: normal;
  color: var(--fg-3);
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 480ms cubic-bezier(0.22,1,0.36,1),
              transform 480ms cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap;
}
.h1-morph .m-w::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%;
  top: 56%;
  height: 0.12em;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  border-radius: 4px;
  filter: drop-shadow(0 0 8px rgba(34,211,238,0.45));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms cubic-bezier(0.22,1,0.36,1);
}
.h1-morph .m-w.m-active {
  opacity: 1;
  transform: translateY(0);
}
.h1-morph .m-w.m-active::after { transform: scaleX(1); transition-delay: 200ms; }
.h1-morph .m-w.m-leaving {
  opacity: 0;
  transform: translateY(-0.3em);
}

.h1-accent {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-violet) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.hero-copy .sub {
  font-size: 19px; line-height: 1.5; color: var(--fg-3);
  max-width: 540px; margin: 0 0 36px;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.hero-copy .cta-row {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  margin-bottom: 24px; flex-wrap: wrap;
}

/* Hero proof-strip — 4 ключевых метрики проекта */
.hero-proof {
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
  padding: 18px 28px;
  margin-bottom: 36px;
  background:
    linear-gradient(135deg, rgba(34,211,238,0.05) 0%, rgba(167,139,250,0.04) 100%),
    var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  flex-wrap: wrap;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.hero-proof .hp-item { display: flex; flex-direction: column; gap: 2px; align-items: center; min-width: 0; }
.hero-proof .hp-val {
  font-family: var(--font-mono); font-size: 16px;
  color: var(--fg-1); font-weight: 500;
  letter-spacing: -0.005em; white-space: nowrap;
}
.hero-proof .hp-lbl {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-4); white-space: nowrap;
}
.hero-proof .hp-divider {
  width: 1px; height: 28px;
  background: var(--border-subtle);
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .hero-proof { gap: 14px; padding: 14px 18px; }
  .hero-proof .hp-divider { display: none; }
  .hero-proof .hp-item { flex: 1 1 calc(50% - 14px); }
}

/* Compare row: chaos vs clean */
.hero-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding: 22px 24px;
  background: var(--glass-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  backdrop-filter: var(--blur-md);
  max-width: 560px;
}
.comp-col { display: flex; flex-direction: column; gap: 10px; }
.comp-lbl {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-4);
}
.comp-lbl-clean { color: var(--accent-cyan); }
.comp-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comp-col li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-2);
  line-height: 1.3;
}
.comp-chaos li i { color: var(--fg-4); }
.comp-chaos li { color: var(--fg-4); text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.15); text-decoration-thickness: 1px; }
.comp-clean li i { color: var(--accent-cyan); filter: drop-shadow(0 0 4px rgba(34,211,238,0.5)); }
.comp-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-subtle) 30%, var(--border-subtle) 70%, transparent);
}

/* ----- RIGHT PANEL ----- */
.hero-panel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--glass-1);
  border: 1px solid var(--border-subtle);
  backdrop-filter: var(--blur-md);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 30px 80px rgba(0,0,0,0.5),
    0 0 80px rgba(34,211,238,0.08);
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 200px at 80% 0%, rgba(34,211,238,0.10), transparent 60%);
  pointer-events: none;
}

.panel-chrome {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
  position: relative; z-index: 1;
}
.chrome-dots { display: flex; gap: 6px; }
.chrome-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.chrome-title {
  flex: 1;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-4); letter-spacing: 0.12em; text-transform: uppercase;
}
.chrome-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--success);
  letter-spacing: 0.12em;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.panel-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative; z-index: 1;
}

/* Active project card */
.panel-project {
  padding: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.pp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px; gap: 12px;
}
.pp-name {
  font-size: 14px; color: var(--fg-1);
  font-weight: 500;
  margin-bottom: 2px;
}
.pp-meta {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg-4);
  letter-spacing: 0.1em;
}
.pp-day {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent-cyan);
  letter-spacing: 0.14em;
  padding: 4px 8px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pp-bar {
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.pp-bar-fill {
  width: var(--w, 60%);
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  box-shadow: 0 0 12px rgba(34,211,238,0.5);
  border-radius: 2px;
  animation: barGrow 1.6s cubic-bezier(0.22,1,0.36,1) 0.4s both;
}
@keyframes barGrow {
  from { width: 0; }
  to { width: var(--w, 60%); }
}
.pp-steps {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pp-steps .step {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  color: var(--fg-4);
  border-radius: var(--r-pill);
}
.pp-steps .step.done {
  color: var(--fg-2);
  border-color: rgba(255,255,255,0.12);
}
.pp-steps .step.done i {
  color: var(--success);
}
.pp-steps .step.active {
  color: var(--accent-cyan);
  background: rgba(34,211,238,0.08);
  border-color: rgba(34,211,238,0.3);
  box-shadow: 0 0 12px rgba(34,211,238,0.2);
}
.step-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1.4s ease-in-out infinite;
}

/* Ticker */
.panel-ticker {
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.ticker-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.ticker-lbl {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-4);
}
.ticker-hz {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--success);
  letter-spacing: 0.08em;
}
.ticker-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-faint);
}
.ticker-row:first-of-type { border-top: 0; }
.tr-icon { color: var(--fg-3); display: inline-flex; }
.tr-label {
  font-size: 12px; color: var(--fg-2);
}
.tr-val {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tr-delta {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
}
.tr-delta.up { color: var(--success); background: rgba(34,197,94,0.08); }
.tr-delta.ok { color: var(--accent-cyan); background: rgba(34,211,238,0.08); }

/* KPI trio */
.panel-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kpi {
  padding: 12px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-align: center;
}
.kpi-val {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 20px;
  color: var(--fg-1);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-4);
}

/* Bottom trust strip */
.hero-strip {
  margin-top: 56px;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-pill);
  position: relative;
  z-index: 1;
}
.strip-lbl {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-4);
  white-space: nowrap;
}
.strip-track {
  flex: 1;
  display: flex; align-items: center;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
}
/* Бегущая дорожка: контент дублируется в render.php (две группы),
   ширина group = 50% от track, анимация двигает на -50%. */
.strip-track-inner {
  display: flex; align-items: center; gap: 22px;
  animation: stripScroll 28s linear infinite;
  flex-shrink: 0;
  padding-right: 22px;
}
.strip-track:hover .strip-track-inner { animation-play-state: paused; }
@keyframes stripScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.strip-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.strip-item i { color: var(--accent-cyan); }
.strip-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--fg-5, rgba(255,255,255,0.2));
}
.strip-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-decoration: none;
  transition: gap 200ms cubic-bezier(0.22,1,0.36,1);
}
.strip-more:hover { gap: 10px; }

/* ========== Responsive ========== */
@media (max-width: 720px) {
  .hero-v2 { padding-top: 100px; padding-bottom: 32px; }
  .hero-copy h1 { font-size: clamp(28px, 9vw, 48px); line-height: 1.08; }
  .hero-copy .sub { font-size: 16px; }
  .hero-copy .cta-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-copy .cta-row .btn { width: 100%; justify-content: center; }
  .hero-compare {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 18px;
  }
  .comp-divider {
    width: 100%; height: 1px;
    background: linear-gradient(to right, transparent, var(--border-subtle) 30%, var(--border-subtle) 70%, transparent);
  }
  .hero-watermark { font-size: 60vw; bottom: -6vw; }
  .hero-strip {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 14px;
  }
  /* Hero side-orbs скрыты на мобиле — нет места и они визуально мешают */
  .hero-orbs { display: none; }
}
@media (max-width: 420px) {
  /* На самых узких экранах разрешаем морф-слову уехать на новую строку,
     если не помещается — лучше чем horizontal-scroll */
  .hero-copy h1 .h1-row { white-space: normal; }
  .hero-copy h1 .h1-row-morph { flex-wrap: wrap; }
}
