/**
 * bear-mascot.css - позиционирование маскота в 7 секциях лендинга.
 * v3 (2026-09-04): адаптив phone/tablet/desktop — медведи не перекрывают
 * текст и кнопки; на узких экранах уменьшены/сдвинуты, не удалены.
 * Подключается через layouts/BaseLayout.astro как глобальный CSS.
 */

/* picture-wrapper не должен ломать abs-позиционирование img */
picture:has(> .bear-mascot) {
  display: contents;
}

.bear-mascot {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
  will-change: opacity, transform;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.18));
  /* CSS перебивает width="N" HTML-атрибут (для CLS-фикса оставляем атрибут) */
  width: auto;
  max-width: 100%;
  height: auto;
}

@keyframes bearWobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-2px) rotate(-1.5deg); }
  45% { transform: translateY(0) rotate(0.8deg); }
  70% { transform: translateY(-1px) rotate(-0.4deg); }
}
@keyframes bearPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.015); }
}
@keyframes bearPulseFlip {
  0%, 100% { transform: translateY(0) scaleX(-1) scale(1); }
  50% { transform: translateY(-6px) scaleX(-1) scale(1.015); }
}
@keyframes bearWobbleFlip {
  0%, 100% { transform: translateY(0) scaleX(-1) rotate(0deg); }
  20% { transform: translateY(-2px) scaleX(-1) rotate(-1.5deg); }
  45% { transform: translateY(0) scaleX(-1) rotate(0.8deg); }
  70% { transform: translateY(-1px) scaleX(-1) rotate(-0.4deg); }
}
.bear-mascot.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   1. HERO
   Desktop: правый нижний угол. Tablet: правее текста (2-col).
   Phone: под контентом, уменьшен — не перекрывает CTA.
   ============================================================ */
