/* bgremove-act.css — "The Cutout" principal act (tools/remove-background only).
 * Pinned scroll cinema: photographic backdrop, JS-first (hidden until live),
 * transform/opacity animation only. All classes namespaced .ract-*. */
#bgremove-act { position: relative; background: #0b0d12; color: #fff; overflow: clip; }
.ract-bg { position: absolute; inset: 0; z-index: 0; }
.ract-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ract-bg-scrim { position: absolute; inset: 0; background: rgba(7, 9, 13, 0.80); }
.ract-pin { position: relative; z-index: 1; height: 100vh; height: 100svh; overflow: hidden; }
.ract-inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 76px clamp(16px, 4vw, 64px) clamp(12px, 3vh, 36px); visibility: hidden; }
#bgremove-act.ract-live .ract-inner { visibility: visible; }
#bgremove-act.ract-dead { display: none; }

#bgremove-act h2, #bgremove-act h3, #bgremove-act p { opacity: 1; }
#bgremove-act h2.in, #bgremove-act h3.in, #bgremove-act p.in,
#bgremove-act h2.done, #bgremove-act h3.done, #bgremove-act p.done { animation: none; opacity: 1; }

.ract-head { position: relative; z-index: 5; max-width: 1200px; margin: 0 auto 1vh; width: 100%; }
.ract-chapters { position: relative; min-height: clamp(110px, 19vh, 200px); }
.ract-ch { position: absolute; inset: 0; opacity: 0; visibility: hidden; max-width: 680px; }
.ract-ch.is-on { opacity: 1; visibility: visible; }
.ract-kicker { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #ffd98a; margin: 0 0 10px; font-weight: 700; }
.ract-ctitle { font-size: clamp(30px, 4.6vw, 58px); line-height: 1.04; margin: 0 0 12px; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.ract-ctitle .ract-cw { display: inline-block; }
.ract-cdesc { font-size: clamp(14px, 1.5vw, 18px); line-height: 1.55; color: rgba(255, 255, 255, 0.82); margin: 0; max-width: 50ch; }
.ract-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.ract-pbar { position: relative; width: min(320px, 40vw); height: 3px; background: rgba(255, 255, 255, 0.18); border-radius: 3px; overflow: hidden; }
.ract-pbar i { position: absolute; inset: 0; width: 100%; background: #ffd98a; border-radius: 3px; transform: scaleX(0); transform-origin: 0 50%; }
.ract-dots { display: flex; gap: 7px; }
.ract-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.ract-dots i.is-on { background: #ffd98a; }

.ract-stage { position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 48px); width: 100%; max-width: 1240px; margin: 0 auto; flex: 1; min-height: 0; }
.ract-frame { position: relative; width: min(360px, 44vw); aspect-ratio: 4/5; border-radius: 18px; overflow: hidden; background: #14161c; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); flex: 0 0 auto; }
.ract-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ract-tag { position: absolute; left: 12px; bottom: 12px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(0, 0, 0, 0.55); color: #fff; padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(4px); }
.ract-photo { position: absolute; inset: 0; }
.ract-scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #ffd98a; box-shadow: 0 0 24px 4px rgba(255, 217, 138, 0.8); opacity: 0; }
.ract-bgdrop { position: absolute; inset: 0; background: rgba(20, 22, 28, 0.72); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding-top: 18px; opacity: 0; }
.ract-bgdrop span { font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); border: 1px dashed rgba(255, 255, 255, 0.4); padding: 8px 16px; border-radius: 999px; }
.ract-checker { position: absolute; inset: 0; opacity: 0;
  background-image: linear-gradient(45deg, #2a2d36 25%, transparent 25%), linear-gradient(-45deg, #2a2d36 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2a2d36 75%), linear-gradient(-45deg, transparent 75%, #2a2d36 75%);
  background-size: 28px 28px; background-position: 0 0, 0 14px, 14px -14px, -14px 0; background-color: #1d2027; }
.ract-cutout { position: absolute; inset: 6%; opacity: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.ract-edge { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.ract-wipe { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.ract-wipe-before, .ract-wipe-after { position: absolute; inset: 0; }
.ract-wipe-after { clip-path: inset(0 0 0 50%); }
.ract-wipe-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.ract-wipe-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.6); }
.ract-wipe-handle span { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #14161a; font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.ract-wipe-handle span::before { content: "‹›"; letter-spacing: -2px; }

.ract-side { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.ract-drops { display: flex; gap: 12px; }
.ract-drops figure { margin: 0; width: 108px; cursor: pointer; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: rgba(255, 255, 255, 0.06); }
.ract-drops figure.on { border-color: #ffd98a; }
.ract-drops img { width: 100%; height: 76px; object-fit: cover; display: block; }
.ract-drops figcaption { font-size: 11px; font-weight: 700; text-align: center; padding: 7px 4px; color: rgba(255, 255, 255, 0.8); }
.ract-facts { display: flex; flex-wrap: wrap; gap: 8px; max-width: 280px; justify-content: center; opacity: 0; }
.ract-fact { font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: rgba(255, 217, 138, 0.12); border: 1px solid rgba(255, 217, 138, 0.45); color: #ffe9bd; }

.ract-cta { position: relative; z-index: 5; display: flex; gap: 12px; justify-content: center; margin-top: 1.6vh; opacity: 0; }
.ract-btn { appearance: none; border: 0; cursor: pointer; padding: 13px 30px; border-radius: 999px; background: #ffd98a; color: #14161a; font-weight: 800; font-size: 15px; text-decoration: none; display: inline-block; }
.ract-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }

@media (max-width: 900px) {
  .ract-stage { flex-direction: column; }
  .ract-frame { width: min(300px, 70vw); }
  .ract-facts { max-width: none; }
}

/* ---- Remove Background: erase/restore edge-refinement (added 2026-10-04) ---- */
.rb-shot canvas { width: 100%; border-radius: var(--radius-input); border: 1px solid var(--line); display: block; }
.rb-shot canvas.checker {
  background-image: linear-gradient(45deg, #dfe3ea 25%, transparent 25%), linear-gradient(-45deg, #dfe3ea 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dfe3ea 75%), linear-gradient(-45deg, transparent 75%, #dfe3ea 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.rb-shot canvas.rb-paint { cursor: crosshair; touch-action: none; }
.rb-refine { border: 1px solid var(--line); border-radius: var(--radius-input); background: #fff; padding: 1rem 1.15rem; margin: 1rem 0; }
.rb-refine[hidden] { display: none; }
.rb-refine-bar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.rb-refine-label { font-weight: 800; font-size: .95rem; }
.rb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.rb-seg button { appearance: none; border: 0; background: #fff; color: var(--ink, #1c1526); font-weight: 700; font-size: .9rem; padding: .55rem 1.1rem; min-height: 44px; cursor: pointer; }
.rb-seg button + button { border-left: 1px solid var(--line); }
.rb-seg button.on { background: var(--violet); color: #fff; }
.rb-brush { display: inline-flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 600; }
.rb-brush input[type="range"] { width: 130px; accent-color: var(--violet); min-height: 44px; }
.rb-brush span { min-width: 52px; font-variant-numeric: tabular-nums; }
.btn.sm { padding: .6rem 1.2rem; font-size: .9rem; min-height: 44px; }
body.ts-dark .rb-refine { background: #14161c; }
body.ts-dark .rb-seg button { background: #1d2027; color: #fff; }
body.ts-dark .rb-seg button.on { background: var(--violet); color: #fff; }

/* ---- reduced motion: static stacked chapters + static before/after ---- */
@media (prefers-reduced-motion: reduce) {
  .ract-pin { height: auto; overflow: visible; }
  .ract-inner { position: static; visibility: visible; padding-bottom: 48px; }
  .ract-chapters { min-height: 0; }
  .ract-ch { position: static; opacity: 1; visibility: visible; margin: 0 0 26px; }
  .ract-progress { display: none; }
  .ract-scan, .ract-edge, .ract-bgdrop, .ract-checker, .ract-photo, .ract-cutout { display: none; }
  .ract-wipe { opacity: 1; visibility: visible; }
  .ract-facts { opacity: 1; }
  .ract-cta { opacity: 1; }
}
