/* The split-screen controls over the page, and the frame with its sketched copy. Not sketched: it is
 * the instrument, not the exhibit. The page underneath is the index's own body, styled by raw.css,
 * so nothing here touches html, body or the page's classes. */
:root {
  --split: 50vw;
  --ink: #111111;
  --paper: #f3efe6;
  --yellow: #ffd23f;
}

/* The sketched copy, over the whole page: positioned against the initial containing block, so it is
 * exactly as wide as the page underneath (the viewport less a scrollbar). Its height follows its
 * document (shell.js). The clip also cuts where it takes clicks, so the left half is the original.
 *
 * Known gap: with classic scrollbars (Windows, Linux) the page's media queries see the viewport with
 * the scrollbar and the frame's see it without, so in the few pixels above the 640px breakpoint the
 * two halves can lay out differently. Overlay scrollbars (macOS, phones) have no such gap. */
.sketch { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100vh; border: 0; clip-path: inset(0 0 0 var(--split)); z-index: 1; }
body.dragging .sketch { pointer-events: none; }
body.dragging { cursor: ew-resize; user-select: none; }

/* The divider: a wide, invisible hit area around a thin line. */
.divider, .dock {
  box-sizing: border-box;
  font: 14px/1 ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
}
.divider *, .dock * { box-sizing: border-box; }
.divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 32px;
  margin-left: -16px;
  cursor: ew-resize;
  touch-action: none;
  z-index: 2;
  outline: none;
}
.divider__line { position: absolute; top: 0; bottom: 0; left: 15px; width: 2px; background: var(--ink); }
.divider__grip {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  font-size: 22px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.divider:focus-visible .divider__grip { outline: 3px solid #3355ff; outline-offset: 3px; }
.divider__tag {
  position: absolute;
  top: 12px;
  padding: 6px 8px;
  white-space: nowrap;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.divider__tag--raw { right: 24px; }
.divider__tag--sketch { left: 24px; } /* Its look is in tag.css, drawn by sketchify. */

/* The roughness switch. */
.dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--paper);
  border: 2px solid var(--ink);
  z-index: 3;
}
.dock__label { padding: 0 8px 0 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.dock__btn { padding: 8px 12px; font: inherit; color: var(--ink); background: transparent; border: 2px solid transparent; cursor: pointer; }
.dock__btn:hover { border-color: var(--ink); }
.dock__btn[aria-pressed='true'] { background: var(--yellow); border-color: var(--ink); font-weight: 700; }
.dock__btn:focus-visible { outline: 3px solid #3355ff; outline-offset: 2px; }

@media (max-width: 640px) {
  .divider__tag { top: 72px; }
  .dock__label { display: none; }
  .dock__btn { padding: 8px 10px; }
}
