/* SIDE B — camera kit (finder → shutter → print / film strip / rangefinder object)
   Pairs with camera.js. Everything is prefixed .sbc- and sized in container units,
   so each piece scales with the box it is put in. */

.sbc{
  --sbc-ink:#0e0e0d; --sbc-paper:#faf6ee; --sbc-y:#ffc629; --sbc-r:#ff5a3c;
  --sbc-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='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.7 0 0 0 -.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --sbc-fibre:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5 .9' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .32 0 0 0 0 .2 1.4 0 0 0 -.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-sizing:border-box;
}
.sbc *,.sbc *::before,.sbc *::after{box-sizing:border-box}

/* ───────────────────────── A. finder → shutter → print ───────────────────────── */

.sbc-finder{container-type:inline-size;display:block;position:relative;width:100%;max-width:var(--sbc-max,600px);margin:0 auto;padding:0;color:inherit}
.sbc-stage{position:relative;width:100%;aspect-ratio:100/72;-webkit-tap-highlight-color:transparent;outline:none;user-select:none;-webkit-user-select:none}
.sbc-finder.sbc-replayable[data-state=print] .sbc-stage{cursor:pointer}
.sbc-stage:focus-visible{outline:2px solid var(--sbc-y);outline-offset:4px}
.sbc-finder img{display:block;-webkit-user-drag:none}

/* — looking through the eyepiece: no body, only the dark the eye sees around the screen.
     .sbc-dark is that darkness (blurred, so its edge is the out-of-focus rim of the cup),
     .sbc-view clips what is seen, .sbc-rim lays the same soft rim back over the corners. — */
