/* Soft Brand Icons v2 — transform/opacity only; compact + reduced-motion safe */

.brand-ico {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  overflow: visible;
  color: #6366f1;
  -webkit-font-smoothing: antialiased;
  contain: layout style;
}

/* Эталонные sticker GIF/JPG — анимация уже в файле, CSS только hover */
.brand-ico--sticker {
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  image-rendering: auto;
  pointer-events: none;
}

.brand-ico--sticker.brand-ico--tile {
  border-radius: 16px;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  padding: 10%;
  box-sizing: border-box;
  object-fit: contain;
}

.brand-ico--sticker.is-animated {
  /* GIF играет сам; JPG без CSS-анимации — как в эталоне */
}

a:hover .brand-ico--sticker.is-animated,
button:hover .brand-ico--sticker.is-animated,
.bi-card:hover .brand-ico--sticker.is-animated {
  transform: translateY(-2px) scale(1.05);
  transition: transform 0.28s cubic-bezier(.22,.8,.28,1);
}

.brand-ico .bi-body {
  transform-origin: 50% 55%;
}

.brand-ico.is-animated .bi-body {
  animation: bi-breathe 3.6s ease-in-out infinite;
}

/* Маскот / sticker dump·diamond·city — своё движение, без общего «дыхания» */
.brand-ico--beaver.is-animated .bi-body,
.brand-ico--dump.is-animated .bi-body,
.brand-ico--diamonds.is-animated .bi-body,
.brand-ico--city.is-animated .bi-body {
  animation: none;
}

