/* Lagos Life · B4 "See your brand on the board" = Drive-by (client pick 9 Oct 2026, from Design/variations/2026-10-09-brands-b4 #1).
   Scoped to #preview, except .b4-ad, which b4.js also paints into B9's night board. Tokens come from style.css. */

/* ---------- the ad (any [data-face]) ---------- */
.b4-ad { position: absolute; inset: 0; container-type: size; background: var(--adbg, var(--paper)); color: var(--ink); }
.b4-ad__in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6cqw; padding: 9cqh 7cqw; }
.b4-ad--sample img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b4-ad__logo { display: block; max-width: 100%; max-height: 100%; min-width: 0; object-fit: contain; }
.b4-ad--combo .b4-ad__logo { max-width: 42%; max-height: 82%; }
.b4-ad__name { min-width: 0; font: 800 min(26cqh, 15cqw)/.92 var(--display); font-variation-settings: "wdth" 75; letter-spacing: -.01em; text-transform: uppercase; overflow-wrap: anywhere; text-align: center; }
.b4-ad--combo .b4-ad__name { font-size: min(20cqh, 9cqw); text-align: left; }
/* pixel-scan reveal: the ad prints down in 12 steps under a green pixel screen */
[data-face].is-scan .b4-ad { animation: b4Clip 760ms steps(12, end) both; }
[data-face].is-scan::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: multiply;
  background: linear-gradient(var(--green) 0 0) 0 var(--y, 0) / 100% 8% no-repeat, repeating-conic-gradient(rgba(34,181,115,.55) 0 25%, transparent 0 50%) 0 0 / 14px 14px;
  animation: b4Pix 900ms steps(9, end) both; }
