/* The Portland skyline band at the foot of the footer (2026-11-22).
   Owns: the band's box, the crop at each width, the birds, the rise-in.
   Siblings: footer-skyline.js (motion), footer-skyline.svg (the drawing, which
   carries its own line styles so it also works as a plain <img>),
   _footer_skyline.php (markup). Touches two rules it does not own, both in
   the footer: its bottom padding and where the rose watermark sits. */

/* the band is the last thing on the page: the footer's own bottom padding
   would leave a blank strip under the river */
footer{padding-bottom:0;--fsky-h:clamp(200px,20vw,424px)}

/* The rose watermark used to bleed off the bottom-right corner, which is now
   the skyline. It rides above the band and thins out before it reaches the
   drawing, so the two never tangle. */
.frose{bottom:calc(var(--fsky-h) - 64px);
  -webkit-mask-image:linear-gradient(#000 52%,transparent 86%);mask-image:linear-gradient(#000 52%,transparent 86%)}
@media(max-width:520px){.frose{bottom:calc(var(--fsky-h) - 40px)}}

/* The box is sized here, before any art loads, so nothing shifts (no CLS).
   20vw is the drawing's own ratio (2400:480): from 1000px up the whole
   panorama shows. Below that the height holds at 200px and the sides crop
   around --fsky-x, a point a little right of centre, which keeps the towers,
   the wheel and the Fremont arch on a phone. */
.fsky{
  --fsky-w:max(100%,calc(var(--fsky-h) * 5));
  --fsky-x:.56;
  position:relative;height:var(--fsky-h);
  margin-top:clamp(14px,2.4vw,30px);
  overflow:hidden;pointer-events:none;
  contain:layout paint;
}
.fsky-img{
  position:absolute;inset:0;width:100%;height:100%;display:block;
  object-fit:cover;object-position:56% 100%;
}
/* Inline, the drawing is four stacked copies, one depth plane each, so each
   plane is its own compositor layer and sliding it costs no repaint. They are
   24px wider than the band on each side: room to slide without showing an edge. */
.fsky-pl{
  position:absolute;top:0;height:100%;display:block;
  width:calc(var(--fsky-w) + 48px);
  left:calc((100% - var(--fsky-w)) * var(--fsky-x) - 24px);
  will-change:transform,opacity;
}

/* ── rise-in, once: the planes settle into place, far to near ───────────── */
.fsky-pre .fsky-pl{opacity:0}
.fsky-pl{transition:opacity 1.5s ease var(--d,0s)}

/* ── birds: folded paper, two wings hinged on a body ─────────────────────
   Each wing is a flat triangle that swings about the body line in real 3D
   (rotateX), seen a little from above and ahead, so it foreshortens as it
   beats. Three nested boxes: the crossing, the soaring bob, the 3D body. */
.fsky-birds{position:absolute;inset:0;overflow:hidden;opacity:0;transition:opacity 1.6s ease}
.fsky-live .fsky-birds{opacity:1}
.fsky-bird{position:absolute;left:0;top:var(--y);width:24px;height:24px;margin:-12px 0 0 -12px;opacity:var(--o);
  animation:fsky-cross var(--t) linear var(--dl) infinite}
.fsky-bird-back{animation-name:fsky-cross-back}
.fsky-bird-p{position:absolute;inset:0;animation:fsky-soar var(--bob) ease-in-out infinite alternate}
.fsky-bird-b{position:absolute;inset:0;transform-style:preserve-3d;
  transform:scale(var(--s)) perspective(140px) rotateX(-24deg) rotateY(-30deg)}
.fsky-bird-back .fsky-bird-b{transform:scale(var(--s)) scaleX(-1) perspective(140px) rotateX(-24deg) rotateY(-30deg)}
.fsky-bd{position:absolute;left:1px;top:11px;width:22px;height:2.4px;background:linear-gradient(90deg,#9CC2EE,#fff 60%);
  clip-path:polygon(0 50%,22% 0,82% 0,100% 50%,82% 100%,22% 100%)}
.fsky-w{position:absolute;left:4px;top:-1px;width:15px;height:13px;transform-origin:50% 100%;
  clip-path:polygon(34% 100%,92% 100%,58% 46%,8% 0);backface-visibility:visible}
.fsky-wf{background:linear-gradient(180deg,#8FB8EA,#C9DEF8);animation:fsky-wing-far var(--flap) ease-in-out infinite}
.fsky-wn{background:linear-gradient(180deg,#E4EFFD,#fff);animation:fsky-wing-near var(--flap) ease-in-out infinite}
@keyframes fsky-cross{from{transform:translate3d(-40px,0,0)}to{transform:translate3d(calc(100vw + 40px),0,0)}}
@keyframes fsky-cross-back{from{transform:translate3d(calc(100vw + 40px),0,0)}to{transform:translate3d(-40px,0,0)}}
@keyframes fsky-soar{from{transform:translateY(-9px) rotate(-5deg)}to{transform:translateY(10px) rotate(4deg)}}
/* three beats, then a long glide on set wings */
@keyframes fsky-wing-far{
  0%,54%,100%{transform:rotateX(74deg)}
  7%,23%,39%{transform:rotateX(30deg)}
  15%,31%,46%{transform:rotateX(122deg)}
}
@keyframes fsky-wing-near{
  0%,54%,100%{transform:rotateX(-74deg)}
  7%,23%,39%{transform:rotateX(-30deg)}
  15%,31%,46%{transform:rotateX(-122deg)}
}

/* off screen, nothing runs */
.fsky:not(.fsky-on) .fsky-bird,.fsky:not(.fsky-on) .fsky-bird *{animation-play-state:paused}

/* the script does not run under reduced motion; this covers a setting that
   changes while the page is open */
@media(prefers-reduced-motion:reduce){
  .fsky-birds{display:none}
  .fsky-pl{transform:none!important;transition:none!important;opacity:1!important}
  .fsky-pl *{transition:none!important}
}
@media print{.fsky{display:none}}
