/* Ruvuma motion language. One set of timings, reused by every piece. */
:root{
  --m-ease:cubic-bezier(.22,.61,.36,1);   /* slow start, long soft landing */
  --m-fast:.4s;
  --m-med:1s;
  --m-slow:2.5s;
  --m-sky:1.6s;
  --m-glide:3.6s;       /* herd marker: time for a whole lap of the migration loop */
  --m-year:8s;          /* Tanzania page: Play the year, January to December */
  --m-year-home:6s;     /* homepage: the year runs once on phones */
  --m-route:1.25s;      /* one route (US city, connection, Kilimanjaro) */
  --m-river:15,46,41;   /* River dark, #0F2E29 */
  --m-ink:31,26,21;     /* Ink, #1F1A15 */
}

/* Piece 1: coming-soon hero, the first morning.
   Plays only when a tiny script in the head adds .dawn-play to <html>
   (first visit in a browser session). Without it, or without JavaScript,
   the hero is simply in its final state.
   Two dark layers over the photo: the sky clears first, the ground last.
   Overlay only (pseudo-elements of the hero <picture>), so the photo can be
   swapped later. Layers sit above the page's own .hero::after scrim and
   below .hero-inner (same z-index, later in the DOM), so text and the
   button are never covered. */
.dawn-play .hero picture::before,
.dawn-play .hero picture::after{
  content:"";position:absolute;left:0;right:0;z-index:1;pointer-events:none;
  animation-timing-function:var(--m-ease);animation-fill-mode:both;
}
.dawn-play .hero picture::before{      /* sky: top part, soft lower edge */
  top:0;height:65%;
  background:linear-gradient(180deg,rgba(var(--m-river),.62),rgba(var(--m-river),.5) 60%,rgba(var(--m-river),0));
  animation-name:dawn-lift;animation-duration:var(--m-sky);
}
.dawn-play .hero picture::after{       /* ground: lower part, soft upper edge */
  top:0;bottom:0;
  background:linear-gradient(180deg,rgba(var(--m-ink),0) 30%,rgba(var(--m-ink),.5) 55%,rgba(var(--m-ink),.58));
  animation-name:dawn-lift;animation-duration:var(--m-slow);
}
.dawn-play .hero h1,
.dawn-play .hero .subline{
  animation:dawn-settle var(--m-med) var(--m-ease) backwards;
}
.dawn-play .hero h1{animation-delay:.2s}
.dawn-play .hero .subline{animation-delay:.5s}

@keyframes dawn-lift{from{opacity:1}to{opacity:0}}
@keyframes dawn-settle{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion:reduce){
  .dawn-play .hero picture::before,.dawn-play .hero picture::after{animation:none;opacity:0}
  .dawn-play .hero h1,.dawn-play .hero .subline{animation:none}
}
