.char-float {
  animation: chaibeeFloat 4s ease-in-out infinite;
}

@keyframes chaibeeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.char-appear {
  opacity: 0;
  transform: translateY(16px);
  animation: chaibeeAppear 0.8s ease forwards;
}

@keyframes chaibeeAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.js-chaibee-wave.is-wave {
  transform-origin: bottom center;
  animation: chaibeeWave 1.4s ease-in-out 2;
}

@keyframes chaibeeWave {
  0%, 100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-2deg);
  }
  60% {
    transform: rotate(2deg);
  }
}

.icon-lantern-glow {
  animation: lanternGlow 3s ease-in-out infinite;
}

@keyframes lanternGlow {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(242, 184, 75, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(242, 184, 75, 0.65));
  }
}

.deco-leaf {
  position: absolute;
  top: -40px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  opacity: 0;
  animation: leafFall 12s linear infinite;
}

.deco-leaf::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 70% 0 70% 0;
  background: var(--leaf-color, var(--color-main));
  transform: rotate(18deg);
}

@keyframes leafFall {
  0% {
    transform: translate3d(0, -40px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(40px, 110vh, 0) rotate(160deg);
    opacity: 0;
  }
}

.js-scroll-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-scroll-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.p-opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  overflow: hidden;
  background: #f5eed9;
  opacity: 1;
  filter: blur(0);
}

.p-opening.is-active {
  display: block;
}

.p-opening.is-hidden {
  opacity: 0;
  filter: blur(12px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.95s ease, filter 0.95s ease, visibility 0.95s ease;
}

.p-opening__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.p-opening__gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.p-opening__panel {
  position: absolute;
  top: 0;
  width: 62%;
  height: 100%;
  overflow: visible;
  background: transparent;
  will-change: transform;
}

.p-opening__panel--left {
  left: 0;
}

.p-opening__panel--right {
  right: 0;
}

.p-opening.is-gate-opening .p-opening__panel--left {
  animation: openingForestLeft 1.9s cubic-bezier(0.72, 0, 0.24, 1) forwards;
}

.p-opening.is-gate-opening .p-opening__panel--right {
  animation: openingForestRight 1.9s cubic-bezier(0.72, 0, 0.24, 1) forwards;
}

.p-opening__panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.p-opening__panel--left img {
  object-position: left center;
}

.p-opening__panel--right img {
  object-position: right center;
}

@keyframes openingForestLeft {
  to {
    transform: translateX(-104%);
  }
}

@keyframes openingForestRight {
  to {
    transform: translateX(104%);
  }
}

.p-opening__skip {
  position: fixed;
  right: 20px;
  bottom: 20px;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 4;
  min-width: 88px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-brown);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-weight: 700;
  letter-spacing: 0;
  backdrop-filter: blur(10px);
}

@media (max-width: 767px) {
  .deco-leaf:nth-child(n+4) {
    display: none;
  }

  .p-opening__video {
    top: 50%;
    left: 50%;
    width: auto;
    max-width: none;
    height: 84%;
    object-fit: contain;
    transform: translate(-50%, -50%);
  }

  .p-opening__panel {
    width: 100%;
  }

  .p-opening__panel img {
    position: absolute;
    top: 0;
    width: auto;
    max-width: none;
    height: 100%;
  }

  .p-opening__panel--left img {
    left: 0;
  }

  .p-opening__panel--right img {
    right: 0;
  }

  .p-opening__skip {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-width: 76px;
    min-height: 42px;
    padding: 9px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .deco-leaf {
    display: none !important;
  }
}
