/* Production page: conditions stage + Steenbeck */

/* ---------- on set ---------- */
.set { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: clamp(16px, 2vw, 28px); }
.set-stage {
  position: relative; height: clamp(440px, 68vh, 760px); border-radius: var(--radius); overflow: hidden;
  background: var(--stage-bg); border: 1px solid var(--line); perspective: 1400px; perspective-origin: 50% 46%; isolation: isolate;
  --lx: 50%; --ly: 45%;
}
.set-world { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.sc {
  position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--card-bg); box-shadow: var(--card-shadow); overflow: hidden; will-change: transform, opacity; transform-origin: 50% 50%;
  backface-visibility: hidden; color: #fff;
}
.sc-m, .sc-m img, .sc-m video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.sc-m img { transition: transform 0.9s var(--ease-out); }
.sc-m video { opacity: 0; transition: opacity 0.25s; }
.sc-m video.on { opacity: 1; }
.sc::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, calc(var(--lt, 0) * 0.16)), transparent 46%); }
.sc-t { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 18px 8px 6px; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); opacity: 0; transition: opacity 0.25s; }
.sc:hover .sc-t, .sc:focus-visible .sc-t { opacity: 1; }
.sc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-stage[data-mode='macro'] .sc-m img, .set-stage[data-mode='macro'] .sc-m video { transform: scale(1.45); }
.set-stage[data-mode='solo'] .sc { box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85); }
/* night: everything sinks into darkness, the pointer is a flashlight */
.set-light { position: absolute; inset: 0; z-index: 5000; pointer-events: none; opacity: 0; transition: opacity 0.7s; background: radial-gradient(circle at var(--lx) var(--ly), transparent 0, transparent 12%, rgba(3, 3, 4, 0.5) 22%, rgba(3, 3, 4, 0.9) 38%); }
.set-stage[data-mode='night'] .set-light { opacity: 1; }
.set-stage[data-mode='night'] { background: #050506; }
/* viewfinder */
.set-hud { position: absolute; inset: 0; z-index: 5001; pointer-events: none; color: #fff; font-size: 11px; letter-spacing: 0.08em; }
.set-hud .c { position: absolute; width: 22px; height: 22px; border: 1.5px solid currentColor; opacity: 0.7; }
.set-hud .tl { left: 14px; top: 14px; border-right: 0; border-bottom: 0; }
.set-hud .tr { right: 14px; top: 14px; border-left: 0; border-bottom: 0; }
.set-hud .bl { left: 14px; bottom: 14px; border-right: 0; border-top: 0; }
.set-hud .br { right: 14px; bottom: 14px; border-left: 0; border-top: 0; }
.set-slug { position: absolute; left: 46px; top: 18px; text-transform: uppercase; }
.set-rec { position: absolute; right: 46px; top: 18px; display: flex; gap: 8px; align-items: center; }
.set-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: recblink 1.2s steps(1) infinite; }
.set-rec b { font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes recblink { 50% { opacity: 0.2; } }
.set-hint { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 5001; text-align: center; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); pointer-events: none; margin: 0; }

.set-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.set-modes { display: grid; gap: 6px; }
.set-mode {
  position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) 14px; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; font-weight: 600; font-size: 15px;
  transition: border-color 0.2s, background-color 0.25s;
}
.set-mode b { font-weight: 500; font-size: 11px; color: var(--muted); }
.set-mode i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.set-mode:hover { border-color: var(--line-strong); }
.set-mode[aria-checked='true'] { border-color: var(--text); background: var(--surface); }
.set-mode[aria-checked='true'] i { background: var(--rec); border-color: var(--rec); box-shadow: 0 0 0 4px color-mix(in oklab, var(--rec) 25%, transparent); }
.set-note { margin-top: auto; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.set-note b { display: block; font-family: var(--f-display); font-weight: var(--display-w); font-variation-settings: var(--display-vs); letter-spacing: var(--display-ls); font-size: 22px; margin-bottom: 6px; }
.set-note p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Steenbeck ---------- */
.stb { display: grid; gap: 18px; }
.stb-screen { position: relative; height: min(50vh, 40vw); border-radius: 6px; overflow: hidden; background: #050403; cursor: zoom-in; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9); }
.stb-screen img, .stb-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.stb-screen video { opacity: 0; transition: opacity 0.35s; }
.stb-screen video.on { opacity: 1; }
.stb-screen.jump img { filter: brightness(1.6) blur(1px); }
.stb-flicker { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.stb-flicker::after { content: ''; position: absolute; inset: 0; background: #fff3dc; opacity: 0; animation: flick 0.18s steps(2) infinite; mix-blend-mode: soft-light; }
@keyframes flick { 0% { opacity: 0.02; } 50% { opacity: 0.07; } 100% { opacity: 0.03; } }
.stb-info { position: absolute; left: clamp(14px, 2vw, 26px); bottom: clamp(12px, 2vw, 22px); right: clamp(14px, 2vw, 26px); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); pointer-events: none; }
.stb-info .pg-chip { color: rgba(255, 255, 255, 0.85); }
.stb-n { font-size: 12px; letter-spacing: 0.08em; opacity: 0.8; }
.stb-t { font-family: var(--f-display); font-weight: var(--display-w); font-variation-settings: var(--display-vs); letter-spacing: var(--display-ls); font-size: clamp(18px, 2.2vw, 32px); line-height: 1.1; }
.stb-deck { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.stb-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.stb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stb-btn:hover { border-color: var(--text); }
.stb-strip {
  --film: #2c1e12; --hole: var(--bg);
  position: relative; height: 150px; overflow: hidden; border-radius: 6px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(circle, var(--hole) 0 3.5px, transparent 4px) 0 9px / 20px 20px repeat-x,
    radial-gradient(circle, var(--hole) 0 3.5px, transparent 4px) 0 calc(100% - 9px) / 20px 20px repeat-x,
    var(--film);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.stb-strip.drag { cursor: grabbing; }
.stb-track { position: absolute; left: 0; top: 22px; bottom: 22px; display: flex; gap: 6px; will-change: transform; }
.stb-f { position: relative; flex: none; height: 100%; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #000; opacity: 0.5; transition: opacity 0.25s; }
.stb-f.on { opacity: 1; }
.stb-f img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; filter: sepia(0.25) saturate(0.9); }
.stb-f.on img { filter: none; }
.stb-edge { position: absolute; left: 4px; top: -17px; font-size: 9px; color: rgba(240, 190, 110, 0.75); letter-spacing: 0.06em; }
.stb-gate { position: absolute; left: 50%; top: 14px; bottom: 14px; transform: translateX(-50%); aspect-ratio: 16 / 10.6; border: 2px solid var(--rec); border-radius: 5px; pointer-events: none; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12); }
.stb-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.stb-hint { margin: 0; text-align: center; }

@media (max-width: 900px) {
  .set { grid-template-columns: minmax(0, 1fr); }
  .set-stage { height: min(72svh, 600px); }
  .set-panel { order: -1; }
  .set-panel .pg-hint { display: none; }
  .set-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .set-mode { grid-template-columns: minmax(0, 1fr); justify-items: start; min-height: 54px; padding: 8px 10px; gap: 2px; font-size: 13.5px; }
  .set-mode i { position: absolute; right: 10px; top: 10px; width: 9px; height: 9px; }
  .set-note { order: 3; margin-top: 0; padding: 12px 14px; }
  .set-note b { font-size: 18px; }
  .set-slug { left: 40px; font-size: 10px; } .set-rec { right: 40px; font-size: 10px; } .set-rec b { display: none; }
  .set-hint { display: none; }
  .stb-screen { height: auto; aspect-ratio: 16 / 9; margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
  .stb-deck { grid-template-columns: minmax(0, 1fr); }
  .stb-btn { display: none; }
  .stb-strip { height: 112px; margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
  .stb-track { top: 18px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .stb-flicker::after, .set-rec i { animation: none; }
}
