/* ══════════════════════════════════════════════
   HOME PAGE — hero (reference layout)
══════════════════════════════════════════════ */

html:has(body.home-page) {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.home-page {
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  --hero-edge-x: 28px;
}

body.home-page .home-screen {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 28, 0.48);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.home-page #heroBadge { display: none; }

body.menu-open { overflow: hidden; }

/* ── Hero: слева звёзды (как шапка), справа фото со сглаженным краем ── */
body.home-page .hero {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
  background: transparent;
  min-height: 0;
}

/* ── Hero: звёздный фон как на «О нас» — без фото-подложки ── */
.hero-backdrop {
  display: none;
}

.hero-layout {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: stretch;
  justify-content: stretch;
  gap: clamp(24px, 2.8vw, 40px);
  width: 100%;
  max-width: none;
  min-height: 0;
}

.hero-layout.hero-layout--no-panel {
  grid-template-columns: minmax(0, 1fr);
}

.hero-layout.hero-layout--no-panel .hero-copy {
  max-width: clamp(680px, 64vw, 980px);
}

.hero-layout.hero-layout--no-panel .hero-copy-inner {
  max-width: 100%;
  justify-content: center;
}

.hero-panel {
  position: relative;
  z-index: 1;
  grid-column: 2;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  border-radius: clamp(14px, 1.6vw, 22px);
  overflow: hidden;
  pointer-events: auto;
  isolation: isolate;
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 212, 255, 0.2),
    0 0 48px rgba(97, 50, 242, 0.16);
}

.hero-panel-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  pointer-events: none;
}

.hero-panel-nav {
  position: absolute;
  right: clamp(8px, 1vw, 14px);
  bottom: clamp(8px, 1vh, 14px);
  z-index: 4;
  display: flex;
  gap: 8px;
}

.hero-panel-nav-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 212, 255, 0.45);
  border-radius: 999px;
  background: rgba(8, 11, 20, 0.58);
  color: #e6edf3;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-panel-nav-btn:hover {
  background: rgba(0, 212, 255, 0.18);
}

.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to right, rgba(8, 11, 20, 0.12) 0%, transparent 14%);
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(0, 212, 255, 0.07) 0%, transparent 42%),
    linear-gradient(to bottom, transparent 68%, rgba(8, 11, 20, 0.38) 100%);
}

.hero-body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1vh, 12px);
  width: 100%;
  min-height: 0;
  padding: clamp(6px, 1.2vh, 14px) var(--hero-edge-x) clamp(6px, 1vh, 12px) var(--hero-edge-x);
  box-sizing: border-box;
}

.hero-copy {
  position: relative;
  z-index: 3;
  grid-column: 1;
  min-width: 0;
  width: 100%;
  max-width: none;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  box-sizing: border-box;
  min-height: 0;
  overflow: visible;
}

.hero-copy-inner {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: clamp(18px, 2.2vh, 28px) clamp(18px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(10px, 1.4vh, 14px);
  text-align: left;
  color: #e6edf3;
  box-sizing: border-box;
  background: rgba(8, 11, 26, 0.55);
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: clamp(14px, 1.6vw, 22px);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 212, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-layout:not(.hero-layout--no-panel) .hero-copy {
  align-self: stretch;
  min-height: 100%;
}

.hero-layout:not(.hero-layout--no-panel) .hero-copy-inner {
  min-height: 100%;
}

.hero-layout:not(.hero-layout--no-panel) .hero-cta-row {
  margin-top: auto;
  padding-top: 0;
}

.hero-cta-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: stretch;
  gap: clamp(10px, 1.5vw, 14px);
  width: 100%;
  padding-top: clamp(4px, 0.8vh, 8px);
  min-width: 0;
  box-sizing: border-box;
}

.hero-cta-row .btn-hero-primary {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.btn-hero-secondary {
  background: var(--cta-bg);
  border: 1px solid var(--cta-border);
  color: #fff;
  box-shadow: var(--cta-shadow);
}

.btn-hero-secondary:hover {
  background: var(--cta-bg-hover);
  box-shadow: var(--cta-shadow-hover);
}

[data-theme="light"] .btn-hero-secondary {
  color: #fff;
}

.hero-kicker {
  margin: 0;
  color: #00d4ff;
  font-weight: 800;
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.35);
}

.hero-copy-inner h1.hero-title {
  margin: 0;
  font-weight: 900;
  line-height: 1.12;
  font-size: clamp(26px, 3.6vw, 44px);
  letter-spacing: -0.02em;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
  width: 100%;
  max-width: 100%;
  text-align: left;
}

.hero-copy-inner h1.hero-title + p.hero-text {
  margin-top: calc(2 * 1.65em - clamp(10px, 1.4vh, 14px));
}

.hero-title .white { color: #fff; }
.hero-title .accent-cyan { color: #00d4ff; }

/* Перебивает components.css `.hero p { max-width: 560px }` (выше специфичность) */
.hero-copy-inner p.hero-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.65;
  width: 100%;
  max-width: 100%;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  word-spacing: 0.02em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  padding-top: clamp(2px, 0.5vh, 6px);
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(15px, 1.8vh, 18px) clamp(34px, 4vw, 42px);
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.35;
  background: var(--cta-bg);
  color: #fff;
  border: 1px solid var(--cta-border);
  box-shadow: var(--cta-shadow);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  background: var(--cta-bg-hover);
  box-shadow: var(--cta-shadow-hover);
}

/* Process timeline — в потоке, внизу hero */
.process-steps {
  position: relative;
  --process-gap: clamp(8px, 1.2vw, 14px);
  left: auto;
  transform: none;
  bottom: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--process-gap);
  align-items: start;
  flex-shrink: 0;
  padding: clamp(8px, 1.2vh, 14px) 0 0;
}

.process-step .desc {
  font-size: clamp(11px, 1.05vw, 13px);
  color: rgba(143, 180, 211, 0.88);
  line-height: 1.5;
  max-width: none;
  margin: 0 auto;
  padding: 0 clamp(4px, 0.6vw, 8px);
}

.process-connector {
  position: absolute;
  left: calc((100% - (4 * var(--process-gap))) / 10);
  right: calc((100% - (4 * var(--process-gap))) / 10);
  top: calc(clamp(40px, 4.2vh, 48px) / 2);
  height: 2px;
  background: linear-gradient(90deg,
    rgba(0, 212, 255, 0) 0%,
    rgba(0, 212, 255, 0.4) 15%,
    rgba(0, 212, 255, 0.4) 85%,
    rgba(0, 212, 255, 0) 100%
  );
  z-index: 0;
  overflow: visible;
}

.process-connector::before,
.process-connector::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #00d4ff;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.9), 0 0 20px rgba(0, 212, 255, 0.5);
}

