/* ==========================================================================
   우리집 본부 (Woorijip HQ) — GPU 60fps Ambient & Interactive Animations
   Pure transform/opacity composited keyframes + Zone Theme Layers
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. House Map Speech-Bubble Pins Floating (Staggered Delays)
   -------------------------------------------------------------------------- */

@keyframes pinPillBob {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -5px, 0);
  }
}

#pin-kitchen .map-pin-pill {
  animation: pinPillBob 3.6s ease-in-out infinite;
  animation-delay: 0s;
  will-change: transform;
}

#pin-bath .map-pin-pill {
  animation: pinPillBob 3.9s ease-in-out infinite;
  animation-delay: -1.1s;
  will-change: transform;
}

#pin-living .map-pin-pill {
  animation: pinPillBob 3.4s ease-in-out infinite;
  animation-delay: -2.1s;
  will-change: transform;
}

#pin-laundry .map-pin-pill {
  animation: pinPillBob 3.8s ease-in-out infinite;
  animation-delay: -0.7s;
  will-change: transform;
}

#pin-entrance .map-pin-pill {
  animation: pinPillBob 4.1s ease-in-out infinite;
  animation-delay: -1.8s;
  will-change: transform;
}

.map-pin:hover .map-pin-pill,
.map-pin:active .map-pin-pill {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   2. House Map Ambient Micro-Life (#house-map-ambient)
   -------------------------------------------------------------------------- */

/* Bathroom Sunlit Window Warm Glow (42.8%, 28.5%) */
.ambient-window-sun {
  position: absolute;
  left: 42.8%;
  top: 28.5%;
  width: 15%;
  height: 16%;
  transform: translate3d(-50%, -50%, 0) rotate(-18deg);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 241, 196, 0.72) 0%,
    rgba(255, 224, 152, 0.34) 48%,
    rgba(255, 224, 152, 0) 75%
  );
  mix-blend-mode: screen;
  animation: windowSunBreath 4.6s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes windowSunBreath {
  0%, 100% {
    opacity: 0.55;
    transform: translate3d(-50%, -50%, 0) rotate(-18deg) scale(0.94);
  }
  50% {
    opacity: 0.95;
    transform: translate3d(-50%, -50%, 0) rotate(-18deg) scale(1.12);
  }
}

/* Kitchen Stove Rising Steam Wisps (27.3%, 45.5%) */
.ambient-kitchen-steam {
  position: absolute;
  left: 27.3%;
  top: 45.5%;
  width: 28px;
  height: 44px;
  transform: translate3d(-50%, -100%, 0);
}

.steam-wisp {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 10px;
  height: 16px;
  margin-left: -5px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 250, 244, 0.32) 55%,
    rgba(255, 255, 255, 0) 78%
  );
  animation: mapSteamRise 3.1s ease-out infinite;
  will-change: transform, opacity;
}

.steam-wisp:nth-child(2) {
  left: 36%;
  animation-delay: -1.05s;
  animation-duration: 3.4s;
}

.steam-wisp:nth-child(3) {
  left: 64%;
  animation-delay: -2.1s;
  animation-duration: 2.9s;
}

@keyframes mapSteamRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 4px, 0) scale(0.55);
  }
  30% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: translate3d(5px, -28px, 0) scale(1.65);
  }
}

/* Living Room Stand Lamp Warm Halo (40.2%, 54.5%) */
.ambient-lamp-glow {
  position: absolute;
  left: 40.2%;
  top: 54.5%;
  width: 12%;
  aspect-ratio: 1;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 223, 148, 0.68) 0%,
    rgba(255, 198, 112, 0.25) 52%,
    rgba(255, 198, 112, 0) 76%
  );
  mix-blend-mode: screen;
  animation: lampWarmGlow 3.8s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes lampWarmGlow {
  0%, 100% {
    opacity: 0.62;
    transform: translate3d(-50%, -50%, 0) scale(0.92);
  }
  50% {
    opacity: 0.96;
    transform: translate3d(-50%, -50%, 0) scale(1.1);
  }
}

/* Living Room Sky-Blue Bear Cozy Breathing Aura (52.2%, 55.0%) */
.ambient-bear-breath {
  position: absolute;
  left: 52.2%;
  top: 55.0%;
  width: 11%;
  aspect-ratio: 1;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(198, 234, 255, 0.42) 0%,
    rgba(255, 245, 230, 0.18) 55%,
    rgba(255, 255, 255, 0) 76%
  );
  animation: bearCozyBreath 3.2s ease-in-out infinite;
  will-change: transform, opacity;
}

.ambient-bear-note {
  position: absolute;
  right: 0;
  top: -4px;
  font-size: 10px;
  opacity: 0.85;
  animation: bearNoteFloat 3.6s ease-in-out infinite;
}

@keyframes bearCozyBreath {
  0%, 100% {
    opacity: 0.48;
    transform: translate3d(-50%, -50%, 0) scale(0.94);
  }
  50% {
    opacity: 0.88;
    transform: translate3d(-50%, -50%, 0) scale(1.08);
  }
}

@keyframes bearNoteFloat {
  0%, 100% {
    opacity: 0.25;
    transform: translate3d(0, 2px, 0) scale(0.85);
  }
  50% {
    opacity: 0.88;
    transform: translate3d(3px, -6px, 0) scale(1.05);
  }
}

