/* scene-look.css - scenes "Step inside" (#inside, v4-inside-*) and "Versus" (#versus, v4-versus-*).
 * Built on the v4 primitives (screen, gate, slate, switch, transport, key). Grammar: GIVEN = red-orange dashed,
 * CAMERA SEAM = magenta dashed, BLACK = never observed / never given, GENERATED = the picture itself, no outline.
 * A chosen thumbnail is marked below it, never framed (a frame would read as "given"). */

/* =============================================================== STEP INSIDE */
.v4-inside-top {
  display: flex; flex-direction: column; align-items: center; gap: var(--v4-s4);
  margin: 0 auto clamp(26px, 4.4vh, 48px); text-align: center;
}
.v4-inside-head { max-width: 22ch; }

/* 480 px: a 110-degree Perspective view then draws the ERP's centre at 1.03 x its own pixel density, and the zoom
   stops at 1.1 x (DESIGN.md section 7). Wide screens: the window and its deck (map, projection, transport) side by side. */
.v4-inside-stage { max-width: 480px; margin: 0 auto; }
.v4-inside-win {
  --v4-ar: 3 / 2;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.v4-inside-win.is-dragging { cursor: grabbing; }
.v4-inside-win.is-flat { cursor: default; }
.v4-inside-win:focus-visible { outline: 2px solid var(--v4-ink); outline-offset: 6px; box-shadow: var(--v4-shadow); }
.v4-inside-cv { opacity: 0; transition: opacity var(--v4-t2) var(--v4-ease); }
.v4-inside-win.is-drawn .v4-inside-cv { opacity: 1; }
.v4-inside-flat { display: none; }
.v4-inside-win.is-flat .v4-inside-flat { display: block; }
.v4-inside-hint {
  position: absolute; left: 50%; bottom: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 11px 7px 10px;
  background: rgba(12, 12, 14, 0.46); color: #fff;
  font-size: 12.5px; line-height: 1; font-weight: 550; white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity var(--v4-t3) var(--v4-ease), transform var(--v4-t3) var(--v4-ease);
}
.v4-inside-hint svg { width: 24px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
html.v4-js:not(.v4-reduced) .v4-inside-hint svg { animation: v4-inside-sway 2.8s var(--v4-ease-io) infinite; }
@keyframes v4-inside-sway { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.v4-inside-win.is-used .v4-inside-hint, .v4-inside-win:not(.is-drawn):not(.is-flat) .v4-inside-hint { opacity: 0; transform: translate(-50%, 6px); }
.v4-inside-win.is-flat .v4-inside-hint { opacity: 1; transform: translateX(-50%); }
.v4-inside-win.is-flat .v4-inside-hint svg { display: none; }
.v4-inside-look { font-variant-numeric: lining-nums tabular-nums; }
.v4-inside-what { text-wrap: balance; }
/* dataset · split (left) and the view readout (right) share a line only while both are short: two lines are held, so
   neither a longer readout nor another clip moves what is below */
.v4-inside-screen > .v4-slate { min-height: calc(2.9em + var(--v4-s2)); }
/* a cut between clips: a short dip, like a splice */
html.v4-js:not(.v4-reduced) .v4-inside-stage.is-cut .v4-inside-win { animation: v4-inside-cut 0.6s var(--v4-ease) both; }
@keyframes v4-inside-cut { 0% { filter: brightness(1); } 18% { filter: brightness(1.55) saturate(0.35); } 100% { filter: none; } }

.v4-inside-deck {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
  gap: var(--v4-s4) var(--v4-s6);
  max-width: 320px;
  margin-top: var(--v4-s5);
}
@media (min-width: 960px) {
  .v4-inside-stage {
    max-width: none;
    display: grid; grid-template-columns: 480px 320px; justify-content: center; align-items: center;
    column-gap: clamp(36px, 4vw, 64px);
  }
  .v4-inside-deck { margin-top: 0; padding-bottom: 28px; }   /* level with the picture, not with its slate */
}
.v4-inside-map {
  position: relative; aspect-ratio: 2 / 1; overflow: hidden;
  background: var(--v4-paper-2);
  cursor: crosshair; touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
}
.v4-inside-map video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.v4-inside-foot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.v4-inside-foot path {
  fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1.2px rgba(0, 0, 0, 0.85));
}
.v4-inside-map.is-all::after {            /* little planet: the whole frame is in view */
  content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1.6px #fff, inset 0 0 0 2.6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.v4-inside-mapcap { margin-top: 8px; }
.v4-inside-ctl { display: grid; gap: var(--v4-s4); justify-items: start; padding-top: 2px; }
.v4-inside-transport { width: 100%; }
.v4-inside-transport .v4-scrub { min-width: 120px; }

/* the filmstrip: frames that roll (each one is a whole 360-degree frame, so it wraps) */
.v4-inside-strip {
  position: relative;
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-top: clamp(30px, 5vh, 56px);
  padding: 26px max(var(--v4-gutter), calc((100% - var(--v4-max)) / 2)) 30px;
  background:
    repeating-linear-gradient(90deg, var(--v4-line-2) 0 8px, transparent 8px 20px) 0 9px / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--v4-line-2) 0 8px, transparent 8px 20px) 0 calc(100% - 9px) / 100% 5px no-repeat;
  background-attachment: local, local;
  cursor: grab;
}
.v4-inside-strip::-webkit-scrollbar { display: none; }
/* soft edges where more frames wait (set by the script) */
.v4-inside-strip.is-more-r, .v4-versus-strip.is-more-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
}
.v4-inside-strip.is-more-l, .v4-versus-strip.is-more-l {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px);
  mask-image: linear-gradient(90deg, transparent, #000 56px);
}
.v4-inside-strip.is-more-l.is-more-r, .v4-versus-strip.is-more-l.is-more-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.v4-inside-strip.is-dragging { cursor: grabbing; }
.v4-inside-strip.is-dragging .v4-inside-pick { pointer-events: none; }
.v4-inside-pick {
  flex: none; display: grid; gap: 12px; width: 232px; padding: 0;
  border: 0; background: none; text-align: left; color: var(--v4-ink-3);
}
.v4-inside-pick__ph {
  position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden;
  background: var(--v4-paper-2);
  opacity: 0.6; filter: saturate(0.5);
  transition: opacity var(--v4-t2) var(--v4-ease), filter var(--v4-t2) var(--v4-ease), box-shadow var(--v4-t2) var(--v4-ease);
}
.v4-inside-pick__roll {
  position: absolute; left: 0; top: 0; bottom: 0; width: 200%;
  background-repeat: repeat-x; background-size: 50% 100%; background-position: 0 0;
}
.v4-inside-pick:hover .v4-inside-pick__ph, .v4-inside-pick:focus-visible .v4-inside-pick__ph { opacity: 0.92; filter: none; }
.v4-inside-pick[aria-checked="true"] .v4-inside-pick__ph { opacity: 1; filter: none; box-shadow: 0 6px 0 -3px var(--v4-ink); }
html.v4-js:not(.v4-reduced) .v4-inside-pick[aria-checked="true"] .v4-inside-pick__roll,
html.v4-js:not(.v4-reduced) .v4-inside-pick:hover .v4-inside-pick__roll { animation: v4-inside-roll 36s linear infinite; }
@keyframes v4-inside-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.v4-inside-pick__cap { display: grid; gap: 2px; font-size: var(--v4-fs-xs); line-height: 1.3; }
.v4-inside-pick__cap b { color: var(--v4-ink-2); font-weight: 600; font-size: 13.5px; }
.v4-inside-pick[aria-checked="true"] .v4-inside-pick__cap b { color: var(--v4-ink); }
.v4-inside-pick:focus-visible { outline-offset: 6px; }

