/* ABFN 2026, home page: motion on the first screen. Nothing here applies until
   hero-motion.js runs: it inserts the two canvases and adds .hero--live, so without
   JavaScript, or with "reduce motion", the first screen is the still one. */
.hero__brain, .hero__trace { position: absolute; pointer-events: none; }

/* the brain: above the photograph, its shade and the darkening that lies under the type
   (which would dim the lower half of the drawing), under the text itself, which it never touches */
.hero__brain { z-index: 0; opacity: 0; }

/* the live line lies exactly on the static one, which it replaces */
.hero__trace { animation: draw 2.4s cubic-bezier(.5, 0, .2, 1) .35s both; }
.hero--live .trace path { visibility: hidden; }

/* The sky. The camera pushes in very slowly towards the top right, where the brain is. */
.hero--live .hero__media { transform-origin: 100% 0; animation: hero-drift 38s ease-in-out infinite alternate; }
@keyframes hero-drift { to { transform: scale(1.055); } }

/* While it does, the shade deepens a little behind the menu and behind everything from
   the title down: whatever part of the photograph drifts in behind the text, the text
   never loses contrast. (--hero-sky is where the title starts; the script sets it.) */
.hero--live .hero__media::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0;
  background:
    linear-gradient(180deg, rgba(5, 24, 32, .18), rgba(5, 24, 32, 0) 14%),
    linear-gradient(180deg, rgba(5, 24, 32, 0) calc(var(--hero-sky, 38%) - 4rem), rgba(5, 24, 32, .1) calc(var(--hero-sky, 38%) - 1rem), rgba(5, 24, 32, .22));
  animation: hero-keep 38s ease-in-out infinite alternate;
}
@keyframes hero-keep { 35%, to { opacity: 1; } }

/* Thin haze: two rows of soft, dark patches cross the sky above the title at different
   speeds, like the shadows of clouds. Each row repeats every half of its width, so
   sliding it by half is seamless. Dark only, so it cannot weaken light text either. */
.hero--live .hero__shade::before, .hero--live .hero__shade::after {
  content: ""; position: absolute; left: 0; top: 0; width: 300%; height: var(--hero-sky, 38%);
  background:
    radial-gradient(ellipse 22% 34% at 30% 52%, rgba(9, 28, 38, .24), rgba(9, 28, 38, .1) 50%, rgba(9, 28, 38, 0)),
    radial-gradient(ellipse 14% 26% at 73% 42%, rgba(9, 28, 38, .17), rgba(9, 28, 38, .07) 50%, rgba(9, 28, 38, 0)),
    radial-gradient(ellipse 9% 20% at 52% 68%, rgba(9, 28, 38, .13), rgba(9, 28, 38, .05) 50%, rgba(9, 28, 38, 0));
  background-size: 50% 100%;
  animation: hero-haze 200s linear infinite, hero-appear 6s ease-out both;
}
.hero--live .hero__shade::after {
  width: 220%;
  background-image:
    radial-gradient(ellipse 19% 24% at 26% 44%, rgba(9, 28, 38, .15), rgba(9, 28, 38, .06) 50%, rgba(9, 28, 38, 0)),
    radial-gradient(ellipse 12% 30% at 68% 58%, rgba(9, 28, 38, .11), rgba(9, 28, 38, .045) 50%, rgba(9, 28, 38, 0));
  animation-duration: 290s, 6s;
}
@keyframes hero-haze { from { transform: translate3d(-50%, 0, 0); } }
@keyframes hero-appear { from { opacity: 0; } }

/* paused while the first screen is out of sight; index.html?heroT=<seconds> freezes
   everything at that instant, for screenshots */
.hero--paused .hero__media, .hero--paused .hero__media::after,
.hero--paused .hero__shade::before, .hero--paused .hero__shade::after { animation-play-state: paused; }
.hero--frozen .hero__media, .hero--frozen .hero__media::after,
.hero--frozen .hero__shade::before, .hero--frozen .hero__shade::after { animation-delay: calc(var(--hero-t, 0) * -1s); }
.hero--frozen .hero__trace { animation: none; }