@keyframes b4Clip { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes b4Pix { 0% { opacity: 1; background-position: 0 0%, 0 0; } 85% { opacity: .9; background-position: 0 100%, 0 0; } 100% { opacity: 0; background-position: 0 100%, 0 0; } }

/* ---------- head ---------- */
#preview .b4-head { display: grid; grid-template-columns: 1fr minmax(0, 40ch); gap: 24px 48px; align-items: end; margin-bottom: 40px; }
#preview .b4-head .sec__lede { margin: 0; }
#preview .b4-head .sec__lede b { color: var(--ink); font-weight: 700; }

/* ---------- toolbar ---------- */
#preview .b4-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px; border: var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--white); }
#preview .b4-tb__up { display: flex; gap: 8px; }
#preview .b4-tb__up .btn { min-height: 44px; padding: 0 18px; cursor: pointer; }
#preview .b4-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
#preview .b4-file:focus-visible + label { outline: 3px solid var(--fuch); outline-offset: 3px; }
#preview .b4-tb__sep { width: 2px; align-self: stretch; margin: 6px 2px; background: var(--ink-3); }
#preview .b4-tb__name { flex: 1 1 210px; min-width: 0; }
#preview .b4-in { width: 100%; min-height: 44px; padding: 0 18px; border: var(--line); border-radius: 999px; background: var(--white); font: 600 16px/1 var(--text); color: var(--ink); transition: background var(--d-quick); }
#preview .b4-in::placeholder { color: rgba(16,22,52,.45); }
#preview .b4-in:hover { background: var(--paper); }
#preview .b4-in:focus-visible { outline: 3px solid var(--fuch); outline-offset: 2px; }
#preview .b4-tabs { display: flex; align-items: stretch; flex: none; gap: 4px; margin-left: auto; padding: 4px; border: 2px solid var(--ink-3); border-radius: 999px; background: var(--cotton); }
#preview .b4-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font: 700 14px/1 var(--text); color: var(--ink); white-space: nowrap; cursor: pointer; transition: background var(--d-quick), color var(--d-quick); }
#preview .b4-tab span { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: color var(--d-quick); }
#preview .b4-tab:hover { background: var(--white); }
#preview .b4-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
#preview .b4-tab[aria-selected="true"] span { color: var(--gold-soft); }
#preview .b4-tab:focus-visible { outline: 3px solid var(--fuch); outline-offset: 2px; }

/* ---------- stage: three scenes side by side, the track pans ---------- */
#preview .b4-stage { position: relative; aspect-ratio: 16 / 7.4; container-type: size; border: var(--line); border-radius: 0 0 24px 24px; overflow: hidden; background: var(--cotton); }
#preview .b4-track { position: absolute; inset: 0; width: 300%; display: flex; transition: transform 1100ms cubic-bezier(.65,0,.25,1); }
#preview .b4-panel { position: relative; flex: 1; border-right: 2.5px dashed rgba(16,22,52,.18); --bw: 40%; --lw: 36%; --cell: clamp(20px, 3.6vw, 44px); }
#preview .b4-hud { position: absolute; z-index: 8; right: 16px; top: 16px; display: flex; gap: 8px; }
#preview .b4-hud span { padding: 6px 12px; border: var(--line); border-radius: 999px; background: var(--paper); font: 700 13px/1.2 var(--text); font-variant-numeric: tabular-nums; }
#preview .b4-hud span:last-child { background: var(--gold); }
#preview .b4-drop { position: absolute; z-index: 20; inset: 12px; display: grid; place-items: center; border: 3px dashed var(--ink); border-radius: 18px; background: rgba(215,244,230,.92); font: 800 clamp(22px, 3vw, 40px)/1 var(--display); font-variation-settings: "wdth" 75; text-transform: uppercase; text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--d-quick); }
#preview .b4-stage.is-dragging .b4-drop { opacity: 1; }
#preview .b4-rail { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
#preview .b4-rail p { margin: 0; padding: 0 16px; font-size: 14px; color: var(--ink-2); border-left: 2.5px solid var(--ink-3); }
#preview .b4-rail b { display: block; color: var(--ink); font-weight: 700; }
#preview .b4-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 24px; }
#preview .b4-msg { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--ink-2); }
#preview .b4-lock { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1.3 var(--text); }
#preview .b4-lock svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* scenes */
#preview .scn { position: absolute; inset: 0; overflow: hidden; }
#preview [data-face] { position: absolute; inset: 0; overflow: hidden; background: var(--paper); }
#preview .scn__cap { position: absolute; z-index: 6; left: 16px; bottom: 16px; margin: 0; padding: 8px 14px; border: var(--line); border-radius: 999px; background: var(--paper); font: 700 13px/1.2 var(--text); box-shadow: var(--sh-pill); max-width: calc(100% - 32px); }
#preview .adtag { position: absolute; z-index: 3; top: 6px; left: 6px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--gold); font: 800 11px/1.3 var(--text); }
#preview .passer { position: absolute; z-index: 5; pointer-events: none; animation: b4Pass var(--d, 9s) linear infinite; }
#preview .passer img, #preview .passer svg { display: block; width: 100%; height: auto; }
@keyframes b4Pass { from { left: -25%; translate: -40% 0; } to { left: 105%; translate: 0 0; } }
/* road */
#preview .scn--road { background: linear-gradient(#FFFCF7 0%, #EAF1F8 58%, #E4EDF7 72%); }
#preview .scn--road .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 28%; background: var(--etu); }
#preview .scn--road .ground::before { content: ""; position: absolute; left: 0; right: 0; top: -9%; height: 9%; background: #DCE1F2; }
#preview .scn--road .ground::after { content: ""; position: absolute; left: 0; right: 0; top: 46%; height: 5px; background: repeating-linear-gradient(90deg, var(--gold) 0 26px, transparent 26px 48px); }
#preview .scn--road .skyline { position: absolute; left: 0; right: 0; bottom: 30.5%; height: 18%; opacity: .5;
  background: linear-gradient(#C9D3EA 0 0) 4% 100%/7% 60% no-repeat, linear-gradient(#C9D3EA 0 0) 13% 100%/5% 100% no-repeat, linear-gradient(#C9D3EA 0 0) 70% 100%/6% 80% no-repeat, linear-gradient(#C9D3EA 0 0) 78% 100%/4% 45% no-repeat, linear-gradient(#C9D3EA 0 0) 92% 100%/8% 70% no-repeat; }
#preview .scn--road .bb { position: absolute; left: 50%; bottom: 30%; width: var(--bw); translate: -50% 0; }
#preview .scn--road .bb__frame { position: relative; aspect-ratio: 2 / 1; padding: 6px; border: 3px solid var(--ink); border-radius: 10px; background: var(--etu); box-shadow: 0 24px 40px -22px rgba(16,22,52,.5); }
#preview .scn--road .bb__frame > .inner { position: relative; height: 100%; border-radius: 4px; overflow: hidden; }
#preview .scn--road .bb__lamp { position: absolute; top: -14px; width: 26px; height: 12px; border: 2.5px solid var(--ink); border-radius: 6px 6px 2px 2px; background: var(--paper); }
#preview .scn--road .bb__lamp:nth-of-type(1) { left: 20%; } #preview .scn--road .bb__lamp:nth-of-type(2) { right: 20%; }
#preview .scn--road .bb__posts { display: flex; justify-content: space-between; height: 13cqh; padding: 0 22%; }
#preview .scn--road .bb__posts i { width: 12px; background: #3B4580; border: 2.5px solid var(--ink); border-top: 0; }
#preview .scn--road .passer { bottom: 6%; width: clamp(80px, 16%, 150px); --d: 8s; }
/* sea */
#preview .scn--sea { background: linear-gradient(#EEF2FB 0 22%, #CDD7EE 22% 100%); }
#preview .scn--sea .shore { position: absolute; left: 0; right: 0; top: 14%; height: 9%; border-bottom: 2.5px solid var(--ink); background: linear-gradient(#BFE8D2 0 0) 0 0/100% 55% no-repeat, linear-gradient(var(--green) 0 0) 0 55%/100% 3px no-repeat, #EFE3C2; }
#preview .scn--sea .grid { position: absolute; left: 0; right: 0; top: 23%; bottom: 0; background-image: linear-gradient(rgba(27,35,80,.12) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(27,35,80,.12) 1.5px, transparent 1.5px); background-size: var(--cell) var(--cell); background-position: center; }
#preview .scn--sea .plot { position: absolute; left: 50%; top: calc(23% + (77% - var(--cell) * 6) / 2); width: calc(var(--cell) * 6); height: calc(var(--cell) * 6); translate: -50% 0; border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 0 0 5px var(--paper), 0 0 0 7.5px var(--ink), 0 26px 40px -20px rgba(16,22,52,.5); }
#preview .scn--sea .plot .inner { position: absolute; inset: 0; overflow: hidden; border-radius: 3px; }
#preview .scn--sea .plot .cells { position: absolute; inset: 0; z-index: 2; pointer-events: none; background-image: linear-gradient(rgba(16,22,52,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(16,22,52,.1) 1px, transparent 1px); background-size: calc(100% / 6) calc(100% / 6); }
#preview .scn--sea .plot .adtag { top: -14px; left: -10px; }
#preview .scn--sea .passer { top: 30%; width: clamp(64px, 11%, 110px); --d: 12s; }
/* airport: a real arrivals-hall ceiling (indigo slab, warm light panels), the sign hangs from it */
#preview .scn--air { background: linear-gradient(#F3F1EA 0 64%, #E6E2D6 64% 100%); }
#preview .scn--air .ceil { position: absolute; left: 0; right: 0; top: 0; height: 9%; background: var(--etu); border-bottom: 2.5px solid var(--ink); }
#preview .scn--air .ceil::before { content: ""; position: absolute; left: 4%; right: 4%; top: 50%; height: 8px; translate: 0 -50%; border-radius: 4px; background: repeating-linear-gradient(90deg, #FFF1C2 0 9%, transparent 9% 14%); box-shadow: 0 0 18px rgba(255,236,170,.6); }
#preview .scn--air .glow { position: absolute; left: 0; right: 0; top: 9%; height: 26%; background: radial-gradient(60% 100% at 50% 0%, rgba(255,241,194,.55), transparent 70%); pointer-events: none; }
#preview .scn--air .sign { position: absolute; top: 15%; left: 50%; translate: -50% 0; display: flex; gap: 10px; align-items: center; padding: 8px 16px; border: var(--line); border-radius: 10px; background: var(--etu); color: var(--paper); font: 700 clamp(11px, 1.2vw, 14px)/1 var(--text); white-space: nowrap; }
#preview .scn--air .sign::before, #preview .scn--air .sign::after { content: ""; position: absolute; bottom: 100%; width: 2.5px; height: 6cqh; background: var(--ink); }
#preview .scn--air .sign::before { left: 18%; } #preview .scn--air .sign::after { right: 18%; }
#preview .scn--air .sign b { color: var(--gold); font-weight: 800; }
#preview .scn--air .lb { position: absolute; left: 50%; top: 28%; width: var(--lw); aspect-ratio: 16 / 10; translate: -50% 0; padding: 8px; border: 3px solid var(--ink); border-radius: 12px; background: #2A3366; box-shadow: 0 0 0 6px rgba(255,246,216,.7), 0 30px 50px -24px rgba(16,22,52,.55); }
#preview .scn--air .lb .inner { position: relative; height: 100%; border-radius: 5px; overflow: hidden; }
#preview .scn--air .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: repeating-linear-gradient(90deg, transparent 0 60px, rgba(16,22,52,.07) 60px 62px); }
#preview .scn--air .belt { position: absolute; left: 8%; right: 8%; bottom: 14%; height: 10px; border: 2.5px solid var(--ink); border-radius: 999px; background: repeating-linear-gradient(90deg, #8E97B8 0 12px, #A9B1CC 12px 24px); }
#preview .scn--air .passer { bottom: 12%; width: clamp(44px, 6%, 64px); --d: 14s; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { #preview .b4-tabs { margin-left: 0; width: 100%; } #preview .b4-tab { flex: 1; } }
@media (max-width: 900px) {
  #preview .b4-head { grid-template-columns: 1fr; }
  #preview .b4-tb__sep { display: none; }
  #preview .b4-tab { flex-direction: column; gap: 2px; padding: 6px 4px; }
  #preview .b4-stage { aspect-ratio: 4 / 4.2; }
  #preview .b4-panel { --bw: 80%; --lw: 72%; --cell: 30px; }
  #preview .b4-rail { display: none; }
}
@media (max-width: 600px) {
  #preview .b4-tb__up { flex: 1 1 100%; } #preview .b4-tb__up .btn { flex: 1; padding: 0 12px; }
  #preview .b4-panel { --cell: 25px; }
  #preview .b4-hud { right: 10px; top: 10px; } #preview .b4-hud span:first-child { display: none; }
  #preview .scn__cap { left: 10px; bottom: 10px; font-size: 12px; }
}

/* ---------- reduced motion (OS setting or the footer toggle) ---------- */
@media (prefers-reduced-motion: reduce) {
  #preview .b4-track { transition: none; }
  #preview .passer { animation: none; left: 62%; }
  [data-face].is-scan .b4-ad, [data-face].is-scan::after { animation: none; }
  [data-face].is-scan::after { display: none; }
}
.reduce-motion #preview .b4-track { transition: none; }
.reduce-motion #preview .passer { animation: none; left: 62%; }
.reduce-motion [data-face].is-scan .b4-ad { animation: none; }
.reduce-motion [data-face].is-scan::after { display: none; }
