/* CHERNOV — живой логотип, перфоманс-зона в футере и утколифт */

/* ---------- Утилиты ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Слоты букв (общее для шапки и футера) ---------- */
.lg-slot,
.lab-slot {
  position: relative;
  display: inline-block;
  perspective: 420px;
}
.lg-slot img,
.lab-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out),
    filter 0.55s var(--ease-out);
  will-change: opacity, transform;
}
.lg-slot .lg-over,
.lab-slot .lg-over { opacity: 0; }

/* Эффект 1: растворение */
.fx-fade .lg-over { filter: blur(6px); transform: scale(0.84); }
.fx-fade.swap .lg-over { opacity: 1; filter: blur(0); transform: none; }
.fx-fade.swap .lg-base { opacity: 0; filter: blur(5px); transform: scale(1.14); }

/* Эффект 2: переворот карточки */
.fx-flip .lg-over { transform: rotateX(-86deg); }
.fx-flip.swap .lg-over { opacity: 1; transform: rotateX(0); }
.fx-flip.swap .lg-base { opacity: 0; transform: rotateX(78deg); }

/* Эффект 3: слот-машина */
.fx-rise { overflow: hidden; }
.fx-rise .lg-over { transform: translateY(62%); }
.fx-rise.swap .lg-over { opacity: 1; transform: none; }
.fx-rise.swap .lg-base { opacity: 0; transform: translateY(-62%); }

/* ---------- Шапка: живой логотип ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-logo .lg {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.brand-logo .lg-slot {
  width: 27px;
  height: 27px;
}
/* на планшетных ширинах логотип компактнее, чтобы навигация не переносилась */
@media (min-width: 861px) and (max-width: 1150px) {
  .brand-logo .lg-slot { width: 21px; height: 21px; }
  .site-header .bar { gap: 18px; }
  .site-nav { gap: 14px; }
}
@media (max-width: 480px) {
  .brand-logo .lg-slot { width: 23px; height: 23px; }
}

/* ---------- Футер: перфоманс-зона ---------- */
.logo-lab {
  text-align: center;
  padding: clamp(30px, 5vw, 64px) var(--pad) clamp(26px, 4vw, 46px);
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.lab-kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.lab-word {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(2px, 1vw, 12px);
  margin: clamp(18px, 3.4vw, 34px) auto clamp(16px, 2.6vw, 26px);
}
.lab-slot {
  width: clamp(36px, 11vw, 116px);
  aspect-ratio: 1;
  border-radius: 10px;
  transition: transform 0.35s var(--ease-out);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lab-slot:hover { transform: translateY(-6px); }
.lab-slot:focus-visible { outline-offset: 5px; }
.lab-slot img { pointer-events: none; }
.lab-note {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.lab-quip {
  display: block;
  margin-top: 7px;
  min-height: 1.5em;
  color: var(--faint);
  font-size: 13px;
}

/* ---------- Утколифт: наверх ---------- */
.duck-lift {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 5, 0.78);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out),
    border-color 0.3s;
}
.duck-lift.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.duck-lift:hover { border-color: rgba(215, 255, 0, 0.55); }

.dl-ring {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
}
.dl-track { fill: none; stroke: rgba(242, 240, 234, 0.12); stroke-width: 1.6; }
.dl-prog {
  fill: none;
  stroke: var(--acid);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.2s linear;
}

.dl-duck {
  width: 29px;
  height: 29px;
  color: var(--ink);
  transition: color 0.3s;
}
.duck-lift:hover .dl-duck {
  color: var(--acid);
  animation: dl-bob 1.7s ease-in-out infinite;
}
@keyframes dl-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-3px) rotate(-5deg); }
}

.duck-lift.fly .dl-duck {
  animation: dl-fly 1.25s cubic-bezier(0.3, 0.6, 0.2, 1) forwards;
}
@keyframes dl-fly {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  18% { transform: translateY(3px) rotate(7deg); }
  60% { transform: translateY(-36px) rotate(-13deg); opacity: 1; }
  100% { transform: translateY(-64px) rotate(-9deg); opacity: 0; }
}

.dl-quack {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translate(-50%, 6px);
  font-family: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--acid);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.duck-lift.fly .dl-quack {
  animation: dl-quack 1s ease-out forwards;
}
@keyframes dl-quack {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -16px) rotate(6deg); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .duck-lift:hover .dl-duck,
  .duck-lift.fly .dl-duck,
  .duck-lift.fly .dl-quack { animation: none; }
  .dl-prog { transition: none; }
}