/* Laundry Drum Washer Micro-Vibration Ripple (37.3%, 68.5%) */
.ambient-laundry-wave {
  position: absolute;
  left: 37.3%;
  top: 68.5%;
  width: 26px;
  height: 26px;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 8px rgba(176, 220, 248, 0.45);
  animation: washerSpinRipple 2.4s ease-out infinite;
  will-change: transform, opacity;
}

.ambient-laundry-wave::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.2px dashed rgba(255, 255, 255, 0.65);
  animation: washerDrumSpin 3s linear infinite;
}

@keyframes washerSpinRipple {
  0% {
    opacity: 0.82;
    transform: translate3d(-50%, -50%, 0) scale(0.68);
  }
  70% {
    opacity: 0.35;
    transform: translate3d(-50%, -50%, 0) scale(1.22);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(1.36);
  }
}

@keyframes washerDrumSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Entrance Console Lamp Warm Dot (70.8%, 45.0%) */
.ambient-entrance-glow {
  position: absolute;
  left: 70.8%;
  top: 45.0%;
  width: 8%;
  aspect-ratio: 1;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 228, 168, 0.68) 0%,
    rgba(255, 214, 140, 0) 72%
  );
  animation: lampWarmGlow 4.2s ease-in-out infinite -1.5s;
}

/* Wall Poster Hotspot Inviting Pulse (#hotspot-poster::before) */
@keyframes posterHotspotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.55), 0 6px 16px rgba(90, 58, 28, 0.16);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 5px rgba(255, 232, 194, 0.78), 0 8px 20px rgba(184, 121, 72, 0.3);
  }
}

#hotspot-poster::before {
  animation: posterHotspotPulse 2.8s ease-in-out infinite;
  will-change: transform;
}

#hotspot-poster:active::before {
  transform: scale(0.95);
}

/* Presence Live Dot Pulse */
@keyframes presenceDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.78;
  }
}

.presence-dot {
  animation: presenceDotPulse 2.4s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   3. Zone Detail Section Entrance & Theme Ambient DOM Layers
   -------------------------------------------------------------------------- */

@keyframes zoneRevealIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

#zone-detail-section:not([hidden]) {
  animation: zoneRevealIn 0.34s var(--ease-spring) both;
}

/* Zone Theme Ambient DOM Overlays (#zone-ambient-dom) */
.zone-dom-sunbeam {
  position: absolute;
  top: -15%;
  right: -10%;
  width: 75%;
  height: 65%;
  background: radial-gradient(
    ellipse at top right,
    rgba(255, 232, 174, 0.45) 0%,
    rgba(255, 214, 140, 0.16) 45%,
    transparent 72%
  );
  transform: rotate(-12deg);
  animation: domSunBreath 5.2s ease-in-out infinite;
}

.zone-dom-windray {
  position: absolute;
  top: -25%;
  left: 10%;
  width: 34%;
  height: 150%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 248, 228, 0.34) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(28deg) translate3d(-20px, 0, 0);
  animation: windRaySweep 6s ease-in-out infinite;
}

.zone-dom-windray.ray-2 {
  left: 52%;
  width: 24%;
  animation-delay: -2.8s;
  animation-duration: 7.2s;
}

.zone-dom-hearthglow {
  position: absolute;
  bottom: -10%;
  left: 20%;
  width: 60%;
  height: 45%;
  background: radial-gradient(
    ellipse at bottom,
    rgba(255, 212, 162, 0.38) 0%,
    transparent 70%
  );
  animation: domSunBreath 4s ease-in-out infinite;
}

@keyframes domSunBreath {
  0%, 100% {
    opacity: 0.58;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.96;
    transform: scale(1.06);
  }
}

@keyframes windRaySweep {
  0%, 100% {
    opacity: 0.32;
    transform: rotate(28deg) translate3d(-18px, 0, 0);
  }
  50% {
    opacity: 0.72;
    transform: rotate(28deg) translate3d(22px, 0, 0);
  }
}

/* --------------------------------------------------------------------------
   4. Modals, Corkboard Poster Spring, Memo Paper Sway & Micro-Feedback
   -------------------------------------------------------------------------- */

@keyframes modalCardSpring {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.modal-backdrop:not([hidden]) .modal-card {
  animation: modalCardSpring 0.32s var(--ease-spring) both;
}

@keyframes memoPaperSway {
  0%, 100% {
    transform: rotate(-0.45deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(0.45deg) translate3d(0, -1.5px, 0);
  }
}

#list-poster-todos > li:nth-child(odd) {
  transform-origin: 50% 0%;
  animation: memoPaperSway 5.4s ease-in-out infinite;
}

#list-poster-todos > li:nth-child(even) {
  transform-origin: 50% 0%;
  animation: memoPaperSway 6.1s ease-in-out infinite reverse;
}

#list-poster-todos > li.empty-state,
#list-poster-todos > li.empty-item,
#list-poster-todos > li.is-empty {
  animation: none;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.toast,
.toast-item,
#toast-container > * {
  animation: toastSlideIn 0.24s var(--ease-spring) both;
}

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