.process-connector::before { left: 0; }
.process-connector::after  { left: 100%; }

.process-step {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #9ccfe8;
  font-size: 12px;
}

.process-step .num-wrap {
  position: relative;
  width: clamp(40px, 4.2vh, 48px);
  height: clamp(40px, 4.2vh, 48px);
  margin: 0 auto clamp(6px, 0.8vh, 10px);
}

.process-step .num {
  width: clamp(40px, 4.2vh, 48px);
  height: clamp(40px, 4.2vh, 48px);
  border-radius: 50%;
  background: rgba(5, 10, 20, 0.72);
  border: 2px solid rgba(0, 212, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(13px, 1.3vw, 15px);
  color: #00d4ff;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
  position: relative;
  z-index: 1;
}

.process-step .title {
  font-weight: 700;
  color: #e6edf3;
  font-size: clamp(12px, 1.25vw, 15px);
  margin-bottom: clamp(6px, 0.8vh, 8px);
  line-height: 1.3;
}

/* Hero modals */
.hero-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.hero-modal-overlay.open { display: flex; }

.hero-modal {
  background: rgba(14, 19, 36, 0.96);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
}

.hero-modal-wide { max-width: 640px; }

.hero-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 0;
}

.hero-modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.hero-modal-sub {
  margin: 0;
  font-size: 14px;
  color: rgba(143, 180, 211, 0.95);
}

.hero-modal-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(143, 180, 211, 0.95);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.hero-modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.hero-modal-body { padding: 20px 28px 28px; }

.hero-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-modal-field { margin-bottom: 14px; }

.hero-modal-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(143, 180, 211, 0.95);
  margin-bottom: 6px;
}

.hero-modal-opt { font-weight: 600; text-transform: none; letter-spacing: 0; opacity: 0.85; }

.hero-modal-field input,
.hero-modal-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.hero-modal-field input:focus,
.hero-modal-field textarea:focus { border-color: rgba(0, 212, 255, 0.45); }

.hero-modal-field input::placeholder,
.hero-modal-field textarea::placeholder { color: #4a5568; }

.hero-modal-submit {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--cta-border);
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--cta-bg);
  box-shadow: var(--cta-shadow);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.hero-modal-submit:hover { background: var(--cta-bg-hover); transform: translateY(-1px); box-shadow: var(--cta-shadow-hover); }

.hero-modal-msg {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
}

