/**
 * Scene hover animations (v8.3.0)
 * Орбитальное движение на глобусе, pause-on-element-hover, подсветка активного элемента
 * и tooltip (native <title> + styled JS-tooltip через .sk-scene-tooltip).
 *
 * Используют только transform/opacity/stroke — не конфликтуют со stroke-animation draw-in.
 */

/* ===== SCENE-BOOK: idea-lines pulse + bookmark sway ===== */
.sk-scene--book:hover #scene-book__idea-1,
.sk-scene--book:hover #scene-book__idea-2,
.sk-scene--book:hover #scene-book__idea-3,
.sk-scene--book:focus-within #scene-book__idea-1,
.sk-scene--book:focus-within #scene-book__idea-2,
.sk-scene--book:focus-within #scene-book__idea-3 {
  animation: sk-scene-idea-pulse 2s ease-in-out infinite;
  transform-origin: bottom center;
  transform-box: fill-box;
}
.sk-scene--book:hover #scene-book__idea-2,
.sk-scene--book:focus-within #scene-book__idea-2 { animation-delay: 0.25s; }
.sk-scene--book:hover #scene-book__idea-3,
.sk-scene--book:focus-within #scene-book__idea-3 { animation-delay: 0.5s; }

@keyframes sk-scene-idea-pulse {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50%      { transform: translateY(-8px); opacity: 1; }
}

.sk-scene--book:hover #scene-book__bookmark,
.sk-scene--book:focus-within #scene-book__bookmark {
  animation: sk-scene-bookmark-sway 3s ease-in-out infinite;
  transform-origin: top center;
  transform-box: fill-box;
}

@keyframes sk-scene-bookmark-sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50%      { transform: rotate( 1.5deg); }
}

/* Book: pause + highlight на hover конкретного элемента */
#scene-book__idea-1:hover, #scene-book__idea-1:focus-visible,
#scene-book__idea-2:hover, #scene-book__idea-2:focus-visible,
#scene-book__idea-3:hover, #scene-book__idea-3:focus-visible,
#scene-book__bookmark:hover, #scene-book__bookmark:focus-visible {
  animation-play-state: paused !important;
  cursor: pointer;
}
#scene-book__idea-1:hover circle,
#scene-book__idea-2:hover circle,
#scene-book__idea-3:hover circle,
#scene-book__idea-1:focus-visible circle,
#scene-book__idea-2:focus-visible circle,
#scene-book__idea-3:focus-visible circle {
  r: 6;
  fill: var(--color-accent, #B05B3B);
  transition: all 200ms ease;
}
#scene-book__idea-1:hover path,
#scene-book__idea-2:hover path,
#scene-book__idea-3:hover path,
#scene-book__bookmark:hover path {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(176, 91, 59, 0.45));
  transition: all 200ms ease;
}

/* ===== SCENE-GLOBE: орбитальное движение пинов (5 разных скоростей) ===== */
/* Меридианы и параллели НЕ вращаются — убрано намеренно (v8.3.0) */

.sk-scene--globe:hover #scene-globe__orbit-1,
.sk-scene--globe:focus-within #scene-globe__orbit-1 {
  animation: sk-orbit 18s linear infinite;
}
.sk-scene--globe:hover #scene-globe__orbit-2,
.sk-scene--globe:focus-within #scene-globe__orbit-2 {
  animation: sk-orbit-reverse 22s linear infinite;
}
.sk-scene--globe:hover #scene-globe__orbit-3,
.sk-scene--globe:focus-within #scene-globe__orbit-3 {
  animation: sk-orbit 12s linear infinite;
}
.sk-scene--globe:hover #scene-globe__orbit-4,
.sk-scene--globe:focus-within #scene-globe__orbit-4 {
  animation: sk-orbit 25s linear infinite;
}
.sk-scene--globe:hover #scene-globe__orbit-5,
.sk-scene--globe:focus-within #scene-globe__orbit-5 {
  animation: sk-orbit-reverse 20s linear infinite;
}

@keyframes sk-orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes sk-orbit-reverse {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* Globe: pause + highlight на hover конкретной orbit-группы */
.scene-globe__orbit:hover,
.scene-globe__orbit:focus-visible {
  animation-play-state: paused !important;
  cursor: pointer;
  outline: none;
}
.scene-globe__orbit:hover .scene-globe__pin circle,
.scene-globe__orbit:focus-visible .scene-globe__pin circle {
  r: 10;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px rgba(176, 91, 59, 0.55));
  transition: r 200ms ease, stroke-width 200ms ease, filter 200ms ease;
}

/* Маршруты — fade in/out при общем hover сцены */
.sk-scene--globe:hover [id^="scene-globe__route"],
.sk-scene--globe:focus-within [id^="scene-globe__route"] {
  animation: sk-scene-route-fade 2.5s ease-in-out infinite;
}
.sk-scene--globe:hover #scene-globe__route-2,
.sk-scene--globe:focus-within #scene-globe__route-2 { animation-delay: 0.5s; }
.sk-scene--globe:hover #scene-globe__route-3,
.sk-scene--globe:focus-within #scene-globe__route-3 { animation-delay: 1.0s; }
.sk-scene--globe:hover #scene-globe__route-4,
.sk-scene--globe:focus-within #scene-globe__route-4 { animation-delay: 1.5s; }