/* =============================================================== VERSUS */
.v4-versus-top { align-items: end; row-gap: var(--v4-s4); margin-bottom: clamp(28px, 4.4vh, 52px); }
.v4-versus-head { grid-column: 3 / -1; grid-row: 1; justify-self: end; text-align: right; }

.v4-versus { position: relative; }
.v4-versus:focus { outline: none; }
/* one row above the panels: what is compared (tabs) on the left, how it is shown (switches) on the right */
.v4-versus-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px;
  border-bottom: 1px solid var(--v4-line);
}
.v4-versus-bar .v4-versus-switches { padding-bottom: 9px; }
.v4-versus-sub {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 28px; margin: 12px 0 18px;
}
.v4-versus-tabs { display: flex; flex-wrap: wrap; gap: 0 clamp(16px, 2.6vw, 40px); }
.v4-versus-tabs [role="tab"] {
  position: relative; padding: 4px 0 13px; border: 0; background: none;
  font-family: var(--v4-display); font-stretch: 75%; font-weight: 650;
  font-size: clamp(22px, 2.3vw, 34px); line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
  color: var(--v4-ink-4);
  transition: color var(--v4-t1) var(--v4-ease);
}
.v4-versus-tabs [role="tab"] > span[aria-hidden] { font-family: var(--v4-serif); font-stretch: 100%; font-weight: 400; font-size: 0.8em; }
.v4-versus-tabs [role="tab"]:hover { color: var(--v4-ink-3); }
.v4-versus-tabs [role="tab"][aria-selected="true"] { color: var(--v4-ink); }
.v4-versus-tabs [role="tab"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--v4-ink);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--v4-t2) var(--v4-ease);
}
.v4-versus-tabs [role="tab"][aria-selected="true"]::after { transform: none; }
.v4-versus-tabs [role="tab"]:focus-visible { outline-offset: 2px; box-shadow: none; }

