/* ------------------------------------------------------------------
   Секция 02 «Учить английский сложно?»
   Десктоп 121:17054, планшет 175:13623, телефон 175:14020.
   Десктоп — сцена 1600 px, масштабируется через --s (script.js).
   ------------------------------------------------------------------ */

/* overflow-x: стикер до появления увеличен и не должен давать горизонтальный скролл */
.hard { background: var(--c-bg); overflow-x: clip; }

.hard__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 70px;
  width: 1600px;
  margin: 120px auto 0;
  padding: 100px 40px 0;
  zoom: var(--s, 1);
}

/* ---------- Заголовок ---------- */

.hard__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 1021px;
  padding-top: 26px;
  text-align: center;
}

.hard__h2 { position: relative; align-self: stretch; }

.hard__h2 h2 {
  margin: 0;
  font: 400 46px/105% var(--font-display);
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
}

/* Стикер повёрнут вокруг левого верхнего угла, как в Figma */
.sticker {
  position: absolute;
  left: 870px;
  top: -91px;
  width: 272px;
  height: 63px;
  padding: 8px 22px 11px;
  border-radius: 16px;
  background: var(--c-lime);
  color: var(--c-ink);
  font: 400 35px/125% var(--font-display);
  white-space: nowrap;
  text-align: left;
  transform-origin: 0 0;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}
.sticker::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% + 24px);
  background: inherit;
  clip-path: polygon(260px 62.4px, 249.6px 80.4px, 239.2px 62.4px);
}

.hard__lead {
  font: 400 22px/145% var(--font-text);
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- Панель ---------- */

.b2n {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  width: 100%;
  padding-top: 56px;
}

.b2n__bg {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 522px;
  border-radius: 52px;
  background: #160f2b url("../assets/s2/panel-d.svg") center top / cover no-repeat;
}

.b2n__ttl {
  display: flex;
  align-items: center;
  gap: 41px;
  width: 1200px;
}

.b2n__ava {
  position: relative;
  flex: none;
  width: 132px;
  height: 132px;
}
.b2n__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a38f5 0%, #d4baff 55%, #e5f974 100%);
}
.b2n__ring img {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  object-fit: cover;
}
.b2n__wave { display: none; }

.b2n__title {
  flex: 1;
  font: 400 35px/125% var(--font-display);
  color: #fff;
}

/* ---------- Карточки ---------- */

.b2n__grid {
  display: flex;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  margin: 0;
  padding: 0 40px;
  list-style: none;
}

.fcard {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
  padding: 20px;
  background: #1f1c29;
  border-radius: 30px;
  /* обводка inside, как в макете: не влияет на размеры */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.fcard__ill {
  display: block;
  height: 250px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--c-phone);
}

.fcard__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.fcard h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65px;
  margin: 0;
  font: 400 27px/120% var(--font-display);
  color: #fff;
}

.fcard__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font: 400 17px/26px var(--font-text);
  color: rgba(255, 255, 255, 0.55);
}

/* наведение: карточка светлеет (белый 10%), сценарий играет (script.js) */
.fcard::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .fcard:hover::before { opacity: 1; }
}

/* ---------- Анимации (включает script.js, класс .is-anim) ---------- */

.hard.is-anim .hard__h2 h2,
.hard.is-anim .hard__lead,
.hard.is-anim .b2n__bg,
.hard.is-anim .b2n__ttl,
.hard.is-anim .fcard {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s, transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
.hard.is-anim .hard__lead { transition-delay: 0.12s; }
.hard.is-anim .b2n__ttl { transition-delay: 0.15s; }
.hard.is-anim .fcard:nth-child(2) { transition-delay: 0.1s; }
.hard.is-anim .fcard:nth-child(3) { transition-delay: 0.2s; }
.hard.is-anim .fcard:nth-child(4) { transition-delay: 0.3s; }
.hard.is-anim .hard__head.is-go :is(h2, .hard__lead),
.hard.is-anim .b2n.is-go :is(.b2n__bg, .b2n__ttl),
.hard.is-anim .b2n__grid.is-go .fcard { opacity: 1; transform: none; }

/* «Теперь нет»: стикер прилетает и шлёпается на место, потом изредка
   покачивается. Поворот 6° — в переменной, чтобы анимации его не теряли */
.sticker { --r: 6deg; transform: rotate(var(--r)); }
.hard.is-anim .sticker { opacity: 0; transform: translate(40px, -30px) rotate(24deg) scale(1.6); }
.hard.is-anim .hard__head.is-go .sticker {
  animation:
    stk-in 0.7s 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both,
    stk-wiggle 4s 2s ease-in-out infinite;
}
@keyframes stk-in {
  from { opacity: 0; transform: translate(40px, -30px) rotate(24deg) scale(1.6); }
  60% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--r)); }
}
@keyframes stk-wiggle {
  0%, 82%, 100% { opacity: 1; transform: rotate(var(--r)); }
  86% { opacity: 1; transform: rotate(calc(var(--r) - 4deg)) scale(1.04); }
  90% { opacity: 1; transform: rotate(calc(var(--r) + 3deg)) scale(1.04); }
  94% { opacity: 1; transform: rotate(calc(var(--r) - 1.5deg)); }
}

