/* ===========================================================================
   styles-home.css  —  титульная страница ipd.by
   Редизайн блоков «Что происходит, когда система выстроена правильно»,
   «Цифровой операционный партнёр», «Форматы работы», «Как строится работа».
   Дизайн-токены повторяют общую визуальную систему (Inter, #2e5aac,
   мягкий градиент #f8fbff→#f0f6ff, радиус 20px, контраст ~8:1).
   ------------------------------------------------------------------------- */

/* ---------- 1. «Что происходит, когда система выстроена правильно» ----------
   9 карточек с фото, метрикой достижения (вместо счётчика 01–09),
   в стиле блока «Цифровой операционный партнёр». */

.home-impact-section {
  padding: 60px 0 20px;
}

.home-impact-section .container > h2 {
  text-align: center;
  font-size: 2rem;
  color: #2e5aac;
  margin-bottom: 16px;
}

.home-impact-section .section-description {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.68);
}

.home-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
}

.home-impact-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(46, 90, 172, 0.12);
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.05), 0 6px 16px rgba(0, 51, 102, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.home-impact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255,255,255,0.02), rgba(46,90,172,0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
  pointer-events: none;
}

.home-impact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 90, 172, 0.35);
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.12);
}

.home-impact-card:hover::before { opacity: 1; }

.home-impact-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef3fb;
  border-bottom: 1px solid rgba(46, 90, 172, 0.12);
}

.home-impact-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.home-impact-card:hover .home-impact-media img {
  transform: scale(1.06);
}

.home-impact-body {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.home-impact-metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.home-impact-metric-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: #2e5aac;
  white-space: nowrap;
}

.home-impact-metric-label {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.62);
  font-weight: 600;
}

.home-impact-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1f3f8f;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.home-impact-text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.62;
  color: rgba(0, 0, 0, 0.68);
  flex: 1 1 auto;
}

.home-impact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2e5aac;
  transition: color 0.2s ease, gap 0.2s ease;
}

.home-impact-card:hover .home-impact-link { color: #1a3a6e; gap: 10px; }

@media (max-width: 1000px) {
  .home-impact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .home-impact-grid { grid-template-columns: 1fr; }
  .home-impact-section { padding: 40px 0 10px; }
}

.home-impact-more {
  margin-top: 24px;
  text-align: center;
}

/* ---------- 5. «Цифровой операционный партнёр» ----------
   Одна карточка + много пустого места справа → панель с метриками. */

.op-partner-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 36px;
  align-items: stretch;
}

.op-partner-main {
  position: relative;
  background: linear-gradient(135deg, #1a3a6e 0%, #2e5aac 100%);
  color: #fff;
  border-radius: 20px;
  padding: 32px 32px 30px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(26, 58, 110, 0.22);
}

.op-partner-main::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
}

.op-partner-main h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: #fff;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.op-partner-main p {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.op-partner-main p strong {
  color: #fff;
}

.op-partner-main .op-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 22px;
  background: #fff;
  color: #1a3a6e;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}

.op-partner-main .op-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.op-partner-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.op-partner-metric {
  background: #fff;
  border: 1px solid rgba(46, 90, 172, 0.12);
  border-top: 3px solid #2e5aac;
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.05);
}

.op-partner-metric-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: #2e5aac;
  margin-bottom: 8px;
}

.op-partner-metric-label {
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.68);
}

@media (max-width: 900px) {
  .op-partner-layout { grid-template-columns: 1fr; }
  .op-partner-side { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .op-partner-side { grid-template-columns: 1fr; }
}

/* ---------- 7. «Форматы работы» ----------
   Карточки форматов + SVG-иконка с анимацией. */

.home-format-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 26px 24px 24px;
  border: 1px solid rgba(46, 90, 172, 0.12);
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.05), 0 6px 16px rgba(0, 51, 102, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-format-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.02), rgba(46,90,172,0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.home-format-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,51,102,0.12); }
.home-format-card:hover::before { opacity: 1; }

.home-format-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbff, #eaf1fb);
  border: 1px solid rgba(46, 90, 172, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2e5aac;
}

.home-format-icon svg { width: 30px; height: 30px; }