.v4-versus-strip {
  display: flex; align-items: center; gap: 5px;
  min-width: 0; max-width: 100%; flex: 0 1 auto;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 6px 2px 12px;
  cursor: grab;
}
.v4-versus-strip::-webkit-scrollbar { display: none; }
.v4-versus-strip.is-dragging { cursor: grabbing; }
.v4-versus-strip.is-dragging .v4-versus-pick { pointer-events: none; }
.v4-versus-group {
  flex: none; margin: 0 3px 0 12px;
  font-size: 11px; line-height: 1; font-weight: 600; letter-spacing: 0.02em; color: var(--v4-ink-3); white-space: nowrap;
}
.v4-versus-group:first-child { margin-left: 0; }
.v4-versus-pick {
  position: relative; flex: none; width: 70px; aspect-ratio: 2 / 1; padding: 0; border: 0;
  background: var(--v4-paper-2); opacity: 0.5;
  transition: opacity var(--v4-t1) var(--v4-ease);
}
.v4-versus[data-kind="persp"] .v4-versus-pick { width: 56px; aspect-ratio: 16 / 9; }
.v4-versus-pick img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.v4-versus-pick:hover { opacity: 0.86; }
.v4-versus-pick[aria-checked="true"] { opacity: 1; }
.v4-versus-pick::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; }
.v4-versus-pick[aria-checked="true"]::after { background: var(--v4-ink); }
.v4-versus-pick:focus-visible { outline-offset: 1px; box-shadow: none; }

.v4-versus-slate { margin: 0; flex: 0 1 auto; }
.v4-versus-slate .v4-versus-what { text-align: right; }
.v4-versus-grid {
  position: relative;
  display: grid; justify-content: center;
  grid-template-columns: repeat(var(--v4-versus-cols, 2), var(--v4-versus-cw, minmax(0, 1fr)));
  gap: 26px 16px;
}
.v4-versus-grid:focus-visible { outline-offset: 10px; }
.v4-versus-cell { position: relative; margin: 0; min-width: 0; }
.v4-versus-view {
  position: relative; overflow: hidden; aspect-ratio: 2 / 1;
  background: var(--v4-paper-2); box-shadow: var(--v4-shadow);
}
.v4-versus-grid--persp .v4-versus-view { aspect-ratio: var(--v4-versus-ar, 16 / 9); }
.v4-versus-view > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.v4-versus-cap { display: grid; justify-items: start; gap: 4px; margin-top: 10px; font-size: 12.5px; line-height: 1.35; color: var(--v4-ink-3); }
/* the method's name: the panel's one label, in the display face (about 1.6-1.8 x the old 13.5 px); PwP's carries the
   ink bar of the tables' own rows (tr.is-ours), not a bigger size or a colour */
.v4-versus-name {
  font-family: var(--v4-display); font-stretch: 75%; font-weight: 650;
  font-size: clamp(21px, 1.7vw, 24px); line-height: 1.05; letter-spacing: 0.004em;
  color: var(--v4-ink-2);
}
.v4-versus-cell.is-ours .v4-versus-name { color: var(--v4-ink); font-weight: 700; padding-left: 9px; border-left: 3px solid var(--v4-ink); }

/* what each method was given (video -> 360): camera slices at t = 0 / the center-view video; black = never given */
.v4-versus-given {
  position: absolute; inset: 0; z-index: 1; background: var(--v4-void);
  opacity: 0; visibility: hidden;
  transition: opacity var(--v4-t2) var(--v4-ease), visibility 0s linear var(--v4-t2);
}
.v4-versus.is-given .v4-versus-given { opacity: 1; visibility: visible; transition: opacity var(--v4-t2) var(--v4-ease), visibility 0s; }
.v4-versus-given > img, .v4-versus-given > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.v4-versus-cvbox { position: absolute; }
.v4-versus-cvbox video { width: 100%; height: 100%; object-fit: fill; background: var(--v4-void); }
.v4-versus-seam { stroke: var(--v4-seam); stroke-width: 1.5; stroke-dasharray: var(--v4-seam-dash); vector-effect: non-scaling-stroke; }

