/* CurtainCall, assets/proof.css
   The before-and-after divide on the case-study pages (2026-10-16): the source page underneath, the animated frame on
   top, clipped at a line the visitor drags. Its behaviour is assets/proof.js, whose header holds the markup contract.

   TWIN. This is a port of the homepage's Proof stage, whose rules sit in assets/home.css (search "proof": the Media
   frames rule, "Proof slider", the 640px block near the end, the handle's hover and pressed states near the top, and
   the reduced-transparency block), with its behaviour in home.js initProof. The homepage keeps its own copy because it
   launched on 2026-10-14 and its Proof rules are spread over seven places; moving it onto these files is its own commit,
   proven by a getComputedStyle dump and a pixel diff of #proof. Until then a change to either copy should be considered
   for the other.

   Where this copy differs from the homepage's, and why:
   - The stage is a <figure> that also holds its caption, so the framed box (aspect ratio, corner, rim, glow, the clip)
     is .proof-panel, not .proof-stage. The stage is a one-column grid: the panel and the play button share the first
     cell, so the button sits on the picture's corner however tall the caption below it is.
   - The shape comes from --ar on the stage (the pairs are not all 16:9), and the width cap that keeps the whole
     comparison on screen under the nav is the homepage's idea with --ar in place of 16 / 9, less the homepage's tab row.
   - The play button is hidden by the hidden attribute until proof.js shows it (reduced motion, a clip in the pair), so
     a page without scripts never shows a button that cannot work. The homepage shows it from html.rm.
   - pages.css has no button reset, so the handle and the play button reset their own border, padding and font here.
   - A still can stand where the clip stands (.proof-after img), and a <noscript> poster covers the box.

   Tokens only: colour, type, radius, spacing and depth all come from assets/tokens.css, the same roles the homepage uses. */

/* ---------- The stage and its frame ---------- */
/* The stage is as wide as its container, but never wider than the shape that fits the window under the nav with a
   --space-7 to spare (the gaps and a one-line caption). 16rem is a floor, which only a tall pair on a short window
   reaches (a 9:16 pair under about 580px tall, a phone held sideways): narrower than that, the line's travel (84% of
   the width) falls under about 215px, too short to compare by dragging, so that screen scrolls instead. */
.proof-stage { --ar: 16 / 9; display: grid; grid-template-columns: minmax(0, 1fr);
  width: min(100%, max(calc((100svh - var(--nav-h) - var(--space-7)) * var(--ar)), 16rem)); }
/* The media frame recipe (home.css, "Media frames"): the large corner, a hairline rim and --shadow-glow, the corner
   stepping down at 640px. The panel is a drag surface, so no text selection and no iOS long-press menu on its pictures. */
.proof-panel { --split: 50; grid-area: 1 / 1; position: relative; aspect-ratio: var(--ar); overflow: hidden;
  background: var(--surface-sunken); border-radius: var(--radius-l); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-glow);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.proof-stage > figcaption { grid-row: 2; }

/* ---------- Two layers in one box ----------
   The source is cropped to the frame its clip or still was made from, at the same shape, so both layers share one box,
   one fit and one position and the divide only clips the layer on top. Keep the fit and position identical on both, or
   the crops drift apart. */
.proof-before, .proof-after { position: absolute; inset: 0; background: var(--surface-sunken); }
.proof-after { clip-path: inset(0 0 0 calc(var(--split) * 1%)); }
.proof-before img, .proof-after img, .proof-after video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%; display: block; }

/* ---------- The line and its handle ---------- */
.proof-line { position: absolute; top: 0; bottom: 0; left: calc(var(--split) * 1%); width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 18px var(--accent-glow-strong); }
/* One finger drags the line from the handle; two zoom the page (pinch-zoom), the picture being made for close looking. */
.proof-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: inherit; font: inherit; display: flex; align-items: center; justify-content: center; cursor: ew-resize;
  box-shadow: 0 6px 24px var(--accent-halo); touch-action: pinch-zoom; }
.proof-handle svg { width: 20px; height: 20px; stroke: var(--text-on-bright); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* The site's one 1.8px stroke at any size (home.css, review B8.4). */
:is(.proof-handle svg, .proof-play svg) path { vector-effect: non-scaling-stroke; }
@media (hover: hover) and (pointer: fine) { .proof-handle:hover { transform: translate(-50%, -50%) scale(1.08); } }
.proof-handle:active { transform: translate(-50%, -50%) scale(.94); }

/* ---------- The name tags: the tag-on-a-picture recipe (home.css, review B8.5) ----------
   Each rides on its own layer and fades once the line reaches it (proof.js), so a name never sits on the wrong side. */
.proof-label, .proof-play { position: absolute; border-radius: var(--radius-pill); background: var(--scrim-medium); border: 1px solid var(--border-subtle); color: var(--text-primary); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.proof-label { top: var(--space-3); padding: var(--space-2) var(--space-3); border-color: var(--border-strong);
  font-size: var(--text-2xs); font-weight: var(--weight-semibold); line-height: var(--leading-snug); letter-spacing: var(--tracking-wider); text-transform: uppercase;
  pointer-events: none; transition: opacity var(--duration-fast) ease; }
.proof-label.is-covered { opacity: 0; }
.proof-label-before { left: var(--space-3); }
.proof-label-after { right: var(--space-3); }

/* ---------- Reduced motion: one play and pause button on the animated side ----------
   Nothing plays on its own, and the browser's own controls would be clipped by the divide (their play button sits
   under the source half), so the stage carries this button. It shares the panel's grid cell, at its bottom right, its
   offset measured inside the panel's 1px rim as the homepage's is inside its stage's. */
.proof-play { position: relative; z-index: 2; grid-area: 1 / 1; align-self: end; justify-self: end; margin: calc(var(--space-3) + 1px);
  display: inline-flex; width: var(--tap-min); height: var(--tap-min); padding: 0; font: inherit; align-items: center; justify-content: center; cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast) ease; }
.proof-play[hidden] { display: none; }
.proof-play svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proof-play .i-pause { display: none; fill: none; }
.proof-play.is-playing .i-play { display: none; }
.proof-play.is-playing .i-pause { display: inline; }
@media (hover: hover) and (pointer: fine) { .proof-play:hover { border-color: var(--border-bright); } }
.proof-play:active { transform: scale(var(--state-pressed-scale)); }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .proof-panel { border-radius: var(--radius-m); }
  /* The stage is about 350 x 200 here: smaller name tags so they do not cover the art they name. */
  .proof-label { top: var(--space-2); padding: var(--space-1) var(--space-2); }
  .proof-label-before { left: var(--space-2); }
  .proof-label-after { right: var(--space-2); }
  .proof-play { margin: calc(var(--space-2) + 1px); }
}

/* Reduced transparency: solid tags and button instead of frosted ones. */
@media (prefers-reduced-transparency: reduce) {
  .proof-label, .proof-play { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-glass-solid); }
}
