/* B9 "Night drive, Brands cut" with the helicopter (client pick 9 Oct). Scoped to #b9 on the Brands side.
   Static by default (no JS, OS reduced motion, footer toggle): the helicopter spotlights the big board over the headline and CTAs.
   b9.js adds .is-on for the pinned, scrubbed scene. */
#b9 {
  --night: #0B0F26; --b9-top: 0px; --b9-h: calc(100svh - var(--b9-top)); --b9-bar: 7svh; --b9-gut: 24px;
  --big-w: min(480px, 80vw); --big-top: calc(var(--b9-bar) + 13svh);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  position: relative; overflow: clip; background: var(--night); color: var(--paper);
  scroll-margin-top: calc(var(--b9-top) - 112px);
}
@media (max-width: 699px) { #b9 { --b9-bar: 5svh; --b9-gut: 16px; --big-w: 80vw; --big-top: calc(var(--b9-bar) + 12svh); } }
#b9 .b9f__stage { position: relative; height: max(100svh, 680px); overflow: hidden; }
#b9.is-on .b9f__stage { height: var(--b9-h); }

/* the scene layer: night + boards + helicopter. The outro scales it into a framed card on paper; the lockup stays full size */
#b9 .b9f__scene { position: absolute; inset: 0; overflow: hidden; background: var(--night); transform-origin: 50% 50%; }
#b9.is-on .b9f__stage { background: var(--paper); }
/* night Lagos */
#b9 .b9f__bd { position: absolute; inset: 0; }
#b9 .b9f__night { position: absolute; inset: 0; width: 100%; height: 100%; }

/* billboards along the road; the last, biggest one is the visitor's */
#b9 .b9f__row { position: absolute; inset: 0; z-index: 2; }
#b9 .b9b { position: absolute; top: var(--top, 20svh); width: var(--w, 260px); }
#b9 .b9b__lamps { display: flex; justify-content: space-around; padding: 0 12%; height: 11px; }
#b9 .b9b__lamps i { width: 22px; height: 10px; border-radius: 0 0 12px 12px; background: #2a3270; border: 2px solid var(--ink); border-top: 0; }
#b9 .b9b__frame { position: relative; aspect-ratio: 16 / 9; border: 4px solid var(--ink); border-radius: 10px; background: #fff; overflow: hidden; box-shadow: 0 0 0 3px #2a3270; }
#b9 .b9b__face { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; overflow: hidden; }
#b9 .b9b--big .b9b__face > * { max-width: 100%; max-height: 100%; }
#b9 .b9b--big .b9b__face img { width: 100%; height: 100%; object-fit: contain; }   /* big board only: the small boards' ad builds keep their own image sizes */
/* The B1 ad builds are laid out for the B1 board. Each is rendered at the B1 board's native size inside a fixed wrapper and
   the wrapper is scaled down to the small board (b9.js sets --ns = face width / native width), so the layout is identical,
   just smaller. Native: the B1 ad box (1084 × 16:7.4 on desktop; 340 × 3:2 at phone widths, where B1 itself switches). */
#b9 { --nw: 1084px; --na: 16 / 7.4; }
@media (max-width: 600px) { #b9 { --nw: 340px; --na: 3 / 2; } }
#b9 .b9b:not(.b9b--big) { --w: 300px; }
#b9 .b9b:not(.b9b--big) .b9b__tag { left: auto; right: 6px; }   /* top-right, clear of the ads' own logos */
#b9 .b9b:not(.b9b--big) .b9b__frame { aspect-ratio: var(--na); }
#b9 .b9b__face--ad { overflow: hidden; border-radius: 6px; }
#b9 .b9b__native { position: absolute; left: 0; top: 0; width: var(--nw); aspect-ratio: var(--na); overflow: hidden; container-type: inline-size; transform-origin: 0 0; transform: scale(var(--ns, .25)); }
#b9 .b9b__face--ad .bd-ad { visibility: visible; }
#b9 .b9b__face .b4-ad--sample { background: #fff; }
#b9 .b9b__face .b4-ad--sample img { object-fit: contain; }   /* the 3:1 sample ad shows whole on the 16:9 boards */
#b9 .b9b__tag { position: absolute; z-index: 2; top: 6px; left: 6px; padding: 2px 7px; border-radius: 6px; background: var(--gold); color: var(--ink); font: 800 10px/1.2 var(--text); }
#b9 .b9b__off { position: absolute; inset: 0; z-index: 1; background: #05071a; opacity: 0; }
#b9 .b9b__glow { position: absolute; left: -20%; right: -20%; top: -35%; height: 90%; background: radial-gradient(50% 60% at 50% 0%, rgba(255,233,166,.42), transparent 70%); pointer-events: none; }
#b9 .b9b__posts { display: flex; justify-content: space-around; padding: 0 28%; }
#b9 .b9b__posts i { width: 10px; height: var(--post, 24svh); background: #161D47; border: 2px solid var(--ink); border-top: 0; }
#b9 .b9b--big { --w: var(--big-w); --top: var(--big-top); --post: 40svh; left: 50%; margin-left: calc(var(--big-w) / -2); }
#b9 .b9b--big .b9b__tag { font-size: 12px; padding: 3px 9px; }
#b9:not(.is-on) .b9b:not(.b9b--big) { display: none; }
@media (max-width: 699px) { #b9 .b9b, #b9 .b9b:not(.b9b--big) { --w: 190px; } #b9 .b9b__lamps i { width: 14px; height: 7px; } }

/* the helicopter: flat sticker style, spinning rotor, blinking nav light, a searchlight beam, a towed banner */
#b9 .b9f__heli { position: absolute; z-index: 4; left: 0; top: 0; width: var(--heli, 150px); transform-origin: 50% 40%;
  translate: calc(50vw - var(--heli, 150px) / 2) calc(var(--big-top) - var(--heli, 150px) * .62 - 18px); }
#b9.is-on .b9f__heli { translate: none; }
@media (max-width: 699px) { #b9 { --heli: 100px; } }
#b9 .b9f__copter { position: relative; display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
#b9 .b9f__rotor { transform-box: fill-box; transform-origin: 50% 50%; animation: b9-rotor .12s linear infinite; }
#b9 .b9f__trotor { transform-box: fill-box; transform-origin: 50% 50%; animation: b9-rotor .1s linear infinite; }
#b9 .b9f__nav { animation: b9-nav 1.1s steps(1) infinite; }
@keyframes b9-rotor { 0% { transform: scaleX(1); } 50% { transform: scaleX(.18); } 100% { transform: scaleX(1); } }
@keyframes b9-nav { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
#b9 .b9f__beam { position: absolute; left: 50%; top: 62%; width: calc(var(--heli, 150px) * 2.4); height: calc(var(--big-top) * .5 + 34svh); margin-left: calc(var(--heli, 150px) * -1.2); transform-origin: 50% 0; z-index: -1;
  background: linear-gradient(rgba(255,243,201,.55), rgba(255,243,201,.06) 85%, transparent); clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); mix-blend-mode: screen; pointer-events: none; }
#b9 .b9f__tow { position: absolute; right: 92%; top: 42%; display: flex; align-items: center; }
#b9 .b9f__rope { order: 2; width: 44px; height: 2px; background: rgba(255,252,247,.6); }
#b9 .b9f__banner { order: 1; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 4px 10px 10px 4px; background: var(--paper); color: var(--ink); font: 800 11px/1 var(--text); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
#b9:not(.is-on) .b9f__tow { display: none; }
@media (max-width: 699px) { #b9 .b9f__banner { font-size: 9px; padding: 4px 7px; } #b9 .b9f__rope { width: 26px; } }

/* the lockup: headline + the two CTAs, in clear space under the boards */
#b9 .b9f__lock { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding: 0 var(--b9-gut) calc(var(--b9-bar) + 3.6svh); pointer-events: none; }
#b9 .b9f__lock a { pointer-events: auto; }
#b9 .b9f__h { font: 800 min(6vw, 8svh)/.86 var(--display); font-variation-settings: "wdth" 75; letter-spacing: -.02em; text-transform: uppercase; }
#b9 .b9f__l { display: flex; justify-content: center; gap: .2em; white-space: nowrap; }
#b9 .b9f__w { display: inline-block; color: var(--paper); -webkit-text-stroke: .04em var(--ink); paint-order: stroke fill; transform-origin: 50% 50%; }
#b9 .b9f__w--board { color: var(--gold); }
#b9 .b9f__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 2.4svh; }
#b9 .b9f__cta .btn--ghost { background: var(--paper); color: var(--ink); }
#b9 .btn:focus-visible { outline: 3px solid var(--paper); outline-offset: 4px; }
@media (max-width: 699px) { #b9 .b9f__h { font-size: 12vw; } #b9 .b9f__cta { width: min(100%, 340px); } #b9 .b9f__cta .btn { width: 100%; } }

/* letterbox, grain */
#b9:not(.is-on) .b9f__bars { display: none; }
#b9 .b9f__bars { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
#b9 .b9f__bar { position: absolute; left: 0; right: 0; height: var(--b9-bar); background: #000; }
#b9 .b9f__bar--t { top: 0; transform-origin: 50% 0; }
#b9 .b9f__bar--b { bottom: 0; transform-origin: 50% 100%; }
#b9 .b9f__grain { position: absolute; inset: -60px; z-index: 9; pointer-events: none; background-image: var(--grain); opacity: .1; mix-blend-mode: overlay; }
#b9 .is-playing :is(.b9f__w, .b9f__row, .b9f__heli) { will-change: transform; }
@media (prefers-reduced-motion: reduce) { #b9 .b9f__rotor, #b9 .b9f__trotor, #b9 .b9f__nav { animation: none; } }
.reduce-motion #b9 .b9f__rotor, .reduce-motion #b9 .b9f__trotor, .reduce-motion #b9 .b9f__nav { animation: none; }
