/* ====================================================================
   Package Whisperer — Motion & Kinetic Typography Design System
   "Animation Type Design" — Living Vector Motion, Kinetic Type, & Micro-Physics
   ==================================================================== */

/* --- 1. KINETIC TYPOGRAPHY & ANIMATED TEXT --- */
.kinetic-gradient-text {
  background: linear-gradient(135deg, #1B1A17 0%, #B45309 35%, #1B1A17 70%, #2D6A4F 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text-flow 8s ease infinite;
}

@keyframes gradient-text-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.brand:hover .kinetic-gradient-text {
  animation: gradient-text-flow 3s ease infinite;
}

.text-shimmer {
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.text-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: shimmer-swipe 4s infinite ease-in-out;
}

@keyframes shimmer-swipe {
  0%, 60% { left: -100%; }
  100% { left: 160%; }
}

/* Typing cursor for Amazon Bedrock AI generation */
.typing-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.15em;
  background-color: var(--amber);
  vertical-align: text-bottom;
  margin-left: 2px;
  border-radius: 1px;
  animation: cursor-blink 0.75s infinite cubic-bezier(1, 0, 0, 1);
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

/* Rolling numbers on stat counters */
.counter-animating {
  display: inline-block;
  animation: roll-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes roll-bounce {
  0% { transform: translateY(-10px) scale(0.95); opacity: 0.3; }
  60% { transform: translateY(3px) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

/* --- 2. AUDIO EQUALIZER / SOUNDWAVE VISUALIZER --- */
.audio-equalizer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
  margin-left: 4px;
}

.eq-bar {
  width: 3px;
  background: var(--sage);
  border-radius: 2px;
  height: 4px;
  transition: height 0.15s ease;
}

.eq-bar.active {
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}

.eq-bar.bar-1 { animation-delay: 0.05s; }
.eq-bar.bar-2 { animation-delay: 0.25s; }
.eq-bar.bar-3 { animation-delay: 0.45s; }
.eq-bar.bar-4 { animation-delay: 0.15s; }

@keyframes eq-bounce {
  0% { height: 3px; }
  50% { height: 13px; background: var(--amber); }
  100% { height: 7px; }
}

/* --- 3. PORCH MOTION DIORAMA STAGE --- */
.porch-stage-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
  transition: all var(--transition-normal);
}

.porch-stage-header {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 5;
  position: relative;
}

.porch-stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.porch-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--amber-light);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.porch-stage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.porch-tool-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.porch-tool-btn:hover {
  background: #FFF;
  border-color: var(--ink-soft);
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: var(--shadow-sm);
}

.porch-tool-btn.primary {
  background: var(--sage);
  color: #FFF;
  border-color: var(--sage);
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
}

.porch-tool-btn.primary:hover {
  background: #23553E;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.35);
}

/* Stage Canvas Area */
.porch-viewport {
  position: relative;
  width: 100%;
  height: 310px;
  overflow: hidden;
  user-select: none;
  background: linear-gradient(180deg, #E0F2FE 0%, #FEF3C7 50%, #F5F2EB 100%);
  transition: background 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Night Mode Viewport */
.porch-viewport.night-sky {
  background: linear-gradient(180deg, #0B132B 0%, #1C2541 45%, #24344D 100%);
}

/* Sky Elements */
.sky-layer {
  position: absolute;
  top: 0; left: 0; right: 0; height: 180px;
  pointer-events: none;
  overflow: hidden;
}

.celestial-sun {
  position: absolute;
  top: 24px;
  right: 50px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #FDE68A 20%, #F59E0B 100%);
  box-shadow: 0 0 35px #FBBF24, 0 0 65px rgba(245, 158, 11, 0.3);
  transition: all 1.2s ease;
  animation: sun-pulse 6s infinite alternate ease-in-out;
}

@keyframes sun-pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5)); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)); }
}

.celestial-moon {
  position: absolute;
  top: 24px;
  right: 50px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 12px 10px 0 0 #FEF3C7;
  transform: rotate(-25deg);
  opacity: 0;
  transition: all 1.2s ease;
  filter: drop-shadow(0 0 16px rgba(254, 243, 199, 0.6));
}

.porch-viewport.night-sky .celestial-sun {
  opacity: 0;
  transform: translateY(40px) scale(0.6);
}

