/* Motion on the landing page. Transforms and opacity only, so it stays
   smooth on phones. All of it stops when the visitor asks for reduced
   motion. Scroll reveals only apply when site.js has marked the page `.js`
   (no script: everything simply shows). */

/* ---------------------------------------------------- hero phone: live timer
   The focus screen with its digits painted out, and the countdown drawn on
   top in the app's timer style: Bricolage Grotesque SemiBold 84 pt on a
   402 pt screen, tight tracking, tabular figures. Sizes are in cqw of the
   phone image, so it scales with the phone. */
.phone-live { container-type: inline-size; }
.phone-live > .phone { width: 100%; height: auto; }
.phone-live__timer {
  position: absolute; left: 0; right: 0; top: 123.95cqw;
  text-align: center;
  font: 600 19.95cqw/1 var(--display);
  /* The app's Bricolage is the small optical size (wider digits). */
  font-variation-settings: "opsz" 12;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ------------------------------------------------------------------ sky
   Clouds drift sideways on their own loops, the bigger ones faster and
   further; the sun's rays turn and it breathes. */
.sun { animation: sun-turn 36s linear infinite, sun-breathe 3s ease-in-out infinite alternate; }
.cloud { animation: drift var(--t) ease-in-out var(--delay, 0s) infinite alternate; }
.cloud--a { --drift: 240px; --t: 14s; --delay: -4s; }
.cloud--b { --drift: -200px; --t: 17s; --delay: -9s; }
.cloud--c { --drift: 170px; --t: 21s; --delay: -2s; }
.cloud--d { --drift: -140px; --t: 25s; --delay: -12s; }
@media (max-width: 639px) {
  .cloud--a { --drift: 90px; }
  .cloud--b { --drift: -80px; }
  .cloud--c { --drift: 70px; }
  .cloud--d { --drift: -60px; }
}
@keyframes sun-turn { to { rotate: 360deg; } }
@keyframes sun-breathe { from { scale: 1; } to { scale: 1.06; } }
@keyframes drift {
  from { translate: calc(var(--drift) / -2) 0; }
  to { translate: calc(var(--drift) / 2) 0; }
}

/* ------------------------------------------------------- trees and grass
   They lean a little in the breeze, each on its own beat. */
.hero__stage .tree,
.garden .el:not(.hill):not(.grass) {
  transform-origin: 50% 88%;
  animation: sway 5.5s ease-in-out infinite alternate;
}
.hero__stage .tree:nth-of-type(2n),
.garden .el:nth-of-type(2n) { animation-duration: 6.5s; animation-delay: -2.5s; }
.hero__stage .tree:nth-of-type(3n),
.garden .el:nth-of-type(3n) { animation-duration: 7.2s; animation-delay: -4s; }
.scene .grass { transform-origin: 50% 100%; animation: sway-grass 3.2s ease-in-out infinite alternate; }
.scene .grass:nth-of-type(2n) { animation-duration: 2.7s; animation-delay: -1.2s; }
.scene .grass:nth-of-type(3n) { animation-duration: 3.8s; animation-delay: -2s; }
@keyframes sway { from { rotate: -1.4deg; } to { rotate: 1.4deg; } }
@keyframes sway-grass { from { rotate: -6deg; } to { rotate: 6deg; } }

/* ------------------------------------------------------------ hero entry */
.js .hero__copy > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.js .hero__copy > :nth-child(2) { animation-delay: 0.08s; }
.js .hero__copy > :nth-child(3) { animation-delay: 0.16s; }
.js .phone-live { animation: rise-far 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both; }
@keyframes rise { from { opacity: 0; translate: 0 24px; } }
@keyframes rise-far { from { opacity: 0; translate: 0 80px; } }

/* --------------------------------------------------------- scroll reveals */
.js [data-reveal] {
  opacity: 0; translate: 0 36px;
  transition: opacity 0.8s ease, translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* Seed to fruit: the five stages grow in, one after another. */
.stages li:nth-child(1) { --i: 0; }
.stages li:nth-child(2) { --i: 1; }
.stages li:nth-child(3) { --i: 2; }
.stages li:nth-child(4) { --i: 3; }
.stages li:nth-child(5) { --i: 4; }
.js .stages img {
  opacity: 0; scale: 0.3; transform-origin: 50% 88%;
  transition: scale 0.9s cubic-bezier(0.3, 1.45, 0.5, 1), opacity 0.4s ease;
  transition-delay: calc(var(--i) * 0.28s);
}
.js .stages .stage-label {
  opacity: 0; translate: 0 10px;
  transition: opacity 0.5s ease, translate 0.6s ease;
  transition-delay: calc(var(--i) * 0.28s + 0.25s);
}
.js .seed__panel.is-in .stages img { opacity: 1; scale: 1; }
.js .seed__panel.is-in .stages .stage-label { opacity: 1; translate: 0 0; }

/* Badges tilt when you point at them. */
.badges img { transition: rotate 0.35s cubic-bezier(0.3, 1.5, 0.5, 1), scale 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
.badges li:hover img { rotate: -8deg; scale: 1.08; }

/* ------------------------------------------------------------ reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal], .js .stages img, .js .stages .stage-label { opacity: 1; translate: none; scale: none; }
}