.hero-modal-msg.ok { color: #4ade80; }
.hero-modal-msg.err { color: #ff6b6b; }

.hero-modal-legal {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(143, 180, 211, 0.85);
  text-align: center;
}

.hero-modal-legal a { color: #00d4ff; }

.hero-case-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.hero-case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-case-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00d4ff;
  margin-bottom: 6px;
}

.hero-case-side p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.hero-case-side-result .hero-case-label { color: #7ec8ff; }

/* Light theme */
[data-theme="light"] body.home-page { background: transparent; }
[data-theme="light"] body.home-page .home-screen { background: transparent; }
[data-theme="light"] .hero-copy-inner {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(97, 50, 242, 0.22);
  box-shadow: 0 16px 44px rgba(0, 20, 60, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .process-connector::before,
[data-theme="light"] .process-connector::after {
  background: #6132f2;
  box-shadow: 0 0 8px rgba(97, 50, 242, 0.65);
}
[data-theme="light"] .hero-title { filter: none; }
[data-theme="light"] .hero-title .white { color: #0e1624; }
[data-theme="light"] .hero-title .accent-cyan { color: #0099cc; }
[data-theme="light"] .hero-kicker { text-shadow: none; color: #0099cc; }
[data-theme="light"] .hero-modal {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 20, 60, 0.12);
}
[data-theme="light"] .hero-modal-title { color: #0e1624; }
[data-theme="light"] .hero-modal-sub,
[data-theme="light"] .hero-modal-field label,
[data-theme="light"] .hero-modal-legal { color: #5a6b7d; }
[data-theme="light"] .hero-modal-field input,
[data-theme="light"] .hero-modal-field textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 20, 60, 0.12);
  color: #0e1624;
}
[data-theme="light"] .hero-case-card {
  background: rgba(0, 20, 60, 0.04);
  border-color: rgba(0, 20, 60, 0.1);
}
[data-theme="light"] .hero-case-side p { color: #1a2838; }
[data-theme="light"] .hero-backdrop::after {
  background:
    linear-gradient(to right, var(--bg) 0%, rgba(250, 251, 255, 0.92) 12%, rgba(250, 251, 255, 0.55) 28%, rgba(250, 251, 255, 0.4) 50%, rgba(250, 251, 255, 0.55) 72%, rgba(250, 251, 255, 0.92) 88%, var(--bg) 100%),
    linear-gradient(to bottom, rgba(250, 251, 255, 0.45) 0%, transparent 16%, transparent 52%, rgba(250, 251, 255, 0.7) 84%, var(--bg) 100%);
}
[data-theme="light"] .hero-panel {
  box-shadow:
    0 18px 44px rgba(0, 20, 60, 0.12),
    0 0 0 1px rgba(0, 150, 220, 0.22),
    0 0 36px rgba(97, 50, 242, 0.1);
}
[data-theme="light"] .hero-panel::before {
  background: none;
}
[data-theme="light"] .hero-panel::after {
  background: none;
}
[data-theme="light"] .hero-copy-inner p.hero-text { color: #243447; text-shadow: none; }
[data-theme="light"] .hero-kicker { color: #0099cc; text-shadow: none; }
[data-theme="light"] .process-step .title { color: #0e1624; }
[data-theme="light"] .process-step .desc { color: #3a4d63; }
[data-theme="light"] .process-step .num {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 180, 255, 0.45);
  color: #0077aa;
}

/* Responsive */
@media (max-width: 768px) {
  .process-step .desc { padding: 0 6px; }
}

@media (max-width: 900px) {
  .hero-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-copy {
    grid-column: auto;
    flex: 0 1 auto;
    max-width: none;
    justify-content: flex-start;
  }

  .hero-copy-inner {
    max-width: none;
    align-items: stretch;
    text-align: left;
  }

  .hero-cta-row { justify-content: stretch; }

  .hero-panel {
    grid-column: auto;
    width: min(100%, 640px);
    align-self: auto;
    margin-top: 0;
    height: auto;
    min-height: clamp(200px, 30vh, 320px);
    border-radius: clamp(14px, 1.6vw, 22px);
    order: 2;
  }

  .hero-copy { order: 1; }

  .hero-body {
    padding: 8px 14px 12px;
    gap: 10px;
  }

  .process-steps {
    width: 100%;
    padding: 8px 0 0;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
  }

  .process-connector { display: none; }
  .process-step .desc { max-width: none; }
}

@media (max-width: 768px) {
  .hero-backdrop img { display: none; }

  .hero-backdrop::after {
    background:
      linear-gradient(to right, var(--bg) 0%, rgba(8, 11, 20, 0.85) 32%, rgba(8, 11, 20, 0.45) 62%, rgba(8, 11, 20, 0.2) 100%),
      linear-gradient(to bottom, var(--bg) 0%, rgba(8, 11, 20, 0.96) 100%);
  }

  [data-theme="light"] .hero-backdrop::after {
    background:
      linear-gradient(to right, var(--bg) 0%, rgba(250, 251, 255, 0.88) 32%, rgba(250, 251, 255, 0.5) 62%, rgba(250, 251, 255, 0.2) 100%),
      linear-gradient(to bottom, var(--bg) 0%, rgba(250, 251, 255, 0.98) 100%);
  }

  .hero-panel { display: none; }

  .hero-copy .hero-title {
    font-size: clamp(24px, 7vw, 34px);
  }

  .hero-copy .hero-text { font-size: 14px; }

  .hero-cta-row {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .hero-cta-row .btn-hero-primary {
    flex: none;
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
  }

  .hero-modal-row { grid-template-columns: 1fr; }
  .hero-case-grid { grid-template-columns: 1fr; }

  .process-steps {
    padding: 12px 0 0;
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .hero-copy .hero-title { font-size: clamp(22px, 6.5vw, 28px); }
  .process-steps { grid-template-columns: 1fr; padding: 16px 14px 24px; }
  .process-step .num-wrap,
  .process-step .num { width: 40px; height: 40px; font-size: 12px; }
}