@keyframes sk-scene-route-fade {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ===== SCENE-BIRDS: wings flap + drift ===== */
.sk-scene--birds:hover [id^="scene-birds__bird"],
.sk-scene--birds:focus-within [id^="scene-birds__bird"] {
  animation: sk-scene-birds-flap 0.65s ease-in-out infinite,
             sk-scene-birds-drift 4.5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.sk-scene--birds:hover #scene-birds__bird-2,
.sk-scene--birds:focus-within #scene-birds__bird-2 { animation-delay: 0.1s, 0.4s; }
.sk-scene--birds:hover #scene-birds__bird-3,
.sk-scene--birds:focus-within #scene-birds__bird-3 { animation-delay: 0.2s, 0.8s; }
.sk-scene--birds:hover #scene-birds__bird-4,
.sk-scene--birds:focus-within #scene-birds__bird-4 { animation-delay: 0.15s, 1.2s; }
.sk-scene--birds:hover #scene-birds__bird-5,
.sk-scene--birds:focus-within #scene-birds__bird-5 { animation-delay: 0.25s, 1.6s; }

@keyframes sk-scene-birds-flap {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.75); }
}
@keyframes sk-scene-birds-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Birds: pause + highlight на hover конкретной птицы */
[id^="scene-birds__bird"]:hover,
[id^="scene-birds__bird"]:focus-visible {
  animation-play-state: paused !important;
  cursor: pointer;
  outline: none;
}
[id^="scene-birds__bird"]:hover path,
[id^="scene-birds__bird"]:focus-visible path {
  stroke: var(--color-accent, #B05B3B);
  stroke-width: 3;
  filter: drop-shadow(0 0 4px rgba(176, 91, 59, 0.4));
  transition: stroke 200ms ease, stroke-width 200ms ease, filter 200ms ease;
}

/* ===== SCENE-TREE: fruits pulse + branches sway ===== */
.sk-scene--tree:hover [id^="scene-tree__fruit"],
.sk-scene--tree:focus-within [id^="scene-tree__fruit"] {
  animation: sk-scene-fruit-pulse 2.2s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.sk-scene--tree:hover #scene-tree__fruit-2,
.sk-scene--tree:focus-within #scene-tree__fruit-2 { animation-delay: 0.2s; }
.sk-scene--tree:hover #scene-tree__fruit-3,
.sk-scene--tree:focus-within #scene-tree__fruit-3 { animation-delay: 0.4s; }
.sk-scene--tree:hover #scene-tree__fruit-4,
.sk-scene--tree:focus-within #scene-tree__fruit-4 { animation-delay: 0.6s; }
.sk-scene--tree:hover #scene-tree__fruit-5,
.sk-scene--tree:focus-within #scene-tree__fruit-5 { animation-delay: 0.8s; }
.sk-scene--tree:hover #scene-tree__fruit-6,
.sk-scene--tree:focus-within #scene-tree__fruit-6 { animation-delay: 1.0s; }
.sk-scene--tree:hover #scene-tree__fruit-7,
.sk-scene--tree:focus-within #scene-tree__fruit-7 { animation-delay: 1.2s; }

@keyframes sk-scene-fruit-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.sk-scene--tree:hover #scene-tree__branches,
.sk-scene--tree:focus-within #scene-tree__branches {
  animation: sk-scene-tree-sway 4s ease-in-out infinite;
  transform-origin: 240px 380px;
  transform-box: view-box;
}

@keyframes sk-scene-tree-sway {
  0%, 100% { transform: rotate(-0.8deg); }
  50%      { transform: rotate( 0.8deg); }
}

/* Tree: pause + highlight на hover конкретного плода */
[id^="scene-tree__fruit"]:hover,
[id^="scene-tree__fruit"]:focus-visible {
  animation-play-state: paused !important;
  cursor: pointer;
  outline: none;
}
[id^="scene-tree__fruit"]:hover circle,
[id^="scene-tree__fruit"]:focus-visible circle {
  r: 13;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(176, 91, 59, 0.5));
  transition: r 200ms ease, stroke-width 200ms ease, filter 200ms ease;
}

/* ===== STYLED TOOLTIP ===== */
.sk-scene-tooltip {
  position: fixed;
  z-index: 9999;
  padding: 10px 14px;
  background: var(--color-navy-900, #1A2E5F);
  color: var(--color-white, #FFFFFF);
  font-size: 14px;
  line-height: 1.45;
  font-family: var(--ff-body, "Inter", sans-serif);
  border-radius: 0;
  border-left: 2px solid var(--color-accent, #B05B3B);
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(26, 46, 95, 0.18);
  animation: sk-tooltip-in 180ms ease-out;
}
.sk-scene-tooltip[hidden] { display: none; }

@keyframes sk-tooltip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Reduced motion — отключить все loop-анимации ===== */
@media (prefers-reduced-motion: reduce) {
  .sk-scene:hover [id^="scene-"],
  .sk-scene:focus-within [id^="scene-"],
  .scene-globe__orbit {
    animation: none !important;
  }
  .sk-scene-tooltip { animation: none; }
}

/* ===== Cursor hint + subtle scale на hover сцены ===== */
.sk-scene__svg { transition: transform 300ms ease; }
.sk-scene:hover .sk-scene__svg,
.sk-scene:focus-within .sk-scene__svg {
  transform: scale(1.01);
}
@media (prefers-reduced-motion: reduce) {
  .sk-scene__svg { transition: none; }
  .sk-scene:hover .sk-scene__svg,
  .sk-scene:focus-within .sk-scene__svg { transform: none; }
}
