/* ba-viewer.css — adapt the custom properties to the site's theme. */
.ba{--ba-glass-font:system-ui,-apple-system,"Segoe UI",sans-serif;--ba-glass:rgba(10,10,10,.6);--ba-glass-fg:#fff;--ba-glass-line:rgba(255,255,255,.14);--ba-solid:rgba(255,255,255,.92);--ba-solid-fg:#111;
 /* mapped to the site's tokens (css/style.css :root). The site is dark-only, so there is no light variant. */
 --ba-fg:var(--text-primary,#EDEDED);--ba-bg:var(--bg-surface,#121212);--ba-mut:var(--text-muted,#71717A);--ba-line:var(--border-subtle,#232326);--ba-acc:var(--accent-sky,#38BDF8);--ba-accfg:#0A0A0A;--ba-r:var(--radius,10px);--ba-pill:var(--radius,10px);
 --ba-wk-w:3px;--ba-wk-gap:4px;--ba-wk-h:18px;--ba-wk-r:2px;
 --ba-cl-bg:rgba(10,10,10,.6);--ba-cl-fg:var(--text-secondary,#A1A1AA);--ba-cl-font:var(--font-mono,ui-monospace,monospace);--ba-cl-size:.8125rem;--ba-cl-weight:500;--ba-cl-ls:.06em;--ba-cl-r:var(--radius,10px);--ba-cl-pad:.3em .9em;--ba-cl-blur:blur(12px) saturate(1.5);--ba-cl-x:12px;--ba-cl-y:12px;
 position:relative}
.ba-stage{position:relative;overflow:hidden;border-radius:var(--ba-r);background:#000;touch-action:pan-y;cursor:pointer;outline:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;contain:layout paint}
.ba-stage{box-shadow:0 0 0 1px var(--border-subtle,#232326)}
.ba-stage:focus-visible{outline:2px solid var(--accent-sky,#38BDF8);outline-offset:3px}
.ba-stage.ba-edit{touch-action:none}
.ba-img,.ba-img2,.ba-cv{position:absolute;inset:0;width:100%;height:100%;display:block}
.ba-img,.ba-img2{object-fit:cover}
.ba-cv{opacity:0}
.ba-ready .ba-cv{opacity:1}.ba-ready .ba-img{visibility:hidden}
.ba-img2{opacity:0;transition:opacity .45s ease}
.ba-after .ba-img2{opacity:1}
.ba-hsw,.ba-ov{position:absolute;inset:0}
.ba-hsw{pointer-events:none;z-index:4}
.ba-ov{pointer-events:none;z-index:4;cursor:crosshair}
.ba-hs{position:absolute;opacity:0}
.ba-hs b{position:absolute;left:-4px;top:-4px;width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.95);box-shadow:0 0 0 4px rgba(255,255,255,.16),0 1px 6px rgba(0,0,0,.25)}
.ba-hs b::after{content:"";position:absolute;inset:0;border-radius:50%;border:1px solid rgba(255,255,255,.55);animation:ba-rip 3.6s cubic-bezier(.2,.6,.3,1) infinite}
.ba-hs span{position:absolute;left:19px;top:-16px;white-space:nowrap;font-family:var(--ba-cl-font,inherit);font-size:var(--ba-cl-size,12px);font-weight:var(--ba-cl-weight,500);letter-spacing:var(--ba-cl-ls,0);line-height:1.6;color:var(--ba-cl-fg,#fff);background:var(--ba-cl-bg,rgba(23,24,26,.36));-webkit-backdrop-filter:var(--ba-cl-blur,blur(10px));backdrop-filter:var(--ba-cl-blur,blur(10px));padding:var(--ba-cl-pad,4px 12px);border-radius:var(--ba-cl-r,999px);transition:background .3s,color .3s}
.ba-hs span::before{content:"";position:absolute;right:100%;top:50%;width:15px;height:1px;margin-top:-.5px;background:rgba(255,255,255,.7)}
.ba-hs.ba-l span{left:auto;right:19px}
.ba-hs.ba-l span::before{right:auto;left:100%}
.ba-hs.ba-on span,.ba-hs:focus-visible span{background:var(--ba-solid);color:var(--ba-solid-fg)}
@media (hover:hover) and (pointer:fine){.ba-tap .ba-hs:hover span{background:var(--ba-solid);color:var(--ba-solid-fg)}}
.ba-hs:focus-visible{outline:none}.ba-hs:focus-visible b{box-shadow:0 0 0 5px rgba(255,255,255,.55)}
.ba-tap .ba-hs{pointer-events:auto;cursor:pointer}
.ba-tap .ba-hs::before{content:"";position:absolute;left:-22px;top:-22px;width:44px;height:44px;border-radius:50%}
.ba-zo{position:relative;display:none;overflow:hidden;font:inherit;border:1px solid var(--ba-line);background:var(--ba-bg);color:var(--text-secondary,#A1A1AA);padding:.4em 1.1em;border-radius:var(--ba-pill);cursor:pointer;transition:color .2s ease,border-color .2s ease,transform .15s ease}
.ba-zo:hover{color:var(--ba-fg);border-color:var(--border-hover,#2E2E33)}
.ba-zo,.ba-hz .ba-zo{display:none !important}
.ba-zo i{position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--ba-acc);transform-origin:left;transform:scaleX(0)}
.ba-zo.ba-run i{animation:ba-cd var(--hz,5s) linear forwards}
@keyframes ba-cd{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@keyframes ba-rip{0%{transform:scale(1);opacity:.55}70%,100%{transform:scale(4);opacity:0}}
@media (prefers-reduced-motion:reduce){.ba-hs b::after{animation:none;opacity:0}.ba-zo.ba-run i{animation:none}}
.ba-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:center;margin-top:12px;font:500 .85rem/1.3 var(--font-sans,system-ui,sans-serif)}
.ba-seg{display:inline-flex;gap:2px;background:var(--ba-bg);border:1px solid var(--ba-line);border-radius:var(--ba-pill);padding:3px}
.ba-seg button{border:1px solid transparent;background:transparent;color:var(--ba-mut);font:inherit;padding:.4em 1.1em;border-radius:calc(var(--ba-pill) - 3px);cursor:pointer;transition:background-color .2s ease,color .2s ease,border-color .2s ease}
.ba-seg button:hover{color:var(--ba-fg)}
.ba-seg button:focus-visible,.ba-nav button:focus-visible,.ba-lpb:focus-visible,.ba-zo:focus-visible{outline:2px solid var(--ba-acc);outline-offset:3px}
.ba-seg button[aria-pressed="true"]{background:var(--bg-surface-elevated,#1C1C1F);border-color:var(--border-active,#3F3F46);color:var(--ba-fg)}
.ba-nav{display:flex;gap:8px;align-items:center}
.ba-nav[hidden],.ba-lpb[hidden],.ba-nav button[hidden]{display:none}
.ba-nav button,.ba-lpb{font:inherit;border:1px solid var(--ba-line);background:var(--ba-bg);color:var(--text-secondary,#A1A1AA);padding:.4em 1.1em;border-radius:var(--ba-pill);cursor:pointer;transition:color .2s ease,border-color .2s ease,background-color .2s ease,transform .15s ease}
.ba-nav button:hover,.ba-lpb:hover{color:var(--ba-fg);border-color:var(--border-hover,#2E2E33)}
.ba-nav button:active,.ba-lpb:active,.ba-zo:active{transform:scale(.96)}
.ba-lpb[aria-pressed="true"]{background:var(--bg-surface-elevated,#1C1C1F);border-color:var(--border-active,#3F3F46);color:var(--ba-fg)}
.ba-cap{color:var(--ba-mut);font:400 .75rem/1.4 var(--font-mono,ui-monospace,monospace);min-width:8em;text-align:center}
/* editor (only present with ?edit) */
.ba-ov .rb{position:absolute;border:2px solid #fff;border-radius:8px;box-shadow:0 0 0 1px rgba(0,0,0,.55)}
.ba-ov .rb em{position:absolute;left:-2px;top:-22px;background:#fff;color:#000;font:600 11px system-ui;padding:1px 8px;border-radius:var(--ba-pill);font-style:normal}

/* intro: controls stay hidden (space reserved) until the first After has landed */
.ba-bar{transition:opacity .7s ease,visibility .7s}
.ba-pre .ba-bar{opacity:0;visibility:hidden}
.ba-tag{position:absolute;top:var(--ba-cl-y,12px);z-index:3;pointer-events:none;opacity:0;transition:opacity .4s;text-transform:uppercase;font-family:var(--ba-cl-font,inherit);font-size:var(--ba-cl-size,12px);font-weight:var(--ba-cl-weight,500);letter-spacing:var(--ba-cl-ls,0);line-height:1.6;color:var(--ba-cl-fg,#fff);background:var(--ba-cl-bg,rgba(23,24,26,.36));-webkit-backdrop-filter:var(--ba-cl-blur,blur(10px));backdrop-filter:var(--ba-cl-blur,blur(10px));padding:var(--ba-cl-pad,4px 12px);border-radius:var(--ba-cl-r,999px)}   /* the same pill as the slider's .ba-cl, so nothing changes or moves when the intro hands over to the slider */
.ba-t0{left:var(--ba-cl-x,12px)}.ba-t1{right:var(--ba-cl-x,12px)}
.ba-tag.ba-on{opacity:1}

/* small stages (phones): smaller labels and chips */
.ba-hs.ba-nolead span::before{display:none}
.ba-sm .ba-hs span{top:-14px}

/* the glass lens (loupe): only the ball takes touches, so the rest of the image still scrolls the page */
.ba-lhit{position:absolute;left:0;top:0;display:none;border-radius:50%;touch-action:none;z-index:5;cursor:grab;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;will-change:transform}
.ba-lhit:active{cursor:grabbing}
.ba img{-webkit-user-drag:none;-webkit-touch-callout:none;user-select:none}
/* any aspect ratio (4:5, 3:4, 16:9, 1:1 ...) fits the screen height: width = min(column, (screen height - reserve) x ratio), centred.
   --ba-ar is set per image by the viewer; set --ba-reserve to header + control bar height if needed. */
.ba{width:min(100%,max(320px,calc((100vh - var(--ba-reserve,130px)) * var(--ba-ar,1.25))));width:min(100%,max(320px,calc((100svh - var(--ba-reserve,130px)) * var(--ba-ar,1.25))));margin-inline:auto}

/* ══ Compare slider mode (options.compare, and the default on low-end phones) ═══════════
   The corner is the stage's own --ba-r and the labels read their look from the --ba-cl-* variables, so both
   come from the site's styling: set them to match the site's image radius and its tags/badges/pills. */
.ba-cb,.ba-cl,.ba-cline,.ba-cgrip{display:none}
.ba-cmp .ba-cb{display:block;position:absolute;inset:0}
.ba-cmp .ba-img{visibility:visible}
.ba-cmp .ba-cl,.ba-cmp .ba-cline,.ba-cmp .ba-cgrip{display:block}
.ba-cmp .ba-cv,.ba-cmp .ba-hsw,.ba-cmp .ba-tag,.ba-cmp .ba-lhit,.ba-cmp .ba-nav,.ba-cmp .ba-lpb,.ba-cmp .ba-zo,.ba-cmp .ba-wk{display:none !important}
.ba-cmp .ba-stage{cursor:ew-resize}
.ba-cl{position:absolute;top:var(--ba-cl-y,12px);left:var(--ba-cl-x,12px);padding:var(--ba-cl-pad,4px 12px);border-radius:var(--ba-cl-r,999px);background:var(--ba-cl-bg,rgba(23,24,26,.36));-webkit-backdrop-filter:var(--ba-cl-blur,blur(10px));backdrop-filter:var(--ba-cl-blur,blur(10px));color:var(--ba-cl-fg,#fff);font-family:var(--ba-cl-font,inherit);font-size:var(--ba-cl-size,12px);font-weight:var(--ba-cl-weight,500);letter-spacing:var(--ba-cl-ls,0);line-height:1.6;text-transform:uppercase;pointer-events:none}
.ba-cl.ba-cl-r{left:auto;right:var(--ba-cl-x,12px)}
/* the line is drawn, so it can bend: a 2px curve with a soft glow, over the whole block */
.ba-cline{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;filter:drop-shadow(0 0 6px rgba(255,255,255,.5))}
.ba-cline path{fill:none;stroke:var(--ba-cline,#fff);stroke-width:2}
.ba-cgrip{position:absolute;top:0;bottom:0;width:0;pointer-events:none}
.ba-cknob{position:absolute;left:50%;top:50%;width:36px;height:36px;translate:-50% -50%;display:grid;place-items:center;border-radius:50%;background:var(--ba-bg);color:var(--ba-fg);box-shadow:0 2px 12px rgba(23,24,26,.25);transition:scale 220ms cubic-bezier(.24,1.34,.38,1)}
.ba-stage:hover .ba-cknob{scale:1.08}
.ba-stage[data-held] .ba-cknob{scale:.9}

/* ══ Wake slider: the magnification control next to the Magnify button (only when the image has the loupe on).
   Bars are data marks, so they take the ink strengths: --ba-fg when lit, a faint mix of --ba-fg and --ba-bg after the value.
   Map --ba-fg / --ba-bg / --ba-acc to the site's ink, ground and accent; the bar size is yours via --ba-wk-w / -gap / -h / -r. */
.ba-wk{display:flex;flex-direction:column;align-items:center;gap:7px;flex:1 1 100%;min-width:0;padding:2px 4px;color:var(--ba-fg)}
.ba-wk[hidden]{display:none}
.ba-wkt{display:flex;align-items:center;gap:var(--ba-wk-gap,4px);height:calc(var(--ba-wk-h,20px) * 2.6);cursor:ew-resize;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;border-radius:6px}
.ba-wkt:focus-visible{outline:2px solid var(--ba-acc);outline-offset:6px}
.ba-wb{flex:none;width:var(--ba-wk-w,3px);height:var(--ba-wk-h,20px);border-radius:var(--ba-wk-r,3px);background:var(--ba-mut);background:color-mix(in srgb,var(--ba-fg) 32%,var(--ba-bg));transform-origin:50% 50%;transition:background-color 160ms ease}
.ba-wb[data-on]{background:var(--ba-fg)}
.ba-wkv{order:-1;min-width:0;text-align:center;font:500 .8rem/1 var(--font-mono,ui-monospace,monospace);letter-spacing:-.01em;font-variant-numeric:tabular-nums;color:var(--ba-mut);color:color-mix(in srgb,var(--ba-fg) 72%,var(--ba-bg))}

/* the invitation pill: quiet, small, bottom centre; fades in after the intro and goes at the first touch */
.ba-hint{position:absolute;left:50%;bottom:14px;z-index:3;pointer-events:none;opacity:0;translate:-50% 6px;transition:opacity .6s ease,translate .6s cubic-bezier(.22,1,.36,1);height:32px;display:flex;align-items:center;padding:0 16px;white-space:nowrap;border-radius:var(--ba-pill);font-family:var(--ba-glass-font);font-size:14px;font-weight:500;line-height:1;letter-spacing:.03em;color:var(--ba-glass-fg);background:var(--ba-glass);-webkit-backdrop-filter:blur(12px) saturate(1.5);backdrop-filter:blur(12px) saturate(1.5);border:1px solid var(--ba-glass-line)}
.ba-hint.ba-on,.ba-hz .ba-hint{opacity:.95;translate:-50% 0}
.ba-sm .ba-hint{bottom:10px;height:28px;padding:0 13px;font-size:13px}
.ba-cmp .ba-hint{display:none}

/* phones: the magnifier glass floats above the image (it may leave the picture's edge; it only ever shows the picture) */
.ba-dl{position:absolute;left:0;top:0;display:none;z-index:8;pointer-events:none;will-change:transform,opacity}
.ba-dlg{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;pointer-events:auto;touch-action:none;cursor:grab;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;
 box-shadow:0 0 0 1px rgba(255,255,255,.3),0 14px 34px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.35);transition:box-shadow .25s ease}
.ba-dlg::after{content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;
 background:radial-gradient(120% 90% at 30% 8%,rgba(255,255,255,.2),rgba(255,255,255,0) 45%),radial-gradient(closest-side,rgba(0,0,0,0) 78%,rgba(0,0,0,.28) 100%);
 box-shadow:inset 0 0 0 1px rgba(255,255,255,.18),inset 0 0 18px rgba(255,255,255,.1)}
.ba-dli{position:absolute;left:0;top:0;will-change:transform}
.ba-dli img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;pointer-events:none;-webkit-user-drag:none}
.ba-dli img+img{opacity:0}
.ba-dlh{position:absolute;left:50%;top:calc(100% + 12px);width:22px;height:22px;margin-left:-11px;border-radius:50%;background:#fff;pointer-events:auto;touch-action:none;
 box-shadow:0 0 0 4px rgba(255,255,255,.18),0 4px 14px rgba(0,0,0,.45);transition:transform .25s cubic-bezier(.22,1,.36,1),box-shadow .25s ease}
.ba-dlh::before{content:"";position:absolute;inset:-16px}
.ba-dl.ba-up .ba-dlh{top:auto;bottom:calc(100% + 12px)}
.ba-dl.ba-held .ba-dlh{transform:scale(.86);box-shadow:0 0 0 7px rgba(255,255,255,.14),0 4px 14px rgba(0,0,0,.45)}
.ba-dl.ba-held .ba-dlg{cursor:grabbing}

/* inside the photo viewer the page never scrolls under a finger: the stage handles its own gestures */
dialog .ba-stage{touch-action:none}

/* phones: control bar = Before/After + Magnify on one line, the magnification slider on its own centred line */
@media (max-width:700px){
 .ba-bar{gap:8px;margin-top:10px}
 .ba-wk{padding:0}
}

/* Magnify switch: an icon at the right end of the control row, under the photo; same look as the Before/After switch */
.ba-bar{position:relative}
.ba-bar .ba-lpb{position:absolute;right:0;top:0;width:var(--ba-lpb,38px);height:var(--ba-lpb,38px);padding:0;margin:0;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ba-pill);color:var(--ba-mut)}
.ba-bar .ba-lpb[hidden]{display:none}
.ba-bar .ba-lpb:hover{color:var(--ba-fg)}
.ba-bar .ba-lpb[aria-pressed="true"]{color:var(--ba-fg)}

/* the glass canvas: bigger than the photo, clear everywhere the glass is not */
.ba-lc{position:absolute;display:none;z-index:7;pointer-events:none}
.ba-dl.ba-gl .ba-dlg{box-shadow:none;background:none}
.ba-dl.ba-gl .ba-dlg::after,.ba-dl.ba-gl .ba-dli{display:none}

/* the glass: on mouse it simply follows the pointer; the handle and drag are for touch only */
.ba-dlg{pointer-events:none}
.ba-dlh{display:none}
.ba-dl.ba-touch .ba-dlg{pointer-events:auto}
.ba-dl.ba-touch .ba-dlh{display:block}

/* tapped hotspot: dot and line fade out, the label settles bottom middle as a glass tag (same as Before / After) */
.ba-hs b{transition:opacity .45s ease,transform .5s cubic-bezier(.22,1,.36,1)}
.ba-hs span::before{transition:opacity .35s ease}
.ba-hs.ba-set b,.ba-hs.ba-set span::before{opacity:0}
.ba-hs.ba-set b{transform:scale(.3)}
.ba-hs.ba-set b::after{animation:none}
.ba-tap .ba-hs.ba-set::before{display:none}
.ba-stage.ba-tap .ba-hs.ba-set span,.ba-stage.ba-tap .ba-hs.ba-set:hover span{background:var(--ba-cl-bg,rgba(23,24,26,.36));color:var(--ba-cl-fg,#fff);pointer-events:none}

/* zoom-out X, right beside the hotspot label while it is zoomed (js sets its position, size and opacity) */
.ba-hx{position:absolute;z-index:5;left:0;top:0;width:32px;height:32px;padding:0;border-radius:50%;display:grid;place-items:center;opacity:0;pointer-events:none;cursor:pointer;color:var(--ba-glass-fg);background:var(--ba-glass);-webkit-backdrop-filter:blur(12px) saturate(1.5);backdrop-filter:blur(12px) saturate(1.5);border:1px solid var(--ba-glass-line);box-shadow:0 4px 18px rgba(0,0,0,.28);-webkit-tap-highlight-color:transparent;transition:background .25s,color .25s}
.ba-hx:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:2px}
@media (hover:hover) and (pointer:fine){.ba-hx:hover{background:var(--ba-solid);color:var(--ba-solid-fg);border-color:var(--ba-solid)}}
.ba-cmp .ba-hx{display:none}

/* hotspots are plain labels now: no dot, no line, and the tap area is the label itself */
.ba-hs b,.ba-hs span::before,.ba-tap .ba-hs::before{display:none !important}
.ba-hs span{left:0;top:0}
.ba-hs{cursor:default}.ba-tap .ba-hs{cursor:pointer}

/* simple slider with the blur intro (option "sintro"): Before blurs into After while the slider is still hidden, then it fades in */
.ba-ci .ba-cline,.ba-ci .ba-cgrip,.ba-ci .ba-cl{opacity:0 !important}
.ba-ci .ba-cb{opacity:0;filter:blur(18px);will-change:opacity,filter}
.ba-ci .ba-stage>.ba-img{will-change:filter}
.ba-ci-run .ba-cb{opacity:1;filter:blur(0);transition:opacity var(--ba-ci-dur,3.5s) cubic-bezier(.4,0,.2,1),filter var(--ba-ci-dur,3.5s) cubic-bezier(.3,0,.2,1)}
.ba-ci-run .ba-stage>.ba-img{filter:blur(16px);transition:filter var(--ba-ci-dur,3.5s) cubic-bezier(.4,0,.2,1)}
.ba-ci-ui .ba-cline,.ba-ci-ui .ba-cgrip{animation:ba-ci-ui 1s cubic-bezier(.3,0,.2,1) both}   /* the labels are not faded: they stand where the Fold's tags stood, so they must not blink */
@keyframes ba-ci-ui{from{opacity:0}}
@media (prefers-reduced-motion:reduce){.ba-ci .ba-cb{opacity:1;filter:none}.ba-ci .ba-cline,.ba-ci .ba-cgrip,.ba-ci .ba-cl{opacity:1 !important}}
/* the last Fold frame fades out over the slider after the intro (ghostIn in ba-viewer.js); labels, line and grip stay above it */
.ba-ghost{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:1;pointer-events:none;opacity:1;transition:opacity .45s cubic-bezier(.4,0,.2,1)}
.ba-ghost.ba-ghost-out{opacity:0}
.ba-cmp .ba-cl,.ba-cmp .ba-cline,.ba-cmp .ba-cgrip{z-index:2}