.bear-mascot--hero {
  bottom: 0;
  right: 2%;
  height: 580px;
  width: auto;
  z-index: 1;
}
@media (max-width: 1279px) {
  .bear-mascot--hero { height: 480px; right: 1%; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .bear-mascot--hero {
    height: 400px;
    right: 0;
    bottom: 0;
    opacity: 0.95;
    max-width: 42%;
    object-fit: contain;
    object-position: bottom right;
  }
}
@media (max-width: 767px) {
  .bear-mascot--hero {
    position: relative;
    height: 240px;
    max-width: min(220px, 55vw);
    margin: 8px auto 0;
    display: block;
    right: auto;
    bottom: auto;
    left: auto;
    opacity: 1;
    z-index: 0;
  }
}
@media (max-width: 379px) {
  .bear-mascot--hero {
    height: 200px;
    max-width: min(180px, 50vw);
  }
}

/* ============================================================
   2. PROBLEMS
   ============================================================ */
.bear-mascot--problems {
  top: 40px;
  left: 1%;
  right: auto;
  height: 560px;
  z-index: 1;
  opacity: 1;
  transform: translateY(24px);
}
.bear-mascot--problems.is-revealed {
  opacity: 1;
  transform: translateY(0);
  animation: bearWobble 2.4s ease-out 0.7s 1;
}
@media (max-width: 1279px) {
  .bear-mascot--problems { height: 480px; left: 0; top: 30px; }
}
/* Tablet: уменьшаем и прижимаем к краю, контент выше по z-index */
@media (min-width: 768px) and (max-width: 1023px) {
  .bear-mascot--problems {
    display: block;
    height: 280px;
    top: auto;
    bottom: 0;
    left: 0;
    opacity: 0.55;
    max-width: 28%;
    object-fit: contain;
    object-position: bottom left;
  }
}
@media (max-width: 767px) {
  .bear-mascot--problems { display: none; }
}

/* ============================================================
   3. SERVICES (FeatureBento)
   ============================================================ */
.bear-mascot--services {
  position: absolute;
  top: 60px;
  right: 1%;
  left: auto;
  height: 540px;
  z-index: 1;
  opacity: 1;
  transform: translateY(24px);
}
.bear-mascot--services.is-revealed {
  opacity: 1;
  transform: translateY(0);
  animation: bearPulse 2.6s ease-in-out 0.8s 1;
}
@media (max-width: 1279px) {
  .bear-mascot--services { height: 460px; right: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .bear-mascot--services {
    display: block;
    height: 260px;
    top: auto;
    bottom: 0;
    right: 0;
    opacity: 0.5;
    max-width: 26%;
  }
}
@media (max-width: 767px) {
  .bear-mascot--services { display: none; }
}

/* ============================================================
   4. WORKFLOW (Process)
   ============================================================ */
.bear-mascot--workflow {
  position: absolute;
  top: 60px;
  left: 1%;
  right: auto;
  height: 540px;
  z-index: 1;
  opacity: 1;
  transform: translateY(24px) scaleX(-1);
}
.bear-mascot--workflow.is-revealed {
  opacity: 1;
  transform: translateY(0) scaleX(-1);
}
@media (max-width: 1279px) {
  .bear-mascot--workflow { height: 460px; left: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .bear-mascot--workflow {
    display: block;
    height: 260px;
    top: auto;
    bottom: 0;
    left: 0;
    opacity: 0.5;
    max-width: 26%;
  }
}
@media (max-width: 767px) {
  .bear-mascot--workflow { display: none; }
}

/* ============================================================
   5. CASES
   Same corner as before (top 140 / left 8). Height matches Problems.
   ============================================================ */
.bear-mascot--cases {
  position: absolute;
  top: 140px;
  bottom: auto;
  right: auto;
  left: 8px;
  height: 560px;
  width: auto;
  max-width: none;
  max-height: none;
  transform: translateY(0) scaleX(-1);
  z-index: 1;
  opacity: 1;
  pointer-events: none;
  object-position: top left;
  object-fit: contain;
}
.bear-mascot--cases.is-revealed {
  opacity: 1;
  transform: translateY(0) scaleX(-1);
}
@media (max-width: 1279px) {
  .bear-mascot--cases { height: 480px; }
}
@media (max-width: 1023px) {
  .bear-mascot--cases { display: none; }
}

/* ============================================================
   6. PRICING
   Same corner as before (top 48 / left 8). Height matches Problems.
   ============================================================ */
.bear-mascot--pricing {
  position: absolute;
  display: block;
  top: 48px;
  left: 8px;
  right: auto;
  bottom: auto;
  margin: 0;
  height: 560px;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: top left;
  z-index: 1;
  opacity: 1;
  transform: translateY(0) scaleX(-1);
  pointer-events: none;
}
.bear-mascot--pricing.is-revealed {
  opacity: 1;
  transform: translateY(0) scaleX(-1);
}
@media (max-width: 1279px) {
  .bear-mascot--pricing { height: 480px; }
}
@media (max-width: 1023px) {
  .bear-mascot--pricing { display: none; }
}

/* ============================================================
   7. CTA FINAL
   ============================================================ */
.bear-mascot--cta {
  bottom: -40px;
  right: 4%;
  height: 580px;
  z-index: 1;
  transform: translateY(24px);
}
.bear-mascot--cta.is-revealed {
  transform: translateY(0);
}
@media (max-width: 1279px) {
  .bear-mascot--cta { height: 480px; right: 2%; bottom: -20px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .bear-mascot--cta {
    height: 300px;
    right: 0;
    bottom: 0;
    opacity: 0.7;
    max-width: 36%;
    object-fit: contain;
    object-position: bottom right;
  }
}
@media (max-width: 767px) {
  .bear-mascot--cta {
    position: relative;
    height: 220px;
    max-width: min(200px, 50vw);
    margin: 16px auto 0;
    display: block;
    right: auto;
    bottom: auto;
    opacity: 1;
    z-index: 0;
  }
}
@media (max-width: 379px) {
  .bear-mascot--cta {
    height: 180px;
    max-width: min(160px, 48vw);
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .bear-mascot {
    transition: none;
    transform: none;
    opacity: 1;
    filter: none;
  }
  .bear-mascot--problems.is-revealed,
  .bear-mascot--services.is-revealed {
    animation: none;
  }
  .bear-mascot--problems,
  .bear-mascot--services,
  .bear-mascot--workflow {
    opacity: 0.95;
  }
}

@media (min-width: 1024px) {
  #cases .cases-layout,
  #pricing .pricing-inner {
    padding-left: 0 !important;
  }
}



