/* Proovly — the seasonal drawings and their motion: small drawings at the edges of cards and pages, their
   sway, and the ones that fall as the app opens. The winter look uses them (styles-winter.css). The
   themes' paper, headers and pictures are in styles-themes.css. */
/* ---------- drawings at the edges ----------
   Small drawings at the edges of cards and pages. They only reach into a card's padding, never its text,
   and taps go through them. --r is the leaf's turn, --f -1 mirrors it. */
.view { position: relative; }
.leaf {
  position: absolute; height: auto; z-index: 3; pointer-events: none; user-select: none;
  transform: rotate(var(--r, 0deg)) scaleX(var(--f, 1)); transform-origin: 50% 85%;
  filter: var(--leaf-tone) drop-shadow(0 3px 5px rgba(110, 78, 60, .12)); animation: leaf-sway 9s ease-in-out infinite;
}
/* The soft, muted watercolour tone of the autumn mockup. */
:root { --leaf-tone: saturate(.9) brightness(1.03); }
.app:not(.plain) :is(.j-flower, .deco, .empty-art, .add-foot img) { filter: var(--leaf-tone); }
@keyframes leaf-sway {
  0%, 100% { transform: rotate(var(--r, 0deg)) scaleX(var(--f, 1)); }
  50% { transform: rotate(calc(var(--r, 0deg) + 5deg)) scaleX(var(--f, 1)); }
}
/* The other drawn leaves sway the same way. */
.deco, .empty-art, .add-foot img {
  transform: rotate(var(--r, 0deg)) scaleX(var(--f, 1)); transform-origin: 50% 85%; animation: leaf-sway 9s ease-in-out infinite;
}
.deco-bl { animation-delay: -4s; }
/* Android blinks these when a sheet's dimmed backdrop fades in over them: each filtered, swaying
   drawing gets its own layer, so it is drawn once and only moved, and stands still behind a sheet. */
.leaf, .j-flower, .deco, .empty-art, .add-foot img, .gentle-flower { will-change: transform; }
.app:has(> .overlay) :is(.screen, .tabbar) * { animation-play-state: paused !important; }
.page-leaves { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: clip; }
.stagger > .page-leaves { animation: fade-in 1.2s var(--ease) .3s both; }
.pl-1 { top: calc(env(safe-area-inset-top, 0px) + 58px); right: -20px; width: 58px; --r: 12deg; }
.pl-2 { top: 30%; left: -12px; width: 30px; --r: -24deg; animation-delay: -3s; }
.pl-3 { top: 52%; right: -22px; width: 54px; --r: 10deg; --f: -1; animation-delay: -5s; }
.pl-4 { top: 74%; left: -18px; width: 44px; --r: 20deg; animation-delay: -2s; }
.pl-5 { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); right: -14px; width: 32px; --r: -16deg; animation-delay: -6s; }
.evidence-card { position: relative; }

/* Welcome: two drawings on the photo's edges. */
.lf-wel-l { top: 34dvh; left: -14px; width: 56px; --r: -10deg; --f: -1; }
.lf-wel-r { top: 22dvh; right: -14px; width: 46px; --r: 16deg; animation-delay: -4s; }
/* Single leaves falling once as the app opens, like real ones: each swings side to side like a pendulum,
   slowing and tipping up at the end of a swing and dropping fastest through the middle, while it flutters.
   They come in from above the screen, fall at one steady speed on every screen and fade away before the time is up.
   .fall drops, .fall-swing swings, .fall-leaf flutters. --d delay, --t fall time, --fall distance, --dx swing width, --sw one swing. */
.leaf-fall { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; z-index: 60; pointer-events: none; overflow: hidden; }
.fall {
  position: absolute;
  animation: leaf-drop var(--t) linear var(--d) both;
}
.fall-swing {
  display: block; perspective: 300px;
  animation: leaf-swing var(--sw) ease-in-out var(--d) infinite alternate both;
}
.fall-leaf {
  display: block; width: 34px; height: auto; transform: rotate(var(--a));
  filter: var(--leaf-tone) drop-shadow(0 4px 6px rgba(110, 78, 60, .18));
  animation: leaf-flutter calc(var(--sw) * 1.7) ease-in-out var(--d) infinite alternate both;
}
.fall:nth-child(even) .fall-leaf { width: 26px; }
@keyframes leaf-drop {
  0%, 55% { opacity: 1; }
  0% { transform: translateY(0); }
  100% { transform: translateY(var(--fall)); opacity: 0; }
}
/* One swing: from one side to the other along a shallow arc, tilted towards where it is heading. */
@keyframes leaf-swing {
  0% { transform: translate(calc(var(--dx) * -1), -10px) rotate(-28deg); }
  50% { transform: translate(0, 6px) rotate(0deg); }
  100% { transform: translate(var(--dx), -10px) rotate(28deg); }
}
/* The leaf rocks and turns a little in depth as the air catches it. */
@keyframes leaf-flutter {
  0% { transform: rotate(var(--a)) rotateX(10deg) rotateY(-35deg); }
  100% { transform: rotate(calc(var(--a) + 20deg)) rotateX(-25deg) rotateY(40deg); }
}
@media (prefers-reduced-motion: reduce) { .leaf-fall { display: none; } }