.brand-ico.is-animated .bi-spark {
  transform-origin: center;
  transform-box: fill-box;
  animation: bi-twinkle 2.6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-spark--2 { animation-delay: 0.55s; }
.brand-ico.is-animated .bi-spark--3 { animation-delay: 1.1s; }

.brand-ico.is-animated .bi-facet {
  animation: bi-facet-glow 2.6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-gem .bi-shine,
.brand-ico.is-animated .bi-token .bi-shine {
  animation: bi-shine-sweep 3s ease-in-out infinite;
}

.brand-ico.is-animated .bi-drop {
  transform-origin: 32px 18px;
  animation: bi-drop-sway 3.8s ease-in-out infinite;
}

.brand-ico.is-animated .bi-ripple {
  transform-origin: center;
  transform-box: fill-box;
  animation: bi-ripple-out 3s ease-out infinite;
}

.brand-ico.is-animated .bi-tower {
  transform-origin: 50% 100%;
  transform-box: fill-box;
  animation: bi-tower-breathe 4.2s ease-in-out infinite;
}

.brand-ico.is-animated .bi-tower--side {
  animation: bi-tower-breathe 4.2s ease-in-out infinite 0.2s;
}

.brand-ico.is-animated .bi-win {
  animation: bi-win-blink 2.8s ease-in-out infinite;
}

.brand-ico.is-animated .bi-win--2 { animation-delay: 0.22s; }
.brand-ico.is-animated .bi-win--3 { animation-delay: 0.44s; }
.brand-ico.is-animated .bi-win--4 { animation-delay: 0.66s; }

.brand-ico.is-animated .bi-sun {
  transform-origin: center;
  transform-box: fill-box;
  animation: bi-sun-glow 3.4s ease-in-out infinite;
}

.brand-ico.is-animated .bi-bush {
  transform-origin: 50% 100%;
  transform-box: fill-box;
  animation: bi-bush-sway 3.6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-bush--2 {
  animation-delay: 0.35s;
}

.brand-ico.is-animated .bi-dump {
  transform-origin: 32px 40px;
  animation: bi-dump-bounce 3.2s cubic-bezier(.37,.6,.35,1) infinite;
}

.brand-ico.is-animated .bi-stripe {
  animation: bi-stripe-pulse 2.4s ease-in-out infinite;
}

.brand-ico.is-animated .bi-stripe--2 { animation-delay: 0.18s; }
.brand-ico.is-animated .bi-stripe--3 { animation-delay: 0.36s; }

.brand-ico.is-animated .bi-pin {
  transform-origin: 32px 29px;
  animation: bi-pin-settle 3.2s ease-in-out infinite;
}

.brand-ico.is-animated .bi-bubble {
  transform-origin: 32px 34px;
}

.brand-ico.is-animated .bi-qdot {
  transform-origin: center;
  transform-box: fill-box;
  animation: bi-twinkle 2.4s ease-in-out infinite;
}

.brand-ico.is-animated .bi-coin {
  transform-origin: 32px 32px;
  animation: bi-coin-settle 4s ease-in-out infinite;
}

.brand-ico.is-animated .bi-gem {
  transform-origin: 32px 34px;
  animation: bi-gem-tilt 4.4s ease-in-out infinite;
}

.brand-ico--diamonds .bi-body,
.brand-ico--token .bi-body {
  /* без blur-тени — края остаются острыми на retina/мобилке */
}

.brand-ico.is-animated .bi-coin-shadow {
  transform-origin: center;
  transform-box: fill-box;
  animation: bi-glow-pulse 4s ease-in-out infinite;
}

.brand-ico.is-animated .bi-mascot {
  transform-origin: 32px 54px;
  animation: bi-mascot-float 6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-mascot-img {
  transform-origin: 32px 54px;
  animation: bi-mascot-sway 7s ease-in-out infinite;
}

.brand-ico.is-animated .bi-handle {
  transform-origin: 32px 14px;
  animation: bi-handle-nudge 3.5s ease-in-out infinite;
}

.brand-ico.is-animated .bi-lid {
  transform-origin: 24px 18px;
  animation: bi-lid-nudge 3.3s ease-in-out infinite;
}

.brand-ico.is-animated .bi-tape {
  animation: bi-tape-pulse 2.2s ease-in-out infinite;
}

.brand-ico.is-animated .bi-card--back {
  animation: bi-card-stack 3.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.brand-ico.is-animated .bi-card--mid {
  animation: bi-card-stack 3.8s ease-in-out infinite 0.14s;
  transform-box: fill-box;
  transform-origin: center;
}

.brand-ico.is-animated .bi-card--front {
  animation: bi-card-stack 3.8s ease-in-out infinite 0.28s;
  transform-box: fill-box;
  transform-origin: center;
}

.brand-ico.is-animated .bi-arrow {
  animation: bi-arrow-bob 2.1s ease-in-out infinite;
}

.brand-ico.is-animated .bi-check {
  stroke-dasharray: 36;
  stroke-dashoffset: 0;
  animation: bi-check-draw 3s ease-in-out infinite;
}

.brand-ico.is-animated .bi-hand {
  transform-origin: 32px 32px;
  animation: bi-clock-hour 10s linear infinite;
}

.brand-ico.is-animated .bi-hand--min {
  animation: bi-clock-min 2.6s linear infinite;
}

.brand-ico.is-animated .bi-lock {
  transform-origin: 50% 80%;
  animation: bi-lock-settle 3.6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-shackle {
  transform-origin: 32px 18px;
  animation: bi-shackle-nudge 3.6s ease-in-out infinite;
}

.brand-ico.is-animated .bi-bag {
  transform-origin: 50% 80%;
  animation: bi-bag-sway 3.4s ease-in-out infinite;
}

/* Компакт (nav, карточки ≤32px): без тяжёлых вложенных анимаций */
.brand-ico--compact.is-animated .bi-gem,
.brand-ico--compact.is-animated .bi-drop,
.brand-ico--compact.is-animated .bi-ripple,
.brand-ico--compact.is-animated .bi-pin,
.brand-ico--compact.is-animated .bi-coin,
.brand-ico--compact.is-animated .bi-coin-shadow,
.brand-ico--compact.is-animated .bi-win,
.brand-ico--compact.is-animated .bi-tower,
.brand-ico--compact.is-animated .bi-tower--side,
.brand-ico--compact.is-animated .bi-bush,
.brand-ico--compact.is-animated .bi-bush--2,
.brand-ico--compact.is-animated .bi-stripe,
.brand-ico--compact.is-animated .bi-stripe--2,
.brand-ico--compact.is-animated .bi-stripe--3,
.brand-ico--compact.is-animated .bi-card--back,
.brand-ico--compact.is-animated .bi-card--mid,
.brand-ico--compact.is-animated .bi-card--front,
.brand-ico--compact.is-animated .bi-hand,
.brand-ico--compact.is-animated .bi-hand--min,
.brand-ico--compact.is-animated .bi-check {
  animation: none !important;
}

.brand-ico--compact.is-animated .bi-dump {
  animation: bi-dump-bounce-compact 3.4s ease-in-out infinite;
}

.brand-ico--compact.is-animated .bi-sun {
  animation: bi-sun-glow 3.8s ease-in-out infinite;
}

.brand-ico--compact .bi-bush--2,
.brand-ico--compact .bi-spark--2,
.brand-ico--compact .bi-spark--3 {
  display: none;
}

.brand-ico--compact.is-animated .bi-body {
  animation: bi-breathe-compact 3.8s ease-in-out infinite;
}

.brand-ico--compact.brand-ico--beaver.is-animated .bi-body,
.brand-ico--compact.brand-ico--dump.is-animated .bi-body,
.brand-ico--compact.brand-ico--diamonds.is-animated .bi-body,
.brand-ico--compact.brand-ico--city.is-animated .bi-body {
  animation: none;
}

.brand-ico--compact.is-animated .bi-gem {
  animation: bi-gem-tilt 4.8s ease-in-out infinite !important;
}

.brand-ico--compact.is-animated .bi-mascot {
  animation: bi-mascot-float-compact 6s ease-in-out infinite;
}

.brand-ico--compact.is-animated .bi-mascot-img {
  animation: none;
}

.brand-ico .bi-mascot-img {
  image-rendering: auto;
}

.brand-ico--tile .bi-mascot-img {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.12));
}

/* Hover */
.brand-ico.is-animated:hover .bi-body,
a:hover .brand-ico.is-animated .bi-body,
button:hover .brand-ico.is-animated .bi-body,
.bi-card:hover .brand-ico.is-animated .bi-body {
  animation: bi-lift 0.35s cubic-bezier(.22,.8,.28,1) both;
}

.brand-ico--beaver.is-animated:hover .bi-mascot,
.bi-card:hover .brand-ico--beaver.is-animated .bi-mascot {
  animation: bi-lift 0.35s cubic-bezier(.22,.8,.28,1) both;
}

@keyframes bi-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.02); }
}

@keyframes bi-breathe-compact {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.6px); }
}

