/*
 * Avendor decorative environment tuning.
 *
 * Moving background copies are visual-only. They must never become a second
 * character-visibility system; authored depthOccluders own that responsibility.
 */

.walk-stage .dock-boat-window {
  /* Player depth begins above 1000; keep decorative boat copies below it. */
  z-index: 930 !important;
}

/* Tight hull masks keep nearby dock boards out of the bobbing crop. */
.walk-stage .dock-boat-window[data-boat="central"] {
  clip-path: polygon(
    8.5% 10.5%,
    76.5% 7%,
    93.5% 35%,
    85% 77%,
    59% 92%,
    25% 85%,
    6% 56%
  ) !important;
  animation-duration: 4.1s !important;
}

.walk-stage .dock-boat-window[data-boat="west"] {
  clip-path: polygon(
    12% 13%,
    69.5% 7%,
    92% 29%,
    89% 72%,
    57% 92%,
    22% 81%,
    8% 48%
  ) !important;
  animation-duration: 4.7s !important;
  animation-delay: -1.35s !important;
}

/* Lanterns keep their daypart opacity but flicker with irregular flame energy. */
.walk-stage .dock-lantern-glow {
  animation-name: avendor-lantern-flicker !important;
  animation-duration: 2.9s !important;
  animation-timing-function: linear !important;
  animation-iteration-count: infinite !important;
}

@keyframes avendor-lantern-flicker {
  0%, 18%, 42%, 71%, 100% {
    transform: translate(-50%, -50%) scale(.985);
    filter: blur(3px) brightness(.94);
  }
  7%, 31%, 59%, 86% {
    transform: translate(-50%, -50%) scale(1.035);
    filter: blur(3px) brightness(1.18);
  }
  11%, 35%, 63%, 90% {
    transform: translate(-50%, -50%) scale(1.005);
    filter: blur(3px) brightness(1.03);
  }
}

/* Two distant Docks birds. Decorative only, beneath hero and occluder depth. */
.walk-stage .dock-bird-layer {
  position: absolute;
  inset: 0;
  z-index: 945;
  overflow: hidden;
  pointer-events: none;
}

.walk-stage .dock-bird {
  --bird-scale: 1;
  position: absolute;
  width: 50px;
  height: 24px;
  opacity: .88;
  pointer-events: none;
  transform-origin: center;
}

.walk-stage .dock-bird::before,
.walk-stage .dock-bird::after {
  content: '';
  position: absolute;
  top: 7px;
  width: 26px;
  height: 13px;
  border-top: 3px solid rgba(18, 23, 29, .98);
  border-radius: 52% 52% 0 0;
}

.walk-stage .dock-bird::before {
  left: 0;
  transform-origin: 100% 35%;
  animation: avendor-bird-wing-left .62s ease-in-out infinite alternate;
}

.walk-stage .dock-bird::after {
  right: 0;
  transform-origin: 0 35%;
  animation: avendor-bird-wing-right .62s ease-in-out infinite alternate;
}

.walk-stage .dock-bird-a {
  left: -2%;
  top: 9%;
  animation: avendor-bird-flight-a 18.5s linear infinite;
}

.walk-stage .dock-bird-b {
  --bird-scale: .86;
  left: 18%;
  top: 13%;
  opacity: .72;
  animation: avendor-bird-flight-b 22s linear infinite;
  animation-delay: -7.5s;
}

.walk-stage[data-daypart="dawn"] .dock-bird { opacity: .80; }
.walk-stage[data-daypart="dusk"] .dock-bird { opacity: .66; }
.walk-stage[data-daypart="night"] .dock-bird { opacity: .18; }

@keyframes avendor-bird-wing-left {
  from { transform: rotate(17deg) translateY(0); }
  to { transform: rotate(-13deg) translateY(2px); }
}

@keyframes avendor-bird-wing-right {
  from { transform: rotate(-17deg) translateY(0); }
  to { transform: rotate(13deg) translateY(2px); }
}

@keyframes avendor-bird-flight-a {
  0% { transform: translate3d(0, 0, 0) scale(var(--bird-scale)); }
  24% { transform: translate3d(27vw, -7px, 0) scale(var(--bird-scale)); }
  53% { transform: translate3d(57vw, 3px, 0) scale(var(--bird-scale)); }
  78% { transform: translate3d(82vw, -6px, 0) scale(var(--bird-scale)); }
  100% { transform: translate3d(108vw, 1px, 0) scale(var(--bird-scale)); }
}

@keyframes avendor-bird-flight-b {
  0% { transform: translate3d(0, 0, 0) scale(var(--bird-scale)); }
  31% { transform: translate3d(24vw, 5px, 0) scale(var(--bird-scale)); }
  64% { transform: translate3d(52vw, -4px, 0) scale(var(--bird-scale)); }
  100% { transform: translate3d(92vw, 2px, 0) scale(var(--bird-scale)); }
}

@media (prefers-reduced-motion: reduce) {
  .walk-stage .dock-bird-layer {
    display: none;
  }
}