.porch-viewport.night-sky .celestial-moon {
  opacity: 1;
  transform: rotate(-10deg) translateY(0);
}

/* Night Stars */
.star-cluster {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.porch-viewport.night-sky .star-cluster {
  opacity: 1;
}

.star-twinkle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 0 4px #FFF;
  animation: star-flicker 2.5s infinite ease-in-out;
}

@keyframes star-flicker {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Floating Clouds */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
  filter: blur(1px);
  animation: cloud-drift linear infinite;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  top: 35px;
  left: -120px;
  width: 100px;
  height: 32px;
  animation-duration: 48s;
}

.cloud-1::before { width: 45px; height: 45px; top: -20px; left: 18px; }
.cloud-1::after { width: 34px; height: 34px; top: -14px; left: 48px; }

.cloud-2 {
  top: 75px;
  left: -180px;
  width: 140px;
  height: 40px;
  animation-duration: 65s;
  animation-delay: -22s;
  opacity: 0.7;
}

.cloud-2::before { width: 55px; height: 55px; top: -24px; left: 25px; }
.cloud-2::after { width: 42px; height: 42px; top: -16px; left: 70px; }

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(1300px); }
}

.porch-viewport.night-sky .cloud {
  background: rgba(45, 60, 95, 0.4);
}

/* Porch House Architecture */
.porch-ground {
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 75px;
  background: linear-gradient(180deg, #D4CEBF 0%, #B8B09D 100%);
  border-top: 4px solid #A8A08C;
  z-index: 2;
}

.porch-ground::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 6px;
  background: rgba(255, 255, 255, 0.3);
}

.porch-house-structure {
  position: absolute;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 220px;
  z-index: 2;
}

/* Eaves & Overhang Roof */
.porch-roof {
  position: absolute;
  top: 0;
  left: -25px;
  width: 530px;
  height: 24px;
  background: linear-gradient(180deg, #374151 0%, #1F2937 100%);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  border-bottom: 3px solid #111827;
}

.porch-roof::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 10px;
  right: 10px;
  height: 10px;
  background: #4B5563;
  clip-path: polygon(4% 0%, 96% 0%, 100% 100%, 0% 100%);
}

/* House Facade Wall */
.porch-wall {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  height: 196px;
  background: #F4EFE6;
  border-left: 5px solid #E5DECF;
  border-right: 5px solid #E5DECF;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(210, 200, 185, 0.4) 22px, rgba(210, 200, 185, 0.4) 23px);
}

.porch-viewport.night-sky .porch-wall {
  background: #252F42;
  border-color: #1A2232;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(20, 26, 40, 0.6) 22px, rgba(20, 26, 40, 0.6) 23px);
}

/* Porch Warm Lantern */
.porch-lantern-wrap {
  position: absolute;
  top: 50px;
  left: 65px;
  width: 32px;
  height: 52px;
  z-index: 4;
}

.lantern-bracket {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 10px;
  border-top: 3px solid #1C1B18;
  border-left: 3px solid #1C1B18;
}

.lantern-housing {
  position: absolute;
  top: 8px;
  left: 6px;
  width: 22px;
  height: 36px;
  background: #1C1B18;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.lantern-glass {
  width: 14px;
  height: 26px;
  background: #FEF3C7;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px #FBBF24, 0 0 35px #F59E0B;
}

.lantern-filament {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 10px;
  background: #F59E0B;
  border-radius: 50%;
  animation: filament-flicker 3s infinite alternate ease-in-out;
}

@keyframes filament-flicker {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.85; }
}

.lantern-glow-cone {
  position: absolute;
  top: 15px;
  left: -40px;
  width: 140px;
  height: 160px;
  background: radial-gradient(ellipse at 50% 15%, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.12) 50%, transparent 80%);
  pointer-events: none;
  border-radius: 50%;
  z-index: 3;
  transition: opacity 0.8s ease;
}

.porch-viewport.night-sky .lantern-glow-cone {
  background: radial-gradient(ellipse at 50% 15%, rgba(251, 191, 36, 0.55) 0%, rgba(245, 158, 11, 0.25) 50%, transparent 80%);
}

/* Front Wooden Door */
.porch-door-frame {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 185px;
  background: #4B382A;
  border-radius: 8px 8px 0 0;
  padding: 6px 6px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 2px solid #332418;
}