/* ------------------------------------------------------------------
   Планшет 768–1023
   ------------------------------------------------------------------ */

@media (max-width: 1023px) {
  .hard__stage {
    gap: 44px;
    width: auto;
    margin-top: 96px;
    padding: 56px 0 0;
    zoom: 1;
  }

  .hard__head {
    gap: 18px;
    width: 100%;
    padding: 40px 32px 0;
  }
  .hard__h2 h2 { font-size: 36px; line-height: 40px; white-space: normal; }

  .sticker {
    left: calc(50% + 142.5px);
    top: -74px;
    width: 206px;
    height: 45px;
    padding: 6px 18px 9px;
    border-radius: 13px;
    font-size: 26px;
    line-height: 115%;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
  }
  .sticker::after {
    clip-path: polygon(190.2px 42px, 182px 56.3px, 163.8px 43.1px);
  }

  .hard__lead { font-size: 18px; line-height: 22px; }

  .b2n { gap: 40px; padding-top: 48px; }
  .b2n__bg { height: 460px; background-image: url("../assets/s2/panel-t.svg"); }

  .b2n__ttl { gap: 24px; width: 100%; padding: 0 32px; }

  .b2n__ava { width: 96px; height: 96px; }
  .b2n__ring { width: 96px; height: 96px; border-radius: 50%; }
  .b2n__ring img { width: 89px; height: 89px; }
  .b2n__wave {
    position: absolute;
    left: 67px;
    top: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 2px solid var(--c-bg);
    border-radius: 21px;
    background: radial-gradient(50% 50% at 50% 50%, #5b2fc4 0%, #2a1a5e 45%, #160f2b 100%);
  }
  .b2n__wave img { width: 23px; height: 23px; }

  .b2n__title { font-size: 26px; line-height: 30px; }

  .b2n__grid { flex-wrap: wrap; gap: 16px; padding: 0 32px; }
  .fcard { flex: 1 1 calc(50% - 8px); }

  .fcard h3 { font-size: 22px; }
  .fcard__text { font-size: 16px; line-height: 18px; }
}

/* ------------------------------------------------------------------
   Телефон < 768: карточки листаются по горизонтали
   ------------------------------------------------------------------ */

@media (max-width: 767px) {
  .hard__stage { gap: 32px; margin-top: 72px; padding-top: 40px; }

  .hard__head { gap: 14px; padding: 44px 16px 0; }
  .hard__h2 h2 { font-size: 26px; line-height: 30px; }

  .sticker {
    left: calc(50% + 0.9px);
    top: -56px;
    width: 172px;
    height: 38px;
    padding: 5px 14px 7px;
    border-radius: 10px;
    font-size: 22px;
    line-height: 120%;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.3));
  }
  .sticker::after {
    clip-path: polygon(164.6px 36.8px, 158.1px 48.1px, 151.6px 36.8px);
  }

  .hard__lead { font-size: 16px; line-height: 18px; }

  .b2n { gap: 28px; padding-top: 36px; }
  .b2n__bg { height: 420px; background-image: url("../assets/s2/panel-m.svg"); }

  .b2n__ttl { flex-direction: column; gap: 16px; padding: 0 16px; }

  .b2n__ava { width: 76px; height: 76px; }
  .b2n__ring { width: 76px; height: 76px; }
  .b2n__ring img { width: 71px; height: 71px; }
  .b2n__wave { left: 53px; top: 46px; width: 35px; height: 35px; border-radius: 17px; }
  .b2n__wave img { width: 19px; height: 19px; }

  .b2n__title { font-size: 22px; line-height: 26px; text-align: center; }

  /* нижний отступ — чтобы тени карточек не обрезались прокруткой */
  .b2n__grid {
    flex-wrap: nowrap;
    gap: 12px;
    margin-bottom: -44px;
    padding: 0 16px 44px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
  }
  .b2n__grid::-webkit-scrollbar { display: none; }

  .fcard {
    flex: 0 0 300px;
    gap: 14px;
    padding: 17px;
    border-radius: 26px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 17px 43px rgba(0, 0, 0, 0.35);
    scroll-snap-align: start;
  }
  .fcard__ill { height: 218px; border-radius: 17px; }

  .fcard__body { gap: 10px; }
  .fcard h3 { min-height: 57px; font-size: 20px; }
  .fcard__text { gap: 7px; min-height: 145px; font-size: 15px; line-height: 120%; }
}