.sbc-vf{position:absolute;inset:0;transition:opacity .35s ease}
.sbc-dark{position:absolute;inset:7cqw 3cqw;border-radius:19cqw/17cqw;background:#070706;filter:blur(2.3cqw)}
.sbc-view{position:absolute;inset:9cqw 5cqw;border-radius:17cqw/15cqw;overflow:hidden;isolation:isolate}
.sbc-rim{position:absolute;inset:7cqw 3cqw;border-radius:19cqw/17cqw;box-shadow:inset 0 0 4.4cqw 3.7cqw #070706;filter:blur(1.5cqw);pointer-events:none}

/* — the focusing screen — */
.sbc-win{position:absolute;left:4cqw;top:3.67cqw;width:70cqw;height:46.67cqw;border-radius:.9cqw;overflow:hidden;background:#1a1815;
  box-shadow:0 0 0 .12cqw rgba(255,240,210,.09),0 0 2.4cqw rgba(255,214,150,.07)}
.sbc-sway{position:absolute;inset:-1.6cqw;animation:sbc-sway 7.5s ease-in-out infinite}
.sbc-sway img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.sbc-sway .sbc-soft{filter:blur(.85cqw) brightness(1.04);transform:scale(1.07);transition:opacity 1.15s cubic-bezier(.5,0,.2,1),transform 1.15s cubic-bezier(.5,0,.2,1);will-change:opacity}
.sbc-sway .sbc-sharp{transform:scale(1.035);transition:transform 1.15s cubic-bezier(.5,0,.2,1)}
.sbc-screen{position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(ellipse 74% 78% at 50% 50%,transparent 52%,rgba(0,0,0,.34) 86%,rgba(0,0,0,.62) 100%),
    repeating-radial-gradient(circle at 50% 50%,rgba(255,255,255,.028) 0 .22cqw,transparent .22cqw .66cqw),
    linear-gradient(rgba(28,34,16,.16),rgba(28,34,16,.16))}
.sbc-screen::after{content:"";position:absolute;inset:0;background:var(--sbc-grain);background-size:150px;opacity:.14}

/* split-image wedge + microprism collar */
.sbc-split{position:absolute;inset:0;clip-path:circle(5.15cqw at 50% 50%)}
.sbc-half{position:absolute;inset:0;overflow:hidden}
.sbc-half-a{clip-path:inset(0 0 50% 0)}
.sbc-half-b{clip-path:inset(50% 0 0 0)}
.sbc-half>div{position:absolute;inset:-1.6cqw;transition:transform 1.15s cubic-bezier(.5,0,.2,1)}
.sbc-half img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform:scale(1.035);filter:brightness(1.12)}
.sbc-half-a>div{transform:translateX(-1.7cqw)}
.sbc-half-b>div{transform:translateX(1.7cqw)}
.sbc-collar{position:absolute;left:50%;top:50%;width:17.2cqw;height:17.2cqw;margin:-8.6cqw 0 0 -8.6cqw;border-radius:50%;pointer-events:none;
  background:
    repeating-conic-gradient(from 45deg,rgba(255,250,235,.26) 0 25%,rgba(0,0,0,.2) 0 50%) 0 0/.44cqw .44cqw;
  -webkit-mask:radial-gradient(circle,transparent 0 5.2cqw,#000 5.35cqw 8.35cqw,transparent 8.5cqw);
          mask:radial-gradient(circle,transparent 0 5.2cqw,#000 5.35cqw 8.35cqw,transparent 8.5cqw);
  transition:opacity 1.05s ease .05s}
.sbc-etch{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.sbc-etch .e{fill:none;stroke:rgba(8,8,6,.5);stroke-width:.5;vector-effect:non-scaling-stroke}
.sbc-etch .b{fill:none;stroke:#fff3c4;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:.9;vector-effect:non-scaling-stroke;transition:opacity .4s}
.sbc-etch .g{fill:none;stroke:#ffd76a;stroke-width:4.5;stroke-linecap:round;opacity:.16;vector-effect:non-scaling-stroke}

/* match-needle meter in the dark, right of the screen */
.sbc-meter{position:absolute;left:76.4cqw;top:9.5cqw;width:9cqw;height:35cqw;font:700 2.25cqw/1 "Zen Kaku Gothic New",system-ui,sans-serif;color:#f3e3bd;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.sbc-meter i{position:absolute;left:0;width:4.6cqw;text-align:right;font-style:normal;opacity:.62;transform:translateY(-50%)}
.sbc-meter i::after{content:"";position:absolute;left:5.2cqw;top:50%;width:1cqw;height:.16cqw;background:currentColor;opacity:.8}
.sbc-meter u{position:absolute;left:5.1cqw;width:1.2cqw;height:3.4cqw;background:#ff5a3c;opacity:.82;border-radius:.1cqw}
.sbc-meter u:first-of-type{top:-1.6cqw}
.sbc-meter u:last-of-type{bottom:-1.6cqw}
.sbc-needle{position:absolute;right:-5.5cqw;top:50%;width:9.4cqw;height:0;transform-origin:100% 50%;transform:rotate(31deg);transition:transform 1.3s cubic-bezier(.3,1.5,.4,1)}
.sbc-needle b{position:absolute;inset:-.15cqw 0 auto 0;height:.3cqw;background:linear-gradient(90deg,#fff6d8,#c9b98f);border-radius:.2cqw;transform-origin:100% 50%;animation:sbc-tremble 2.9s ease-in-out infinite;box-shadow:0 0 .5cqw rgba(255,226,150,.35)}
.sbc-lamp{position:absolute;left:38.35cqw;top:48.55cqw;width:1.3cqw;height:1.3cqw;border-radius:50%;background:#2b1d0c;box-shadow:0 0 0 .3cqw rgba(0,0,0,.55);transition:background .2s,box-shadow .2s}

/* light behind the blades + the blades */
.sbc-light{position:absolute;inset:0;background:radial-gradient(circle at 46% 50%,#fffdf6 0,#fff1cf 55%,#ffd98a 100%);opacity:0}
.sbc-iris{position:absolute;left:50%;top:50%;width:132cqw;height:132cqw;margin:-66cqw 0 0 -66cqw;visibility:hidden;pointer-events:none}
.sbc-blade{transform:rotate(var(--sbc-open,-67deg));transition:transform .24s cubic-bezier(.45,0,.55,1)}

.sbc-bloom{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;
  background:radial-gradient(closest-side,#fffdf5 0,rgba(255,247,224,.96) 52%,rgba(255,240,205,.5) 78%,rgba(255,236,196,0) 100%)}

/* — the print — */
.sbc-print{position:absolute;left:5cqw;top:50%;width:90cqw;margin-top:-31.4cqw;transform:rotate(-1.3deg);opacity:0;visibility:hidden;transition:opacity .3s ease,visibility 0s .3s}
.sbc-print::before,.sbc-print::after{content:"";position:absolute;z-index:-1;bottom:2.4cqw;width:46%;height:22%;box-shadow:0 2.6cqw 2.2cqw rgba(0,0,0,.5)}
.sbc-print::before{left:1.6cqw;transform:rotate(-3.2deg)}
.sbc-print::after{right:1.6cqw;transform:rotate(3.6deg)}
.sbc-paper{position:relative;padding:4.1cqw;border-radius:.3cqw;
  background:linear-gradient(176deg,#fffdf8 0%,#f8f3e8 60%,#f1eadc 100%);
  box-shadow:
    inset 0 .12cqw 0 rgba(255,255,255,.95),
    inset 0 0 0 .1cqw rgba(120,100,70,.1),
    0 .26cqw 0 #d2c9b7,
    0 .34cqw .1cqw rgba(60,45,25,.45),
    0 .9cqw 1.4cqw rgba(0,0,0,.2)}
.sbc-paper::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sbc-fibre);background-size:240px;opacity:.38;pointer-events:none}
.sbc-paper::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(190deg,rgba(0,0,0,0) 70%,rgba(70,50,20,.07) 100%)}
.sbc-photo{position:relative;aspect-ratio:3/2;overflow:hidden;background:#221f1b}
.sbc-photo>img{width:100%;height:100%;object-fit:cover;filter:sepia(.16) saturate(1.08) contrast(1.04) brightness(1.01)}
.sbc-photo::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:var(--sbc-grain);background-size:130px;opacity:.2;mix-blend-mode:overlay}
.sbc-photo::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:radial-gradient(ellipse at 50% 50%,transparent 60%,rgba(20,10,0,.18) 100%);
  box-shadow:inset 0 0 0 .1cqw rgba(0,0,0,.14)}
.sbc-finder[data-tone=cold] .sbc-photo>img{filter:saturate(.38) contrast(1.1) brightness(.92)}
.sbc-finder[data-tone=cold] .sbc-photo::after{background:linear-gradient(rgba(60,120,150,.2),rgba(30,70,110,.24)),radial-gradient(ellipse at 50% 50%,transparent 55%,rgba(0,8,24,.3) 100%)}
.sbc-finder[data-tone=cold] .sbc-sway img,.sbc-finder[data-tone=cold] .sbc-half img{filter:saturate(.7)}
.sbc-finder[data-tone=cold] .sbc-sway .sbc-soft{filter:blur(.85cqw) saturate(.7)}
.sbc-date{position:absolute;z-index:3;right:4.2%;bottom:5.2%;height:7%;width:auto;overflow:visible;mix-blend-mode:screen;opacity:.94}

.sbc-foot{display:block;margin-top:.6cqw;text-align:center}
.sbc-cap{display:block;min-height:1.9em;font:600 clamp(15px,4.5cqw,25px)/1.9 "Klee One","Zen Kaku Gothic New",sans-serif;letter-spacing:.04em;transform:rotate(-1.1deg);opacity:0;transition:opacity .7s ease .55s}
.sbc-note{display:block;margin-top:.5em;font:500 11px/1.6 "Zen Kaku Gothic New",system-ui,sans-serif;letter-spacing:.06em;opacity:.55}

/* — states — */
.sbc-finder:not([data-state=idle]) .sbc-sway .sbc-soft{opacity:0;transform:scale(1.035)}
.sbc-finder:not([data-state=idle]) .sbc-half>div{transform:none}
.sbc-finder:not([data-state=idle]) .sbc-collar{opacity:0}
.sbc-finder:not([data-state=idle]) .sbc-needle{transform:rotate(0deg)}
.sbc-finder:not([data-state=idle]) .sbc-needle b{animation-play-state:paused}
.sbc-finder:not([data-state=idle]) .sbc-lamp{background:#ffc629;box-shadow:0 0 0 .3cqw rgba(0,0,0,.55),0 0 1.4cqw .5cqw rgba(255,190,40,.6);transition-delay:1.05s}
.sbc-finder:not([data-state=idle]) .sbc-sway{animation-play-state:paused}

.sbc-finder[data-state=shut] .sbc-iris,.sbc-finder[data-state=expose] .sbc-iris{visibility:visible}
.sbc-finder[data-state=shut] .sbc-blade{transform:rotate(0deg);transition:transform .15s cubic-bezier(.5,0,.9,.6)}
.sbc-finder[data-state=shut] .sbc-light{opacity:1;transition:opacity 0s .17s}
.sbc-finder[data-state=expose] .sbc-light{opacity:1}
.sbc-finder[data-state=expose] .sbc-bloom{opacity:1;transition:opacity .2s ease-in .06s}
.sbc-finder[data-state=print] .sbc-bloom{opacity:0;transition:opacity .75s cubic-bezier(.3,0,.3,1)}
.sbc-finder[data-state=print] .sbc-vf{opacity:0;visibility:hidden;transition:none}
.sbc-finder[data-state=print] .sbc-print{opacity:1;visibility:visible;transition:none;animation:sbc-settle .8s cubic-bezier(.2,.85,.25,1) both}
.sbc-finder[data-state=print] .sbc-cap{opacity:1}
.sbc-finder.sbc-static .sbc-print{animation:none}
.sbc-finder.sbc-static .sbc-cap{transition:none}
.sbc-finder.sbc-paused .sbc-sway,.sbc-finder.sbc-paused .sbc-needle b{animation-play-state:paused}

@keyframes sbc-sway{0%,100%{transform:translate(.35cqw,-.2cqw)}30%{transform:translate(-.3cqw,.25cqw)}62%{transform:translate(.1cqw,.4cqw)}82%{transform:translate(-.4cqw,-.1cqw)}}
@keyframes sbc-tremble{0%,100%{transform:rotate(-2.5deg)}22%{transform:rotate(3deg)}47%{transform:rotate(-1deg)}71%{transform:rotate(4deg)}}
@keyframes sbc-settle{0%{opacity:0;transform:translateY(-2.6cqw) rotate(1.4deg) scale(1.045)}35%{opacity:1}100%{opacity:1;transform:rotate(-1.3deg)}}

/* ───────────────────────── B. film strip ───────────────────────── */

.sbc-strip{--sbc-h:clamp(186px,52vw,270px);--u:calc(var(--sbc-h) / 35);
  display:block;width:100%;max-width:100%;height:calc(var(--sbc-h) + 54px);padding:14px 20px 40px;
  overflow-x:auto;overflow-y:hidden;touch-action:pan-x pan-y;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.sbc-strip::-webkit-scrollbar{display:none}
.sbc-strip.sbc-grab{cursor:grab}
.sbc-strip.sbc-grabbing{cursor:grabbing;user-select:none}
.sbc-track{position:relative;height:var(--sbc-h);width:calc(var(--u) * var(--sbc-w));filter:drop-shadow(0 1px 0 rgba(0,0,0,.5)) drop-shadow(0 12px 9px rgba(0,0,0,.42))}
.sbc-track svg{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none}
.sbc-track .sbc-gloss{z-index:2}
.sbc-cell{position:absolute;top:calc(var(--u) * 5.5);width:calc(var(--u) * 36);height:calc(var(--u) * 24);border-radius:calc(var(--u) * .45);overflow:hidden;background:#0a0908;margin:0}
.sbc-cell img{display:block;width:100%;height:100%;object-fit:cover;filter:saturate(1.1) contrast(1.05) sepia(.08);-webkit-user-drag:none;user-select:none}
.sbc-cell[data-tone=cold] img{filter:saturate(.4) contrast(1.1) brightness(.92)}
.sbc-cell::after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 calc(var(--u) * 1.4) rgba(0,0,0,.55)}
.sbc-cell[data-tone=cold]::after{background:linear-gradient(rgba(60,120,150,.2),rgba(30,70,110,.24))}
.sbc-edge{font-family:"Zen Kaku Gothic New",system-ui,sans-serif;font-weight:700;fill:#ffc629}
.sbc-edge-n{font-family:"Zen Kaku Gothic New",system-ui,sans-serif;font-weight:900;fill:#ffc629}

/* ───────────────────────── C. the rangefinder ───────────────────────── */

.sbc-cam{--sbc-cam-body:var(--sbc-y);--sbc-cam-plate:#f6f0e2;--sbc-cam-ink:#161513;--sbc-cam-trim:#57514a;--sbc-cam-accent:var(--sbc-r);
  display:inline-block;width:var(--sbc-cam-w,148px);aspect-ratio:240/170;vertical-align:middle;flex:none}
.sbc-cam svg{display:block;width:100%;height:100%;overflow:visible}
.sbc-cam text{font-family:"Fraunces",Georgia,serif}
.sbc-cam-lever{transform-box:fill-box;transform-origin:100% 58%;animation:sbc-wind 9s cubic-bezier(.3,0,.2,1) infinite}
.sbc-cam-btn{animation:sbc-press 9s ease infinite}
.sbc-cam-glint{transform-box:fill-box;transform-origin:50% 50%;animation:sbc-glint 9s ease-in-out infinite}
.sbc-cam-sheen{transform-box:fill-box;transform-origin:50% 50%;animation:sbc-sheen 9s ease-in-out infinite}
.sbc-cam-leaf{transform-box:fill-box;transform-origin:50% 50%;animation:sbc-leaf 9s linear infinite}
@keyframes sbc-press{0%,5.5%,100%{transform:none}2%,4%{transform:translateY(2.2px)}}
@keyframes sbc-leaf{0%,2.2%,6%,100%{transform:scale(1)}3.2%,4.6%{transform:scale(.12)}}
@keyframes sbc-glint{0%,3%,17%,100%{transform:scale(0) rotate(0deg);opacity:0}8%{transform:scale(1) rotate(40deg);opacity:1}13%{transform:scale(.55) rotate(70deg);opacity:.8}}
@keyframes sbc-sheen{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-16deg)}}
@keyframes sbc-wind{0%,20%,37%,100%{transform:rotate(0deg)}26%{transform:rotate(17deg)}29%{transform:rotate(17deg)}34%{transform:rotate(-2deg)}}

@media (prefers-reduced-motion:reduce){
  .sbc-sway,.sbc-needle b,.sbc-cam-lever,.sbc-cam-btn,.sbc-cam-glint,.sbc-cam-sheen,.sbc-cam-leaf{animation:none}
  .sbc-cam-glint{opacity:.9}
  .sbc-finder *{transition:none!important}
  .sbc-finder[data-state=print] .sbc-print{animation:none}
}