/* look around: one canvas over the grid draws every panel as a perspective view */
.v4-versus-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.v4-versus-grid.is-looking { cursor: grab; -webkit-user-select: none; user-select: none; }
.v4-versus-grid.is-dragging { cursor: grabbing; }

/* the camera-position diagram (per camera) */
.v4-versus-cell.is-rig .v4-versus-view { background: var(--v4-raise); box-shadow: inset 0 0 0 1px var(--v4-line); }
.v4-versus-rig { position: absolute; inset: 0; width: 100%; height: 100%; }
.v4-versus-rig__orbit { fill: none; stroke: var(--v4-line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.v4-versus-rig__spoke { stroke: var(--v4-line-2); stroke-width: 1; }
.v4-versus-rig__cam { fill: rgba(20, 21, 24, 0.1); stroke: var(--v4-ink); stroke-width: 1.2; }
.v4-versus-rig__center { stroke: var(--v4-ink-3); stroke-width: 1.4; stroke-dasharray: 4 3; }
.v4-versus-rig__car { fill: var(--v4-ink); }
.v4-versus-rig__glass { stroke: var(--v4-raise); stroke-width: 1.4; }
.v4-versus-rig__txt { font: 600 11px var(--v4-sans); fill: var(--v4-ink); }

.v4-versus-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 12px 24px; margin-top: 22px;
}
.v4-versus-transport { flex: 1 1 380px; max-width: 600px; }
.v4-versus-steps { display: inline-flex; gap: 4px; }
.v4-versus-step {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--v4-line-2); background: transparent; color: var(--v4-ink);
}
.v4-versus-step:hover { border-color: var(--v4-ink); }
.v4-versus-step svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.v4-versus-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.v4-versus:not([data-kind="v2v"]) .v4-versus-show { display: none; }
.v4-versus[data-kind="persp"] .v4-versus-mode { display: none; }
.v4-versus-reset { min-height: 34px; padding: 0 12px; font-size: 13px; }
.v4-versus-reset[hidden] { display: none; }
.v4-versus-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; margin-top: 12px; min-height: 20px; padding-bottom: 8px;
}
.v4-versus-read { font-variant-numeric: lining-nums tabular-nums; }
.v4-versus-key { display: none; }
.v4-versus.is-given .v4-versus-key { display: flex; }

/* =============================================================== responsive */
@media (max-width: 1099px) {
  .v4-versus-head { grid-column: 1 / -1; justify-self: start; text-align: left; }
  .v4-versus-strip { flex-basis: 100%; }
  .v4-versus-slate .v4-versus-what { text-align: left; }
}
@media (max-width: 719px) {
  .v4-inside-top { align-items: flex-start; text-align: left; }
  .v4-inside-deck { max-width: none; }
  .v4-inside-ctl .v4-switch { width: 100%; }
  .v4-inside-ctl .v4-switch > button { flex: 1 1 0; justify-content: center; padding: 0 6px; }
  .v4-inside-pick { width: 176px; }
  .v4-inside-strip { gap: 10px; padding-top: 22px; padding-bottom: 26px; }
  .v4-inside-hint { bottom: 10px; font-size: 12px; }
  .v4-versus-tabs { gap: 0 18px; }
  .v4-versus-tabs [role="tab"] { font-size: 20px; padding-bottom: 11px; }
  .v4-versus-grid { gap: 20px 10px; }
  .v4-versus-cap { font-size: 12px; margin-top: 8px; }
  .v4-versus-name { font-size: 20px; }
  .v4-versus-cell.is-ours .v4-versus-name { padding-left: 7px; }
  .v4-versus-bar { border-bottom: 0; }
  .v4-versus-tabs { width: 100%; border-bottom: 1px solid var(--v4-line); }
  .v4-versus-bar .v4-versus-switches { padding: 4px 0 0; }
  .v4-versus-switches, .v4-versus-switches .v4-switch { width: 100%; }
  .v4-versus-switches .v4-switch > button { flex: 1 1 0; justify-content: center; padding: 0 6px; }
  .v4-versus-transport { flex-basis: 100%; }
}
