/* The landing page's background photograph (static/landing.js picks the
 * light and the crop). Photos stack; landing.js sets each one's opacity and
 * --fade, the time a change takes (1.2 s on load, 4 s when the light changes). */

.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background-color: var(--bg); }
.scene img.photo {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 50% 50%;
  opacity: 0; transition: opacity var(--fade, 1200ms) linear;
}

/* Rain while it rains in Bangkok: two tiles of streaks falling at different
   speeds. A tile moves exactly its own height, so the loop never jumps. */
.scene .rain { position: absolute; inset: 0; z-index: 1; display: none; pointer-events: none; overflow: hidden; }
.scene[data-rain="rain"] .rain, .scene[data-rain="storm"] .rain { display: block; }
.scene .rain i {
  position: absolute; left: 0; right: 0; top: -240px; bottom: 0;
  background-repeat: repeat; opacity: .22; animation: fall .55s linear infinite;
}
.scene .rain i + i { opacity: .14; animation-duration: .85s; }
@keyframes fall { to { transform: translateY(240px); } }
.scene[data-rain="storm"] .rain { background: rgba(10, 14, 20, .18); }

/* A soft scrim at the top so the greeting reads on any sky. */
.scene::after {
  content: ""; position: absolute; inset: 0 0 auto 0; z-index: 2; height: 320px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .32), rgba(0, 0, 0, 0));
}

@media (prefers-reduced-motion: reduce) {
  .scene img.photo { transition: none; }
  .scene .rain i { animation: none; }
}

/* Text that sits on the photo takes its ink from the photo, not the theme. */
main .top h1, main p.sub, main h2, main p.foot a {
  color: var(--sky-ink, var(--text));
  text-shadow: 0 1px 2px var(--sky-halo, transparent), 0 0 6px var(--sky-halo, transparent),
    0 0 16px var(--sky-halo, transparent);
}
/* Over a photo the small labels need full ink, not the page's dimmed one. */
main p.sub, main h2, main p.foot a { opacity: .95; }