.porch-door {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #7C4A28 0%, #5C3218 100%);
  border-radius: 5px 5px 0 0;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
  gap: 12px;
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.porch-door.door-open {
  transform: perspective(600px) rotateY(-38deg);
}

.door-panel {
  width: 104px;
  height: 60px;
  border: 2px solid #432412;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.door-handle {
  position: absolute;
  top: 98px;
  right: 14px;
  width: 9px;
  height: 22px;
  background: linear-gradient(180deg, #FDE68A 0%, #D97706 100%);
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.door-window {
  width: 96px;
  height: 38px;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.9) 0%, rgba(186, 230, 253, 0.6) 100%);
  border: 3px solid #332418;
  border-radius: 4px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Interior warm glow revealed when door opens */
.interior-glow-backdrop {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 180px;
  background: radial-gradient(circle at 50% 60%, #FEF3C7 0%, #F59E0B 80%, #78350F 100%);
  border-radius: 5px 5px 0 0;
  z-index: 1;
}

/* Ring Doorbell Mounted on Wall */
.ring-doorbell-device {
  position: absolute;
  bottom: 76px;
  left: calc(50% + 82px);
  width: 18px;
  height: 44px;
  background: #1F2937;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
  gap: 6px;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.15s ease;
}

.ring-doorbell-device:hover {
  transform: scale(1.12);
}

.ring-lens {
  width: 9px;
  height: 9px;
  background: #111827;
  border-radius: 50%;
  border: 1.5px solid #000;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.ring-button {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #111827;
  border: 1.5px solid #38BDF8;
  box-shadow: 0 0 5px #0284C7;
  position: relative;
  transition: all 0.2s ease;
}

.ring-button.ringing {
  border-color: #34D399;
  box-shadow: 0 0 12px #10B981, 0 0 20px #10B981;
  animation: ring-vibrate 0.3s infinite ease-in-out;
}

@keyframes ring-vibrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Sonar Ripple Waves when Doorbell rings */
.sonar-wave-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sonar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #38BDF8;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.sonar-ring.active {
  animation: sonar-expand 1.4s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

.sonar-ring.ring-1 { animation-delay: 0s; }
.sonar-ring.ring-2 { animation-delay: 0.25s; }
.sonar-ring.ring-3 { animation-delay: 0.5s; }

@keyframes sonar-expand {
  0% { width: 10px; height: 10px; opacity: 0.9; transform: translate(-50%, -50%) scale(1); border-color: #38BDF8; }
  70% { opacity: 0.5; border-color: #34D399; }
  100% { width: 140px; height: 140px; opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* Welcome Porch Mat */
.porch-mat {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 26px;
  background: #A3704C;
  border-radius: 4px;
  border: 2px solid #825232;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 8.5px;
  color: #5C3218;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --- THE ANIMATED DELIVERY PARCEL --- */
.animated-parcel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 48px;
  z-index: 5;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
}

.animated-parcel.visible {
  display: block;
}

.animated-parcel.drop-in {
  animation: parcel-drop 0.65s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes parcel-drop {
  0% { transform: translate(-50%, -180px) scale(0.7) rotate(8deg); opacity: 0; }
  60% { transform: translate(-50%, 0) scale(1.15, 0.85) rotate(-3deg); opacity: 1; }
  80% { transform: translate(-50%, -16px) scale(0.95, 1.05) rotate(1deg); }
  100% { transform: translate(-50%, 0) scale(1, 1) rotate(0deg); opacity: 1; }
}

.animated-parcel.floating {
  animation: parcel-idle-float 3s infinite ease-in-out;
}

@keyframes parcel-idle-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

.animated-parcel.retrieved-pop {
  animation: parcel-retrieve-soar 0.75s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes parcel-retrieve-soar {
  0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  40% { transform: translate(-50%, -35px) scale(1.18); opacity: 1; filter: drop-shadow(0 0 16px #34D399); }
  100% { transform: translate(-50%, -90px) scale(0.4); opacity: 0; }
}

.parcel-box {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #D4A373 0%, #BC8A5F 100%);
  border-radius: 6px;
  border: 2px solid #8C5836;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.parcel-tape {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 14px;
  transform: translateX(-50%);
  background: rgba(254, 243, 199, 0.65);
  border-left: 1px dashed #A7744D;
  border-right: 1px dashed #A7744D;
}

.parcel-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 18px;
  height: 12px;
  background: #FFF;
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.parcel-beacon {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: #FFF;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(201, 122, 30, 0.4);
  animation: beacon-bounce 2s infinite ease-in-out;
}

@keyframes beacon-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

/* --- ANIMATED COURIER & DELIVERY VAN --- */
.delivery-van {
  position: absolute;
  bottom: 40px;
  left: -220px;
  width: 160px;
  height: 80px;
  z-index: 4;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.4, 1);
  pointer-events: none;
}

.delivery-van.drive-in {
  transform: translateX(290px);
}

.delivery-van.drive-out {
  transform: translateX(950px);
}

.van-body {
  position: absolute;
  bottom: 14px;
  left: 0;
  width: 150px;
  height: 60px;
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border-radius: 10px 18px 4px 4px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 18px;
  color: #FFF;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.van-cabin-window {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 24px;
  background: #93C5FD;
  border-radius: 4px 10px 2px 2px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.van-headlight {
  position: absolute;
  bottom: 22px;
  right: -4px;
  width: 8px;
  height: 10px;
  background: #FEF08A;
  border-radius: 2px;
  box-shadow: 0 0 12px #FDE047;
}

.van-wheel {
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: #111827;
  border-radius: 50%;
  border: 4px solid #4B5563;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.van-wheel.front { right: 18px; }
.van-wheel.back { left: 24px; }

.van-wheel.rolling {
  animation: wheel-spin 0.4s linear infinite;
}

@keyframes wheel-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Animated Courier Character */
.courier-person {
  position: absolute;
  bottom: 45px;
  left: 170px;
  width: 36px;
  height: 72px;
  z-index: 5;
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.courier-person.walk-in {
  opacity: 1;
  transform: translateX(45px);
}

.courier-person.walk-out {
  opacity: 0;
  transform: translateX(-40px);
}

.character-head {
  width: 22px;
  height: 22px;
  background: #FBCFE8;
  border-radius: 50%;
  margin: 0 auto 3px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.character-cap {
  position: absolute;
  top: -3px;
  left: 0; right: 0;
  height: 10px;
  background: #1E3A8A;
  border-radius: 10px 10px 0 0;
}

.character-cap::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -5px;
  width: 10px;
  height: 3px;
  background: #1E3A8A;
  border-radius: 2px;
}

.character-torso {
  width: 28px;
  height: 30px;
  background: #2563EB;
  border-radius: 6px;
  margin: 0 auto;
  position: relative;
}

.character-legs {
  display: flex;
  justify-content: space-around;
  width: 22px;
  margin: 0 auto;
}

.character-leg {
  width: 6px;
  height: 20px;
  background: #1E293B;
  border-radius: 3px;
}

/* Animated Resident Character */
.resident-person {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  width: 38px;
  height: 78px;
  z-index: 3;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.resident-person.step-out {
  opacity: 1;
  transform: translateX(-50%) translateY(25px) scale(1);
  z-index: 5;
}

.resident-person .character-torso {
  background: #059669; /* Soft cozy green sweater */
}

.resident-person .character-head {
  background: #FED7AA;
}

/* Floating celebratory hearts / sparkles */
.celebrate-burst {
  position: absolute;
  font-size: 20px;
  pointer-events: none;
  animation: float-sparkle 1.1s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes float-sparkle {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-75px) scale(1.3); opacity: 0; }
}

/* --- 4. TACTILE SQUASH & SPRING MICRO-PHYSICS --- */
button, .tab-btn, .sim-btn-row, .porch-tool-btn {
  will-change: transform;
}

.btn-spring-press {
  animation: spring-squash 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes spring-squash {
  0% { transform: scale(1); }
  40% { transform: scale(0.92, 0.94); }
  75% { transform: scale(1.04, 1.02); }
  100% { transform: scale(1); }
}

/* Ripple waves on click */
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple-wave 0.55s ease-out;
  pointer-events: none;
}

@keyframes ripple-wave {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Mode Pill in Header */
.motion-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #FCD34D;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.motion-mode-pill:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

/* Canvas Particle Container for Confetti */
#motionFxCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* Animated traveler along the pipeline track */
.pipeline-traveler-icon {
  position: absolute;
  top: -15px;
  right: -16px;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
  animation: traveler-bob 1.4s infinite alternate ease-in-out;
  z-index: 10;
}

@keyframes traveler-bob {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.12) translateY(-3px); }
}
