/* ch-levers-1-3 (builder B): scenes 5 to 12. Every selector starts with ub- or sits under .ub. */

/* ---------- shared: labels over 3D, scrims, tags ---------- */
.ub .ub-lab { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; line-height: 1.2; color: #fff; transition: opacity .45s; }
.ub .ub-lab.is-gone { opacity: 0; }
.scene:not(.is-active) .ub-lab { opacity: 0; transition: none; }
.ub .ub-lab--orange { color: #FFB07A; }
.ub .ub-lab--white { color: #fff; }
.ub .ub-lab--dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FF7F32; box-shadow: 0 0 10px #FF7F32; flex: none; }
.ub .ub-lab--chip { padding: 5px 10px; border-radius: 6px; background: rgb(14 10 8 / .72); color: #FFC49A; box-shadow: inset 0 0 0 1px rgb(255 127 50 / .45); text-shadow: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ub .ub-lab--pill { padding: 5px 10px; border-radius: 6px; background: rgb(8 8 10 / .7); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); text-shadow: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ub .ub-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ub-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgb(5 5 6 / .82) 0, rgb(5 5 6 / .5) 22%, transparent 42%), linear-gradient(90deg, rgb(5 5 6 / .55) 0, transparent 38%); }
@media (max-width: 959px), (max-height: 599px) {
  .ub .ub-lab { font-size: 14px; }
  /* l3-how beat 2: the brief sheet sits right; keep the dimmed cabinet out from behind the title and text */
  /* the solid part ends at the text column (--ub-scr, set by the scene), so the sheet's labels stay on clear paper */
  .ub-cab.ub-cab--b2 .ub-scrim { background: linear-gradient(90deg, rgb(5 5 6) 0, rgb(5 5 6) var(--ub-scr, 58%), rgb(5 5 6 / .5) calc(var(--ub-scr, 58%) + 5%), transparent calc(var(--ub-scr, 58%) + 14%)); }
}
@media (max-width: 759px) and (orientation: portrait) {
  .ub .ub-lab { font-size: 14px; }
  .ub-scrim { background: linear-gradient(180deg, rgb(5 5 6 / .85) 0, rgb(5 5 6 / .55) 34%, transparent 52%); }
}

/* ---------- 6 l1-proof: the 500 million board ---------- */
.ub-bd__stage { position: relative; height: 100%; min-height: 0; container-type: size; }
.ub-bd__board { position: absolute; left: 0; top: 26cqh; transition: top .9s cubic-bezier(.2,.8,.2,1); }
.ub-bd .ub-bd__digits.flap { font-size: clamp(24px, min(6.4cqw, 15cqh), 74px); gap: 3px; transition: font-size .9s cubic-bezier(.2,.8,.2,1); }
.ub-bd__lab { margin-top: 12px; font-size: clamp(15px, 1.4vw, 21px); line-height: 1.3; font-weight: 500; color: var(--s-fg); max-width: 22em; transition: font-size .9s cubic-bezier(.2,.8,.2,1), margin .9s; }
.ub-bd__cols { position: absolute; right: 0; top: 0; bottom: 0; width: 22cqw; display: flex; align-items: flex-end; justify-content: flex-end; gap: 12%; transition: opacity .6s, transform .8s; }
.ub-bd__col { position: relative; height: 100%; }
.ub-bd__col canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ub-bd__col--v { width: 52%; clip-path: inset(100% 0 0 0); transition: clip-path 1.6s cubic-bezier(.2,.8,.2,1) .2s; }
.ub-bd__col--b { width: 26%; }
.ub-bd__col--b canvas { clip-path: inset(100% 0 0 0); transition: clip-path 1.6s cubic-bezier(.2,.8,.2,1) .6s; }
.ub-bd__buyer { position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #FF7F32; box-shadow: 0 0 0 4px rgb(255 127 50 / .18), 0 0 18px rgb(255 127 50 / .7); opacity: 0; transition: opacity .6s 1.2s, transform 1.6s cubic-bezier(.2,.8,.2,1) .6s; }
.ub-bd__stage.is-on .ub-bd__col--v { clip-path: inset(0 0 0 0); }
.ub-bd__stage.is-on .ub-bd__col--b canvas { clip-path: inset(98.6% 0 0 0); }
.ub-bd__stage.is-on .ub-bd__buyer { opacity: 1; transform: translateY(calc(-1.4cqh - 6px)); }
.ub-bd__bars { position: absolute; left: 0; right: 0; top: 30cqh; display: grid; gap: min(14px, 2.6cqh); align-content: start; opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .8s cubic-bezier(.2,.8,.2,1); }
.ub-bd__h { font-size: 15px; font-weight: 500; color: var(--s-muted); margin-bottom: 2px; }
.ub-bd__row { display: grid; grid-template-columns: 6.6em minmax(0, 1fr) 4.6em; align-items: center; gap: 14px; height: clamp(26px, 11cqh, 46px); }
.ub-bd__name { font-size: clamp(15px, 1.25vw, 19px); font-weight: 500; white-space: nowrap; }
.ub-bd__num { font-size: clamp(16px, 1.5vw, 24px); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ub-bd__track { position: relative; height: 70%; min-height: 18px; }
.ub-bd__bar { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--w) * (100% - 18px)); clip-path: inset(0 100% 0 0); transition: clip-path 1.2s cubic-bezier(.2,.8,.2,1); }
.ub-bd__bar canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ub-bd__dot { position: absolute; right: -16px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #FF7F32; box-shadow: 0 0 12px rgb(255 127 50 / .75); }
.ub-bd__bar { clip-path: inset(-20px 100% -20px -4px); }
.ub-bd__stage.is-b2 .ub-bd__bar { clip-path: inset(-20px -24px -20px -4px); }
.ub-bd__row:nth-child(3) .ub-bd__bar { transition-delay: .18s; } .ub-bd__row:nth-child(4) .ub-bd__bar { transition-delay: .36s; } .ub-bd__row:nth-child(5) .ub-bd__bar { transition-delay: .54s; }
.ub-bd__stage.is-b2 .ub-bd__board { top: 0; }
.ub-bd__stage.is-b2 .ub-bd__digits.flap { font-size: clamp(20px, min(3.4cqw, 9cqh), 40px); }
.ub-bd__stage.is-b2 .ub-bd__lab { font-size: 15px; margin-top: 6px; }
.ub-bd__stage.is-b2 .ub-bd__cols { opacity: 0; transform: translateY(24px); }
.ub-bd__stage.is-b2 .ub-bd__bars { opacity: 1; transform: none; }
.ub-instant, .ub-instant * { transition: none !important; }
.scene:not(.is-active) .ub-bd__stage * { transition: none !important; }

/* ---------- 7 l1-how and 11 l3-proof: Ads Manager ---------- */
.ub-am__wrap { position: relative; height: 100%; min-height: 0; display: flex; flex-direction: column; }
.ub-am__wrap > .uk-am { flex: none; transform-origin: 50% 0; }
.ub-am__fn { position: absolute; left: 4%; right: 4%; top: 14%; z-index: 3; opacity: 0; transform: translateY(46px); transition: opacity .6s, transform .9s cubic-bezier(.2,.8,.2,1); }
.ub-am__wrap.is-b3 .ub-am__fn { opacity: 1; transform: none; }
.ub-am__wrap.is-b3 > .uk-am { opacity: .34; transform: translateY(18px) scale(.92); filter: saturate(.3); }
.ub-am__wrap.is-b3 > .uk-am :is(.uk-am__val, .uk-am__name, .uk-am__ht, .uk-example) { opacity: 0; transition: opacity .4s; }
@media (max-width: 759px) and (orientation: portrait) { .ub-am__fn { left: 0; right: 0; top: 8%; } }

/* ---------- 9 l2-how: the smart retainer ---------- */
.ub-rt__box { position: relative; height: 100%; min-height: 0; }
.ub-rt__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ub-rt__grid line { stroke: #ECEAE6; stroke-width: 1; }
.ub-rt__axes { fill: none; stroke: #111; stroke-width: 1.5; }
.ub-rt__guide { fill: none; stroke: #9A958D; stroke-width: 1.5; stroke-dasharray: 3 6; stroke-linecap: round; }
.ub-rt__area { opacity: .55; }
.ub-rt__line { fill: none; stroke: #FF7F32; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 2px 6px rgb(255 127 50 / .35)); }
.ub-rt__brk { fill: none; stroke: #C79586; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ub-rt__dot { fill: #fff; stroke: #111; stroke-width: 3; }
.ub-rt__star { fill: #FF7F32; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.ub-rt__starg { fill: #FF7F32; filter: blur(9px); }
.ub-rt__lab { position: absolute; left: 0; top: 0; font-size: 15px; line-height: 1.2; font-weight: 500; color: #111; white-space: nowrap; pointer-events: none; will-change: transform; }
.ub-rt__lab--axis { color: var(--s-muted); }
.ub-rt__lab--orange { color: #B2531A; }
.ub-rt__lab--rose { color: #85503F; }
.ub-rt__lab--big { font-size: clamp(20px, 2vw, 32px); font-weight: 500; color: #111; }
.ub-rt__lab.is-gone { visibility: hidden; }
.scene .ub-rt__s1 .ug-stat { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 16px; }
.scene .ub-rt__s1 .ug-stat__v { font-size: clamp(44px, 5vw, 84px); }
.scene .ub-rt__s1 .ub-rt__statnote { font-size: clamp(15px, 1.2vw, 18px); line-height: 1.35; }
.ub-rt__s1 { display: grid; gap: 14px; }

/* ---------- 11 l3-proof: the thirty copies ---------- */
.ub-x__wrap { padding-left: 18px; }
.ub-x__brk { position: absolute; width: 8px; border: 2.5px solid #C79586; border-right: 0; border-radius: 6px 0 0 6px; transform-origin: 50% 0; transform: scaleY(0); opacity: 0; transition: transform 1.4s cubic-bezier(.2,.8,.2,1) .3s, opacity .4s; pointer-events: none; }
.ub-x__wrap.is-b1 .ub-x__brk { transform: none; opacity: 1; }
.ub-x__brk.is-none { display: none; }
.ub-x .uk-am__row.is-collapsed .uk-am__caret { transform: rotate(-90deg); }
.ub-x3 { display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: 100%; }
.ub-x3__track { position: relative; flex: 1 1 auto; height: 20px; min-width: 40px; }
.ub-x3__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; clip-path: inset(0 67% 0 0); transition: clip-path 1.6s cubic-bezier(.2,.8,.2,1) .2s; border-radius: 3px; background: rgb(225 181 168 / .22); }
.ub-x3__bar canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ub-x3.is-on .ub-x3__bar { clip-path: inset(0 0 0 0); }
.ub-x3__v { font-size: 18px; font-weight: 700; color: #85503F; font-variant-numeric: tabular-nums; }
.ub-x .uk-am__row--group .uk-am__name { font-weight: 600; }
.ub .ub-lab--c::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }

/* ---------- 12 l3-how: the pigeonhole cabinet ---------- */
.ub .ub-lab--board { color: #FFE3C8; }
.ub .ub-lab--col { color: #fff; }
.ub .ub-lab--paper { color: #2a241c; text-shadow: none; font-size: 15px; white-space: normal; line-height: 1.15; }
.ub .ub-lab--head { font-weight: 700; color: #111; padding-left: 24px; }
.ub .ub-lab--paper.is-gone { opacity: 0; transition: none; }
@media (max-width: 959px), (max-height: 599px) { .ub .ub-lab--paper { font-size: 14px; } }
.ub .ub-lab--col { white-space: normal; text-align: center; justify-content: center; line-height: 1.15; }
/* compact: a narrower text column leaves a real free area beside it for the 3D subject */
@media (max-width: 959px), (max-height: 599px) {
  .ub .ug--full .ug-side { max-width: min(21em, 46vw); }
}
@media (max-width: 759px) and (orientation: portrait) {
  .ub .ug--full .ug-side { max-width: 100%; }
}

/* ---------- short frames (640x360 and similar) ---------- */
/* l1-proof: with no room for both, beat 2 drops the shrunk board and the bars take the whole stage */
@container (max-height: 240px) {
  .ub-bd__stage.is-b2 .ub-bd__board { opacity: 0; visibility: hidden; }
  .ub-bd__stage.is-b2 .ub-bd__bars { top: 0; gap: 4px; }
  .ub-bd__row { height: max(20px, 11cqh); }
  .ub-bd__h { margin-bottom: 0; }
}
/* l1-how: the funnel strip sits at the top of the visual and drops its header */
.ub-am__wrap { container-type: size; }
@container (max-height: 300px) {
  .ub-am__fn { top: 0; padding: 10px 14px; gap: 8px; }
  .ub-am__fn .uk-fn__head { display: none; }
  .ub-am__fn .uk-fn__rows { gap: 8px; }
  .ub-am__fn .uk-fn__track { height: 24px; }
}
/* l2-how: a wider text column and tighter gaps so the text never reaches the bottom zone */
@media (max-width: 959px), (max-height: 599px) {
  .scene.ub-rt .ug--split { grid-template-columns: minmax(0, .52fr) minmax(0, .48fr); }
  .ub-rt .ug-side > div { display: grid; gap: 6px; }
  .scene .ub-rt__s1 .ug-stat__v { font-size: 40px; }
  .scene .ub-rt__s1 .ub-rt__statnote { font-size: 14px; line-height: 1.3; }
  .ub .ub-lab--paper { line-height: 1.05; }
}
@media (max-width: 759px) and (orientation: portrait) {
  .scene.ub-rt .ug--split { grid-template-columns: minmax(0, 1fr); }
}
/* phone: the brief sheet sits below the text, so the beat-2 scrim only darkens the top */
@media (max-width: 759px) and (orientation: portrait) {
  .ub-cab.ub-cab--b2 .ub-scrim { background: linear-gradient(180deg, rgb(5 5 6 / .9) 0, rgb(5 5 6 / .6) 34%, transparent 52%); }
}
