/* =============================================================================
   Блок «Особенности» на странице обучения (/products/main-education).
   SVG-сцена 1190 × 700 + HTML-карточки поверх неё.
   Все классы скоупнуты префиксом .ef- — с другими блоками не пересекаются.
   Клинья, ленты, коннекторы, узлы и карточки — отдельные слои,
   поэтому анимация появления работает каскадом (см. edu-features.js).
   ============================================================================= */

.ef-panel {
  --ef-font: 'Manrope', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --ef-ink: #292c2e;
  --ef-ink-soft: #4a5054;
  /* размеры текста считаются от ширины панели (container query units):
     при панели 1152 карточки выглядят так же, как макет при 1190 —
     см. .ef-card h3 / .ef-card p */
  --ef-radius-block: 32px;
  --ef-radius-inner: calc(var(--ef-radius-block) / 2);
  --ef-indigo: #3d2a8e;
  --ef-orange: #e2541c;
  --ef-pink: #c62d86;
  --ef-cyan: #17b6c0;

  position: relative;
  width: 100%;
  max-width: 1190px;
  margin: 0 auto;
  container-type: inline-size;
  aspect-ratio: 1190 / 700;
  border-radius: var(--ef-radius-block);
  overflow: hidden;
  font-family: var(--ef-font);
  background:
    radial-gradient(120% 90% at 16% 6%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 58%),
    linear-gradient(135deg, #e4e4e4 0%, #dcdcdc 52%, #d1d1d1 100%);
}

.ef-panel *,
.ef-panel *::before,
.ef-panel *::after {
  box-sizing: border-box;
}

.ef-stage {
  position: absolute;
  inset: 0;
}

.ef-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ef-cards {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.ef-cards .ef-card {
  position: absolute;
}

/* --- карточка-выноска ------------------------------------------------------- */

.ef-card {
  display: flex;
  flex-direction: column;
  /* тема ставит article margin-bottom: 3rem — из-за него карточки
     уезжали вверх: с absolute и bottom отступ добавляется к смещению */
  margin: 0;
  gap: 9px;
  gap: 0.7563cqw;
  padding: 21px 25px;
  padding: 1.76471cqw 2.10084cqw;
  border: 2px dashed currentColor;
  border-radius: var(--ef-radius-inner);
  /* карточки чуть светлее фона панели */
  background: rgba(255, 255, 255, .55);
}

.ef-card h3 {
  margin: 0;
  /* px — запасной вариант, cqw — размер от ширины панели (макет 1190) */
  font-size: 18.5px;
  font-size: 1.55462cqw;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.005em;
  text-transform: uppercase;
  color: #2f3336;
}

.ef-card p {
  margin: 0;
  font-size: 15.5px;
  font-size: 1.30252cqw;
  line-height: 1.44;
  color: var(--ef-ink-soft);
}

.ef-card--orange {
  color: var(--ef-orange);
}

.ef-card--violet {
  color: var(--ef-indigo);
}

.ef-card--pink {
  color: var(--ef-pink);
}

.ef-card--cyan {
  color: var(--ef-cyan);
}

/* --- круги с иконками ------------------------------------------------------ */

.ef-node {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 9.75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 30px rgba(29, 26, 38, .18);
  transform: translate(-50%, -50%);
}

.ef-node--left {
  left: 31.2%;
  top: 53.96%;
}

.ef-node--right {
  left: 88.6%;
  top: 53.53%;
  width: 8.4%;
}

.ef-node svg {
  width: 38%;
  height: 38%;
  fill: none;
  stroke: var(--ef-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- позиции карточек (координаты макета, сцена 1190 × 700) ---------------- */

.ef-cards .ef-card--orange {
  left: 27.5%;
  width: 33.3%;
  bottom: 68.73%;
}

.ef-cards .ef-card--violet {
  left: 64%;
  width: 33.5%;
  bottom: 57.87%;
}

.ef-cards .ef-card--pink {
  left: 34%;
  width: 29%;
  top: 75.29%;
}

.ef-cards .ef-card--cyan {
  left: 66%;
  width: 29%;
  top: 66%;
}

/* =============================================================================
   Анимация появления: клинья → узлы → ленты → коннекторы → карточки.
   Классы ef-anim / is-inview ставит edu-features.js, длины лент он же
   передаёт в переменную --ef-len.
   ============================================================================= */

.ef-panel.ef-anim .ef-bands {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(.22, .61, .36, 1);
}

.ef-panel.ef-anim.is-inview .ef-bands {
  opacity: 1;
  transform: none;
}

.ef-panel.ef-anim .ef-node {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.88);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(.34, 1.4, .64, 1);
}

.ef-panel.ef-anim .ef-node--left {
  transition-delay: 160ms;
}

.ef-panel.ef-anim .ef-node--right {
  transition-delay: 230ms;
}

.ef-panel.ef-anim.is-inview .ef-node {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ленты «протягиваются» от точки схода вправо */
.ef-panel.ef-anim .ef-ribbon {
  stroke-dasharray: var(--ef-len, 2000px);
  stroke-dashoffset: var(--ef-len, 2000px);
  transition: stroke-dashoffset 720ms cubic-bezier(.25, .6, .25, 1);
}

.ef-panel.ef-anim.is-inview .ef-ribbon {
  stroke-dashoffset: 0;
}

.ef-panel.ef-anim .ef-ribbons .ef-ribbon:nth-child(1) {
  transition-delay: 300ms;
}

.ef-panel.ef-anim .ef-ribbons .ef-ribbon:nth-child(2) {
  transition-delay: 420ms;
}

.ef-panel.ef-anim .ef-ribbons .ef-ribbon:nth-child(3) {
  transition-delay: 540ms;
}

.ef-panel.ef-anim .ef-ribbons .ef-ribbon:nth-child(4) {
  transition-delay: 660ms;
}

/* каждый пунктир проявляется после своей ленты */
.ef-panel.ef-anim .ef-connectors path {
  opacity: 0;
  transition: opacity 220ms ease;
}

.ef-panel.ef-anim.is-inview .ef-connectors path {
  opacity: 1;
}

.ef-panel.ef-anim .ef-connectors path:nth-child(1),
.ef-panel.ef-anim .ef-connectors path:nth-child(2) {
  transition-delay: 1180ms;
}

.ef-panel.ef-anim .ef-connectors path:nth-child(3) {
  transition-delay: 1060ms;
}

.ef-panel.ef-anim .ef-connectors path:nth-child(4) {
  transition-delay: 1300ms;
}

.ef-panel.ef-anim .ef-connectors path:nth-child(5) {
  transition-delay: 1420ms;
}

/* карточки — последними, коротким каскадом */
.ef-panel.ef-anim .ef-cards .ef-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 320ms ease, transform 380ms cubic-bezier(.22, .61, .36, 1);
}

.ef-panel.ef-anim.is-inview .ef-cards .ef-card {
  opacity: 1;
  transform: none;
}

.ef-panel.ef-anim .ef-cards .ef-card:nth-child(1) {
  transition-delay: 1000ms;
}

.ef-panel.ef-anim .ef-cards .ef-card:nth-child(2) {
  transition-delay: 1080ms;
}

.ef-panel.ef-anim .ef-cards .ef-card:nth-child(3) {
  transition-delay: 1160ms;
}

.ef-panel.ef-anim .ef-cards .ef-card:nth-child(4) {
  transition-delay: 1240ms;
}

@media (prefers-reduced-motion: reduce) {
  .ef-panel.ef-anim .ef-bands,
  .ef-panel.ef-anim .ef-connectors path,
  .ef-panel.ef-anim .ef-cards .ef-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ef-panel.ef-anim .ef-node {
    opacity: 1;
    transform: translate(-50%, -50%);
    transition: none;
  }

  .ef-panel.ef-anim .ef-ribbon {
    stroke-dashoffset: 0;
    transition: none;
  }
}

/* =============================================================================
   Адаптив: планшет и уже — сцена сверху, карточки сеткой под ней,
   коннекторы не нужны.
   ============================================================================= */

@media (max-width: 1199px) {
  /* здесь панель уже не масштабируется — размеры текста возвращаем в px */
  .ef-card {
    gap: 9px;
    padding: 21px 25px;
  }

  .ef-card h3 {
    font-size: 18.5px;
  }

  .ef-card p {
    font-size: 15.5px;
  }

  .ef-panel {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    padding: 20px;
    max-width: none;
    overflow: visible;
  }

  .ef-panel .ef-stage {
    position: relative;
    inset: auto;
    order: 1;
    width: 100%;
    aspect-ratio: 1190 / 700;
    border-radius: var(--ef-radius-inner);
    overflow: hidden;
  }

  .ef-panel .ef-cards {
    position: static;
    inset: auto;
    order: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
  }

  .ef-panel .ef-cards .ef-card {
    position: static;
    width: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
  }

  .ef-panel .ef-connectors {
    display: none;
  }

  .ef-panel .ef-svg {
    height: auto;
  }

  .ef-panel .ef-node--left {
    top: 54%;
  }

  .ef-panel .ef-node--right {
    top: 53.6%;
  }
}

@media (max-width: 768px) {
  .ef-panel .ef-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .ef-card {
    padding: 18px 20px;
    gap: 7px;
  }

  .ef-card h3 {
    font-size: 17.5px;
  }

  .ef-card p {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .ef-panel {
    padding: 12px;
  }

  .ef-panel .ef-stage {
    border-radius: 12px;
  }

  .ef-card h3 {
    font-size: 16px;
  }
}
