/* Home: full-screen footage with text straight on top. */
:root { --fg: #f3f3f3; --bg: #000; }
html, body { height: 100%; overflow: hidden; }

/* Layers stack and cross-fade. */
#stage { position: fixed; inset: 0; }
#stage > * {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .9s ease;
}
#stage > .on { opacity: 1; }
/* A whisper of shadow keeps text legible on bright frames. */
.top, .bottom {
  position: fixed; left: 0; right: 0; z-index: 1;
  text-shadow: var(--shadow);
  pointer-events: none;
}
.top > *, .bottom > * { pointer-events: auto; }
.nav .icon svg { filter: drop-shadow(0 0 6px rgba(0, 0, 0, .5)); } /* text-shadow does not reach drawings */
.top { top: 0; }
.bottom {
  bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 30px;
  padding:
    var(--pad)
    max(var(--pad), env(safe-area-inset-right))
    max(var(--pad), env(safe-area-inset-bottom))
    max(var(--pad), env(safe-area-inset-left));
}

/* A soft shade behind the top line, so it stays readable over a bright sky. It eases out over many
   steps: a straight fade leaves a visible line where it stops, plain to see on a clear sky. */
#stage::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 160px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, .25) 0,
    rgba(0, 0, 0, .239) 20px,
    rgba(0, 0, 0, .211) 40px,
    rgba(0, 0, 0, .171) 60px,
    rgba(0, 0, 0, .125) 80px,
    rgba(0, 0, 0, .079) 100px,
    rgba(0, 0, 0, .039) 120px,
    rgba(0, 0, 0, .011) 140px,
    rgba(0, 0, 0, 0) 160px);
}

/* Bottom right: the work's caption. */
.aside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#recent button { display: block; opacity: .7; transition: opacity .25s ease; }
#recent button:hover, #recent [aria-current="true"] { opacity: 1; }

.more { display: inline-block; margin-top: 16px; text-decoration-line: underline; }

/* The caption is about the picture, not another work: smaller, in italic and a little softer, so it
   does not read as one more title in the list beside it. */
#caption {
  max-width: 38ch; font-size: 13px; line-height: 19px; font-style: italic; text-align: right; white-space: pre-line;
  opacity: .85; transition: opacity .45s ease;
}
#caption.out { opacity: 0; }
#caption:empty { display: none; }

@media (max-width: 640px) {
  .bottom { flex-direction: column-reverse; align-items: flex-start; gap: 18px; }
  .aside { align-items: flex-start; }
  #caption { font-size: 12.5px; line-height: 18px; text-align: left; }
  #recent button { padding: 2px 0; }
}

@media (prefers-reduced-motion: reduce) {
  #stage > *, #caption { transition: none; }
}