.home-format-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  line-height: 1.35;
  color: #1f3f8f;
}

.home-format-card p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.68);
}

.home-format-card p strong {
  color: #1f3f8f;
}

/* Заголовок секции «Форматы работы» — в стиле панели op-partner (градиент) */
.home-formats-hero {
  position: relative;
  background: linear-gradient(135deg, #1a3a6e 0%, #2e5aac 100%);
  color: #fff;
  border-radius: 20px;
  padding: 34px 36px 30px;
  margin-bottom: 34px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(26, 58, 110, 0.22);
}

.home-formats-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
}

.home-formats-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.services-section .container .home-formats-hero h2 {
  margin: 0 0 14px;
  color: #fff;
  text-align: left;
  font-size: 1.7rem;
  line-height: 1.3;
}

.home-formats-hero p {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

.home-formats-hero p:last-child { margin-bottom: 0; }

@media (max-width: 620px) {
  .home-formats-hero { padding: 26px 22px 24px; }
  .services-section .container .home-formats-hero h2 { font-size: 1.4rem; }
}

/* ---------- 8. «Как строится работа» (шаги 01–05) ----------
   Сверху — анимированная SVG-дорожка, под ней — карточки шагов. */

.home-work-svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 28px auto 8px;
}

.home-work-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.home-work-step {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px;
  border: 1px solid rgba(46, 90, 172, 0.12);
  border-top: 3px solid #2e5aac;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-work-step:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,51,102,0.12); }

.home-work-step .home-step-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: #2e5aac;
  margin-bottom: 10px;
}

.home-work-step h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.3;
  color: #1f3f8f;
}

.home-work-step p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.66);
}

.home-work-step p strong { color: #1f3f8f; }

@media (max-width: 1200px) {
  .home-work-steps { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .home-work-steps { grid-template-columns: repeat(2, 1fr); }
  .home-work-svg { display: none; } /* на мобильных дорожка не нужна */
}

@media (max-width: 460px) {
  .home-work-steps { grid-template-columns: 1fr; }
}

/* ---------- Scroll-reveal (появление блоков при прокрутке) ---------- */

.home-impact-grid > *,
.op-partner-layout > *,
.services-grid > *,
.home-work-svg,
.home-work-steps > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: 0ms;
}

.home-impact-grid > .reveal-in,
.op-partner-layout > .reveal-in,
.services-grid > .reveal-in,
.home-work-svg.reveal-in,
.home-work-steps > .reveal-in {
  opacity: 1;
  transform: none;
}

/* лёгкий «каскад» для карточек в сетке */
.home-impact-grid > .reveal-in:nth-child(2) { transition-delay: 70ms; }
.home-impact-grid > .reveal-in:nth-child(3) { transition-delay: 140ms; }
.home-impact-grid > .reveal-in:nth-child(4) { transition-delay: 210ms; }
.home-impact-grid > .reveal-in:nth-child(5) { transition-delay: 280ms; }
.home-impact-grid > .reveal-in:nth-child(6) { transition-delay: 350ms; }
.home-impact-grid > .reveal-in:nth-child(7) { transition-delay: 420ms; }
.home-impact-grid > .reveal-in:nth-child(8) { transition-delay: 490ms; }
.home-impact-grid > .reveal-in:nth-child(9) { transition-delay: 560ms; }

.services-grid > .reveal-in:nth-child(2) { transition-delay: 90ms; }
.services-grid > .reveal-in:nth-child(3) { transition-delay: 180ms; }
.services-grid > .reveal-in:nth-child(4) { transition-delay: 270ms; }
.services-grid > .reveal-in:nth-child(5) { transition-delay: 360ms; }

.home-work-steps > .reveal-in:nth-child(2) { transition-delay: 90ms; }
.home-work-steps > .reveal-in:nth-child(3) { transition-delay: 180ms; }
.home-work-steps > .reveal-in:nth-child(4) { transition-delay: 270ms; }
.home-work-steps > .reveal-in:nth-child(5) { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .home-impact-grid > *, .op-partner-layout > *, .services-grid > *,
  .home-work-svg, .home-work-steps > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
