/* animations.css */

/* ── whole-plant sway (sprout / sapling — applied to the img so % origins work) */
@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50%       { transform: rotate(2.5deg); }
}

/* page-level entrance */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* new plant appears */
.plant { animation: popIn 300ms var(--ease, cubic-bezier(0.22,1,0.36,1)) both; }

/* sprout / sapling: sway on the img so transform-origin uses real dimensions */
.plant--sprout .plant__img,
.plant--sapling .plant__img {
  transform-origin: 50% 100%;
  animation: sway 4s ease-in-out infinite;
  animation-delay: var(--sway-delay, 0s);
}

/* blooming / overgrown: inline SVG — individual layers animate, not the wrapper */

/* ── per-layer wind animations (inline SVG only) ─────────────────────────────── */
@keyframes windStem {
  0%, 100% { transform: rotate(-0.8deg); }
  50%       { transform: rotate(1.2deg);  }
}

@keyframes windLeaf {
  0%, 100% { transform: rotate(-3deg); }
  50%       { transform: rotate(4deg);  }
}

@keyframes windFlower {
  0%, 100% { transform: rotate(-2deg); }
  50%       { transform: rotate(2.5deg); }
}

.plant__svg #stem {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: windStem 4s ease-in-out infinite;
}

.plant__svg [id^="leaf_"] {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: windLeaf 3s ease-in-out infinite;
}

.plant__svg [id^="flower_head_"] {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: windFlower 2.5s ease-in-out infinite;
}

/* side drawer slides in from the right */
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

.seed-drawer--closing {
  animation: slideOut 240ms var(--ease, cubic-bezier(0.22,1,0.36,1)) both;
}
