/* Our own arrows and scroll cues (js/site/arrows.js). They take the text
   colour, sit on the text's baseline, and lean the way they point when what
   holds them is hovered. */

.arrow {
  flex: none;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.3em;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(.3, 1.4, .5, 1);
}
:hover > .arrow--down { transform: translateY(2px); }
:hover > .arrow--right { transform: translateX(3px); }
:hover > .arrow--left { transform: translateX(-3px); }
:hover > .arrow--ne { transform: translate(2px, -2px); }

/* The sprout's leaf gives a small wave from its stem. */
.arrow .g-leaf { transform-box: view-box; transform-origin: 12.1px 21px; }
:hover > .arrow .g-leaf { animation: g-wave 0.9s ease-in-out; }
@keyframes g-wave {
  30% { transform: rotate(-14deg); }
  60% { transform: rotate(7deg); }
}
/* With two leaves, the left one answers the right, a beat later. */
:hover > .arrow .g-leaf--l { animation: g-wave-l 0.9s ease-in-out 0.12s; }
@keyframes g-wave-l {
  30% { transform: rotate(14deg); }
  60% { transform: rotate(-7deg); }
}

/* Neon glows where it is dark; .is-day (or any light ground) leaves the
   tube unlit. On hover it catches, like a tube warming up. */
.arrow--neon { filter: drop-shadow(0 0 1.5px currentColor) drop-shadow(0 0 5px rgba(255, 178, 74, 0.55)); }
.is-day .arrow--neon { filter: none; opacity: 0.85; }
:hover > .arrow--neon { animation: g-catch 0.6s steps(1, end); }
@keyframes g-catch {
  0% { opacity: 0.3; }
  20% { opacity: 1; }
  35% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- Scroll cues ---------- */

.cue { display: block; width: 27px; height: 45px; overflow: visible; }

.cue--leaf .cue-leaf { transform-box: view-box; transform-origin: 12px 10px; animation: cue-drift 3.2s ease-in-out infinite; }
@keyframes cue-drift {
  0% { opacity: 0; transform: translate(0, -2px) rotate(-18deg); }
  15% { opacity: 1; }
  40% { transform: translate(2.5px, 9px) rotate(16deg); }
  65% { transform: translate(-2px, 17px) rotate(-12deg); opacity: 1; }
  90%, 100% { opacity: 0; transform: translate(0.5px, 24px) rotate(6deg); }
}

.cue--drip .cue-drop { transform-box: view-box; transform-origin: 12px 4px; animation: cue-drop 2.8s cubic-bezier(.5, 0, .9, .6) infinite; }
.cue--drip .cue-ring { transform-box: fill-box; transform-origin: center; opacity: 0; animation: cue-ring 2.8s ease-out infinite; }
.cue--drip .cue-lip { opacity: 0.6; }
@keyframes cue-drop {
  0% { transform: scale(0.15); opacity: 0.9; }
  45% { transform: scale(0.75, 0.85); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  70% { transform: translateY(24px) scale(0.6, 0.9); opacity: 1; }
  71%, 100% { transform: translateY(24px) scale(0.6, 0.9); opacity: 0; }
}
@keyframes cue-ring {
  0%, 70% { opacity: 0; transform: scale(0.2); }
  72% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.3); }
}

.cue--stem .cue-stem { animation: cue-write 2.8s ease-in-out infinite; }
@keyframes cue-write {
  0% { clip-path: inset(0 0 100% 0); opacity: 1; }
  55% { clip-path: inset(0 0 0 0); opacity: 1; }
  80% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

.cue--neon { filter: drop-shadow(0 0 1.5px currentColor) drop-shadow(0 0 5px rgba(255, 178, 74, 0.55)); }
.cue--neon .cue-v { opacity: 0.18; animation: cue-light 2.4s steps(1, end) infinite; }
.cue--neon .cue-v2 { animation-delay: 0.4s; }
@keyframes cue-light {
  0% { opacity: 0.18; }
  8% { opacity: 1; }
  12% { opacity: 0.4; }
  16%, 55% { opacity: 1; }
  70% { opacity: 0.18; }
}

@media (prefers-reduced-motion: reduce) {
  .arrow, .arrow .g-leaf, .cue * { animation: none !important; transition: none; }
  .cue--drip .cue-drop { transform: translateY(10px) scale(0.75, 0.85); }
  .cue--stem .cue-stem { clip-path: none; }
  .cue--neon .cue-v { opacity: 1; }
}