@keyframes bi-lift {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-2px) scale(1.05); }
}

@keyframes bi-twinkle {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes bi-facet-glow {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes bi-shine-sweep {
  0%, 100% { opacity: 0.28; }
  45%, 55% { opacity: 0.75; }
}

@keyframes bi-glow-pulse {
  0%, 100% { opacity: 0.3; transform: scaleX(0.94); }
  50% { opacity: 0.45; transform: scaleX(1.04); }
}

@keyframes bi-drop-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes bi-ripple-out {
  0% { opacity: 0.35; transform: scale(0.85); }
  75% { opacity: 0.08; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.2); }
}

@keyframes bi-pin-settle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

@keyframes bi-gem-tilt {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2.2deg) translateY(-1.2px); }
}

@keyframes bi-dump-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-2.4px) rotate(-1.2deg); }
  55% { transform: translateY(-0.4px) rotate(0.8deg); }
  70% { transform: translateY(-1.6px) rotate(-0.5deg); }
}

@keyframes bi-dump-bounce-compact {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@keyframes bi-stripe-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@keyframes bi-sun-glow {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes bi-bush-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2.4deg); }
}

@keyframes bi-tower-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.015); }
}

@keyframes bi-coin-settle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

@keyframes bi-mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

@keyframes bi-mascot-float-compact {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@keyframes bi-mascot-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.2deg); }
}

@keyframes bi-win-blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes bi-handle-nudge {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.94); }
}

@keyframes bi-lid-nudge {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.94); opacity: 0.9; }
}

@keyframes bi-tape-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes bi-card-stack {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

@keyframes bi-arrow-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

@keyframes bi-check-draw {
  0%, 15% { stroke-dashoffset: 36; opacity: 0.4; }
  40%, 70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.92; }
}

@keyframes bi-clock-hour {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bi-clock-min {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bi-lock-settle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.8px); }
}

@keyframes bi-shackle-nudge {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.97); }
}

@keyframes bi-bag-sway {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1.2deg); }
}

@media (max-width: 640px) {
  .brand-ico.is-animated .bi-mascot-img {
    animation: none;
  }

  .brand-ico.is-animated .bi-win {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-ico.is-animated .bi-body,
  .brand-ico.is-animated [class*="bi-"] {
    animation: none !important;
  }
}
